From 983fd271ded52c034c18e2663e4af133d487cf2a Mon Sep 17 00:00:00 2001
From: Vercel Release Bot
<88769842+vercel-release-bot@users.noreply.github.com>
Date: Thu, 19 Dec 2024 19:02:44 -0300
Subject: [PATCH] Upgrade React from `372ec00c-20241209` to `518d06d2-20241219`
(#74155)
---
package.json | 30 +-
.../cjs/react-dom-client.development.js | 14580 ++++++++--------
.../cjs/react-dom-client.production.js | 10031 +++++------
.../cjs/react-dom-profiling.development.js | 14580 ++++++++--------
.../cjs/react-dom-profiling.profiling.js | 10933 ++++++------
...t-dom-server-legacy.browser.development.js | 38 +-
...ct-dom-server-legacy.browser.production.js | 220 +-
...eact-dom-server-legacy.node.development.js | 38 +-
...react-dom-server-legacy.node.production.js | 231 +-
.../react-dom-server.browser.development.js | 42 +-
.../react-dom-server.browser.production.js | 183 +-
.../cjs/react-dom-server.bun.production.js | 200 +-
.../cjs/react-dom-server.edge.development.js | 42 +-
.../cjs/react-dom-server.edge.production.js | 194 +-
.../cjs/react-dom-server.node.development.js | 42 +-
.../cjs/react-dom-server.node.production.js | 194 +-
.../react-dom-unstable_testing.development.js | 14580 ++++++++--------
.../react-dom-unstable_testing.production.js | 10031 +++++------
.../cjs/react-dom.development.js | 2 +-
.../cjs/react-dom.production.js | 2 +-
.../cjs/react-dom.react-server.development.js | 2 +-
.../cjs/react-dom.react-server.production.js | 2 +-
.../react-dom-experimental/package.json | 4 +-
.../cjs/react-dom-client.development.js | 13668 ++++++++-------
.../cjs/react-dom-client.production.js | 10088 +++++------
.../cjs/react-dom-profiling.development.js | 13668 ++++++++-------
.../cjs/react-dom-profiling.profiling.js | 10118 +++++------
...t-dom-server-legacy.browser.development.js | 34 +-
...ct-dom-server-legacy.browser.production.js | 214 +-
...eact-dom-server-legacy.node.development.js | 34 +-
...react-dom-server-legacy.node.production.js | 225 +-
.../react-dom-server.browser.development.js | 38 +-
.../react-dom-server.browser.production.js | 177 +-
.../cjs/react-dom-server.bun.production.js | 194 +-
.../cjs/react-dom-server.edge.development.js | 38 +-
.../cjs/react-dom-server.edge.production.js | 188 +-
.../cjs/react-dom-server.node.development.js | 38 +-
.../cjs/react-dom-server.node.production.js | 188 +-
.../react-dom/cjs/react-dom.development.js | 2 +-
.../react-dom/cjs/react-dom.production.js | 2 +-
.../cjs/react-dom.react-server.development.js | 2 +-
.../cjs/react-dom.react-server.production.js | 2 +-
.../next/src/compiled/react-dom/package.json | 4 +-
.../cjs/react.development.js | 4 +-
.../cjs/react.production.js | 4 +-
.../cjs/react.react-server.development.js | 12 +-
.../cjs/react.react-server.production.js | 4 +-
.../next/src/compiled/react-is/package.json | 2 +-
...om-turbopack-client.browser.development.js | 223 +-
...dom-turbopack-client.browser.production.js | 20 +-
...r-dom-turbopack-client.edge.development.js | 219 +-
...er-dom-turbopack-client.edge.production.js | 20 +-
...r-dom-turbopack-client.node.development.js | 219 +-
...er-dom-turbopack-client.node.production.js | 20 +-
...om-turbopack-server.browser.development.js | 500 +-
...dom-turbopack-server.browser.production.js | 524 +-
...r-dom-turbopack-server.edge.development.js | 574 +-
...er-dom-turbopack-server.edge.production.js | 603 +-
...r-dom-turbopack-server.node.development.js | 488 +-
...er-dom-turbopack-server.node.production.js | 514 +-
.../package.json | 4 +-
.../server.edge.js | 1 +
.../static.browser.js | 4 +-
.../static.edge.js | 4 +-
.../static.node.js | 4 +-
...om-turbopack-client.browser.development.js | 15 +-
...dom-turbopack-client.browser.production.js | 11 +-
...r-dom-turbopack-client.edge.development.js | 11 +-
...er-dom-turbopack-client.edge.production.js | 11 +-
...r-dom-turbopack-client.node.development.js | 11 +-
...er-dom-turbopack-client.node.production.js | 11 +-
...om-turbopack-server.browser.development.js | 228 +-
...dom-turbopack-server.browser.production.js | 220 +-
...r-dom-turbopack-server.edge.development.js | 308 +-
...er-dom-turbopack-server.edge.production.js | 305 +-
...r-dom-turbopack-server.node.development.js | 209 +-
...er-dom-turbopack-server.node.production.js | 212 +-
.../react-server-dom-turbopack/package.json | 4 +-
.../react-server-dom-turbopack/server.edge.js | 1 +
.../static.browser.js | 4 +-
.../react-server-dom-turbopack/static.edge.js | 4 +-
.../react-server-dom-turbopack/static.node.js | 4 +-
...-dom-webpack-client.browser.development.js | 223 +-
...r-dom-webpack-client.browser.production.js | 20 +-
...ver-dom-webpack-client.edge.development.js | 219 +-
...rver-dom-webpack-client.edge.production.js | 20 +-
...ver-dom-webpack-client.node.development.js | 219 +-
...rver-dom-webpack-client.node.production.js | 20 +-
...bpack-client.node.unbundled.development.js | 219 +-
...ebpack-client.node.unbundled.production.js | 20 +-
...-dom-webpack-server.browser.development.js | 500 +-
...r-dom-webpack-server.browser.production.js | 524 +-
...ver-dom-webpack-server.edge.development.js | 574 +-
...rver-dom-webpack-server.edge.production.js | 603 +-
...ver-dom-webpack-server.node.development.js | 488 +-
...rver-dom-webpack-server.node.production.js | 510 +-
...bpack-server.node.unbundled.development.js | 488 +-
...ebpack-server.node.unbundled.production.js | 510 +-
.../package.json | 4 +-
.../server.edge.js | 1 +
.../static.browser.js | 4 +-
.../static.edge.js | 4 +-
.../static.node.js | 4 +-
.../static.node.unbundled.js | 4 +-
...-dom-webpack-client.browser.development.js | 15 +-
...r-dom-webpack-client.browser.production.js | 11 +-
...ver-dom-webpack-client.edge.development.js | 11 +-
...rver-dom-webpack-client.edge.production.js | 11 +-
...ver-dom-webpack-client.node.development.js | 11 +-
...rver-dom-webpack-client.node.production.js | 11 +-
...bpack-client.node.unbundled.development.js | 11 +-
...ebpack-client.node.unbundled.production.js | 11 +-
...-dom-webpack-server.browser.development.js | 228 +-
...r-dom-webpack-server.browser.production.js | 220 +-
...ver-dom-webpack-server.edge.development.js | 308 +-
...rver-dom-webpack-server.edge.production.js | 305 +-
...ver-dom-webpack-server.node.development.js | 209 +-
...rver-dom-webpack-server.node.production.js | 208 +-
...bpack-server.node.unbundled.development.js | 209 +-
...ebpack-server.node.unbundled.production.js | 208 +-
.../react-server-dom-webpack/package.json | 4 +-
.../react-server-dom-webpack/server.edge.js | 1 +
.../static.browser.js | 4 +-
.../react-server-dom-webpack/static.edge.js | 4 +-
.../react-server-dom-webpack/static.node.js | 4 +-
.../static.node.unbundled.js | 4 +-
.../cjs/react-jsx-dev-runtime.development.js | 2 +-
...sx-dev-runtime.react-server.development.js | 2 +-
.../cjs/react-jsx-runtime.development.js | 2 +-
...ct-jsx-runtime.react-server.development.js | 2 +-
.../compiled/react/cjs/react.development.js | 4 +-
.../compiled/react/cjs/react.production.js | 2 +-
.../cjs/react.react-server.development.js | 4 +-
.../cjs/react.react-server.production.js | 2 +-
.../scheduler-unstable_mock.development.js | 9 -
.../cjs/scheduler-unstable_mock.production.js | 9 -
...cheduler-unstable_post_task.development.js | 5 -
...scheduler-unstable_post_task.production.js | 5 -
.../cjs/scheduler.development.js | 44 +-
.../cjs/scheduler.native.development.js | 21 +-
.../cjs/scheduler.native.production.js | 17 +-
.../cjs/scheduler.production.js | 42 +-
.../scheduler-unstable_mock.development.js | 9 -
.../cjs/scheduler-unstable_mock.production.js | 9 -
...cheduler-unstable_post_task.development.js | 5 -
...scheduler-unstable_post_task.production.js | 5 -
.../scheduler/cjs/scheduler.development.js | 34 +-
.../cjs/scheduler.native.development.js | 15 +-
.../cjs/scheduler.native.production.js | 11 +-
.../scheduler/cjs/scheduler.production.js | 33 +-
.../next/src/compiled/unistore/unistore.js | 2 +-
.../next/src/server/app-render/app-render.tsx | 6 -
.../app-render/collect-segment-data.tsx | 2 +-
.../next/src/server/app-render/entry-base.ts | 2 +-
packages/next/types/$$compiled.internal.d.ts | 2 +-
pnpm-lock.yaml | 605 +-
.../dynamic-io.server-action.test.ts | 10 +-
test/e2e/app-dir/rsc-basic/rsc-basic.test.ts | 4 +-
.../custom-server/custom-server.test.ts | 4 +-
159 files changed, 70326 insertions(+), 68449 deletions(-)
diff --git a/package.json b/package.json
index 1f129b43f212e..7e4bc27c8536d 100644
--- a/package.json
+++ b/package.json
@@ -211,16 +211,16 @@
"pretty-ms": "7.0.0",
"random-seed": "0.3.0",
"react": "19.0.0",
- "react-builtin": "npm:react@19.0.0-rc-372ec00c-20241209",
+ "react-builtin": "npm:react@19.1.0-canary-518d06d2-20241219",
"react-dom": "19.0.0",
- "react-dom-builtin": "npm:react-dom@19.0.0-rc-372ec00c-20241209",
- "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-372ec00c-20241209",
- "react-experimental-builtin": "npm:react@0.0.0-experimental-372ec00c-20241209",
- "react-is-builtin": "npm:react-is@19.0.0-rc-372ec00c-20241209",
- "react-server-dom-turbopack": "19.0.0-rc-372ec00c-20241209",
- "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-372ec00c-20241209",
- "react-server-dom-webpack": "19.0.0-rc-372ec00c-20241209",
- "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-372ec00c-20241209",
+ "react-dom-builtin": "npm:react-dom@19.1.0-canary-518d06d2-20241219",
+ "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-518d06d2-20241219",
+ "react-experimental-builtin": "npm:react@0.0.0-experimental-518d06d2-20241219",
+ "react-is-builtin": "npm:react-is@19.1.0-canary-518d06d2-20241219",
+ "react-server-dom-turbopack": "19.1.0-canary-518d06d2-20241219",
+ "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-518d06d2-20241219",
+ "react-server-dom-webpack": "19.1.0-canary-518d06d2-20241219",
+ "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-518d06d2-20241219",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
@@ -230,8 +230,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.9",
- "scheduler-builtin": "npm:scheduler@0.25.0-rc-372ec00c-20241209",
- "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-372ec00c-20241209",
+ "scheduler-builtin": "npm:scheduler@0.26.0-canary-518d06d2-20241219",
+ "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-518d06d2-20241219",
"seedrandom": "3.0.5",
"semver": "7.3.7",
"shell-quote": "1.7.3",
@@ -272,10 +272,10 @@
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0",
"jest-snapshot": "30.0.0-alpha.6",
- "react": "19.0.0-rc-372ec00c-20241209",
- "react-dom": "19.0.0-rc-372ec00c-20241209",
- "react-is": "19.0.0-rc-372ec00c-20241209",
- "scheduler": "0.25.0-rc-372ec00c-20241209"
+ "react": "19.1.0-canary-518d06d2-20241219",
+ "react-dom": "19.1.0-canary-518d06d2-20241219",
+ "react-is": "19.1.0-canary-518d06d2-20241219",
+ "scheduler": "0.26.0-canary-518d06d2-20241219"
},
"patchedDependencies": {
"webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch",
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js
index dbf9adf3c49cd..965577d4c1490 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js
@@ -510,13 +510,11 @@
return describeBuiltInComponentFrame("SuspenseList");
case 0:
case 15:
- return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber;
+ return describeNativeComponentFrame(fiber.type, !1);
case 11:
- return (
- (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber
- );
+ return describeNativeComponentFrame(fiber.type.render, !1);
case 1:
- return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber;
+ return describeNativeComponentFrame(fiber.type, !0);
default:
return "";
}
@@ -1217,6 +1215,46 @@
rootEntangledLanes &= ~lane;
}
}
+ function getBumpedLaneForHydrationByLane(lane) {
+ switch (lane) {
+ case 2:
+ lane = 1;
+ break;
+ case 8:
+ lane = 4;
+ break;
+ case 32:
+ lane = 16;
+ break;
+ case 128:
+ case 256:
+ case 512:
+ case 1024:
+ case 2048:
+ case 4096:
+ case 8192:
+ case 16384:
+ case 32768:
+ case 65536:
+ case 131072:
+ case 262144:
+ case 524288:
+ case 1048576:
+ case 2097152:
+ case 4194304:
+ case 8388608:
+ case 16777216:
+ case 33554432:
+ lane = 64;
+ break;
+ case 268435456:
+ lane = 134217728;
+ break;
+ default:
+ lane = 0;
+ }
+ return lane;
+ }
function addFiberToLanesMap(root, fiber, lanes) {
if (isDevToolsPresent)
for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) {
@@ -2327,6 +2365,8 @@
"hr" === tag ||
"option" === tag ||
"optgroup" === tag ||
+ "script" === tag ||
+ "template" === tag ||
"#text" === tag
);
case "optgroup":
@@ -3781,6 +3821,32 @@
? "Idle"
: "Other";
}
+ function logComponentRender(fiber, startTime, endTime, wasHydrated) {
+ var name = getComponentNameFromFiber(fiber);
+ if (null !== name && supportsUserTiming) {
+ var selfTime = fiber.actualDuration;
+ if (null === fiber.alternate || fiber.alternate.child !== fiber.child)
+ for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling)
+ selfTime -= fiber.actualDuration;
+ reusableComponentDevToolDetails.color =
+ 0.5 > selfTime
+ ? wasHydrated
+ ? "tertiary-light"
+ : "primary-light"
+ : 10 > selfTime
+ ? wasHydrated
+ ? "tertiary"
+ : "primary"
+ : 100 > selfTime
+ ? wasHydrated
+ ? "tertiary-dark"
+ : "primary-dark"
+ : "error";
+ reusableComponentOptions.start = startTime;
+ reusableComponentOptions.end = endTime;
+ performance.measure(name, reusableComponentOptions);
+ }
+ }
function logComponentEffect(fiber, startTime, endTime, selfTime) {
fiber = getComponentNameFromFiber(fiber);
null !== fiber &&
@@ -3797,33 +3863,80 @@
(reusableComponentOptions.end = endTime),
performance.measure(fiber, reusableComponentOptions));
}
- function logRenderPhase(startTime, endTime) {
+ function logRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prepared"
+ : (lanes & 201326677) === lanes
+ ? "Hydrated"
+ : "Render",
+ reusableLaneOptions
+ ));
}
- function logSuspendedRenderPhase(startTime, endTime) {
+ function logSuspendedRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Prewarm", reusableLaneOptions));
}
- function logSuspendedWithDelayPhase(startTime, endTime) {
+ function logSuspendedWithDelayPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Suspended", reusableLaneOptions));
}
+ function logRecoveredRenderPhase(
+ startTime,
+ endTime,
+ lanes,
+ recoverableErrors,
+ hydrationFailed
+ ) {
+ if (supportsUserTiming) {
+ lanes = [];
+ for (var i = 0; i < recoverableErrors.length; i++) {
+ var error = recoverableErrors[i].value;
+ lanes.push([
+ "Recoverable Error",
+ "object" === typeof error &&
+ null !== error &&
+ "string" === typeof error.message
+ ? String(error.message)
+ : String(error)
+ ]);
+ }
+ performance.measure("Recovered", {
+ start: startTime,
+ end: endTime,
+ detail: {
+ devtools: {
+ color: "primary-dark",
+ track: reusableLaneDevToolDetails.track,
+ trackGroup: LANES_TRACK_GROUP,
+ tooltipText: hydrationFailed
+ ? "Hydration Failed"
+ : "Recovered after Error",
+ properties: lanes
+ }
+ }
+ });
+ }
+ }
function logErroredRenderPhase(startTime, endTime) {
supportsUserTiming &&
((reusableLaneDevToolDetails.color = "error"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Errored Render", reusableLaneOptions));
+ performance.measure("Errored", reusableLaneOptions));
}
function logSuspenseThrottlePhase(startTime, endTime) {
supportsUserTiming &&
@@ -4161,441 +4274,214 @@
for (var child = fiber.child; child; )
(fiber.actualDuration += child.actualDuration), (child = child.sibling);
}
- function createCapturedValueAtFiber(value, source) {
- if ("object" === typeof value && null !== value) {
- var existing = CapturedStacks.get(value);
- if (void 0 !== existing) return existing;
- source = {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- CapturedStacks.set(value, source);
- return source;
- }
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- }
- function pushTreeFork(workInProgress, totalChildren) {
- warnIfNotHydrating();
- forkStack[forkStackIndex++] = treeForkCount;
- forkStack[forkStackIndex++] = treeForkProvider;
- treeForkProvider = workInProgress;
- treeForkCount = totalChildren;
- }
- function pushTreeId(workInProgress, totalChildren, index) {
- warnIfNotHydrating();
- idStack[idStackIndex++] = treeContextId;
- idStack[idStackIndex++] = treeContextOverflow;
- idStack[idStackIndex++] = treeContextProvider;
- treeContextProvider = workInProgress;
- var baseIdWithLeadingBit = treeContextId;
- workInProgress = treeContextOverflow;
- var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
- baseIdWithLeadingBit &= ~(1 << baseLength);
- index += 1;
- var length = 32 - clz32(totalChildren) + baseLength;
- if (30 < length) {
- var numberOfOverflowBits = baseLength - (baseLength % 5);
- length = (
- baseIdWithLeadingBit &
- ((1 << numberOfOverflowBits) - 1)
- ).toString(32);
- baseIdWithLeadingBit >>= numberOfOverflowBits;
- baseLength -= numberOfOverflowBits;
- treeContextId =
- (1 << (32 - clz32(totalChildren) + baseLength)) |
- (index << baseLength) |
- baseIdWithLeadingBit;
- treeContextOverflow = length + workInProgress;
- } else
- (treeContextId =
- (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
- (treeContextOverflow = workInProgress);
+ function resetContextDependencies() {
+ lastContextDependency = currentlyRenderingFiber$1 = null;
+ isDisallowedContextReadInDEV = !1;
}
- function pushMaterializedTreeId(workInProgress) {
- warnIfNotHydrating();
- null !== workInProgress.return &&
- (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
+ function pushProvider(providerFiber, context, nextValue) {
+ push(valueCursor, context._currentValue, providerFiber);
+ context._currentValue = nextValue;
+ push(rendererCursorDEV, context._currentRenderer, providerFiber);
+ void 0 !== context._currentRenderer &&
+ null !== context._currentRenderer &&
+ context._currentRenderer !== rendererSigil &&
+ console.error(
+ "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
+ );
+ context._currentRenderer = rendererSigil;
}
- function popTreeContext(workInProgress) {
- for (; workInProgress === treeForkProvider; )
- (treeForkProvider = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null),
- (treeForkCount = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null);
- for (; workInProgress === treeContextProvider; )
- (treeContextProvider = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextOverflow = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextId = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null);
+ function popProvider(context, providerFiber) {
+ context._currentValue = valueCursor.current;
+ var currentRenderer = rendererCursorDEV.current;
+ pop(rendererCursorDEV, providerFiber);
+ context._currentRenderer = currentRenderer;
+ pop(valueCursor, providerFiber);
}
- function warnIfNotHydrating() {
- isHydrating ||
+ function scheduleContextWorkOnParentPath(
+ parent,
+ renderLanes,
+ propagationRoot
+ ) {
+ for (; null !== parent; ) {
+ var alternate = parent.alternate;
+ (parent.childLanes & renderLanes) !== renderLanes
+ ? ((parent.childLanes |= renderLanes),
+ null !== alternate && (alternate.childLanes |= renderLanes))
+ : null !== alternate &&
+ (alternate.childLanes & renderLanes) !== renderLanes &&
+ (alternate.childLanes |= renderLanes);
+ if (parent === propagationRoot) break;
+ parent = parent.return;
+ }
+ parent !== propagationRoot &&
console.error(
- "Expected to be hydrating. This is a bug in React. Please file an issue."
+ "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
);
}
- function buildHydrationDiffNode(fiber, distanceFromLeaf) {
- if (null === fiber.return) {
- if (null === hydrationDiffRootDEV)
- hydrationDiffRootDEV = {
- fiber: fiber,
- children: [],
- serverProps: void 0,
- serverTail: [],
- distanceFromLeaf: distanceFromLeaf
- };
- else {
- if (hydrationDiffRootDEV.fiber !== fiber)
+ function propagateContextChanges(
+ workInProgress,
+ contexts,
+ renderLanes,
+ forcePropagateEntireTree
+ ) {
+ var fiber = workInProgress.child;
+ null !== fiber && (fiber.return = workInProgress);
+ for (; null !== fiber; ) {
+ var list = fiber.dependencies;
+ if (null !== list) {
+ var nextFiber = fiber.child;
+ list = list.firstContext;
+ a: for (; null !== list; ) {
+ var dependency = list;
+ list = fiber;
+ for (var i = 0; i < contexts.length; i++)
+ if (dependency.context === contexts[i]) {
+ list.lanes |= renderLanes;
+ dependency = list.alternate;
+ null !== dependency && (dependency.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ list.return,
+ renderLanes,
+ workInProgress
+ );
+ forcePropagateEntireTree || (nextFiber = null);
+ break a;
+ }
+ list = dependency.next;
+ }
+ } else if (18 === fiber.tag) {
+ nextFiber = fiber.return;
+ if (null === nextFiber)
throw Error(
- "Saw multiple hydration diff roots in a pass. This is a bug in React."
+ "We just came from a parent so we must have had a parent. This is a bug in React."
);
- hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf &&
- (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
- }
- return hydrationDiffRootDEV;
+ nextFiber.lanes |= renderLanes;
+ list = nextFiber.alternate;
+ null !== list && (list.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ nextFiber,
+ renderLanes,
+ workInProgress
+ );
+ nextFiber = null;
+ } else nextFiber = fiber.child;
+ if (null !== nextFiber) nextFiber.return = fiber;
+ else
+ for (nextFiber = fiber; null !== nextFiber; ) {
+ if (nextFiber === workInProgress) {
+ nextFiber = null;
+ break;
+ }
+ fiber = nextFiber.sibling;
+ if (null !== fiber) {
+ fiber.return = nextFiber.return;
+ nextFiber = fiber;
+ break;
+ }
+ nextFiber = nextFiber.return;
+ }
+ fiber = nextFiber;
}
- var siblings = buildHydrationDiffNode(
- fiber.return,
- distanceFromLeaf + 1
- ).children;
- if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
- return (
- (siblings = siblings[siblings.length - 1]),
- siblings.distanceFromLeaf > distanceFromLeaf &&
- (siblings.distanceFromLeaf = distanceFromLeaf),
- siblings
- );
- distanceFromLeaf = {
- fiber: fiber,
- children: [],
- serverProps: void 0,
- serverTail: [],
- distanceFromLeaf: distanceFromLeaf
- };
- siblings.push(distanceFromLeaf);
- return distanceFromLeaf;
}
- function warnNonHydratedInstance(fiber, rejectedCandidate) {
- didSuspendOrErrorDEV ||
- ((fiber = buildHydrationDiffNode(fiber, 0)),
- (fiber.serverProps = null),
- null !== rejectedCandidate &&
- ((rejectedCandidate =
- describeHydratableInstanceForDevWarnings(rejectedCandidate)),
- fiber.serverTail.push(rejectedCandidate)));
+ function propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ forcePropagateEntireTree
+ ) {
+ current = null;
+ for (
+ var parent = workInProgress, isInsidePropagationBailout = !1;
+ null !== parent;
+
+ ) {
+ if (!isInsidePropagationBailout)
+ if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
+ else if (0 !== (parent.flags & 262144)) break;
+ if (10 === parent.tag) {
+ var currentParent = parent.alternate;
+ if (null === currentParent)
+ throw Error("Should have a current fiber. This is a bug in React.");
+ currentParent = currentParent.memoizedProps;
+ if (null !== currentParent) {
+ var context = parent.type;
+ objectIs(parent.pendingProps.value, currentParent.value) ||
+ (null !== current
+ ? current.push(context)
+ : (current = [context]));
+ }
+ } else if (parent === hostTransitionProviderCursor.current) {
+ currentParent = parent.alternate;
+ if (null === currentParent)
+ throw Error("Should have a current fiber. This is a bug in React.");
+ currentParent.memoizedState.memoizedState !==
+ parent.memoizedState.memoizedState &&
+ (null !== current
+ ? current.push(HostTransitionContext)
+ : (current = [HostTransitionContext]));
+ }
+ parent = parent.return;
+ }
+ null !== current &&
+ propagateContextChanges(
+ workInProgress,
+ current,
+ renderLanes,
+ forcePropagateEntireTree
+ );
+ workInProgress.flags |= 262144;
}
- function throwOnHydrationMismatch(fiber) {
- var diff = "",
- diffRoot = hydrationDiffRootDEV;
- null !== diffRoot &&
- ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot)));
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" +
- diff
- ),
- fiber
+ function checkIfContextChanged(currentDependencies) {
+ for (
+ currentDependencies = currentDependencies.firstContext;
+ null !== currentDependencies;
+
+ ) {
+ if (
+ !objectIs(
+ currentDependencies.context._currentValue,
+ currentDependencies.memoizedValue
+ )
)
- );
- throw HydrationMismatchException;
- }
- function prepareToHydrateHostInstance(fiber) {
- var didHydrate = fiber.stateNode;
- var type = fiber.type,
- props = fiber.memoizedProps;
- didHydrate[internalInstanceKey] = fiber;
- didHydrate[internalPropsKey] = props;
- validatePropertiesInDevelopment(type, props);
- switch (type) {
- case "dialog":
- listenToNonDelegatedEvent("cancel", didHydrate);
- listenToNonDelegatedEvent("close", didHydrate);
- break;
- case "iframe":
- case "object":
- case "embed":
- listenToNonDelegatedEvent("load", didHydrate);
- break;
- case "video":
- case "audio":
- for (type = 0; type < mediaEventTypes.length; type++)
- listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate);
- break;
- case "source":
- listenToNonDelegatedEvent("error", didHydrate);
- break;
- case "img":
- case "image":
- case "link":
- listenToNonDelegatedEvent("error", didHydrate);
- listenToNonDelegatedEvent("load", didHydrate);
- break;
- case "details":
- listenToNonDelegatedEvent("toggle", didHydrate);
- break;
- case "input":
- checkControlledValueProps("input", props);
- listenToNonDelegatedEvent("invalid", didHydrate);
- validateInputProps(didHydrate, props);
- initInput(
- didHydrate,
- props.value,
- props.defaultValue,
- props.checked,
- props.defaultChecked,
- props.type,
- props.name,
- !0
- );
- track(didHydrate);
- break;
- case "option":
- validateOptionProps(didHydrate, props);
- break;
- case "select":
- checkControlledValueProps("select", props);
- listenToNonDelegatedEvent("invalid", didHydrate);
- validateSelectProps(didHydrate, props);
- break;
- case "textarea":
- checkControlledValueProps("textarea", props),
- listenToNonDelegatedEvent("invalid", didHydrate),
- validateTextareaProps(didHydrate, props),
- initTextarea(
- didHydrate,
- props.value,
- props.defaultValue,
- props.children
- ),
- track(didHydrate);
+ return !0;
+ currentDependencies = currentDependencies.next;
}
- type = props.children;
- ("string" !== typeof type &&
- "number" !== typeof type &&
- "bigint" !== typeof type) ||
- didHydrate.textContent === "" + type ||
- !0 === props.suppressHydrationWarning ||
- checkForUnmatchedText(didHydrate.textContent, type)
- ? (null != props.popover &&
- (listenToNonDelegatedEvent("beforetoggle", didHydrate),
- listenToNonDelegatedEvent("toggle", didHydrate)),
- null != props.onScroll &&
- listenToNonDelegatedEvent("scroll", didHydrate),
- null != props.onScrollEnd &&
- listenToNonDelegatedEvent("scrollend", didHydrate),
- null != props.onClick && (didHydrate.onclick = noop$1),
- (didHydrate = !0))
- : (didHydrate = !1);
- didHydrate || throwOnHydrationMismatch(fiber);
+ return !1;
}
- function popToNextHostParent(fiber) {
- for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
- switch (hydrationParentFiber.tag) {
- case 3:
- case 27:
- rootOrSingletonContext = !0;
- return;
- case 5:
- case 13:
- rootOrSingletonContext = !1;
- return;
- default:
- hydrationParentFiber = hydrationParentFiber.return;
- }
+ function prepareToReadContext(workInProgress) {
+ currentlyRenderingFiber$1 = workInProgress;
+ lastContextDependency = null;
+ workInProgress = workInProgress.dependencies;
+ null !== workInProgress && (workInProgress.firstContext = null);
}
- function popHydrationState(fiber) {
- if (fiber !== hydrationParentFiber) return !1;
- if (!isHydrating)
- return popToNextHostParent(fiber), (isHydrating = !0), !1;
- var shouldClear = !1,
- JSCompiler_temp;
- if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
- if ((JSCompiler_temp = 5 === fiber.tag))
- (JSCompiler_temp = fiber.type),
- (JSCompiler_temp =
- !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
- shouldSetTextContent(fiber.type, fiber.memoizedProps));
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp && (shouldClear = !0);
- if (shouldClear && nextHydratableInstance) {
- for (shouldClear = nextHydratableInstance; shouldClear; ) {
- JSCompiler_temp = buildHydrationDiffNode(fiber, 0);
- var description =
- describeHydratableInstanceForDevWarnings(shouldClear);
- JSCompiler_temp.serverTail.push(description);
- shouldClear =
- "Suspense" === description.type
- ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear)
- : getNextHydratable(shouldClear.nextSibling);
- }
- throwOnHydrationMismatch(fiber);
- }
- popToNextHostParent(fiber);
- if (13 === fiber.tag) {
- fiber = fiber.memoizedState;
- fiber = null !== fiber ? fiber.dehydrated : null;
- if (!fiber)
+ function readContext(context) {
+ isDisallowedContextReadInDEV &&
+ console.error(
+ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
+ );
+ return readContextForConsumer(currentlyRenderingFiber$1, context);
+ }
+ function readContextDuringReconciliation(consumer, context) {
+ null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
+ return readContextForConsumer(consumer, context);
+ }
+ function readContextForConsumer(consumer, context) {
+ var value = context._currentValue;
+ context = { context: context, memoizedValue: value, next: null };
+ if (null === lastContextDependency) {
+ if (null === consumer)
throw Error(
- "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
+ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
);
- nextHydratableInstance =
- getNextHydratableInstanceAfterSuspenseInstance(fiber);
- } else
- nextHydratableInstance = hydrationParentFiber
- ? getNextHydratable(fiber.stateNode.nextSibling)
- : null;
- return !0;
- }
- function resetHydrationState() {
- nextHydratableInstance = hydrationParentFiber = null;
- didSuspendOrErrorDEV = isHydrating = !1;
- }
- function queueHydrationError(error) {
- null === hydrationErrors
- ? (hydrationErrors = [error])
- : hydrationErrors.push(error);
- }
- function emitPendingHydrationWarnings() {
- var diffRoot = hydrationDiffRootDEV;
- null !== diffRoot &&
- ((hydrationDiffRootDEV = null),
- (diffRoot = describeDiff(diffRoot)),
- console.error(
- "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
- "https://react.dev/link/hydration-mismatch",
- diffRoot
- ));
- }
- function createThenableState() {
- return { didWarnAboutUncachedPromise: !1, thenables: [] };
- }
- function isThenableResolved(thenable) {
- thenable = thenable.status;
- return "fulfilled" === thenable || "rejected" === thenable;
- }
- function noop$3() {}
- function trackUsedThenable(thenableState, thenable, index) {
- null !== ReactSharedInternals.actQueue &&
- (ReactSharedInternals.didUsePromise = !0);
- var trackedThenables = thenableState.thenables;
- index = trackedThenables[index];
- void 0 === index
- ? trackedThenables.push(thenable)
- : index !== thenable &&
- (thenableState.didWarnAboutUncachedPromise ||
- ((thenableState.didWarnAboutUncachedPromise = !0),
- console.error(
- "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
- )),
- thenable.then(noop$3, noop$3),
- (thenable = index));
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- default:
- if ("string" === typeof thenable.status)
- thenable.then(noop$3, noop$3);
- else {
- thenableState = workInProgressRoot;
- if (
- null !== thenableState &&
- 100 < thenableState.shellSuspendCounter
- )
- throw Error(
- "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- );
- thenableState = thenable;
- thenableState.status = "pending";
- thenableState.then(
- function (fulfilledValue) {
- if ("pending" === thenable.status) {
- var fulfilledThenable = thenable;
- fulfilledThenable.status = "fulfilled";
- fulfilledThenable.value = fulfilledValue;
- }
- },
- function (error) {
- if ("pending" === thenable.status) {
- var rejectedThenable = thenable;
- rejectedThenable.status = "rejected";
- rejectedThenable.reason = error;
- }
- }
- );
- }
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- }
- suspendedThenable = thenable;
- needsToResetSuspendedThenableDEV = !0;
- throw SuspenseException;
- }
- }
- function getSuspendedThenable() {
- if (null === suspendedThenable)
- throw Error(
- "Expected a suspended thenable. This is a bug in React. Please file an issue."
- );
- var thenable = suspendedThenable;
- suspendedThenable = null;
- needsToResetSuspendedThenableDEV = !1;
- return thenable;
- }
- function checkIfUseWrappedInAsyncCatch(rejectedReason) {
- if (
- rejectedReason === SuspenseException ||
- rejectedReason === SuspenseActionException
- )
- throw Error(
- "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- );
- }
- function createCache() {
- return {
- controller: new AbortControllerLocal(),
- data: new Map(),
- refCount: 0
- };
- }
- function retainCache(cache) {
- cache.controller.signal.aborted &&
- console.warn(
- "A cache instance was retained after it was already freed. This likely indicates a bug in React."
- );
- cache.refCount++;
- }
- function releaseCache(cache) {
- cache.refCount--;
- 0 > cache.refCount &&
- console.warn(
- "A cache instance was released after it was already freed. This likely indicates a bug in React."
- );
- 0 === cache.refCount &&
- scheduleCallback$2(NormalPriority, function () {
- cache.controller.abort();
- });
+ lastContextDependency = context;
+ consumer.dependencies = {
+ lanes: 0,
+ firstContext: context,
+ _debugThenableState: null
+ };
+ consumer.flags |= 524288;
+ } else lastContextDependency = lastContextDependency.next = context;
+ return value;
}
function entangleAsyncAction(transition, thenable) {
if (null === currentEntangledListeners) {
@@ -4654,6378 +4540,6553 @@
);
return thenableWithOverride;
}
- function pushHiddenContext(fiber, context) {
- var prevEntangledRenderLanes = entangledRenderLanes;
- push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber);
- push(currentTreeHiddenStackCursor, context, fiber);
- entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes;
- }
- function reuseHiddenContextOnStack(fiber) {
- push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber);
- push(
- currentTreeHiddenStackCursor,
- currentTreeHiddenStackCursor.current,
- fiber
- );
- }
- function popHiddenContext(fiber) {
- entangledRenderLanes = prevEntangledRenderLanesCursor.current;
- pop(currentTreeHiddenStackCursor, fiber);
- pop(prevEntangledRenderLanesCursor, fiber);
- }
- function peekCacheFromPool() {
- var cacheResumedFromPreviousRender = resumedCache.current;
- return null !== cacheResumedFromPreviousRender
- ? cacheResumedFromPreviousRender
- : workInProgressRoot.pooledCache;
- }
- function pushTransition(offscreenWorkInProgress, prevCachePool) {
- null === prevCachePool
- ? push(resumedCache, resumedCache.current, offscreenWorkInProgress)
- : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress);
+ function initializeUpdateQueue(fiber) {
+ fiber.updateQueue = {
+ baseState: fiber.memoizedState,
+ firstBaseUpdate: null,
+ lastBaseUpdate: null,
+ shared: { pending: null, lanes: 0, hiddenCallbacks: null },
+ callbacks: null
+ };
}
- function getSuspendedCache() {
- var cacheFromPool = peekCacheFromPool();
- return null === cacheFromPool
- ? null
- : { parent: CacheContext._currentValue, pool: cacheFromPool };
+ function cloneUpdateQueue(current, workInProgress) {
+ current = current.updateQueue;
+ workInProgress.updateQueue === current &&
+ (workInProgress.updateQueue = {
+ baseState: current.baseState,
+ firstBaseUpdate: current.firstBaseUpdate,
+ lastBaseUpdate: current.lastBaseUpdate,
+ shared: current.shared,
+ callbacks: null
+ });
}
- function mountHookTypesDev() {
- var hookName = currentHookNameInDev;
- null === hookTypesDev
- ? (hookTypesDev = [hookName])
- : hookTypesDev.push(hookName);
+ function createUpdate(lane) {
+ return {
+ lane: lane,
+ tag: UpdateState,
+ payload: null,
+ callback: null,
+ next: null
+ };
}
- function updateHookTypesDev() {
- var hookName = currentHookNameInDev;
+ function enqueueUpdate(fiber, update, lane) {
+ var updateQueue = fiber.updateQueue;
+ if (null === updateQueue) return null;
+ updateQueue = updateQueue.shared;
if (
- null !== hookTypesDev &&
- (hookTypesUpdateIndexDev++,
- hookTypesDev[hookTypesUpdateIndexDev] !== hookName)
+ currentlyProcessingQueue === updateQueue &&
+ !didWarnUpdateInsideUpdate
) {
- var componentName = getComponentNameFromFiber(
- currentlyRenderingFiber$1
- );
- if (
- !didWarnAboutMismatchedHooksForComponent.has(componentName) &&
- (didWarnAboutMismatchedHooksForComponent.add(componentName),
- null !== hookTypesDev)
- ) {
- for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) {
- var oldHookName = hookTypesDev[i],
- newHookName =
- i === hookTypesUpdateIndexDev ? hookName : oldHookName;
- for (
- oldHookName = i + 1 + ". " + oldHookName;
- 30 > oldHookName.length;
-
- )
- oldHookName += " ";
- oldHookName += newHookName + "\n";
- table += oldHookName;
- }
- console.error(
- "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
- componentName,
- table
- );
- }
- }
- }
- function checkDepsAreArrayDev(deps) {
- void 0 === deps ||
- null === deps ||
- isArrayImpl(deps) ||
+ var componentName = getComponentNameFromFiber(fiber);
console.error(
- "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
- currentHookNameInDev,
- typeof deps
+ "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s",
+ componentName
);
- }
- function warnOnUseFormStateInDev() {
- var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
- didWarnAboutUseFormState.has(componentName) ||
- (didWarnAboutUseFormState.add(componentName),
- console.error(
- "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
- componentName
- ));
- }
- function throwInvalidHookError() {
- throw Error(
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
- );
- }
- function areHookInputsEqual(nextDeps, prevDeps) {
- if (ignorePreviousDependencies) return !1;
- if (null === prevDeps)
+ didWarnUpdateInsideUpdate = !0;
+ }
+ if ((executionContext & RenderContext) !== NoContext)
return (
- console.error(
- "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
- currentHookNameInDev
- ),
- !1
- );
- nextDeps.length !== prevDeps.length &&
- console.error(
- "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",
- currentHookNameInDev,
- "[" + prevDeps.join(", ") + "]",
- "[" + nextDeps.join(", ") + "]"
+ (componentName = updateQueue.pending),
+ null === componentName
+ ? (update.next = update)
+ : ((update.next = componentName.next),
+ (componentName.next = update)),
+ (updateQueue.pending = update),
+ (update = getRootForUpdatedFiber(fiber)),
+ markUpdateLaneFromFiberToRoot(fiber, null, lane),
+ update
);
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
- if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
- return !0;
+ enqueueUpdate$1(fiber, updateQueue, update, lane);
+ return getRootForUpdatedFiber(fiber);
}
- function renderWithHooks(
- current,
- workInProgress,
- Component,
- props,
- secondArg,
- nextRenderLanes
- ) {
- renderLanes = nextRenderLanes;
- currentlyRenderingFiber$1 = workInProgress;
- hookTypesDev = null !== current ? current._debugHookTypes : null;
- hookTypesUpdateIndexDev = -1;
- ignorePreviousDependencies =
- null !== current && current.type !== workInProgress.type;
- if (
- "[object AsyncFunction]" ===
- Object.prototype.toString.call(Component) ||
- "[object AsyncGeneratorFunction]" ===
- Object.prototype.toString.call(Component)
- )
- (nextRenderLanes = getComponentNameFromFiber(
- currentlyRenderingFiber$1
- )),
- didWarnAboutAsyncClientComponent.has(nextRenderLanes) ||
- (didWarnAboutAsyncClientComponent.add(nextRenderLanes),
- console.error(
- "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- ));
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.lanes = 0;
- ReactSharedInternals.H =
- null !== current && null !== current.memoizedState
- ? HooksDispatcherOnUpdateInDEV
- : null !== hookTypesDev
- ? HooksDispatcherOnMountWithHookTypesInDEV
- : HooksDispatcherOnMountInDEV;
- shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes =
- (workInProgress.mode & StrictLegacyMode) !== NoMode;
- var children = callComponentInDEV(Component, props, secondArg);
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- didScheduleRenderPhaseUpdateDuringThisPass &&
- (children = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- ));
- if (nextRenderLanes) {
- setIsStrictModeForDevtools(!0);
- try {
- children = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- );
- } finally {
- setIsStrictModeForDevtools(!1);
- }
+ function entangleTransitions(root, fiber, lane) {
+ fiber = fiber.updateQueue;
+ if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
+ var queueLanes = fiber.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ fiber.lanes = lane;
+ markRootEntangled(root, lane);
}
- finishRenderingHooks(current, workInProgress);
- return children;
}
- function finishRenderingHooks(current, workInProgress) {
- workInProgress._debugHookTypes = hookTypesDev;
- null === workInProgress.dependencies
- ? null !== thenableState$1 &&
- (workInProgress.dependencies = {
- lanes: 0,
- firstContext: null,
- _debugThenableState: thenableState$1
- })
- : (workInProgress.dependencies._debugThenableState = thenableState$1);
- ReactSharedInternals.H = ContextOnlyDispatcher;
- var didRenderTooFewHooks =
- null !== currentHook && null !== currentHook.next;
- renderLanes = 0;
- hookTypesDev =
- currentHookNameInDev =
- workInProgressHook =
- currentHook =
- currentlyRenderingFiber$1 =
- null;
- hookTypesUpdateIndexDev = -1;
- null !== current &&
- (current.flags & 31457280) !== (workInProgress.flags & 31457280) &&
- console.error(
- "Internal React error: Expected static flag was missing. Please notify the React team."
- );
- didScheduleRenderPhaseUpdate = !1;
- thenableIndexCounter$1 = 0;
- thenableState$1 = null;
- if (didRenderTooFewHooks)
- throw Error(
- "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
- );
- null === current ||
- didReceiveUpdate ||
- ((current = current.dependencies),
+ function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
+ var queue = workInProgress.updateQueue,
+ current = workInProgress.alternate;
+ if (
null !== current &&
- checkIfContextChanged(current) &&
- (didReceiveUpdate = !0));
- needsToResetSuspendedThenableDEV
- ? ((needsToResetSuspendedThenableDEV = !1), (current = !0))
- : (current = !1);
- current &&
- ((workInProgress =
- getComponentNameFromFiber(workInProgress) || "Unknown"),
- didWarnAboutUseWrappedInTryCatch.has(workInProgress) ||
- didWarnAboutAsyncClientComponent.has(workInProgress) ||
- (didWarnAboutUseWrappedInTryCatch.add(workInProgress),
- console.error(
- "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
- )));
- }
- function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
- currentlyRenderingFiber$1 = workInProgress;
- var numberOfReRenders = 0;
- do {
- didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
- thenableIndexCounter$1 = 0;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- if (numberOfReRenders >= RE_RENDER_LIMIT)
- throw Error(
- "Too many re-renders. React limits the number of renders to prevent an infinite loop."
- );
- numberOfReRenders += 1;
- ignorePreviousDependencies = !1;
- workInProgressHook = currentHook = null;
- if (null != workInProgress.updateQueue) {
- var children = workInProgress.updateQueue;
- children.lastEffect = null;
- children.events = null;
- children.stores = null;
- null != children.memoCache && (children.memoCache.index = 0);
- }
- hookTypesUpdateIndexDev = -1;
- ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV;
- children = callComponentInDEV(Component, props, secondArg);
- } while (didScheduleRenderPhaseUpdateDuringThisPass);
- return children;
- }
- function TransitionAwareHostComponent() {
- var dispatcher = ReactSharedInternals.H,
- maybeThenable = dispatcher.useState()[0];
- maybeThenable =
- "function" === typeof maybeThenable.then
- ? useThenable(maybeThenable)
- : maybeThenable;
- dispatcher = dispatcher.useState()[0];
- (null !== currentHook ? currentHook.memoizedState : null) !==
- dispatcher && (currentlyRenderingFiber$1.flags |= 1024);
- return maybeThenable;
+ ((current = current.updateQueue), queue === current)
+ ) {
+ var newFirst = null,
+ newLast = null;
+ queue = queue.firstBaseUpdate;
+ if (null !== queue) {
+ do {
+ var clone = {
+ lane: queue.lane,
+ tag: queue.tag,
+ payload: queue.payload,
+ callback: null,
+ next: null
+ };
+ null === newLast
+ ? (newFirst = newLast = clone)
+ : (newLast = newLast.next = clone);
+ queue = queue.next;
+ } while (null !== queue);
+ null === newLast
+ ? (newFirst = newLast = capturedUpdate)
+ : (newLast = newLast.next = capturedUpdate);
+ } else newFirst = newLast = capturedUpdate;
+ queue = {
+ baseState: current.baseState,
+ firstBaseUpdate: newFirst,
+ lastBaseUpdate: newLast,
+ shared: current.shared,
+ callbacks: current.callbacks
+ };
+ workInProgress.updateQueue = queue;
+ return;
+ }
+ workInProgress = queue.lastBaseUpdate;
+ null === workInProgress
+ ? (queue.firstBaseUpdate = capturedUpdate)
+ : (workInProgress.next = capturedUpdate);
+ queue.lastBaseUpdate = capturedUpdate;
}
- function checkDidRenderIdHook() {
- var didRenderIdHook = 0 !== localIdCounter;
- localIdCounter = 0;
- return didRenderIdHook;
+ function suspendIfUpdateReadFromEntangledAsyncAction() {
+ if (didReadFromEntangledAsyncAction) {
+ var entangledActionThenable = currentEntangledActionThenable;
+ if (null !== entangledActionThenable) throw entangledActionThenable;
+ }
}
- function bailoutHooks(current, workInProgress, lanes) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.flags =
- (workInProgress.mode & StrictEffectsMode) !== NoMode
- ? workInProgress.flags & -201328645
- : workInProgress.flags & -2053;
- current.lanes &= ~lanes;
- }
- function resetHooksOnUnwind(workInProgress) {
- if (didScheduleRenderPhaseUpdate) {
- for (
- workInProgress = workInProgress.memoizedState;
- null !== workInProgress;
-
- ) {
- var queue = workInProgress.queue;
- null !== queue && (queue.pending = null);
- workInProgress = workInProgress.next;
- }
- didScheduleRenderPhaseUpdate = !1;
- }
- renderLanes = 0;
- hookTypesDev =
- workInProgressHook =
- currentHook =
- currentlyRenderingFiber$1 =
- null;
- hookTypesUpdateIndexDev = -1;
- currentHookNameInDev = null;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- thenableIndexCounter$1 = localIdCounter = 0;
- thenableState$1 = null;
- }
- function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- baseQueue: null,
- queue: null,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
- : (workInProgressHook = workInProgressHook.next = hook);
- return workInProgressHook;
- }
- function updateWorkInProgressHook() {
- if (null === currentHook) {
- var nextCurrentHook = currentlyRenderingFiber$1.alternate;
- nextCurrentHook =
- null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
- } else nextCurrentHook = currentHook.next;
- var nextWorkInProgressHook =
- null === workInProgressHook
- ? currentlyRenderingFiber$1.memoizedState
- : workInProgressHook.next;
- if (null !== nextWorkInProgressHook)
- (workInProgressHook = nextWorkInProgressHook),
- (currentHook = nextCurrentHook);
- else {
- if (null === nextCurrentHook) {
- if (null === currentlyRenderingFiber$1.alternate)
- throw Error(
- "Update hook called on initial render. This is likely a bug in React. Please file an issue."
- );
- throw Error("Rendered more hooks than during the previous render.");
- }
- currentHook = nextCurrentHook;
- nextCurrentHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- baseQueue: currentHook.baseQueue,
- queue: currentHook.queue,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook =
- nextCurrentHook)
- : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
- }
- return workInProgressHook;
- }
- function useThenable(thenable) {
- var index = thenableIndexCounter$1;
- thenableIndexCounter$1 += 1;
- null === thenableState$1 && (thenableState$1 = createThenableState());
- thenable = trackUsedThenable(thenableState$1, thenable, index);
- index = currentlyRenderingFiber$1;
- null ===
- (null === workInProgressHook
- ? index.memoizedState
- : workInProgressHook.next) &&
- ((index = index.alternate),
- (ReactSharedInternals.H =
- null !== index && null !== index.memoizedState
- ? HooksDispatcherOnUpdateInDEV
- : HooksDispatcherOnMountInDEV));
- return thenable;
- }
- function use(usable) {
- if (null !== usable && "object" === typeof usable) {
- if ("function" === typeof usable.then) return useThenable(usable);
- if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
- }
- throw Error("An unsupported type was passed to use(): " + String(usable));
- }
- function useMemoCache(size) {
- var memoCache = null,
- updateQueue = currentlyRenderingFiber$1.updateQueue;
- null !== updateQueue && (memoCache = updateQueue.memoCache);
- if (null == memoCache) {
- var current = currentlyRenderingFiber$1.alternate;
+ function processUpdateQueue(
+ workInProgress,
+ props,
+ instance$jscomp$0,
+ renderLanes
+ ) {
+ didReadFromEntangledAsyncAction = !1;
+ var queue = workInProgress.updateQueue;
+ hasForceUpdate = !1;
+ currentlyProcessingQueue = queue.shared;
+ var firstBaseUpdate = queue.firstBaseUpdate,
+ lastBaseUpdate = queue.lastBaseUpdate,
+ pendingQueue = queue.shared.pending;
+ if (null !== pendingQueue) {
+ queue.shared.pending = null;
+ var lastPendingUpdate = pendingQueue,
+ firstPendingUpdate = lastPendingUpdate.next;
+ lastPendingUpdate.next = null;
+ null === lastBaseUpdate
+ ? (firstBaseUpdate = firstPendingUpdate)
+ : (lastBaseUpdate.next = firstPendingUpdate);
+ lastBaseUpdate = lastPendingUpdate;
+ var current = workInProgress.alternate;
null !== current &&
((current = current.updateQueue),
- null !== current &&
- ((current = current.memoCache),
- null != current &&
- (memoCache = {
- data: current.data.map(function (array) {
- return array.slice();
- }),
- index: 0
- })));
- }
- null == memoCache && (memoCache = { data: [], index: 0 });
- null === updateQueue &&
- ((updateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = updateQueue));
- updateQueue.memoCache = memoCache;
- updateQueue = memoCache.data[memoCache.index];
- if (void 0 === updateQueue || ignorePreviousDependencies)
- for (
- updateQueue = memoCache.data[memoCache.index] = Array(size),
- current = 0;
- current < size;
- current++
- )
- updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
- else
- updateQueue.length !== size &&
- console.error(
- "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
- updateQueue.length,
- size
- );
- memoCache.index++;
- return updateQueue;
- }
- function basicStateReducer(state, action) {
- return "function" === typeof action ? action(state) : action;
- }
- function mountReducer(reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- if (void 0 !== init) {
- var initialState = init(initialArg);
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- init(initialArg);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- } else initialState = initialArg;
- hook.memoizedState = hook.baseState = initialState;
- reducer = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- hook.queue = reducer;
- reducer = reducer.dispatch = dispatchReducerAction.bind(
- null,
- currentlyRenderingFiber$1,
- reducer
- );
- return [hook.memoizedState, reducer];
- }
- function updateReducer(reducer) {
- var hook = updateWorkInProgressHook();
- return updateReducerImpl(hook, currentHook, reducer);
- }
- function updateReducerImpl(hook, current, reducer) {
- var queue = hook.queue;
- if (null === queue)
- throw Error(
- "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
- );
- queue.lastRenderedReducer = reducer;
- var baseQueue = hook.baseQueue,
- pendingQueue = queue.pending;
- if (null !== pendingQueue) {
- if (null !== baseQueue) {
- var baseFirst = baseQueue.next;
- baseQueue.next = pendingQueue.next;
- pendingQueue.next = baseFirst;
- }
- current.baseQueue !== baseQueue &&
- console.error(
- "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
- );
- current.baseQueue = baseQueue = pendingQueue;
- queue.pending = null;
+ (pendingQueue = current.lastBaseUpdate),
+ pendingQueue !== lastBaseUpdate &&
+ (null === pendingQueue
+ ? (current.firstBaseUpdate = firstPendingUpdate)
+ : (pendingQueue.next = firstPendingUpdate),
+ (current.lastBaseUpdate = lastPendingUpdate)));
}
- pendingQueue = hook.baseState;
- if (null === baseQueue) hook.memoizedState = pendingQueue;
- else {
- current = baseQueue.next;
- var newBaseQueueFirst = (baseFirst = null),
- newBaseQueueLast = null,
- update = current,
- didReadFromEntangledAsyncAction = !1;
+ if (null !== firstBaseUpdate) {
+ var newState = queue.baseState;
+ lastBaseUpdate = 0;
+ current = firstPendingUpdate = lastPendingUpdate = null;
+ pendingQueue = firstBaseUpdate;
do {
- var updateLane = update.lane & -536870913;
+ var updateLane = pendingQueue.lane & -536870913,
+ isHiddenUpdate = updateLane !== pendingQueue.lane;
if (
- updateLane !== update.lane
+ isHiddenUpdate
? (workInProgressRootRenderLanes & updateLane) === updateLane
: (renderLanes & updateLane) === updateLane
) {
- var revertLane = update.revertLane;
- if (0 === revertLane)
- null !== newBaseQueueLast &&
- (newBaseQueueLast = newBaseQueueLast.next =
- {
- lane: 0,
- revertLane: 0,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- else if ((renderLanes & revertLane) === revertLane) {
- update = update.next;
- revertLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- continue;
- } else
- (updateLane = {
- lane: 0,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
- (currentlyRenderingFiber$1.lanes |= revertLane),
- (workInProgressRootSkippedLanes |= revertLane);
- updateLane = update.action;
- shouldDoubleInvokeUserFnsInHooksDEV &&
- reducer(pendingQueue, updateLane);
- pendingQueue = update.hasEagerState
- ? update.eagerState
- : reducer(pendingQueue, updateLane);
+ 0 !== updateLane &&
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ null !== current &&
+ (current = current.next =
+ {
+ lane: 0,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: null,
+ next: null
+ });
+ a: {
+ updateLane = workInProgress;
+ var partialState = pendingQueue;
+ var nextProps = props,
+ instance = instance$jscomp$0;
+ switch (partialState.tag) {
+ case ReplaceState:
+ partialState = partialState.payload;
+ if ("function" === typeof partialState) {
+ isDisallowedContextReadInDEV = !0;
+ var nextState = partialState.call(
+ instance,
+ newState,
+ nextProps
+ );
+ if (updateLane.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ partialState.call(instance, newState, nextProps);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ isDisallowedContextReadInDEV = !1;
+ newState = nextState;
+ break a;
+ }
+ newState = partialState;
+ break a;
+ case CaptureUpdate:
+ updateLane.flags = (updateLane.flags & -65537) | 128;
+ case UpdateState:
+ nextState = partialState.payload;
+ if ("function" === typeof nextState) {
+ isDisallowedContextReadInDEV = !0;
+ partialState = nextState.call(
+ instance,
+ newState,
+ nextProps
+ );
+ if (updateLane.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextState.call(instance, newState, nextProps);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ isDisallowedContextReadInDEV = !1;
+ } else partialState = nextState;
+ if (null === partialState || void 0 === partialState) break a;
+ newState = assign({}, newState, partialState);
+ break a;
+ case ForceUpdate:
+ hasForceUpdate = !0;
+ }
+ }
+ updateLane = pendingQueue.callback;
+ null !== updateLane &&
+ ((workInProgress.flags |= 64),
+ isHiddenUpdate && (workInProgress.flags |= 8192),
+ (isHiddenUpdate = queue.callbacks),
+ null === isHiddenUpdate
+ ? (queue.callbacks = [updateLane])
+ : isHiddenUpdate.push(updateLane));
} else
- (revertLane = {
+ (isHiddenUpdate = {
lane: updateLane,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: pendingQueue.callback,
next: null
}),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
- (currentlyRenderingFiber$1.lanes |= updateLane),
- (workInProgressRootSkippedLanes |= updateLane);
- update = update.next;
- } while (null !== update && update !== current);
- null === newBaseQueueLast
- ? (baseFirst = pendingQueue)
- : (newBaseQueueLast.next = newBaseQueueFirst);
- if (
- !objectIs(pendingQueue, hook.memoizedState) &&
- ((didReceiveUpdate = !0),
- didReadFromEntangledAsyncAction &&
- ((reducer = currentEntangledActionThenable), null !== reducer))
- )
- throw reducer;
- hook.memoizedState = pendingQueue;
- hook.baseState = baseFirst;
- hook.baseQueue = newBaseQueueLast;
- queue.lastRenderedState = pendingQueue;
+ null === current
+ ? ((firstPendingUpdate = current = isHiddenUpdate),
+ (lastPendingUpdate = newState))
+ : (current = current.next = isHiddenUpdate),
+ (lastBaseUpdate |= updateLane);
+ pendingQueue = pendingQueue.next;
+ if (null === pendingQueue)
+ if (((pendingQueue = queue.shared.pending), null === pendingQueue))
+ break;
+ else
+ (isHiddenUpdate = pendingQueue),
+ (pendingQueue = isHiddenUpdate.next),
+ (isHiddenUpdate.next = null),
+ (queue.lastBaseUpdate = isHiddenUpdate),
+ (queue.shared.pending = null);
+ } while (1);
+ null === current && (lastPendingUpdate = newState);
+ queue.baseState = lastPendingUpdate;
+ queue.firstBaseUpdate = firstPendingUpdate;
+ queue.lastBaseUpdate = current;
+ null === firstBaseUpdate && (queue.shared.lanes = 0);
+ workInProgressRootSkippedLanes |= lastBaseUpdate;
+ workInProgress.lanes = lastBaseUpdate;
+ workInProgress.memoizedState = newState;
}
- null === baseQueue && (queue.lanes = 0);
- return [hook.memoizedState, queue.dispatch];
+ currentlyProcessingQueue = null;
}
- function rerenderReducer(reducer) {
- var hook = updateWorkInProgressHook(),
- queue = hook.queue;
- if (null === queue)
+ function callCallback(callback, context) {
+ if ("function" !== typeof callback)
throw Error(
- "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ "Invalid argument passed as callback. Expected a function. Instead received: " +
+ callback
);
- queue.lastRenderedReducer = reducer;
- var dispatch = queue.dispatch,
- lastRenderPhaseUpdate = queue.pending,
- newState = hook.memoizedState;
- if (null !== lastRenderPhaseUpdate) {
- queue.pending = null;
- var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
- do
- (newState = reducer(newState, update.action)), (update = update.next);
- while (update !== lastRenderPhaseUpdate);
- objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
- hook.memoizedState = newState;
- null === hook.baseQueue && (hook.baseState = newState);
- queue.lastRenderedState = newState;
- }
- return [newState, dispatch];
+ callback.call(context);
}
- function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = mountWorkInProgressHook();
- if (isHydrating) {
- if (void 0 === getServerSnapshot)
- throw Error(
- "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
- );
- var nextSnapshot = getServerSnapshot();
- didWarnUncachedGetSnapshot ||
- nextSnapshot === getServerSnapshot() ||
- (console.error(
- "The result of getServerSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0));
- } else {
- nextSnapshot = getSnapshot();
- didWarnUncachedGetSnapshot ||
- ((getServerSnapshot = getSnapshot()),
- objectIs(nextSnapshot, getServerSnapshot) ||
- (console.error(
- "The result of getSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0)));
- if (null === workInProgressRoot)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- 0 !== (workInProgressRootRenderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
- }
- hook.memoizedState = nextSnapshot;
- getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
- hook.queue = getServerSnapshot;
- mountEffect(
- subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe),
- [subscribe]
- );
- fiber.flags |= 2048;
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- getServerSnapshot,
- nextSnapshot,
- getSnapshot
- ),
- null
- );
- return nextSnapshot;
+ function commitHiddenCallbacks(updateQueue, context) {
+ var hiddenCallbacks = updateQueue.shared.hiddenCallbacks;
+ if (null !== hiddenCallbacks)
+ for (
+ updateQueue.shared.hiddenCallbacks = null, updateQueue = 0;
+ updateQueue < hiddenCallbacks.length;
+ updateQueue++
+ )
+ callCallback(hiddenCallbacks[updateQueue], context);
}
- function updateSyncExternalStore(
- subscribe,
- getSnapshot,
- getServerSnapshot
- ) {
- var fiber = currentlyRenderingFiber$1,
- hook = updateWorkInProgressHook(),
- isHydrating$jscomp$0 = isHydrating;
- if (isHydrating$jscomp$0) {
- if (void 0 === getServerSnapshot)
- throw Error(
- "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
- );
- getServerSnapshot = getServerSnapshot();
- } else if (
- ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot)
- ) {
- var cachedSnapshot = getSnapshot();
- objectIs(getServerSnapshot, cachedSnapshot) ||
- (console.error(
- "The result of getSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0));
- }
- if (
- (cachedSnapshot = !objectIs(
- (currentHook || hook).memoizedState,
- getServerSnapshot
- ))
- )
- (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0);
- hook = hook.queue;
- var create = subscribeToStore.bind(null, fiber, hook, subscribe);
- updateEffectImpl(2048, Passive, create, [subscribe]);
- if (
- hook.getSnapshot !== getSnapshot ||
- cachedSnapshot ||
- (null !== workInProgressHook &&
- workInProgressHook.memoizedState.tag & HasEffect)
- ) {
- fiber.flags |= 2048;
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- hook,
- getServerSnapshot,
- getSnapshot
- ),
- null
- );
- if (null === workInProgressRoot)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- isHydrating$jscomp$0 ||
- 0 !== (renderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- return getServerSnapshot;
+ function commitCallbacks(updateQueue, context) {
+ var callbacks = updateQueue.callbacks;
+ if (null !== callbacks)
+ for (
+ updateQueue.callbacks = null, updateQueue = 0;
+ updateQueue < callbacks.length;
+ updateQueue++
+ )
+ callCallback(callbacks[updateQueue], context);
}
- function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
- fiber.flags |= 16384;
- fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
- getSnapshot = currentlyRenderingFiber$1.updateQueue;
- null === getSnapshot
- ? ((getSnapshot = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = getSnapshot),
- (getSnapshot.stores = [fiber]))
- : ((renderedSnapshot = getSnapshot.stores),
- null === renderedSnapshot
- ? (getSnapshot.stores = [fiber])
- : renderedSnapshot.push(fiber));
+ function createCache() {
+ return {
+ controller: new AbortControllerLocal(),
+ data: new Map(),
+ refCount: 0
+ };
}
- function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
- inst.value = nextSnapshot;
- inst.getSnapshot = getSnapshot;
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ function retainCache(cache) {
+ cache.controller.signal.aborted &&
+ console.warn(
+ "A cache instance was retained after it was already freed. This likely indicates a bug in React."
+ );
+ cache.refCount++;
}
- function subscribeToStore(fiber, inst, subscribe) {
- return subscribe(function () {
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
- });
+ function releaseCache(cache) {
+ cache.refCount--;
+ 0 > cache.refCount &&
+ console.warn(
+ "A cache instance was released after it was already freed. This likely indicates a bug in React."
+ );
+ 0 === cache.refCount &&
+ scheduleCallback$2(NormalPriority, function () {
+ cache.controller.abort();
+ });
}
- function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- inst = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(inst, nextValue);
- } catch (error) {
- return !0;
+ function warnOnInvalidCallback(callback) {
+ if (null !== callback && "function" !== typeof callback) {
+ var key = String(callback);
+ didWarnOnInvalidCallback.has(key) ||
+ (didWarnOnInvalidCallback.add(key),
+ console.error(
+ "Expected the last optional `callback` argument to be a function. Instead received: %s.",
+ callback
+ ));
}
}
- function forceStoreRerender(fiber) {
- var root = enqueueConcurrentRenderForLane(fiber, 2);
- null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+ function applyDerivedStateFromProps(
+ workInProgress,
+ ctor,
+ getDerivedStateFromProps,
+ nextProps
+ ) {
+ var prevState = workInProgress.memoizedState,
+ partialState = getDerivedStateFromProps(nextProps, prevState);
+ if (workInProgress.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ partialState = getDerivedStateFromProps(nextProps, prevState);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ void 0 === partialState &&
+ ((ctor = getComponentNameFromType(ctor) || "Component"),
+ didWarnAboutUndefinedDerivedState.has(ctor) ||
+ (didWarnAboutUndefinedDerivedState.add(ctor),
+ console.error(
+ "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
+ ctor
+ )));
+ prevState =
+ null === partialState || void 0 === partialState
+ ? prevState
+ : assign({}, prevState, partialState);
+ workInProgress.memoizedState = prevState;
+ 0 === workInProgress.lanes &&
+ (workInProgress.updateQueue.baseState = prevState);
}
- function mountStateImpl(initialState) {
- var hook = mountWorkInProgressHook();
- if ("function" === typeof initialState) {
- var initialStateInitializer = initialState;
- initialState = initialStateInitializer();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ function checkShouldComponentUpdate(
+ workInProgress,
+ ctor,
+ oldProps,
+ newProps,
+ oldState,
+ newState,
+ nextContext
+ ) {
+ var instance = workInProgress.stateNode;
+ if ("function" === typeof instance.shouldComponentUpdate) {
+ oldProps = instance.shouldComponentUpdate(
+ newProps,
+ newState,
+ nextContext
+ );
+ if (workInProgress.mode & StrictLegacyMode) {
setIsStrictModeForDevtools(!0);
try {
- initialStateInitializer();
+ oldProps = instance.shouldComponentUpdate(
+ newProps,
+ newState,
+ nextContext
+ );
} finally {
setIsStrictModeForDevtools(!1);
}
}
+ void 0 === oldProps &&
+ console.error(
+ "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
+ getComponentNameFromType(ctor) || "Component"
+ );
+ return oldProps;
}
- hook.memoizedState = hook.baseState = initialState;
- hook.queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- return hook;
+ return ctor.prototype && ctor.prototype.isPureReactComponent
+ ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
+ : !0;
}
- function mountState(initialState) {
- initialState = mountStateImpl(initialState);
- var queue = initialState.queue,
- dispatch = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- queue
- );
- queue.dispatch = dispatch;
- return [initialState.memoizedState, dispatch];
+ function callComponentWillReceiveProps(
+ workInProgress,
+ instance,
+ newProps,
+ nextContext
+ ) {
+ var oldState = instance.state;
+ "function" === typeof instance.componentWillReceiveProps &&
+ instance.componentWillReceiveProps(newProps, nextContext);
+ "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
+ instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
+ instance.state !== oldState &&
+ ((workInProgress =
+ getComponentNameFromFiber(workInProgress) || "Component"),
+ didWarnAboutStateAssignmentForComponent.has(workInProgress) ||
+ (didWarnAboutStateAssignmentForComponent.add(workInProgress),
+ console.error(
+ "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
+ workInProgress
+ )),
+ classComponentUpdater.enqueueReplaceState(
+ instance,
+ instance.state,
+ null
+ ));
}
- function mountOptimistic(passthrough) {
- var hook = mountWorkInProgressHook();
- hook.memoizedState = hook.baseState = passthrough;
- var queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: null,
- lastRenderedState: null
- };
- hook.queue = queue;
- hook = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !0,
- queue
- );
- queue.dispatch = hook;
- return [passthrough, hook];
+ function resolveClassComponentProps(Component, baseProps) {
+ var newProps = baseProps;
+ if ("ref" in baseProps) {
+ newProps = {};
+ for (var propName in baseProps)
+ "ref" !== propName && (newProps[propName] = baseProps[propName]);
+ }
+ if ((Component = Component.defaultProps)) {
+ newProps === baseProps && (newProps = assign({}, newProps));
+ for (var _propName in Component)
+ void 0 === newProps[_propName] &&
+ (newProps[_propName] = Component[_propName]);
+ }
+ return newProps;
}
- function updateOptimistic(passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- }
- function updateOptimisticImpl(hook, current, passthrough, reducer) {
- hook.baseState = passthrough;
- return updateReducerImpl(
- hook,
- currentHook,
- "function" === typeof reducer ? reducer : basicStateReducer
- );
- }
- function rerenderOptimistic(passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- if (null !== currentHook)
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- hook.baseState = passthrough;
- return [passthrough, hook.queue.dispatch];
- }
- function dispatchActionState(
- fiber,
- actionQueue,
- setPendingState,
- setState,
- payload
- ) {
- if (isRenderPhaseUpdate(fiber))
- throw Error("Cannot update form state while rendering.");
- fiber = actionQueue.action;
- if (null !== fiber) {
- var actionNode = {
- payload: payload,
- action: fiber,
- next: null,
- isTransition: !0,
- status: "pending",
- value: null,
- reason: null,
- listeners: [],
- then: function (listener) {
- actionNode.listeners.push(listener);
- }
+ function createCapturedValueAtFiber(value, source) {
+ if ("object" === typeof value && null !== value) {
+ var existing = CapturedStacks.get(value);
+ if (void 0 !== existing) return existing;
+ source = {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
};
- null !== ReactSharedInternals.T
- ? setPendingState(!0)
- : (actionNode.isTransition = !1);
- setState(actionNode);
- setPendingState = actionQueue.pending;
- null === setPendingState
- ? ((actionNode.next = actionQueue.pending = actionNode),
- runActionStateAction(actionQueue, actionNode))
- : ((actionNode.next = setPendingState.next),
- (actionQueue.pending = setPendingState.next = actionNode));
+ CapturedStacks.set(value, source);
+ return source;
}
+ return {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
+ };
}
- function runActionStateAction(actionQueue, node) {
- var action = node.action,
- payload = node.payload,
- prevState = actionQueue.state;
- if (node.isTransition) {
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- ReactSharedInternals.T._updatedFibers = new Set();
- try {
- var returnValue = action(prevState, payload),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- handleActionReturnValue(actionQueue, node, returnValue);
- } catch (error) {
- onActionError(actionQueue, node, error);
- } finally {
- (ReactSharedInternals.T = prevTransition),
- null === prevTransition &&
- currentTransition._updatedFibers &&
- ((actionQueue = currentTransition._updatedFibers.size),
- currentTransition._updatedFibers.clear(),
- 10 < actionQueue &&
- console.warn(
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
- ));
- }
+ function pushTreeFork(workInProgress, totalChildren) {
+ warnIfNotHydrating();
+ forkStack[forkStackIndex++] = treeForkCount;
+ forkStack[forkStackIndex++] = treeForkProvider;
+ treeForkProvider = workInProgress;
+ treeForkCount = totalChildren;
+ }
+ function pushTreeId(workInProgress, totalChildren, index) {
+ warnIfNotHydrating();
+ idStack[idStackIndex++] = treeContextId;
+ idStack[idStackIndex++] = treeContextOverflow;
+ idStack[idStackIndex++] = treeContextProvider;
+ treeContextProvider = workInProgress;
+ var baseIdWithLeadingBit = treeContextId;
+ workInProgress = treeContextOverflow;
+ var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
+ baseIdWithLeadingBit &= ~(1 << baseLength);
+ index += 1;
+ var length = 32 - clz32(totalChildren) + baseLength;
+ if (30 < length) {
+ var numberOfOverflowBits = baseLength - (baseLength % 5);
+ length = (
+ baseIdWithLeadingBit &
+ ((1 << numberOfOverflowBits) - 1)
+ ).toString(32);
+ baseIdWithLeadingBit >>= numberOfOverflowBits;
+ baseLength -= numberOfOverflowBits;
+ treeContextId =
+ (1 << (32 - clz32(totalChildren) + baseLength)) |
+ (index << baseLength) |
+ baseIdWithLeadingBit;
+ treeContextOverflow = length + workInProgress;
} else
- try {
- (currentTransition = action(prevState, payload)),
- handleActionReturnValue(actionQueue, node, currentTransition);
- } catch (error$3) {
- onActionError(actionQueue, node, error$3);
- }
+ (treeContextId =
+ (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
+ (treeContextOverflow = workInProgress);
}
- function handleActionReturnValue(actionQueue, node, returnValue) {
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
- ? (returnValue.then(
- function (nextState) {
- onActionSuccess(actionQueue, node, nextState);
- },
- function (error) {
- return onActionError(actionQueue, node, error);
- }
- ),
- node.isTransition ||
- console.error(
- "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
- ))
- : onActionSuccess(actionQueue, node, returnValue);
+ function pushMaterializedTreeId(workInProgress) {
+ warnIfNotHydrating();
+ null !== workInProgress.return &&
+ (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
}
- function onActionSuccess(actionQueue, actionNode, nextState) {
- actionNode.status = "fulfilled";
- actionNode.value = nextState;
- notifyActionListeners(actionNode);
- actionQueue.state = nextState;
- actionNode = actionQueue.pending;
- null !== actionNode &&
- ((nextState = actionNode.next),
- nextState === actionNode
- ? (actionQueue.pending = null)
- : ((nextState = nextState.next),
- (actionNode.next = nextState),
- runActionStateAction(actionQueue, nextState)));
+ function popTreeContext(workInProgress) {
+ for (; workInProgress === treeForkProvider; )
+ (treeForkProvider = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null),
+ (treeForkCount = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null);
+ for (; workInProgress === treeContextProvider; )
+ (treeContextProvider = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextOverflow = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextId = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null);
}
- function onActionError(actionQueue, actionNode, error) {
- var last = actionQueue.pending;
- actionQueue.pending = null;
- if (null !== last) {
- last = last.next;
- do
- (actionNode.status = "rejected"),
- (actionNode.reason = error),
- notifyActionListeners(actionNode),
- (actionNode = actionNode.next);
- while (actionNode !== last);
- }
- actionQueue.action = null;
+ function warnIfNotHydrating() {
+ isHydrating ||
+ console.error(
+ "Expected to be hydrating. This is a bug in React. Please file an issue."
+ );
}
- function notifyActionListeners(actionNode) {
- actionNode = actionNode.listeners;
- for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+ function buildHydrationDiffNode(fiber, distanceFromLeaf) {
+ if (null === fiber.return) {
+ if (null === hydrationDiffRootDEV)
+ hydrationDiffRootDEV = {
+ fiber: fiber,
+ children: [],
+ serverProps: void 0,
+ serverTail: [],
+ distanceFromLeaf: distanceFromLeaf
+ };
+ else {
+ if (hydrationDiffRootDEV.fiber !== fiber)
+ throw Error(
+ "Saw multiple hydration diff roots in a pass. This is a bug in React."
+ );
+ hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf &&
+ (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
+ }
+ return hydrationDiffRootDEV;
+ }
+ var siblings = buildHydrationDiffNode(
+ fiber.return,
+ distanceFromLeaf + 1
+ ).children;
+ if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
+ return (
+ (siblings = siblings[siblings.length - 1]),
+ siblings.distanceFromLeaf > distanceFromLeaf &&
+ (siblings.distanceFromLeaf = distanceFromLeaf),
+ siblings
+ );
+ distanceFromLeaf = {
+ fiber: fiber,
+ children: [],
+ serverProps: void 0,
+ serverTail: [],
+ distanceFromLeaf: distanceFromLeaf
+ };
+ siblings.push(distanceFromLeaf);
+ return distanceFromLeaf;
}
- function actionStateReducer(oldState, newState) {
- return newState;
+ function warnNonHydratedInstance(fiber, rejectedCandidate) {
+ didSuspendOrErrorDEV ||
+ ((fiber = buildHydrationDiffNode(fiber, 0)),
+ (fiber.serverProps = null),
+ null !== rejectedCandidate &&
+ ((rejectedCandidate =
+ describeHydratableInstanceForDevWarnings(rejectedCandidate)),
+ fiber.serverTail.push(rejectedCandidate)));
}
- function mountActionState(action, initialStateProp) {
- if (isHydrating) {
- var ssrFormState = workInProgressRoot.formState;
- if (null !== ssrFormState) {
- a: {
- var isMatching = currentlyRenderingFiber$1;
- if (isHydrating) {
- if (nextHydratableInstance) {
- b: {
- var markerInstance = nextHydratableInstance;
- for (
- var inRootOrSingleton = rootOrSingletonContext;
- 8 !== markerInstance.nodeType;
-
- ) {
- if (!inRootOrSingleton) {
- markerInstance = null;
- break b;
- }
- markerInstance = getNextHydratable(
- markerInstance.nextSibling
- );
- if (null === markerInstance) {
- markerInstance = null;
- break b;
- }
- }
- inRootOrSingleton = markerInstance.data;
- markerInstance =
- inRootOrSingleton === FORM_STATE_IS_MATCHING ||
- inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING
- ? markerInstance
- : null;
- }
- if (markerInstance) {
- nextHydratableInstance = getNextHydratable(
- markerInstance.nextSibling
- );
- isMatching = markerInstance.data === FORM_STATE_IS_MATCHING;
- break a;
- }
- }
- throwOnHydrationMismatch(isMatching);
- }
- isMatching = !1;
- }
- isMatching && (initialStateProp = ssrFormState[0]);
- }
- }
- ssrFormState = mountWorkInProgressHook();
- ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
- isMatching = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: actionStateReducer,
- lastRenderedState: initialStateProp
- };
- ssrFormState.queue = isMatching;
- ssrFormState = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- isMatching
- );
- isMatching.dispatch = ssrFormState;
- isMatching = mountStateImpl(!1);
- inRootOrSingleton = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !1,
- isMatching.queue
- );
- isMatching = mountWorkInProgressHook();
- markerInstance = {
- state: initialStateProp,
- dispatch: null,
- action: action,
- pending: null
- };
- isMatching.queue = markerInstance;
- ssrFormState = dispatchActionState.bind(
- null,
- currentlyRenderingFiber$1,
- markerInstance,
- inRootOrSingleton,
- ssrFormState
+ function throwOnHydrationMismatch(fiber) {
+ var diff = "",
+ diffRoot = hydrationDiffRootDEV;
+ null !== diffRoot &&
+ ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot)));
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" +
+ diff
+ ),
+ fiber
+ )
);
- markerInstance.dispatch = ssrFormState;
- isMatching.memoizedState = action;
- return [initialStateProp, ssrFormState, !1];
+ throw HydrationMismatchException;
}
- function updateActionState(action) {
- var stateHook = updateWorkInProgressHook();
- return updateActionStateImpl(stateHook, currentHook, action);
+ function prepareToHydrateHostInstance(fiber) {
+ var didHydrate = fiber.stateNode;
+ var type = fiber.type,
+ props = fiber.memoizedProps;
+ didHydrate[internalInstanceKey] = fiber;
+ didHydrate[internalPropsKey] = props;
+ validatePropertiesInDevelopment(type, props);
+ switch (type) {
+ case "dialog":
+ listenToNonDelegatedEvent("cancel", didHydrate);
+ listenToNonDelegatedEvent("close", didHydrate);
+ break;
+ case "iframe":
+ case "object":
+ case "embed":
+ listenToNonDelegatedEvent("load", didHydrate);
+ break;
+ case "video":
+ case "audio":
+ for (type = 0; type < mediaEventTypes.length; type++)
+ listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate);
+ break;
+ case "source":
+ listenToNonDelegatedEvent("error", didHydrate);
+ break;
+ case "img":
+ case "image":
+ case "link":
+ listenToNonDelegatedEvent("error", didHydrate);
+ listenToNonDelegatedEvent("load", didHydrate);
+ break;
+ case "details":
+ listenToNonDelegatedEvent("toggle", didHydrate);
+ break;
+ case "input":
+ checkControlledValueProps("input", props);
+ listenToNonDelegatedEvent("invalid", didHydrate);
+ validateInputProps(didHydrate, props);
+ initInput(
+ didHydrate,
+ props.value,
+ props.defaultValue,
+ props.checked,
+ props.defaultChecked,
+ props.type,
+ props.name,
+ !0
+ );
+ track(didHydrate);
+ break;
+ case "option":
+ validateOptionProps(didHydrate, props);
+ break;
+ case "select":
+ checkControlledValueProps("select", props);
+ listenToNonDelegatedEvent("invalid", didHydrate);
+ validateSelectProps(didHydrate, props);
+ break;
+ case "textarea":
+ checkControlledValueProps("textarea", props),
+ listenToNonDelegatedEvent("invalid", didHydrate),
+ validateTextareaProps(didHydrate, props),
+ initTextarea(
+ didHydrate,
+ props.value,
+ props.defaultValue,
+ props.children
+ ),
+ track(didHydrate);
+ }
+ type = props.children;
+ ("string" !== typeof type &&
+ "number" !== typeof type &&
+ "bigint" !== typeof type) ||
+ didHydrate.textContent === "" + type ||
+ !0 === props.suppressHydrationWarning ||
+ checkForUnmatchedText(didHydrate.textContent, type)
+ ? (null != props.popover &&
+ (listenToNonDelegatedEvent("beforetoggle", didHydrate),
+ listenToNonDelegatedEvent("toggle", didHydrate)),
+ null != props.onScroll &&
+ listenToNonDelegatedEvent("scroll", didHydrate),
+ null != props.onScrollEnd &&
+ listenToNonDelegatedEvent("scrollend", didHydrate),
+ null != props.onClick && (didHydrate.onclick = noop$1),
+ (didHydrate = !0))
+ : (didHydrate = !1);
+ didHydrate || throwOnHydrationMismatch(fiber);
}
- function updateActionStateImpl(stateHook, currentStateHook, action) {
- currentStateHook = updateReducerImpl(
- stateHook,
- currentStateHook,
- actionStateReducer
- )[0];
- stateHook = updateReducer(basicStateReducer)[0];
- if (
- "object" === typeof currentStateHook &&
- null !== currentStateHook &&
- "function" === typeof currentStateHook.then
- )
- try {
- var state = useThenable(currentStateHook);
- } catch (x) {
- if (x === SuspenseException) throw SuspenseActionException;
- throw x;
+ function popToNextHostParent(fiber) {
+ for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
+ switch (hydrationParentFiber.tag) {
+ case 3:
+ case 27:
+ rootOrSingletonContext = !0;
+ return;
+ case 5:
+ case 13:
+ rootOrSingletonContext = !1;
+ return;
+ default:
+ hydrationParentFiber = hydrationParentFiber.return;
}
- else state = currentStateHook;
- currentStateHook = updateWorkInProgressHook();
- var actionQueue = currentStateHook.queue,
- dispatch = actionQueue.dispatch;
- action !== currentStateHook.memoizedState &&
- ((currentlyRenderingFiber$1.flags |= 2048),
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- actionStateActionEffect.bind(null, actionQueue, action),
- null
- ));
- return [state, dispatch, stateHook];
- }
- function actionStateActionEffect(actionQueue, action) {
- actionQueue.action = action;
- }
- function rerenderActionState(action) {
- var stateHook = updateWorkInProgressHook(),
- currentStateHook = currentHook;
- if (null !== currentStateHook)
- return updateActionStateImpl(stateHook, currentStateHook, action);
- updateWorkInProgressHook();
- stateHook = stateHook.memoizedState;
- currentStateHook = updateWorkInProgressHook();
- var dispatch = currentStateHook.queue.dispatch;
- currentStateHook.memoizedState = action;
- return [stateHook, dispatch, !1];
- }
- function pushSimpleEffect(tag, inst, create, deps) {
- tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
- inst = currentlyRenderingFiber$1.updateQueue;
- null === inst &&
- ((inst = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = inst));
- create = inst.lastEffect;
- null === create
- ? (inst.lastEffect = tag.next = tag)
- : ((deps = create.next),
- (create.next = tag),
- (tag.next = deps),
- (inst.lastEffect = tag));
- return tag;
}
- function createEffectInstance() {
- return { destroy: void 0, resource: void 0 };
- }
- function mountRef(initialValue) {
- var hook = mountWorkInProgressHook();
- initialValue = { current: initialValue };
- return (hook.memoizedState = initialValue);
- }
- function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- currentlyRenderingFiber$1.flags |= fiberFlags;
- hook.memoizedState = pushSimpleEffect(
- HasEffect | hookFlags,
- createEffectInstance(),
- create,
- deps
- );
+ function popHydrationState(fiber) {
+ if (fiber !== hydrationParentFiber) return !1;
+ if (!isHydrating)
+ return popToNextHostParent(fiber), (isHydrating = !0), !1;
+ var shouldClear = !1,
+ JSCompiler_temp;
+ if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
+ if ((JSCompiler_temp = 5 === fiber.tag))
+ (JSCompiler_temp = fiber.type),
+ (JSCompiler_temp =
+ !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
+ shouldSetTextContent(fiber.type, fiber.memoizedProps));
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp && (shouldClear = !0);
+ if (shouldClear && nextHydratableInstance) {
+ for (shouldClear = nextHydratableInstance; shouldClear; ) {
+ JSCompiler_temp = buildHydrationDiffNode(fiber, 0);
+ var description =
+ describeHydratableInstanceForDevWarnings(shouldClear);
+ JSCompiler_temp.serverTail.push(description);
+ shouldClear =
+ "Suspense" === description.type
+ ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear)
+ : getNextHydratable(shouldClear.nextSibling);
+ }
+ throwOnHydrationMismatch(fiber);
+ }
+ popToNextHostParent(fiber);
+ if (13 === fiber.tag) {
+ fiber = fiber.memoizedState;
+ fiber = null !== fiber ? fiber.dehydrated : null;
+ if (!fiber)
+ throw Error(
+ "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
+ );
+ nextHydratableInstance =
+ getNextHydratableInstanceAfterSuspenseInstance(fiber);
+ } else
+ nextHydratableInstance = hydrationParentFiber
+ ? getNextHydratable(fiber.stateNode.nextSibling)
+ : null;
+ return !0;
}
- function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var inst = hook.memoizedState.inst;
- null !== currentHook &&
- null !== deps &&
- areHookInputsEqual(deps, currentHook.memoizedState.deps)
- ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
- : ((currentlyRenderingFiber$1.flags |= fiberFlags),
- (hook.memoizedState = pushSimpleEffect(
- HasEffect | hookFlags,
- inst,
- create,
- deps
- )));
+ function resetHydrationState() {
+ nextHydratableInstance = hydrationParentFiber = null;
+ didSuspendOrErrorDEV = isHydrating = !1;
}
- function mountEffect(create, deps) {
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode
- ? mountEffectImpl(142608384, Passive, create, deps)
- : mountEffectImpl(8390656, Passive, create, deps);
+ function upgradeHydrationErrorsToRecoverable() {
+ var queuedErrors = hydrationErrors;
+ null !== queuedErrors &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = queuedErrors)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ queuedErrors
+ ),
+ (hydrationErrors = null));
+ return queuedErrors;
}
- function useEffectEventImpl(payload) {
- currentlyRenderingFiber$1.flags |= 4;
- var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
- if (null === componentUpdateQueue)
- (componentUpdateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue),
- (componentUpdateQueue.events = [payload]);
- else {
- var events = componentUpdateQueue.events;
- null === events
- ? (componentUpdateQueue.events = [payload])
- : events.push(payload);
- }
+ function queueHydrationError(error) {
+ null === hydrationErrors
+ ? (hydrationErrors = [error])
+ : hydrationErrors.push(error);
}
- function mountEvent(callback) {
- var hook = mountWorkInProgressHook(),
- ref = { impl: callback };
- hook.memoizedState = ref;
- return function () {
- if ((executionContext & RenderContext) !== NoContext)
- throw Error(
- "A function wrapped in useEffectEvent can't be called during rendering."
- );
- return ref.impl.apply(void 0, arguments);
- };
+ function emitPendingHydrationWarnings() {
+ var diffRoot = hydrationDiffRootDEV;
+ null !== diffRoot &&
+ ((hydrationDiffRootDEV = null),
+ (diffRoot = describeDiff(diffRoot)),
+ console.error(
+ "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
+ "https://react.dev/link/hydration-mismatch",
+ diffRoot
+ ));
}
- function updateEvent(callback) {
- var ref = updateWorkInProgressHook().memoizedState;
- useEffectEventImpl({ ref: ref, nextImpl: callback });
- return function () {
- if ((executionContext & RenderContext) !== NoContext)
- throw Error(
- "A function wrapped in useEffectEvent can't be called during rendering."
- );
- return ref.impl.apply(void 0, arguments);
- };
+ function createThenableState() {
+ return { didWarnAboutUncachedPromise: !1, thenables: [] };
}
- function mountLayoutEffect(create, deps) {
- var fiberFlags = 4194308;
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (fiberFlags |= 67108864);
- return mountEffectImpl(fiberFlags, Layout, create, deps);
+ function isThenableResolved(thenable) {
+ thenable = thenable.status;
+ return "fulfilled" === thenable || "rejected" === thenable;
}
- function imperativeHandleEffect(create, ref) {
- if ("function" === typeof ref) {
- create = create();
- var refCleanup = ref(create);
- return function () {
- "function" === typeof refCleanup ? refCleanup() : ref(null);
- };
- }
- if (null !== ref && void 0 !== ref)
- return (
- ref.hasOwnProperty("current") ||
+ function noop$3() {}
+ function trackUsedThenable(thenableState, thenable, index) {
+ null !== ReactSharedInternals.actQueue &&
+ (ReactSharedInternals.didUsePromise = !0);
+ var trackedThenables = thenableState.thenables;
+ index = trackedThenables[index];
+ void 0 === index
+ ? trackedThenables.push(thenable)
+ : index !== thenable &&
+ (thenableState.didWarnAboutUncachedPromise ||
+ ((thenableState.didWarnAboutUncachedPromise = !0),
console.error(
- "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
- "an object with keys {" + Object.keys(ref).join(", ") + "}"
- ),
- (create = create()),
- (ref.current = create),
- function () {
- ref.current = null;
+ "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
+ )),
+ thenable.then(noop$3, noop$3),
+ (thenable = index));
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ default:
+ if ("string" === typeof thenable.status)
+ thenable.then(noop$3, noop$3);
+ else {
+ thenableState = workInProgressRoot;
+ if (
+ null !== thenableState &&
+ 100 < thenableState.shellSuspendCounter
+ )
+ throw Error(
+ "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
+ );
+ thenableState = thenable;
+ thenableState.status = "pending";
+ thenableState.then(
+ function (fulfilledValue) {
+ if ("pending" === thenable.status) {
+ var fulfilledThenable = thenable;
+ fulfilledThenable.status = "fulfilled";
+ fulfilledThenable.value = fulfilledValue;
+ }
+ },
+ function (error) {
+ if ("pending" === thenable.status) {
+ var rejectedThenable = thenable;
+ rejectedThenable.status = "rejected";
+ rejectedThenable.reason = error;
+ }
+ }
+ );
}
- );
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ }
+ suspendedThenable = thenable;
+ needsToResetSuspendedThenableDEV = !0;
+ throw SuspenseException;
+ }
}
- function mountImperativeHandle(ref, create, deps) {
- "function" !== typeof create &&
- console.error(
- "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
- null !== create ? typeof create : "null"
+ function getSuspendedThenable() {
+ if (null === suspendedThenable)
+ throw Error(
+ "Expected a suspended thenable. This is a bug in React. Please file an issue."
);
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- var fiberFlags = 4194308;
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (fiberFlags |= 67108864);
- mountEffectImpl(
- fiberFlags,
- Layout,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
+ var thenable = suspendedThenable;
+ suspendedThenable = null;
+ needsToResetSuspendedThenableDEV = !1;
+ return thenable;
}
- function updateImperativeHandle(ref, create, deps) {
- "function" !== typeof create &&
- console.error(
- "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
- null !== create ? typeof create : "null"
+ function checkIfUseWrappedInAsyncCatch(rejectedReason) {
+ if (
+ rejectedReason === SuspenseException ||
+ rejectedReason === SuspenseActionException
+ )
+ throw Error(
+ "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
);
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- updateEffectImpl(
- 4,
- Layout,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
- }
- function mountCallback(callback, deps) {
- mountWorkInProgressHook().memoizedState = [
- callback,
- void 0 === deps ? null : deps
- ];
- return callback;
- }
- function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- hook.memoizedState = [callback, deps];
- return callback;
}
- function mountMemo(nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var nextValue = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- hook.memoizedState = [nextValue, deps];
- return nextValue;
+ function pushHiddenContext(fiber, context) {
+ var prevEntangledRenderLanes = entangledRenderLanes;
+ push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber);
+ push(currentTreeHiddenStackCursor, context, fiber);
+ entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes;
}
- function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- prevState = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- hook.memoizedState = [prevState, deps];
- return prevState;
+ function reuseHiddenContextOnStack(fiber) {
+ push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber);
+ push(
+ currentTreeHiddenStackCursor,
+ currentTreeHiddenStackCursor.current,
+ fiber
+ );
}
- function mountDeferredValue(value, initialValue) {
- var hook = mountWorkInProgressHook();
- return mountDeferredValueImpl(hook, value, initialValue);
+ function popHiddenContext(fiber) {
+ entangledRenderLanes = prevEntangledRenderLanesCursor.current;
+ pop(currentTreeHiddenStackCursor, fiber);
+ pop(prevEntangledRenderLanesCursor, fiber);
}
- function updateDeferredValue(value, initialValue) {
- var hook = updateWorkInProgressHook();
- return updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
+ function peekCacheFromPool() {
+ var cacheResumedFromPreviousRender = resumedCache.current;
+ return null !== cacheResumedFromPreviousRender
+ ? cacheResumedFromPreviousRender
+ : workInProgressRoot.pooledCache;
}
- function rerenderDeferredValue(value, initialValue) {
- var hook = updateWorkInProgressHook();
- return null === currentHook
- ? mountDeferredValueImpl(hook, value, initialValue)
- : updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
+ function pushTransition(offscreenWorkInProgress, prevCachePool) {
+ null === prevCachePool
+ ? push(resumedCache, resumedCache.current, offscreenWorkInProgress)
+ : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress);
}
- function mountDeferredValueImpl(hook, value, initialValue) {
- if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
- return (hook.memoizedState = value);
- hook.memoizedState = initialValue;
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return initialValue;
+ function getSuspendedCache() {
+ var cacheFromPool = peekCacheFromPool();
+ return null === cacheFromPool
+ ? null
+ : { parent: CacheContext._currentValue, pool: cacheFromPool };
}
- function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
- if (objectIs(value, prevValue)) return value;
- if (null !== currentTreeHiddenStackCursor.current)
- return (
- (hook = mountDeferredValueImpl(hook, value, initialValue)),
- objectIs(hook, prevValue) || (didReceiveUpdate = !0),
- hook
- );
- if (0 === (renderLanes & 42))
- return (didReceiveUpdate = !0), (hook.memoizedState = value);
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return prevValue;
+ function mountHookTypesDev() {
+ var hookName = currentHookNameInDev;
+ null === hookTypesDev
+ ? (hookTypesDev = [hookName])
+ : hookTypesDev.push(hookName);
}
- function startTransition(
- fiber,
- queue,
- pendingState,
- finishedState,
- callback
- ) {
- var previousPriority = ReactDOMSharedInternals.p;
- ReactDOMSharedInternals.p =
- 0 !== previousPriority && previousPriority < ContinuousEventPriority
- ? previousPriority
- : ContinuousEventPriority;
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- dispatchOptimisticSetState(fiber, !1, queue, pendingState);
- currentTransition._updatedFibers = new Set();
- try {
- var returnValue = callback(),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
+ function updateHookTypesDev() {
+ var hookName = currentHookNameInDev;
+ if (
+ null !== hookTypesDev &&
+ (hookTypesUpdateIndexDev++,
+ hookTypesDev[hookTypesUpdateIndexDev] !== hookName)
+ ) {
+ var componentName = getComponentNameFromFiber(currentlyRenderingFiber);
if (
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
+ !didWarnAboutMismatchedHooksForComponent.has(componentName) &&
+ (didWarnAboutMismatchedHooksForComponent.add(componentName),
+ null !== hookTypesDev)
) {
- var thenableForFinishedState = chainThenableValue(
- returnValue,
- finishedState
- );
- dispatchSetStateInternal(
- fiber,
- queue,
- thenableForFinishedState,
- requestUpdateLane(fiber)
- );
- } else
- dispatchSetStateInternal(
- fiber,
- queue,
- finishedState,
- requestUpdateLane(fiber)
+ for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i],
+ newHookName =
+ i === hookTypesUpdateIndexDev ? hookName : oldHookName;
+ for (
+ oldHookName = i + 1 + ". " + oldHookName;
+ 30 > oldHookName.length;
+
+ )
+ oldHookName += " ";
+ oldHookName += newHookName + "\n";
+ table += oldHookName;
+ }
+ console.error(
+ "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
+ componentName,
+ table
);
- } catch (error) {
- dispatchSetStateInternal(
- fiber,
- queue,
- { then: function () {}, status: "rejected", reason: error },
- requestUpdateLane(fiber)
- );
- } finally {
- (ReactDOMSharedInternals.p = previousPriority),
- (ReactSharedInternals.T = prevTransition),
- null === prevTransition &&
- currentTransition._updatedFibers &&
- ((fiber = currentTransition._updatedFibers.size),
- currentTransition._updatedFibers.clear(),
- 10 < fiber &&
- console.warn(
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
- ));
+ }
}
}
- function startHostTransition(formFiber, pendingState, action, formData) {
- if (5 !== formFiber.tag)
- throw Error(
- "Expected the form instance to be a HostComponent. This is a bug in React."
+ function checkDepsAreArrayDev(deps) {
+ void 0 === deps ||
+ null === deps ||
+ isArrayImpl(deps) ||
+ console.error(
+ "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
+ currentHookNameInDev,
+ typeof deps
);
- var queue = ensureFormComponentIsStateful(formFiber).queue;
- startTransition(
- formFiber,
- queue,
- pendingState,
- NotPendingTransition,
- null === action
- ? noop$2
- : function () {
- requestFormReset$1(formFiber);
- return action(formData);
- }
+ }
+ function warnOnUseFormStateInDev() {
+ var componentName = getComponentNameFromFiber(currentlyRenderingFiber);
+ didWarnAboutUseFormState.has(componentName) ||
+ (didWarnAboutUseFormState.add(componentName),
+ console.error(
+ "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
+ componentName
+ ));
+ }
+ function throwInvalidHookError() {
+ throw Error(
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
);
}
- function ensureFormComponentIsStateful(formFiber) {
- var existingStateHook = formFiber.memoizedState;
- if (null !== existingStateHook) return existingStateHook;
- existingStateHook = {
- memoizedState: NotPendingTransition,
- baseState: NotPendingTransition,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: NotPendingTransition
- },
- next: null
- };
- var initialResetState = {};
- existingStateHook.next = {
- memoizedState: initialResetState,
- baseState: initialResetState,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialResetState
- },
- next: null
- };
- formFiber.memoizedState = existingStateHook;
- formFiber = formFiber.alternate;
- null !== formFiber && (formFiber.memoizedState = existingStateHook);
- return existingStateHook;
- }
- function requestFormReset$1(formFiber) {
- null === ReactSharedInternals.T &&
+ function areHookInputsEqual(nextDeps, prevDeps) {
+ if (ignorePreviousDependencies) return !1;
+ if (null === prevDeps)
+ return (
+ console.error(
+ "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
+ currentHookNameInDev
+ ),
+ !1
+ );
+ nextDeps.length !== prevDeps.length &&
console.error(
- "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
+ "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",
+ currentHookNameInDev,
+ "[" + prevDeps.join(", ") + "]",
+ "[" + nextDeps.join(", ") + "]"
);
- var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
- dispatchSetStateInternal(
- formFiber,
- resetStateQueue,
- {},
- requestUpdateLane(formFiber)
- );
- }
- function mountTransition() {
- var stateHook = mountStateImpl(!1);
- stateHook = startTransition.bind(
- null,
- currentlyRenderingFiber$1,
- stateHook.queue,
- !0,
- !1
- );
- mountWorkInProgressHook().memoizedState = stateHook;
- return [!1, stateHook];
- }
- function updateTransition() {
- var booleanOrThenable = updateReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- }
- function rerenderTransition() {
- var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- }
- function useHostTransitionStatus() {
- return readContext(HostTransitionContext);
- }
- function mountId() {
- var hook = mountWorkInProgressHook(),
- identifierPrefix = workInProgressRoot.identifierPrefix;
- if (isHydrating) {
- var treeId = treeContextOverflow;
- var idWithLeadingBit = treeContextId;
- treeId =
- (
- idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
- ).toString(32) + treeId;
- identifierPrefix = ":" + identifierPrefix + "R" + treeId;
- treeId = localIdCounter++;
- 0 < treeId && (identifierPrefix += "H" + treeId.toString(32));
- identifierPrefix += ":";
- } else
- (treeId = globalClientIdCounter++),
- (identifierPrefix =
- ":" + identifierPrefix + "r" + treeId.toString(32) + ":");
- return (hook.memoizedState = identifierPrefix);
- }
- function mountRefresh() {
- return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
- null,
- currentlyRenderingFiber$1
- ));
+ for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
+ if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
+ return !0;
}
- function refreshCache(fiber, seedKey, seedValue) {
- for (var provider = fiber.return; null !== provider; ) {
- switch (provider.tag) {
- case 24:
- case 3:
- var lane = requestUpdateLane(provider);
- fiber = createUpdate(lane);
- var root = enqueueUpdate(provider, fiber, lane);
- null !== root &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(root, provider, lane),
- entangleTransitions(root, provider, lane));
- provider = createCache();
- null !== seedKey &&
- void 0 !== seedKey &&
- null !== root &&
- provider.data.set(seedKey, seedValue);
- fiber.payload = { cache: provider };
- return;
+ function renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ props,
+ secondArg,
+ nextRenderLanes
+ ) {
+ renderLanes = nextRenderLanes;
+ currentlyRenderingFiber = workInProgress;
+ hookTypesDev = null !== current ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ ignorePreviousDependencies =
+ null !== current && current.type !== workInProgress.type;
+ if (
+ "[object AsyncFunction]" ===
+ Object.prototype.toString.call(Component) ||
+ "[object AsyncGeneratorFunction]" ===
+ Object.prototype.toString.call(Component)
+ )
+ (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)),
+ didWarnAboutAsyncClientComponent.has(nextRenderLanes) ||
+ (didWarnAboutAsyncClientComponent.add(nextRenderLanes),
+ console.error(
+ "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
+ ));
+ workInProgress.memoizedState = null;
+ workInProgress.updateQueue = null;
+ workInProgress.lanes = 0;
+ ReactSharedInternals.H =
+ null !== current && null !== current.memoizedState
+ ? HooksDispatcherOnUpdateInDEV
+ : null !== hookTypesDev
+ ? HooksDispatcherOnMountWithHookTypesInDEV
+ : HooksDispatcherOnMountInDEV;
+ shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes =
+ (workInProgress.mode & StrictLegacyMode) !== NoMode;
+ var children = callComponentInDEV(Component, props, secondArg);
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ didScheduleRenderPhaseUpdateDuringThisPass &&
+ (children = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ ));
+ if (nextRenderLanes) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ children = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ );
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- provider = provider.return;
}
+ finishRenderingHooks(current, workInProgress);
+ return children;
}
- function dispatchReducerAction(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p0
- ) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 &&
+ function finishRenderingHooks(current, workInProgress) {
+ workInProgress._debugHookTypes = hookTypesDev;
+ null === workInProgress.dependencies
+ ? null !== thenableState$1 &&
+ (workInProgress.dependencies = {
+ lanes: 0,
+ firstContext: null,
+ _debugThenableState: thenableState$1
+ })
+ : (workInProgress.dependencies._debugThenableState = thenableState$1);
+ ReactSharedInternals.H = ContextOnlyDispatcher;
+ var didRenderTooFewHooks =
+ null !== currentHook && null !== currentHook.next;
+ renderLanes = 0;
+ hookTypesDev =
+ currentHookNameInDev =
+ workInProgressHook =
+ currentHook =
+ currentlyRenderingFiber =
+ null;
+ hookTypesUpdateIndexDev = -1;
+ null !== current &&
+ (current.flags & 31457280) !== (workInProgress.flags & 31457280) &&
console.error(
- "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ "Internal React error: Expected static flag was missing. Please notify the React team."
);
- JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber);
- action = {
- lane: JSCompiler_OptimizeArgumentsArray_p0,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- isRenderPhaseUpdate(fiber)
- ? enqueueRenderPhaseUpdate(queue, action)
- : ((action = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p0
- )),
- null !== action &&
- (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0),
- scheduleUpdateOnFiber(
- action,
- fiber,
- JSCompiler_OptimizeArgumentsArray_p0
- ),
- entangleTransitionUpdate(
- action,
- queue,
- JSCompiler_OptimizeArgumentsArray_p0
- )));
- }
- function dispatchSetState(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p1
- ) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 &&
- console.error(
- "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ didScheduleRenderPhaseUpdate = !1;
+ thenableIndexCounter$1 = 0;
+ thenableState$1 = null;
+ if (didRenderTooFewHooks)
+ throw Error(
+ "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
);
- JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber);
- dispatchSetStateInternal(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p1
- ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1);
- }
- function dispatchSetStateInternal(fiber, queue, action, lane) {
- var update = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
- else {
- var alternate = fiber.alternate;
- if (
- 0 === fiber.lanes &&
- (null === alternate || 0 === alternate.lanes) &&
- ((alternate = queue.lastRenderedReducer), null !== alternate)
- ) {
- var prevDispatcher = ReactSharedInternals.H;
- ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- var currentState = queue.lastRenderedState,
- eagerState = alternate(currentState, action);
- update.hasEagerState = !0;
- update.eagerState = eagerState;
- if (objectIs(eagerState, currentState))
- return (
- enqueueUpdate$1(fiber, queue, update, 0),
- null === workInProgressRoot &&
- finishQueueingConcurrentUpdates(),
- !1
- );
- } catch (error) {
- } finally {
- ReactSharedInternals.H = prevDispatcher;
- }
- }
- action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
- if (null !== action)
- return (
- scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane),
- !0
+ null === current ||
+ didReceiveUpdate ||
+ ((current = current.dependencies),
+ null !== current &&
+ checkIfContextChanged(current) &&
+ (didReceiveUpdate = !0));
+ needsToResetSuspendedThenableDEV
+ ? ((needsToResetSuspendedThenableDEV = !1), (current = !0))
+ : (current = !1);
+ current &&
+ ((workInProgress =
+ getComponentNameFromFiber(workInProgress) || "Unknown"),
+ didWarnAboutUseWrappedInTryCatch.has(workInProgress) ||
+ didWarnAboutAsyncClientComponent.has(workInProgress) ||
+ (didWarnAboutUseWrappedInTryCatch.add(workInProgress),
+ console.error(
+ "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
+ )));
+ }
+ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
+ currentlyRenderingFiber = workInProgress;
+ var numberOfReRenders = 0;
+ do {
+ didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
+ thenableIndexCounter$1 = 0;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ if (numberOfReRenders >= RE_RENDER_LIMIT)
+ throw Error(
+ "Too many re-renders. React limits the number of renders to prevent an infinite loop."
);
- }
- return !1;
+ numberOfReRenders += 1;
+ ignorePreviousDependencies = !1;
+ workInProgressHook = currentHook = null;
+ if (null != workInProgress.updateQueue) {
+ var children = workInProgress.updateQueue;
+ children.lastEffect = null;
+ children.events = null;
+ children.stores = null;
+ null != children.memoCache && (children.memoCache.index = 0);
+ }
+ hookTypesUpdateIndexDev = -1;
+ ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV;
+ children = callComponentInDEV(Component, props, secondArg);
+ } while (didScheduleRenderPhaseUpdateDuringThisPass);
+ return children;
}
- function dispatchOptimisticSetState(
- fiber,
- throwIfDuringRender,
- queue,
- action
- ) {
- null === ReactSharedInternals.T &&
- 0 === currentEntangledLane &&
- console.error(
- "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
- );
- action = {
- lane: 2,
- revertLane: requestTransitionLane(),
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) {
- if (throwIfDuringRender)
- throw Error("Cannot update optimistic state while rendering.");
- console.error("Cannot call startTransition while rendering.");
- } else
- (throwIfDuringRender = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- 2
- )),
- null !== throwIfDuringRender &&
- (startUpdateTimerByLane(2),
- scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
+ function TransitionAwareHostComponent() {
+ var dispatcher = ReactSharedInternals.H,
+ maybeThenable = dispatcher.useState()[0];
+ maybeThenable =
+ "function" === typeof maybeThenable.then
+ ? useThenable(maybeThenable)
+ : maybeThenable;
+ dispatcher = dispatcher.useState()[0];
+ (null !== currentHook ? currentHook.memoizedState : null) !==
+ dispatcher && (currentlyRenderingFiber.flags |= 1024);
+ return maybeThenable;
}
- function isRenderPhaseUpdate(fiber) {
- var alternate = fiber.alternate;
- return (
- fiber === currentlyRenderingFiber$1 ||
- (null !== alternate && alternate === currentlyRenderingFiber$1)
- );
+ function checkDidRenderIdHook() {
+ var didRenderIdHook = 0 !== localIdCounter;
+ localIdCounter = 0;
+ return didRenderIdHook;
}
- function enqueueRenderPhaseUpdate(queue, update) {
- didScheduleRenderPhaseUpdateDuringThisPass =
- didScheduleRenderPhaseUpdate = !0;
- var pending = queue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- queue.pending = update;
+ function bailoutHooks(current, workInProgress, lanes) {
+ workInProgress.updateQueue = current.updateQueue;
+ workInProgress.flags =
+ (workInProgress.mode & StrictEffectsMode) !== NoMode
+ ? workInProgress.flags & -201328645
+ : workInProgress.flags & -2053;
+ current.lanes &= ~lanes;
}
- function entangleTransitionUpdate(root, queue, lane) {
- if (0 !== (lane & 4194176)) {
- var queueLanes = queue.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- queue.lanes = lane;
- markRootEntangled(root, lane);
+ function resetHooksOnUnwind(workInProgress) {
+ if (didScheduleRenderPhaseUpdate) {
+ for (
+ workInProgress = workInProgress.memoizedState;
+ null !== workInProgress;
+
+ ) {
+ var queue = workInProgress.queue;
+ null !== queue && (queue.pending = null);
+ workInProgress = workInProgress.next;
+ }
+ didScheduleRenderPhaseUpdate = !1;
}
+ renderLanes = 0;
+ hookTypesDev =
+ workInProgressHook =
+ currentHook =
+ currentlyRenderingFiber =
+ null;
+ hookTypesUpdateIndexDev = -1;
+ currentHookNameInDev = null;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ thenableIndexCounter$1 = localIdCounter = 0;
+ thenableState$1 = null;
}
- function pushDebugInfo(debugInfo) {
- var previousDebugInfo = currentDebugInfo;
- null != debugInfo &&
- (currentDebugInfo =
- null === previousDebugInfo
- ? debugInfo
- : previousDebugInfo.concat(debugInfo));
- return previousDebugInfo;
+ function mountWorkInProgressHook() {
+ var hook = {
+ memoizedState: null,
+ baseState: null,
+ baseQueue: null,
+ queue: null,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)
+ : (workInProgressHook = workInProgressHook.next = hook);
+ return workInProgressHook;
}
- function validateFragmentProps(element, fiber, returnFiber) {
- for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) {
- var key = keys[i];
- if ("children" !== key && "key" !== key) {
- null === fiber &&
- ((fiber = createFiberFromElement(element, returnFiber.mode, 0)),
- (fiber._debugInfo = currentDebugInfo),
- (fiber.return = returnFiber));
- runWithFiberInDEV(
- fiber,
- function (erroredKey) {
- console.error(
- "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
- erroredKey
- );
- },
- key
- );
- break;
+ function updateWorkInProgressHook() {
+ if (null === currentHook) {
+ var nextCurrentHook = currentlyRenderingFiber.alternate;
+ nextCurrentHook =
+ null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
+ } else nextCurrentHook = currentHook.next;
+ var nextWorkInProgressHook =
+ null === workInProgressHook
+ ? currentlyRenderingFiber.memoizedState
+ : workInProgressHook.next;
+ if (null !== nextWorkInProgressHook)
+ (workInProgressHook = nextWorkInProgressHook),
+ (currentHook = nextCurrentHook);
+ else {
+ if (null === nextCurrentHook) {
+ if (null === currentlyRenderingFiber.alternate)
+ throw Error(
+ "Update hook called on initial render. This is likely a bug in React. Please file an issue."
+ );
+ throw Error("Rendered more hooks than during the previous render.");
}
+ currentHook = nextCurrentHook;
+ nextCurrentHook = {
+ memoizedState: currentHook.memoizedState,
+ baseState: currentHook.baseState,
+ baseQueue: currentHook.baseQueue,
+ queue: currentHook.queue,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook =
+ nextCurrentHook)
+ : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
}
+ return workInProgressHook;
}
- function unwrapThenable(thenable) {
- var index = thenableIndexCounter;
- thenableIndexCounter += 1;
- null === thenableState && (thenableState = createThenableState());
- return trackUsedThenable(thenableState, thenable, index);
- }
- function coerceRef(workInProgress, element) {
- element = element.props.ref;
- workInProgress.ref = void 0 !== element ? element : null;
+ function createFunctionComponentUpdateQueue() {
+ return { lastEffect: null, events: null, stores: null, memoCache: null };
}
- function throwOnInvalidObjectType(returnFiber, newChild) {
- if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
- throw Error(
- 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
- );
- returnFiber = Object.prototype.toString.call(newChild);
- throw Error(
- "Objects are not valid as a React child (found: " +
- ("[object Object]" === returnFiber
- ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
- : returnFiber) +
- "). If you meant to render a collection of children, use an array instead."
- );
- }
- function warnOnFunctionType(returnFiber, invalidChild) {
- var parentName = getComponentNameFromFiber(returnFiber) || "Component";
- ownerHasFunctionTypeWarning[parentName] ||
- ((ownerHasFunctionTypeWarning[parentName] = !0),
- (invalidChild =
- invalidChild.displayName || invalidChild.name || "Component"),
- 3 === returnFiber.tag
- ? console.error(
- "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)",
- invalidChild,
- invalidChild,
- invalidChild
- )
- : console.error(
- "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}%s>",
- invalidChild,
- invalidChild,
- parentName,
- invalidChild,
- parentName
- ));
- }
- function warnOnSymbolType(returnFiber, invalidChild) {
- var parentName = getComponentNameFromFiber(returnFiber) || "Component";
- ownerHasSymbolTypeWarning[parentName] ||
- ((ownerHasSymbolTypeWarning[parentName] = !0),
- (invalidChild = String(invalidChild)),
- 3 === returnFiber.tag
- ? console.error(
- "Symbols are not valid as a React child.\n root.render(%s)",
- invalidChild
- )
- : console.error(
- "Symbols are not valid as a React child.\n <%s>%s%s>",
- parentName,
- invalidChild,
- parentName
- ));
+ function useThenable(thenable) {
+ var index = thenableIndexCounter$1;
+ thenableIndexCounter$1 += 1;
+ null === thenableState$1 && (thenableState$1 = createThenableState());
+ thenable = trackUsedThenable(thenableState$1, thenable, index);
+ index = currentlyRenderingFiber;
+ null ===
+ (null === workInProgressHook
+ ? index.memoizedState
+ : workInProgressHook.next) &&
+ ((index = index.alternate),
+ (ReactSharedInternals.H =
+ null !== index && null !== index.memoizedState
+ ? HooksDispatcherOnUpdateInDEV
+ : HooksDispatcherOnMountInDEV));
+ return thenable;
}
- function createChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (shouldTrackSideEffects) {
- var deletions = returnFiber.deletions;
- null === deletions
- ? ((returnFiber.deletions = [childToDelete]),
- (returnFiber.flags |= 16))
- : deletions.push(childToDelete);
- }
- }
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) return null;
- for (; null !== currentFirstChild; )
- deleteChild(returnFiber, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return null;
- }
- function mapRemainingChildren(currentFirstChild) {
- for (var existingChildren = new Map(); null !== currentFirstChild; )
- null !== currentFirstChild.key
- ? existingChildren.set(currentFirstChild.key, currentFirstChild)
- : existingChildren.set(currentFirstChild.index, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return existingChildren;
- }
- function useFiber(fiber, pendingProps) {
- fiber = createWorkInProgress(fiber, pendingProps);
- fiber.index = 0;
- fiber.sibling = null;
- return fiber;
- }
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
- if (!shouldTrackSideEffects)
- return (newFiber.flags |= 1048576), lastPlacedIndex;
- newIndex = newFiber.alternate;
- if (null !== newIndex)
- return (
- (newIndex = newIndex.index),
- newIndex < lastPlacedIndex
- ? ((newFiber.flags |= 33554434), lastPlacedIndex)
- : newIndex
- );
- newFiber.flags |= 33554434;
- return lastPlacedIndex;
- }
- function placeSingleChild(newFiber) {
- shouldTrackSideEffects &&
- null === newFiber.alternate &&
- (newFiber.flags |= 33554434);
- return newFiber;
- }
- function updateTextNode(returnFiber, current, textContent, lanes) {
- if (null === current || 6 !== current.tag)
- return (
- (current = createFiberFromText(
- textContent,
- returnFiber.mode,
- lanes
- )),
- (current.return = returnFiber),
- (current._debugOwner = returnFiber),
- (current._debugTask = returnFiber._debugTask),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = useFiber(current, textContent);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
+ function use(usable) {
+ if (null !== usable && "object" === typeof usable) {
+ if ("function" === typeof usable.then) return useThenable(usable);
+ if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
}
- function updateElement(returnFiber, current, element, lanes) {
- var elementType = element.type;
- if (elementType === REACT_FRAGMENT_TYPE)
- return (
- (current = updateFragment(
- returnFiber,
- current,
- element.props.children,
- lanes,
- element.key
- )),
- validateFragmentProps(element, current, returnFiber),
- current
- );
- if (
+ throw Error("An unsupported type was passed to use(): " + String(usable));
+ }
+ function useMemoCache(size) {
+ var memoCache = null,
+ updateQueue = currentlyRenderingFiber.updateQueue;
+ null !== updateQueue && (memoCache = updateQueue.memoCache);
+ if (null == memoCache) {
+ var current = currentlyRenderingFiber.alternate;
+ null !== current &&
+ ((current = current.updateQueue),
null !== current &&
- (current.elementType === elementType ||
- isCompatibleFamilyForHotReloading(current, element) ||
- ("object" === typeof elementType &&
- null !== elementType &&
- elementType.$$typeof === REACT_LAZY_TYPE &&
- callLazyInitInDEV(elementType) === current.type))
- )
- return (
- (current = useFiber(current, element.props)),
- coerceRef(current, element),
- (current.return = returnFiber),
- (current._debugOwner = element._owner),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = createFiberFromElement(element, returnFiber.mode, lanes);
- coerceRef(current, element);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
+ ((current = current.memoCache),
+ null != current &&
+ (memoCache = {
+ data: current.data.map(function (array) {
+ return array.slice();
+ }),
+ index: 0
+ })));
}
- function updatePortal(returnFiber, current, portal, lanes) {
- if (
- null === current ||
- 4 !== current.tag ||
- current.stateNode.containerInfo !== portal.containerInfo ||
- current.stateNode.implementation !== portal.implementation
+ null == memoCache && (memoCache = { data: [], index: 0 });
+ null === updateQueue &&
+ ((updateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = updateQueue));
+ updateQueue.memoCache = memoCache;
+ updateQueue = memoCache.data[memoCache.index];
+ if (void 0 === updateQueue || ignorePreviousDependencies)
+ for (
+ updateQueue = memoCache.data[memoCache.index] = Array(size),
+ current = 0;
+ current < size;
+ current++
)
- return (
- (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = useFiber(current, portal.children || []);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
- }
- function updateFragment(returnFiber, current, fragment, lanes, key) {
- if (null === current || 7 !== current.tag)
- return (
- (current = createFiberFromFragment(
- fragment,
- returnFiber.mode,
- lanes,
- key
- )),
- (current.return = returnFiber),
- (current._debugOwner = returnFiber),
- (current._debugTask = returnFiber._debugTask),
- (current._debugInfo = currentDebugInfo),
- current
+ updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
+ else
+ updateQueue.length !== size &&
+ console.error(
+ "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
+ updateQueue.length,
+ size
);
- current = useFiber(current, fragment);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
- }
- function createChild(returnFiber, newChild, lanes) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (newChild = createFiberFromText(
- "" + newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- (newChild._debugOwner = returnFiber),
- (newChild._debugTask = returnFiber._debugTask),
- (newChild._debugInfo = currentDebugInfo),
- newChild
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (lanes = createFiberFromElement(
- newChild,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (returnFiber = pushDebugInfo(newChild._debugInfo)),
- (lanes._debugInfo = currentDebugInfo),
- (currentDebugInfo = returnFiber),
- lanes
- );
- case REACT_PORTAL_TYPE:
- return (
- (newChild = createFiberFromPortal(
- newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- (newChild._debugInfo = currentDebugInfo),
- newChild
- );
- case REACT_LAZY_TYPE:
- var _prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- newChild = callLazyInitInDEV(newChild);
- returnFiber = createChild(returnFiber, newChild, lanes);
- currentDebugInfo = _prevDebugInfo;
- return returnFiber;
+ memoCache.index++;
+ return updateQueue;
+ }
+ function basicStateReducer(state, action) {
+ return "function" === typeof action ? action(state) : action;
+ }
+ function mountReducer(reducer, initialArg, init) {
+ var hook = mountWorkInProgressHook();
+ if (void 0 !== init) {
+ var initialState = init(initialArg);
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ init(initialArg);
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (lanes = createFiberFromFragment(
- newChild,
- returnFiber.mode,
- lanes,
- null
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (returnFiber = pushDebugInfo(newChild._debugInfo)),
- (lanes._debugInfo = currentDebugInfo),
- (currentDebugInfo = returnFiber),
- lanes
- );
- if ("function" === typeof newChild.then)
- return (
- (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = createChild(
- returnFiber,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = _prevDebugInfo),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return createChild(
- returnFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
}
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
+ } else initialState = initialArg;
+ hook.memoizedState = hook.baseState = initialState;
+ reducer = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: reducer,
+ lastRenderedState: initialState
+ };
+ hook.queue = reducer;
+ reducer = reducer.dispatch = dispatchReducerAction.bind(
+ null,
+ currentlyRenderingFiber,
+ reducer
+ );
+ return [hook.memoizedState, reducer];
+ }
+ function updateReducer(reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateReducerImpl(hook, currentHook, reducer);
+ }
+ function updateReducerImpl(hook, current, reducer) {
+ var queue = hook.queue;
+ if (null === queue)
+ throw Error(
+ "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ );
+ queue.lastRenderedReducer = reducer;
+ var baseQueue = hook.baseQueue,
+ pendingQueue = queue.pending;
+ if (null !== pendingQueue) {
+ if (null !== baseQueue) {
+ var baseFirst = baseQueue.next;
+ baseQueue.next = pendingQueue.next;
+ pendingQueue.next = baseFirst;
+ }
+ current.baseQueue !== baseQueue &&
+ console.error(
+ "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
+ );
+ current.baseQueue = baseQueue = pendingQueue;
+ queue.pending = null;
}
- function updateSlot(returnFiber, oldFiber, newChild, lanes) {
- var key = null !== oldFiber ? oldFiber.key : null;
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return null !== key
- ? null
- : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return newChild.key === key
- ? ((key = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateElement(
- returnFiber,
- oldFiber,
- newChild,
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber)
- : null;
- case REACT_PORTAL_TYPE:
- return newChild.key === key
- ? updatePortal(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_LAZY_TYPE:
- return (
- (key = pushDebugInfo(newChild._debugInfo)),
- (newChild = callLazyInitInDEV(newChild)),
- (returnFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChild,
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber
- );
- }
+ pendingQueue = hook.baseState;
+ if (null === baseQueue) hook.memoizedState = pendingQueue;
+ else {
+ current = baseQueue.next;
+ var newBaseQueueFirst = (baseFirst = null),
+ newBaseQueueLast = null,
+ update = current,
+ didReadFromEntangledAsyncAction = !1;
+ do {
+ var updateLane = update.lane & -536870913;
if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
+ updateLane !== update.lane
+ ? (workInProgressRootRenderLanes & updateLane) === updateLane
+ : (renderLanes & updateLane) === updateLane
) {
- if (null !== key) return null;
- key = pushDebugInfo(newChild._debugInfo);
- returnFiber = updateFragment(
- returnFiber,
- oldFiber,
- newChild,
- lanes,
- null
- );
- currentDebugInfo = key;
- return returnFiber;
- }
- if ("function" === typeof newChild.then)
- return (
- (key = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateSlot(
- returnFiber,
- oldFiber,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateSlot(
- returnFiber,
- oldFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
- }
- function updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- ) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (newIdx =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- (existingChildren = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateElement(
- returnFiber,
- newIdx,
- newChild,
- lanes
- )),
- (currentDebugInfo = existingChildren),
- returnFiber
- );
- case REACT_PORTAL_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updatePortal(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_LAZY_TYPE:
- var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo);
- newChild = callLazyInitInDEV(newChild);
- returnFiber = updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- );
- currentDebugInfo = _prevDebugInfo7;
- return returnFiber;
- }
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (newIdx = existingChildren.get(newIdx) || null),
- (existingChildren = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateFragment(
- returnFiber,
- newIdx,
- newChild,
- lanes,
- null
- )),
- (currentDebugInfo = existingChildren),
- returnFiber
- );
- if ("function" === typeof newChild.then)
- return (
- (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = _prevDebugInfo7),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
+ var revertLane = update.revertLane;
+ if (0 === revertLane)
+ null !== newBaseQueueLast &&
+ (newBaseQueueLast = newBaseQueueLast.next =
+ {
+ lane: 0,
+ revertLane: 0,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ else if ((renderLanes & revertLane) === revertLane) {
+ update = update.next;
+ revertLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ continue;
+ } else
+ (updateLane = {
+ lane: 0,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
+ (currentlyRenderingFiber.lanes |= revertLane),
+ (workInProgressRootSkippedLanes |= revertLane);
+ updateLane = update.action;
+ shouldDoubleInvokeUserFnsInHooksDEV &&
+ reducer(pendingQueue, updateLane);
+ pendingQueue = update.hasEagerState
+ ? update.eagerState
+ : reducer(pendingQueue, updateLane);
+ } else
+ (revertLane = {
+ lane: updateLane,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
+ (currentlyRenderingFiber.lanes |= updateLane),
+ (workInProgressRootSkippedLanes |= updateLane);
+ update = update.next;
+ } while (null !== update && update !== current);
+ null === newBaseQueueLast
+ ? (baseFirst = pendingQueue)
+ : (newBaseQueueLast.next = newBaseQueueFirst);
+ if (
+ !objectIs(pendingQueue, hook.memoizedState) &&
+ ((didReceiveUpdate = !0),
+ didReadFromEntangledAsyncAction &&
+ ((reducer = currentEntangledActionThenable), null !== reducer))
+ )
+ throw reducer;
+ hook.memoizedState = pendingQueue;
+ hook.baseState = baseFirst;
+ hook.baseQueue = newBaseQueueLast;
+ queue.lastRenderedState = pendingQueue;
}
- function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) {
- if ("object" !== typeof child || null === child) return knownKeys;
- switch (child.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_PORTAL_TYPE:
- warnForMissingKey(returnFiber, workInProgress, child);
- var key = child.key;
- if ("string" !== typeof key) break;
- if (null === knownKeys) {
- knownKeys = new Set();
- knownKeys.add(key);
- break;
- }
- if (!knownKeys.has(key)) {
- knownKeys.add(key);
- break;
- }
- runWithFiberInDEV(workInProgress, function () {
- console.error(
- "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.",
- key
- );
- });
- break;
- case REACT_LAZY_TYPE:
- (child = callLazyInitInDEV(child)),
- warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys);
- }
- return knownKeys;
+ null === baseQueue && (queue.lanes = 0);
+ return [hook.memoizedState, queue.dispatch];
+ }
+ function rerenderReducer(reducer) {
+ var hook = updateWorkInProgressHook(),
+ queue = hook.queue;
+ if (null === queue)
+ throw Error(
+ "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ );
+ queue.lastRenderedReducer = reducer;
+ var dispatch = queue.dispatch,
+ lastRenderPhaseUpdate = queue.pending,
+ newState = hook.memoizedState;
+ if (null !== lastRenderPhaseUpdate) {
+ queue.pending = null;
+ var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
+ do
+ (newState = reducer(newState, update.action)), (update = update.next);
+ while (update !== lastRenderPhaseUpdate);
+ objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
+ hook.memoizedState = newState;
+ null === hook.baseQueue && (hook.baseState = newState);
+ queue.lastRenderedState = newState;
}
- function reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- for (
- var knownKeys = null,
- resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null;
- null !== oldFiber && newIdx < newChildren.length;
- newIdx++
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- lanes
- );
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- knownKeys = warnOnInvalidKey(
- returnFiber,
- newFiber,
- newChildren[newIdx],
- knownKeys
+ return [newState, dispatch];
+ }
+ function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = mountWorkInProgressHook();
+ if (isHydrating) {
+ if (void 0 === getServerSnapshot)
+ throw Error(
+ "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
);
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (newIdx === newChildren.length)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ var nextSnapshot = getServerSnapshot();
+ didWarnUncachedGetSnapshot ||
+ nextSnapshot === getServerSnapshot() ||
+ (console.error(
+ "The result of getServerSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0));
+ } else {
+ nextSnapshot = getSnapshot();
+ didWarnUncachedGetSnapshot ||
+ ((getServerSnapshot = getSnapshot()),
+ objectIs(nextSnapshot, getServerSnapshot) ||
+ (console.error(
+ "The result of getSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0)));
+ if (null === workInProgressRoot)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
- if (null === oldFiber) {
- for (; newIdx < newChildren.length; newIdx++)
- (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
- null !== oldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- knownKeys
- )),
- (currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- newIdx < newChildren.length;
- newIdx++
- )
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- newChildren[newIdx],
- lanes
- )),
- null !== nextOldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- nextOldFiber,
- newChildren[newIdx],
- knownKeys
- )),
- shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ 0 !== (workInProgressRootRenderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
}
- function reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChildrenIterable,
- lanes
+ hook.memoizedState = nextSnapshot;
+ getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
+ hook.queue = getServerSnapshot;
+ mountEffect(
+ subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe),
+ [subscribe]
+ );
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ getServerSnapshot,
+ nextSnapshot,
+ getSnapshot
+ ),
+ null
+ );
+ return nextSnapshot;
+ }
+ function updateSyncExternalStore(
+ subscribe,
+ getSnapshot,
+ getServerSnapshot
+ ) {
+ var fiber = currentlyRenderingFiber,
+ hook = updateWorkInProgressHook(),
+ isHydrating$jscomp$0 = isHydrating;
+ if (isHydrating$jscomp$0) {
+ if (void 0 === getServerSnapshot)
+ throw Error(
+ "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
+ );
+ getServerSnapshot = getServerSnapshot();
+ } else if (
+ ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot)
) {
- var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
- newChildren !== newChildrenIterable ||
- (0 === returnFiber.tag &&
- "[object AsyncGeneratorFunction]" ===
- Object.prototype.toString.call(returnFiber.type) &&
- "[object AsyncGenerator]" ===
- Object.prototype.toString.call(newChildren)) ||
- (didWarnAboutGenerators ||
- console.error(
- "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items."
- ),
- (didWarnAboutGenerators = !0));
- if (null == newChildren)
- throw Error("An iterable object provided no iterator.");
- return reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- {
- next: function () {
- return unwrapThenable(newChildren.next());
- }
- },
- lanes
- );
+ var cachedSnapshot = getSnapshot();
+ objectIs(getServerSnapshot, cachedSnapshot) ||
+ (console.error(
+ "The result of getSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0));
}
- function reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
+ if (
+ (cachedSnapshot = !objectIs(
+ (currentHook || hook).memoizedState,
+ getServerSnapshot
+ ))
+ )
+ (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0);
+ hook = hook.queue;
+ var create = subscribeToStore.bind(null, fiber, hook, subscribe);
+ updateEffectImpl(2048, Passive, create, [subscribe]);
+ if (
+ hook.getSnapshot !== getSnapshot ||
+ cachedSnapshot ||
+ (null !== workInProgressHook &&
+ workInProgressHook.memoizedState.tag & HasEffect)
) {
- if (null == newChildren)
- throw Error("An iterable object provided no iterator.");
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null,
- knownKeys = null,
- step = newChildren.next();
- null !== oldFiber && !step.done;
- newIdx++, step = newChildren.next()
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- knownKeys = warnOnInvalidKey(
- returnFiber,
- newFiber,
- step.value,
- knownKeys
- );
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (step.done)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ hook,
+ getServerSnapshot,
+ getSnapshot
+ ),
+ null
+ );
+ if (null === workInProgressRoot)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
- if (null === oldFiber) {
- for (; !step.done; newIdx++, step = newChildren.next())
- (oldFiber = createChild(returnFiber, step.value, lanes)),
- null !== oldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- oldFiber,
- step.value,
- knownKeys
- )),
- (currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- !step.done;
- newIdx++, step = newChildren.next()
- )
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- step.value,
- lanes
- )),
- null !== nextOldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- nextOldFiber,
- step.value,
- knownKeys
- )),
- shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ isHydrating$jscomp$0 ||
+ 0 !== (renderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
}
- function reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- ) {
- "object" === typeof newChild &&
- null !== newChild &&
- newChild.type === REACT_FRAGMENT_TYPE &&
- null === newChild.key &&
- (validateFragmentProps(newChild, null, returnFiber),
- (newChild = newChild.props.children));
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- var prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- a: {
- for (var key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key) {
- key = newChild.type;
- if (key === REACT_FRAGMENT_TYPE) {
- if (7 === currentFirstChild.tag) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- newChild.props.children
- );
- lanes.return = returnFiber;
- lanes._debugOwner = newChild._owner;
- lanes._debugInfo = currentDebugInfo;
- validateFragmentProps(newChild, lanes, returnFiber);
- returnFiber = lanes;
- break a;
- }
- } else if (
- currentFirstChild.elementType === key ||
- isCompatibleFamilyForHotReloading(
- currentFirstChild,
- newChild
- ) ||
- ("object" === typeof key &&
- null !== key &&
- key.$$typeof === REACT_LAZY_TYPE &&
- callLazyInitInDEV(key) === currentFirstChild.type)
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.props);
- coerceRef(lanes, newChild);
- lanes.return = returnFiber;
- lanes._debugOwner = newChild._owner;
- lanes._debugInfo = currentDebugInfo;
- returnFiber = lanes;
- break a;
- }
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- } else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- newChild.type === REACT_FRAGMENT_TYPE
- ? ((lanes = createFiberFromFragment(
- newChild.props.children,
- returnFiber.mode,
- lanes,
- newChild.key
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (lanes._debugInfo = currentDebugInfo),
- validateFragmentProps(newChild, lanes, returnFiber),
- (returnFiber = lanes))
- : ((lanes = createFiberFromElement(
- newChild,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (lanes._debugInfo = currentDebugInfo),
- (returnFiber = lanes));
- }
- returnFiber = placeSingleChild(returnFiber);
- currentDebugInfo = prevDebugInfo;
- return returnFiber;
- case REACT_PORTAL_TYPE:
- a: {
- prevDebugInfo = newChild;
- for (
- newChild = prevDebugInfo.key;
- null !== currentFirstChild;
-
- ) {
- if (currentFirstChild.key === newChild)
- if (
- 4 === currentFirstChild.tag &&
- currentFirstChild.stateNode.containerInfo ===
- prevDebugInfo.containerInfo &&
- currentFirstChild.stateNode.implementation ===
- prevDebugInfo.implementation
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- prevDebugInfo.children || []
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- } else {
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- }
- else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- lanes = createFiberFromPortal(
- prevDebugInfo,
- returnFiber.mode,
- lanes
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- }
- return placeSingleChild(returnFiber);
- case REACT_LAZY_TYPE:
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (newChild = callLazyInitInDEV(newChild)),
- (returnFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
+ return getServerSnapshot;
+ }
+ function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
+ fiber.flags |= 16384;
+ fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
+ getSnapshot = currentlyRenderingFiber.updateQueue;
+ null === getSnapshot
+ ? ((getSnapshot = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = getSnapshot),
+ (getSnapshot.stores = [fiber]))
+ : ((renderedSnapshot = getSnapshot.stores),
+ null === renderedSnapshot
+ ? (getSnapshot.stores = [fiber])
+ : renderedSnapshot.push(fiber));
+ }
+ function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
+ inst.value = nextSnapshot;
+ inst.getSnapshot = getSnapshot;
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ }
+ function subscribeToStore(fiber, inst, subscribe) {
+ return subscribe(function () {
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ });
+ }
+ function checkIfSnapshotChanged(inst) {
+ var latestGetSnapshot = inst.getSnapshot;
+ inst = inst.value;
+ try {
+ var nextValue = latestGetSnapshot();
+ return !objectIs(inst, nextValue);
+ } catch (error) {
+ return !0;
+ }
+ }
+ function forceStoreRerender(fiber) {
+ var root = enqueueConcurrentRenderForLane(fiber, 2);
+ null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+ }
+ function mountStateImpl(initialState) {
+ var hook = mountWorkInProgressHook();
+ if ("function" === typeof initialState) {
+ var initialStateInitializer = initialState;
+ initialState = initialStateInitializer();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ initialStateInitializer();
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- if (isArrayImpl(newChild))
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if (getIteratorFn(newChild)) {
- prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- key = getIteratorFn(newChild);
- if ("function" !== typeof key)
- throw Error(
- "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
- );
- var newChildren = key.call(newChild);
- if (newChildren === newChild) {
- if (
- 0 !== returnFiber.tag ||
- "[object GeneratorFunction]" !==
- Object.prototype.toString.call(returnFiber.type) ||
- "[object Generator]" !==
- Object.prototype.toString.call(newChildren)
- )
- didWarnAboutGenerators ||
- console.error(
- "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
- ),
- (didWarnAboutGenerators = !0);
- } else
- newChild.entries !== key ||
- didWarnAboutMaps ||
- (console.error(
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
- ),
- (didWarnAboutMaps = !0));
- returnFiber = reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- );
- currentDebugInfo = prevDebugInfo;
- return returnFiber;
- }
- if ("function" === typeof newChild[ASYNC_ITERATOR])
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if ("function" === typeof newChild.then)
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
}
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (prevDebugInfo = "" + newChild),
- null !== currentFirstChild && 6 === currentFirstChild.tag
- ? (deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- ),
- (lanes = useFiber(currentFirstChild, prevDebugInfo)),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : (deleteRemainingChildren(returnFiber, currentFirstChild),
- (lanes = createFiberFromText(
- prevDebugInfo,
- returnFiber.mode,
- lanes
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (lanes._debugInfo = currentDebugInfo),
- (returnFiber = lanes)),
- placeSingleChild(returnFiber)
- );
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return deleteRemainingChildren(returnFiber, currentFirstChild);
}
- return function (returnFiber, currentFirstChild, newChild, lanes) {
- var prevDebugInfo = currentDebugInfo;
- currentDebugInfo = null;
- try {
- thenableIndexCounter = 0;
- var firstChildFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- );
- thenableState = null;
- return firstChildFiber;
- } catch (x) {
- if (x === SuspenseException || x === SuspenseActionException) throw x;
- var fiber = createFiber(29, x, null, returnFiber.mode);
- fiber.lanes = lanes;
- fiber.return = returnFiber;
- var debugInfo = (fiber._debugInfo = currentDebugInfo);
- fiber._debugOwner = returnFiber._debugOwner;
- fiber._debugTask = returnFiber._debugTask;
- if (null != debugInfo)
- for (var i = debugInfo.length - 1; 0 <= i; i--)
- if ("string" === typeof debugInfo[i].stack) {
- fiber._debugOwner = debugInfo[i];
- fiber._debugTask = debugInfo[i].debugTask;
- break;
- }
- return fiber;
- } finally {
- currentDebugInfo = prevDebugInfo;
- }
+ hook.memoizedState = hook.baseState = initialState;
+ hook.queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialState
};
+ return hook;
}
- function pushPrimaryTreeSuspenseHandler(handler) {
- var current = handler.alternate;
- push(
- suspenseStackCursor,
- suspenseStackCursor.current & SubtreeSuspenseContextMask,
- handler
- );
- push(suspenseHandlerStackCursor, handler, handler);
- null === shellBoundary &&
- (null === current || null !== currentTreeHiddenStackCursor.current
- ? (shellBoundary = handler)
- : null !== current.memoizedState && (shellBoundary = handler));
- }
- function pushOffscreenSuspenseHandler(fiber) {
- if (22 === fiber.tag) {
- if (
- (push(suspenseStackCursor, suspenseStackCursor.current, fiber),
- push(suspenseHandlerStackCursor, fiber, fiber),
- null === shellBoundary)
- ) {
- var current = fiber.alternate;
- null !== current &&
- null !== current.memoizedState &&
- (shellBoundary = fiber);
- }
- } else reuseSuspenseHandlerOnStack(fiber);
+ function mountState(initialState) {
+ initialState = mountStateImpl(initialState);
+ var queue = initialState.queue,
+ dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
+ queue.dispatch = dispatch;
+ return [initialState.memoizedState, dispatch];
}
- function reuseSuspenseHandlerOnStack(fiber) {
- push(suspenseStackCursor, suspenseStackCursor.current, fiber);
- push(
- suspenseHandlerStackCursor,
- suspenseHandlerStackCursor.current,
- fiber
+ function mountOptimistic(passthrough) {
+ var hook = mountWorkInProgressHook();
+ hook.memoizedState = hook.baseState = passthrough;
+ var queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: null,
+ lastRenderedState: null
+ };
+ hook.queue = queue;
+ hook = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !0,
+ queue
);
+ queue.dispatch = hook;
+ return [passthrough, hook];
}
- function popSuspenseHandler(fiber) {
- pop(suspenseHandlerStackCursor, fiber);
- shellBoundary === fiber && (shellBoundary = null);
- pop(suspenseStackCursor, fiber);
+ function updateOptimistic(passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
}
- function findFirstSuspended(row) {
- for (var node = row; null !== node; ) {
- if (13 === node.tag) {
- var state = node.memoizedState;
- if (
- null !== state &&
- ((state = state.dehydrated),
- null === state ||
- state.data === SUSPENSE_PENDING_START_DATA ||
- isSuspenseInstanceFallback(state))
- )
- return node;
- } else if (
- 19 === node.tag &&
- void 0 !== node.memoizedProps.revealOrder
- ) {
- if (0 !== (node.flags & 128)) return node;
- } else if (null !== node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === row) break;
- for (; null === node.sibling; ) {
- if (null === node.return || node.return === row) return null;
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- return null;
+ function updateOptimisticImpl(hook, current, passthrough, reducer) {
+ hook.baseState = passthrough;
+ return updateReducerImpl(
+ hook,
+ currentHook,
+ "function" === typeof reducer ? reducer : basicStateReducer
+ );
}
- function warnOnInvalidCallback(callback) {
- if (null !== callback && "function" !== typeof callback) {
- var key = String(callback);
- didWarnOnInvalidCallback.has(key) ||
- (didWarnOnInvalidCallback.add(key),
- console.error(
- "Expected the last optional `callback` argument to be a function. Instead received: %s.",
- callback
- ));
- }
+ function rerenderOptimistic(passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ if (null !== currentHook)
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ hook.baseState = passthrough;
+ return [passthrough, hook.queue.dispatch];
}
- function applyDerivedStateFromProps(
- workInProgress,
- ctor,
- getDerivedStateFromProps,
- nextProps
+ function dispatchActionState(
+ fiber,
+ actionQueue,
+ setPendingState,
+ setState,
+ payload
) {
- var prevState = workInProgress.memoizedState,
- partialState = getDerivedStateFromProps(nextProps, prevState);
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
+ if (isRenderPhaseUpdate(fiber))
+ throw Error("Cannot update form state while rendering.");
+ fiber = actionQueue.action;
+ if (null !== fiber) {
+ var actionNode = {
+ payload: payload,
+ action: fiber,
+ next: null,
+ isTransition: !0,
+ status: "pending",
+ value: null,
+ reason: null,
+ listeners: [],
+ then: function (listener) {
+ actionNode.listeners.push(listener);
+ }
+ };
+ null !== ReactSharedInternals.T
+ ? setPendingState(!0)
+ : (actionNode.isTransition = !1);
+ setState(actionNode);
+ setPendingState = actionQueue.pending;
+ null === setPendingState
+ ? ((actionNode.next = actionQueue.pending = actionNode),
+ runActionStateAction(actionQueue, actionNode))
+ : ((actionNode.next = setPendingState.next),
+ (actionQueue.pending = setPendingState.next = actionNode));
+ }
+ }
+ function runActionStateAction(actionQueue, node) {
+ var action = node.action,
+ payload = node.payload,
+ prevState = actionQueue.state;
+ if (node.isTransition) {
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ ReactSharedInternals.T._updatedFibers = new Set();
try {
- partialState = getDerivedStateFromProps(nextProps, prevState);
+ var returnValue = action(prevState, payload),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ handleActionReturnValue(actionQueue, node, returnValue);
+ } catch (error) {
+ onActionError(actionQueue, node, error);
} finally {
- setIsStrictModeForDevtools(!1);
+ (ReactSharedInternals.T = prevTransition),
+ null === prevTransition &&
+ currentTransition._updatedFibers &&
+ ((actionQueue = currentTransition._updatedFibers.size),
+ currentTransition._updatedFibers.clear(),
+ 10 < actionQueue &&
+ console.warn(
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
+ ));
}
- }
- void 0 === partialState &&
- ((ctor = getComponentNameFromType(ctor) || "Component"),
- didWarnAboutUndefinedDerivedState.has(ctor) ||
- (didWarnAboutUndefinedDerivedState.add(ctor),
- console.error(
- "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
- ctor
- )));
- prevState =
- null === partialState || void 0 === partialState
- ? prevState
- : assign({}, prevState, partialState);
- workInProgress.memoizedState = prevState;
- 0 === workInProgress.lanes &&
- (workInProgress.updateQueue.baseState = prevState);
- }
- function checkShouldComponentUpdate(
- workInProgress,
- ctor,
- oldProps,
- newProps,
- oldState,
- newState,
- nextContext
- ) {
- var instance = workInProgress.stateNode;
- if ("function" === typeof instance.shouldComponentUpdate) {
- oldProps = instance.shouldComponentUpdate(
- newProps,
- newState,
- nextContext
- );
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- oldProps = instance.shouldComponentUpdate(
- newProps,
- newState,
- nextContext
- );
- } finally {
- setIsStrictModeForDevtools(!1);
- }
+ } else
+ try {
+ (currentTransition = action(prevState, payload)),
+ handleActionReturnValue(actionQueue, node, currentTransition);
+ } catch (error$3) {
+ onActionError(actionQueue, node, error$3);
}
- void 0 === oldProps &&
- console.error(
- "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
- getComponentNameFromType(ctor) || "Component"
- );
- return oldProps;
- }
- return ctor.prototype && ctor.prototype.isPureReactComponent
- ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
- : !0;
}
- function callComponentWillReceiveProps(
- workInProgress,
- instance,
- newProps,
- nextContext
- ) {
- var oldState = instance.state;
- "function" === typeof instance.componentWillReceiveProps &&
- instance.componentWillReceiveProps(newProps, nextContext);
- "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- instance.state !== oldState &&
- ((workInProgress =
- getComponentNameFromFiber(workInProgress) || "Component"),
- didWarnAboutStateAssignmentForComponent.has(workInProgress) ||
- (didWarnAboutStateAssignmentForComponent.add(workInProgress),
- console.error(
- "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
- workInProgress
- )),
- classComponentUpdater.enqueueReplaceState(
- instance,
- instance.state,
- null
- ));
+ function handleActionReturnValue(actionQueue, node, returnValue) {
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ? (returnValue.then(
+ function (nextState) {
+ onActionSuccess(actionQueue, node, nextState);
+ },
+ function (error) {
+ return onActionError(actionQueue, node, error);
+ }
+ ),
+ node.isTransition ||
+ console.error(
+ "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
+ ))
+ : onActionSuccess(actionQueue, node, returnValue);
}
- function resolveClassComponentProps(Component, baseProps) {
- var newProps = baseProps;
- if ("ref" in baseProps) {
- newProps = {};
- for (var propName in baseProps)
- "ref" !== propName && (newProps[propName] = baseProps[propName]);
- }
- if ((Component = Component.defaultProps)) {
- newProps === baseProps && (newProps = assign({}, newProps));
- for (var _propName in Component)
- void 0 === newProps[_propName] &&
- (newProps[_propName] = Component[_propName]);
+ function onActionSuccess(actionQueue, actionNode, nextState) {
+ actionNode.status = "fulfilled";
+ actionNode.value = nextState;
+ notifyActionListeners(actionNode);
+ actionQueue.state = nextState;
+ actionNode = actionQueue.pending;
+ null !== actionNode &&
+ ((nextState = actionNode.next),
+ nextState === actionNode
+ ? (actionQueue.pending = null)
+ : ((nextState = nextState.next),
+ (actionNode.next = nextState),
+ runActionStateAction(actionQueue, nextState)));
+ }
+ function onActionError(actionQueue, actionNode, error) {
+ var last = actionQueue.pending;
+ actionQueue.pending = null;
+ if (null !== last) {
+ last = last.next;
+ do
+ (actionNode.status = "rejected"),
+ (actionNode.reason = error),
+ notifyActionListeners(actionNode),
+ (actionNode = actionNode.next);
+ while (actionNode !== last);
}
- return newProps;
+ actionQueue.action = null;
}
- function defaultOnUncaughtError(error) {
- reportGlobalError(error);
- console.warn(
- "%s\n\n%s\n",
- componentName
- ? "An error occurred in the <" + componentName + "> component."
- : "An error occurred in one of your React components.",
- "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
- );
+ function notifyActionListeners(actionNode) {
+ actionNode = actionNode.listeners;
+ for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
}
- function defaultOnCaughtError(error) {
- var componentNameMessage = componentName
- ? "The above error occurred in the <" + componentName + "> component."
- : "The above error occurred in one of your React components.",
- recreateMessage =
- "React will try to recreate this component tree from scratch using the error boundary you provided, " +
- ((errorBoundaryName || "Anonymous") + ".");
- if (
- "object" === typeof error &&
- null !== error &&
- "string" === typeof error.environmentName
- ) {
- var JSCompiler_inline_result = error.environmentName;
- error = [
- "%o\n\n%s\n\n%s\n",
- error,
- componentNameMessage,
- recreateMessage
- ].slice(0);
- "string" === typeof error[0]
- ? error.splice(
- 0,
- 1,
- badgeFormat + error[0],
- badgeStyle,
- pad + JSCompiler_inline_result + pad,
- resetStyle
- )
- : error.splice(
- 0,
- 0,
- badgeFormat,
- badgeStyle,
- pad + JSCompiler_inline_result + pad,
- resetStyle
- );
- error.unshift(console);
- JSCompiler_inline_result = bind.apply(console.error, error);
- JSCompiler_inline_result();
- } else
- console.error(
- "%o\n\n%s\n\n%s\n",
- error,
- componentNameMessage,
- recreateMessage
- );
- }
- function defaultOnRecoverableError(error) {
- reportGlobalError(error);
+ function actionStateReducer(oldState, newState) {
+ return newState;
}
- function logUncaughtError(root, errorInfo) {
- try {
- componentName = errorInfo.source
- ? getComponentNameFromFiber(errorInfo.source)
- : null;
- errorBoundaryName = null;
- var error = errorInfo.value;
- if (null !== ReactSharedInternals.actQueue)
- ReactSharedInternals.thrownErrors.push(error);
- else {
- var onUncaughtError = root.onUncaughtError;
- onUncaughtError(error, { componentStack: errorInfo.stack });
+ function mountActionState(action, initialStateProp) {
+ if (isHydrating) {
+ var ssrFormState = workInProgressRoot.formState;
+ if (null !== ssrFormState) {
+ a: {
+ var isMatching = currentlyRenderingFiber;
+ if (isHydrating) {
+ if (nextHydratableInstance) {
+ b: {
+ var markerInstance = nextHydratableInstance;
+ for (
+ var inRootOrSingleton = rootOrSingletonContext;
+ 8 !== markerInstance.nodeType;
+
+ ) {
+ if (!inRootOrSingleton) {
+ markerInstance = null;
+ break b;
+ }
+ markerInstance = getNextHydratable(
+ markerInstance.nextSibling
+ );
+ if (null === markerInstance) {
+ markerInstance = null;
+ break b;
+ }
+ }
+ inRootOrSingleton = markerInstance.data;
+ markerInstance =
+ inRootOrSingleton === FORM_STATE_IS_MATCHING ||
+ inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING
+ ? markerInstance
+ : null;
+ }
+ if (markerInstance) {
+ nextHydratableInstance = getNextHydratable(
+ markerInstance.nextSibling
+ );
+ isMatching = markerInstance.data === FORM_STATE_IS_MATCHING;
+ break a;
+ }
+ }
+ throwOnHydrationMismatch(isMatching);
+ }
+ isMatching = !1;
+ }
+ isMatching && (initialStateProp = ssrFormState[0]);
}
- } catch (e$4) {
- setTimeout(function () {
- throw e$4;
- });
- }
- }
- function logCaughtError(root, boundary, errorInfo) {
- try {
- componentName = errorInfo.source
- ? getComponentNameFromFiber(errorInfo.source)
- : null;
- errorBoundaryName = getComponentNameFromFiber(boundary);
- var onCaughtError = root.onCaughtError;
- onCaughtError(errorInfo.value, {
- componentStack: errorInfo.stack,
- errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
- });
- } catch (e$5) {
- setTimeout(function () {
- throw e$5;
- });
}
- }
- function createRootErrorUpdate(root, errorInfo, lane) {
- lane = createUpdate(lane);
- lane.tag = CaptureUpdate;
- lane.payload = { element: null };
- lane.callback = function () {
- runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo);
+ ssrFormState = mountWorkInProgressHook();
+ ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
+ isMatching = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: actionStateReducer,
+ lastRenderedState: initialStateProp
};
- return lane;
+ ssrFormState.queue = isMatching;
+ ssrFormState = dispatchSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ isMatching
+ );
+ isMatching.dispatch = ssrFormState;
+ isMatching = mountStateImpl(!1);
+ inRootOrSingleton = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !1,
+ isMatching.queue
+ );
+ isMatching = mountWorkInProgressHook();
+ markerInstance = {
+ state: initialStateProp,
+ dispatch: null,
+ action: action,
+ pending: null
+ };
+ isMatching.queue = markerInstance;
+ ssrFormState = dispatchActionState.bind(
+ null,
+ currentlyRenderingFiber,
+ markerInstance,
+ inRootOrSingleton,
+ ssrFormState
+ );
+ markerInstance.dispatch = ssrFormState;
+ isMatching.memoizedState = action;
+ return [initialStateProp, ssrFormState, !1];
}
- function createClassErrorUpdate(lane) {
- lane = createUpdate(lane);
- lane.tag = CaptureUpdate;
- return lane;
+ function updateActionState(action) {
+ var stateHook = updateWorkInProgressHook();
+ return updateActionStateImpl(stateHook, currentHook, action);
}
- function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
- var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
- if ("function" === typeof getDerivedStateFromError) {
- var error = errorInfo.value;
- update.payload = function () {
- return getDerivedStateFromError(error);
- };
- update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- runWithFiberInDEV(
- errorInfo.source,
- logCaughtError,
- root,
- fiber,
- errorInfo
- );
- };
- }
- var inst = fiber.stateNode;
- null !== inst &&
- "function" === typeof inst.componentDidCatch &&
- (update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- runWithFiberInDEV(
- errorInfo.source,
- logCaughtError,
- root,
- fiber,
- errorInfo
- );
- "function" !== typeof getDerivedStateFromError &&
- (null === legacyErrorBoundariesThatAlreadyFailed
- ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
- : legacyErrorBoundariesThatAlreadyFailed.add(this));
- callComponentDidCatchInDEV(this, errorInfo);
- "function" === typeof getDerivedStateFromError ||
- (0 === (fiber.lanes & 2) &&
- console.error(
- "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
- getComponentNameFromFiber(fiber) || "Unknown"
- ));
- });
+ function updateActionStateImpl(stateHook, currentStateHook, action) {
+ currentStateHook = updateReducerImpl(
+ stateHook,
+ currentStateHook,
+ actionStateReducer
+ )[0];
+ stateHook = updateReducer(basicStateReducer)[0];
+ if (
+ "object" === typeof currentStateHook &&
+ null !== currentStateHook &&
+ "function" === typeof currentStateHook.then
+ )
+ try {
+ var state = useThenable(currentStateHook);
+ } catch (x) {
+ if (x === SuspenseException) throw SuspenseActionException;
+ throw x;
+ }
+ else state = currentStateHook;
+ currentStateHook = updateWorkInProgressHook();
+ var actionQueue = currentStateHook.queue,
+ dispatch = actionQueue.dispatch;
+ action !== currentStateHook.memoizedState &&
+ ((currentlyRenderingFiber.flags |= 2048),
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ actionStateActionEffect.bind(null, actionQueue, action),
+ null
+ ));
+ return [state, dispatch, stateHook];
}
- function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
- var currentSourceFiber = sourceFiber.alternate;
- null !== currentSourceFiber &&
- propagateParentContextChanges(
- currentSourceFiber,
- sourceFiber,
- rootRenderLanes,
- !0
- );
+ function actionStateActionEffect(actionQueue, action) {
+ actionQueue.action = action;
}
- function markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ) {
- suspenseBoundary.flags |= 65536;
- suspenseBoundary.lanes = rootRenderLanes;
- return suspenseBoundary;
+ function rerenderActionState(action) {
+ var stateHook = updateWorkInProgressHook(),
+ currentStateHook = currentHook;
+ if (null !== currentStateHook)
+ return updateActionStateImpl(stateHook, currentStateHook, action);
+ updateWorkInProgressHook();
+ stateHook = stateHook.memoizedState;
+ currentStateHook = updateWorkInProgressHook();
+ var dispatch = currentStateHook.queue.dispatch;
+ currentStateHook.memoizedState = action;
+ return [stateHook, dispatch, !1];
}
- function throwException(
- root,
- returnFiber,
- sourceFiber,
- value,
- rootRenderLanes
- ) {
- sourceFiber.flags |= 32768;
- isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
- if (
- null !== value &&
- "object" === typeof value &&
- (value.$$typeof === REACT_POSTPONE_TYPE &&
- (value = { then: function () {} }),
- "function" === typeof value.then)
- ) {
- resetSuspendedComponent(sourceFiber, rootRenderLanes);
- isHydrating && (didSuspendOrErrorDEV = !0);
- var suspenseBoundary = suspenseHandlerStackCursor.current;
- if (null !== suspenseBoundary) {
- switch (suspenseBoundary.tag) {
- case 13:
- return (
- null === shellBoundary
- ? renderDidSuspendDelayIfPossible()
- : null === suspenseBoundary.alternate &&
- workInProgressRootExitStatus === RootInProgress &&
- (workInProgressRootExitStatus = RootSuspended),
- (suspenseBoundary.flags &= -257),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? (suspenseBoundary.updateQueue = new Set([value]))
- : sourceFiber.add(value),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- case 22:
- return (
- (suspenseBoundary.flags |= 65536),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? ((sourceFiber = {
- transitions: null,
- markerInstances: null,
- retryQueue: new Set([value])
- }),
- (suspenseBoundary.updateQueue = sourceFiber))
- : ((returnFiber = sourceFiber.retryQueue),
- null === returnFiber
- ? (sourceFiber.retryQueue = new Set([value]))
- : returnFiber.add(value)),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- }
+ function pushSimpleEffect(tag, inst, create, deps) {
+ tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
+ inst = currentlyRenderingFiber.updateQueue;
+ null === inst &&
+ ((inst = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = inst));
+ create = inst.lastEffect;
+ null === create
+ ? (inst.lastEffect = tag.next = tag)
+ : ((deps = create.next),
+ (create.next = tag),
+ (tag.next = deps),
+ (inst.lastEffect = tag));
+ return tag;
+ }
+ function createEffectInstance() {
+ return { destroy: void 0, resource: void 0 };
+ }
+ function mountRef(initialValue) {
+ var hook = mountWorkInProgressHook();
+ initialValue = { current: initialValue };
+ return (hook.memoizedState = initialValue);
+ }
+ function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ currentlyRenderingFiber.flags |= fiberFlags;
+ hook.memoizedState = pushSimpleEffect(
+ HasEffect | hookFlags,
+ createEffectInstance(),
+ create,
+ deps
+ );
+ }
+ function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var inst = hook.memoizedState.inst;
+ null !== currentHook &&
+ null !== deps &&
+ areHookInputsEqual(deps, currentHook.memoizedState.deps)
+ ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
+ : ((currentlyRenderingFiber.flags |= fiberFlags),
+ (hook.memoizedState = pushSimpleEffect(
+ HasEffect | hookFlags,
+ inst,
+ create,
+ deps
+ )));
+ }
+ function mountEffect(create, deps) {
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode
+ ? mountEffectImpl(142608384, Passive, create, deps)
+ : mountEffectImpl(8390656, Passive, create, deps);
+ }
+ function useEffectEventImpl(payload) {
+ currentlyRenderingFiber.flags |= 4;
+ var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
+ if (null === componentUpdateQueue)
+ (componentUpdateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = componentUpdateQueue),
+ (componentUpdateQueue.events = [payload]);
+ else {
+ var events = componentUpdateQueue.events;
+ null === events
+ ? (componentUpdateQueue.events = [payload])
+ : events.push(payload);
+ }
+ }
+ function mountEvent(callback) {
+ var hook = mountWorkInProgressHook(),
+ ref = { impl: callback };
+ hook.memoizedState = ref;
+ return function () {
+ if ((executionContext & RenderContext) !== NoContext)
throw Error(
- "Unexpected Suspense handler tag (" +
- suspenseBoundary.tag +
- "). This is a bug in React."
+ "A function wrapped in useEffectEvent can't be called during rendering."
);
- }
- attachPingListener(root, value, rootRenderLanes);
- renderDidSuspendDelayIfPossible();
- return !1;
+ return ref.impl.apply(void 0, arguments);
+ };
+ }
+ function updateEvent(callback) {
+ var ref = updateWorkInProgressHook().memoizedState;
+ useEffectEventImpl({ ref: ref, nextImpl: callback });
+ return function () {
+ if ((executionContext & RenderContext) !== NoContext)
+ throw Error(
+ "A function wrapped in useEffectEvent can't be called during rendering."
+ );
+ return ref.impl.apply(void 0, arguments);
+ };
+ }
+ function mountLayoutEffect(create, deps) {
+ var fiberFlags = 4194308;
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (fiberFlags |= 67108864);
+ return mountEffectImpl(fiberFlags, Layout, create, deps);
+ }
+ function imperativeHandleEffect(create, ref) {
+ if ("function" === typeof ref) {
+ create = create();
+ var refCleanup = ref(create);
+ return function () {
+ "function" === typeof refCleanup ? refCleanup() : ref(null);
+ };
}
- if (isHydrating)
+ if (null !== ref && void 0 !== ref)
return (
- (didSuspendOrErrorDEV = !0),
- (suspenseBoundary = suspenseHandlerStackCursor.current),
- null !== suspenseBoundary
- ? (0 === (suspenseBoundary.flags & 65536) &&
- (suspenseBoundary.flags |= 256),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value !== HydrationMismatchException &&
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
- { cause: value }
- ),
- sourceFiber
- )
- ))
- : (value !== HydrationMismatchException &&
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
- { cause: value }
- ),
- sourceFiber
- )
- ),
- (root = root.current.alternate),
- (root.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (root.lanes |= rootRenderLanes),
- (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
- (rootRenderLanes = createRootErrorUpdate(
- root.stateNode,
- sourceFiber,
- rootRenderLanes
- )),
- enqueueCapturedUpdate(root, rootRenderLanes),
- workInProgressRootExitStatus !== RootSuspendedWithDelay &&
- (workInProgressRootExitStatus = RootErrored)),
- !1
+ ref.hasOwnProperty("current") ||
+ console.error(
+ "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
+ "an object with keys {" + Object.keys(ref).join(", ") + "}"
+ ),
+ (create = create()),
+ (ref.current = create),
+ function () {
+ ref.current = null;
+ }
);
- queueConcurrentError(
- createCapturedValueAtFiber(
- Error(
- "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
- { cause: value }
- ),
- sourceFiber
- )
+ }
+ function mountImperativeHandle(ref, create, deps) {
+ "function" !== typeof create &&
+ console.error(
+ "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
+ null !== create ? typeof create : "null"
+ );
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ var fiberFlags = 4194308;
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (fiberFlags |= 67108864);
+ mountEffectImpl(
+ fiberFlags,
+ Layout,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
);
- workInProgressRootExitStatus !== RootSuspendedWithDelay &&
- (workInProgressRootExitStatus = RootErrored);
- if (null === returnFiber) return !0;
- sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
- value = returnFiber;
- do {
- switch (value.tag) {
- case 3:
- return (
- (value.flags |= 65536),
- (root = rootRenderLanes & -rootRenderLanes),
- (value.lanes |= root),
- (root = createRootErrorUpdate(
- value.stateNode,
- sourceFiber,
- root
- )),
- enqueueCapturedUpdate(value, root),
- !1
- );
- case 1:
- if (
- ((returnFiber = value.type),
- (suspenseBoundary = value.stateNode),
- 0 === (value.flags & 128) &&
- ("function" === typeof returnFiber.getDerivedStateFromError ||
- (null !== suspenseBoundary &&
- "function" === typeof suspenseBoundary.componentDidCatch &&
- (null === legacyErrorBoundariesThatAlreadyFailed ||
- !legacyErrorBoundariesThatAlreadyFailed.has(
- suspenseBoundary
- )))))
- )
- return (
- (value.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (value.lanes |= rootRenderLanes),
- (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
- initializeClassErrorUpdate(
- rootRenderLanes,
- root,
- value,
- sourceFiber
- ),
- enqueueCapturedUpdate(value, rootRenderLanes),
- !1
- );
+ }
+ function updateImperativeHandle(ref, create, deps) {
+ "function" !== typeof create &&
+ console.error(
+ "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
+ null !== create ? typeof create : "null"
+ );
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ updateEffectImpl(
+ 4,
+ Layout,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
+ );
+ }
+ function mountCallback(callback, deps) {
+ mountWorkInProgressHook().memoizedState = [
+ callback,
+ void 0 === deps ? null : deps
+ ];
+ return callback;
+ }
+ function updateCallback(callback, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ hook.memoizedState = [callback, deps];
+ return callback;
+ }
+ function mountMemo(nextCreate, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var nextValue = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- value = value.return;
- } while (null !== value);
- return !1;
+ }
+ hook.memoizedState = [nextValue, deps];
+ return nextValue;
}
- function reconcileChildren(
- current,
- workInProgress,
- nextChildren,
- renderLanes
- ) {
- workInProgress.child =
- null === current
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
- : reconcileChildFibers(
- workInProgress,
- current.child,
- nextChildren,
- renderLanes
- );
+ function updateMemo(nextCreate, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ prevState = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ hook.memoizedState = [prevState, deps];
+ return prevState;
}
- function updateForwardRef(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- Component = Component.render;
- var ref = workInProgress.ref;
- if ("ref" in nextProps) {
- var propsWithoutRef = {};
- for (var key in nextProps)
- "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
- } else propsWithoutRef = nextProps;
- prepareToReadContext(workInProgress);
- nextProps = renderWithHooks(
- current,
- workInProgress,
- Component,
- propsWithoutRef,
- ref,
- renderLanes
+ function mountDeferredValue(value, initialValue) {
+ var hook = mountWorkInProgressHook();
+ return mountDeferredValueImpl(hook, value, initialValue);
+ }
+ function updateDeferredValue(value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
);
- key = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
+ }
+ function rerenderDeferredValue(value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return null === currentHook
+ ? mountDeferredValueImpl(hook, value, initialValue)
+ : updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
+ );
+ }
+ function mountDeferredValueImpl(hook, value, initialValue) {
+ if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
+ return (hook.memoizedState = value);
+ hook.memoizedState = initialValue;
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return initialValue;
+ }
+ function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
+ if (objectIs(value, prevValue)) return value;
+ if (null !== currentTreeHiddenStackCursor.current)
return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ (hook = mountDeferredValueImpl(hook, value, initialValue)),
+ objectIs(hook, prevValue) || (didReceiveUpdate = !0),
+ hook
);
- isHydrating && key && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
+ if (0 === (renderLanes & 42))
+ return (didReceiveUpdate = !0), (hook.memoizedState = value);
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return prevValue;
}
- function updateMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
+ function startTransition(
+ fiber,
+ queue,
+ pendingState,
+ finishedState,
+ callback
) {
- if (null === current) {
- var type = Component.type;
+ var previousPriority = ReactDOMSharedInternals.p;
+ ReactDOMSharedInternals.p =
+ 0 !== previousPriority && previousPriority < ContinuousEventPriority
+ ? previousPriority
+ : ContinuousEventPriority;
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ dispatchOptimisticSetState(fiber, !1, queue, pendingState);
+ currentTransition._updatedFibers = new Set();
+ try {
+ var returnValue = callback(),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
if (
- "function" === typeof type &&
- !shouldConstruct(type) &&
- void 0 === type.defaultProps &&
- null === Component.compare
- )
- return (
- (Component = resolveFunctionForHotReloading(type)),
- (workInProgress.tag = 15),
- (workInProgress.type = Component),
- validateFunctionComponentInDev(workInProgress, type),
- updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- )
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ) {
+ var thenableForFinishedState = chainThenableValue(
+ returnValue,
+ finishedState
);
- current = createFiberFromTypeAndProps(
- Component.type,
- null,
- nextProps,
- workInProgress,
- workInProgress.mode,
- renderLanes
- );
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
- }
- type = current.child;
- if (!checkScheduledUpdateOrContext(current, renderLanes)) {
- var prevProps = type.memoizedProps;
- Component = Component.compare;
- Component = null !== Component ? Component : shallowEqual;
- if (
- Component(prevProps, nextProps) &&
- current.ref === workInProgress.ref
- )
- return bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ thenableForFinishedState,
+ requestUpdateLane(fiber)
+ );
+ } else
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ finishedState,
+ requestUpdateLane(fiber)
);
+ } catch (error) {
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ { then: function () {}, status: "rejected", reason: error },
+ requestUpdateLane(fiber)
+ );
+ } finally {
+ (ReactDOMSharedInternals.p = previousPriority),
+ (ReactSharedInternals.T = prevTransition),
+ null === prevTransition &&
+ currentTransition._updatedFibers &&
+ ((fiber = currentTransition._updatedFibers.size),
+ currentTransition._updatedFibers.clear(),
+ 10 < fiber &&
+ console.warn(
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
+ ));
}
- workInProgress.flags |= 1;
- current = createWorkInProgress(type, nextProps);
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
}
- function updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- if (null !== current) {
- var prevProps = current.memoizedProps;
- if (
- shallowEqual(prevProps, nextProps) &&
- current.ref === workInProgress.ref &&
- workInProgress.type === current.type
- )
- if (
- ((didReceiveUpdate = !1),
- (workInProgress.pendingProps = nextProps = prevProps),
- checkScheduledUpdateOrContext(current, renderLanes))
- )
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
- else
- return (
- (workInProgress.lanes = current.lanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- }
- return updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
+ function startHostTransition(formFiber, pendingState, action, formData) {
+ if (5 !== formFiber.tag)
+ throw Error(
+ "Expected the form instance to be a HostComponent. This is a bug in React."
+ );
+ var queue = ensureFormComponentIsStateful(formFiber).queue;
+ startTransition(
+ formFiber,
+ queue,
+ pendingState,
+ NotPendingTransition,
+ null === action
+ ? noop$2
+ : function () {
+ requestFormReset$1(formFiber);
+ return action(formData);
+ }
);
}
- function updateOffscreenComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- nextChildren = nextProps.children,
- nextIsDetached =
- 0 !==
- (workInProgress.stateNode._pendingVisibility & OffscreenDetached),
- prevState = null !== current ? current.memoizedState : null;
- markRef(current, workInProgress);
- if ("hidden" === nextProps.mode || nextIsDetached) {
- if (0 !== (workInProgress.flags & 128)) {
- nextProps =
- null !== prevState
- ? prevState.baseLanes | renderLanes
- : renderLanes;
- if (null !== current) {
- nextChildren = workInProgress.child = current.child;
- for (nextIsDetached = 0; null !== nextChildren; )
- (nextIsDetached =
- nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
- (nextChildren = nextChildren.sibling);
- workInProgress.childLanes = nextIsDetached & ~nextProps;
- } else (workInProgress.childLanes = 0), (workInProgress.child = null);
- return deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- }
- if (0 !== (renderLanes & 536870912))
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
- null !== current &&
- pushTransition(
- workInProgress,
- null !== prevState ? prevState.cachePool : null
- ),
- null !== prevState
- ? pushHiddenContext(workInProgress, prevState)
- : reuseHiddenContextOnStack(workInProgress),
- pushOffscreenSuspenseHandler(workInProgress);
- else
- return (
- (workInProgress.lanes = workInProgress.childLanes = 536870912),
- deferHiddenOffscreenComponent(
- current,
- workInProgress,
- null !== prevState
- ? prevState.baseLanes | renderLanes
- : renderLanes,
- renderLanes
- )
- );
- } else
- null !== prevState
- ? (pushTransition(workInProgress, prevState.cachePool),
- pushHiddenContext(workInProgress, prevState),
- reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.memoizedState = null))
- : (null !== current && pushTransition(workInProgress, null),
- reuseHiddenContextOnStack(workInProgress),
- reuseSuspenseHandlerOnStack(workInProgress));
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
- }
- function deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextBaseLanes,
- renderLanes
- ) {
- var JSCompiler_inline_result = peekCacheFromPool();
- JSCompiler_inline_result =
- null === JSCompiler_inline_result
- ? null
- : {
- parent: CacheContext._currentValue,
- pool: JSCompiler_inline_result
- };
- workInProgress.memoizedState = {
- baseLanes: nextBaseLanes,
- cachePool: JSCompiler_inline_result
+ function ensureFormComponentIsStateful(formFiber) {
+ var existingStateHook = formFiber.memoizedState;
+ if (null !== existingStateHook) return existingStateHook;
+ existingStateHook = {
+ memoizedState: NotPendingTransition,
+ baseState: NotPendingTransition,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: NotPendingTransition
+ },
+ next: null
};
- null !== current && pushTransition(workInProgress, null);
- reuseHiddenContextOnStack(workInProgress);
- pushOffscreenSuspenseHandler(workInProgress);
- null !== current &&
- propagateParentContextChanges(current, workInProgress, renderLanes, !0);
- return null;
- }
- function markRef(current, workInProgress) {
- var ref = workInProgress.ref;
- if (null === ref)
- null !== current &&
- null !== current.ref &&
- (workInProgress.flags |= 2097664);
- else {
- if ("function" !== typeof ref && "object" !== typeof ref)
- throw Error(
- "Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
- );
- if (null === current || current.ref !== ref)
- workInProgress.flags |= 2097664;
- }
+ var initialResetState = {};
+ existingStateHook.next = {
+ memoizedState: initialResetState,
+ baseState: initialResetState,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialResetState
+ },
+ next: null
+ };
+ formFiber.memoizedState = existingStateHook;
+ formFiber = formFiber.alternate;
+ null !== formFiber && (formFiber.memoizedState = existingStateHook);
+ return existingStateHook;
}
- function updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- if (
- Component.prototype &&
- "function" === typeof Component.prototype.render
- ) {
- var componentName = getComponentNameFromType(Component) || "Unknown";
- didWarnAboutBadClass[componentName] ||
- (console.error(
- "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
- componentName,
- componentName
- ),
- (didWarnAboutBadClass[componentName] = !0));
- }
- workInProgress.mode & StrictLegacyMode &&
- ReactStrictModeWarnings.recordLegacyContextWarning(
- workInProgress,
- null
+ function requestFormReset$1(formFiber) {
+ null === ReactSharedInternals.T &&
+ console.error(
+ "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
);
- null === current &&
- (validateFunctionComponentInDev(workInProgress, workInProgress.type),
- Component.contextTypes &&
- ((componentName = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutContextTypes[componentName] ||
- ((didWarnAboutContextTypes[componentName] = !0),
- console.error(
- "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
- componentName
- ))));
- prepareToReadContext(workInProgress);
- Component = renderWithHooks(
- current,
- workInProgress,
- Component,
- nextProps,
- void 0,
- renderLanes
+ var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
+ dispatchSetStateInternal(
+ formFiber,
+ resetStateQueue,
+ {},
+ requestUpdateLane(formFiber)
);
- nextProps = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, Component, renderLanes);
- return workInProgress.child;
}
- function replayFunctionComponent(
- current,
- workInProgress,
- nextProps,
- Component,
- secondArg,
- renderLanes
- ) {
- prepareToReadContext(workInProgress);
- hookTypesUpdateIndexDev = -1;
- ignorePreviousDependencies =
- null !== current && current.type !== workInProgress.type;
- workInProgress.updateQueue = null;
- nextProps = renderWithHooksAgain(
- workInProgress,
- Component,
- nextProps,
- secondArg
+ function mountTransition() {
+ var stateHook = mountStateImpl(!1);
+ stateHook = startTransition.bind(
+ null,
+ currentlyRenderingFiber,
+ stateHook.queue,
+ !0,
+ !1
);
- finishRenderingHooks(current, workInProgress);
- Component = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && Component && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
+ mountWorkInProgressHook().memoizedState = stateHook;
+ return [!1, stateHook];
}
- function updateClassComponent(
- current$jscomp$0,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- switch (shouldErrorImpl(workInProgress)) {
- case !1:
- var _instance = workInProgress.stateNode,
- state = new workInProgress.type(
- workInProgress.memoizedProps,
- _instance.context
- ).state;
- _instance.updater.enqueueSetState(_instance, state, null);
- break;
- case !0:
- workInProgress.flags |= 128;
- workInProgress.flags |= 65536;
- _instance = Error("Simulated error coming from DevTools");
- var lane = renderLanes & -renderLanes;
- workInProgress.lanes |= lane;
- state = workInProgressRoot;
- if (null === state)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- lane = createClassErrorUpdate(lane);
- initializeClassErrorUpdate(
- lane,
- state,
- workInProgress,
- createCapturedValueAtFiber(_instance, workInProgress)
- );
- enqueueCapturedUpdate(workInProgress, lane);
+ function updateTransition() {
+ var booleanOrThenable = updateReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ }
+ function rerenderTransition() {
+ var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ }
+ function useHostTransitionStatus() {
+ return readContext(HostTransitionContext);
+ }
+ function mountId() {
+ var hook = mountWorkInProgressHook(),
+ identifierPrefix = workInProgressRoot.identifierPrefix;
+ if (isHydrating) {
+ var treeId = treeContextOverflow;
+ var idWithLeadingBit = treeContextId;
+ treeId =
+ (
+ idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
+ ).toString(32) + treeId;
+ identifierPrefix = ":" + identifierPrefix + "R" + treeId;
+ treeId = localIdCounter++;
+ 0 < treeId && (identifierPrefix += "H" + treeId.toString(32));
+ identifierPrefix += ":";
+ } else
+ (treeId = globalClientIdCounter++),
+ (identifierPrefix =
+ ":" + identifierPrefix + "r" + treeId.toString(32) + ":");
+ return (hook.memoizedState = identifierPrefix);
+ }
+ function mountRefresh() {
+ return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
+ null,
+ currentlyRenderingFiber
+ ));
+ }
+ function refreshCache(fiber, seedKey, seedValue) {
+ for (var provider = fiber.return; null !== provider; ) {
+ switch (provider.tag) {
+ case 24:
+ case 3:
+ var lane = requestUpdateLane(provider);
+ fiber = createUpdate(lane);
+ var root = enqueueUpdate(provider, fiber, lane);
+ null !== root &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(root, provider, lane),
+ entangleTransitions(root, provider, lane));
+ provider = createCache();
+ null !== seedKey &&
+ void 0 !== seedKey &&
+ null !== root &&
+ provider.data.set(seedKey, seedValue);
+ fiber.payload = { cache: provider };
+ return;
+ }
+ provider = provider.return;
}
- prepareToReadContext(workInProgress);
- if (null === workInProgress.stateNode) {
- state = emptyContextObject;
- _instance = Component.contextType;
- "contextType" in Component &&
- null !== _instance &&
- (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) &&
- !didWarnAboutInvalidateContextType.has(Component) &&
- (didWarnAboutInvalidateContextType.add(Component),
- (lane =
- void 0 === _instance
- ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."
- : "object" !== typeof _instance
- ? " However, it is set to a " + typeof _instance + "."
- : _instance.$$typeof === REACT_CONSUMER_TYPE
- ? " Did you accidentally pass the Context.Consumer instead?"
- : " However, it is set to an object with keys {" +
- Object.keys(_instance).join(", ") +
- "}."),
- console.error(
- "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
- getComponentNameFromType(Component) || "Component",
- lane
- ));
- "object" === typeof _instance &&
- null !== _instance &&
- (state = readContext(_instance));
- _instance = new Component(nextProps, state);
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
+ }
+ function dispatchReducerAction(fiber, queue, action) {
+ var args = arguments;
+ "function" === typeof args[3] &&
+ console.error(
+ "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ );
+ args = requestUpdateLane(fiber);
+ var update = {
+ lane: args,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ isRenderPhaseUpdate(fiber)
+ ? enqueueRenderPhaseUpdate(queue, update)
+ : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)),
+ null !== update &&
+ (startUpdateTimerByLane(args),
+ scheduleUpdateOnFiber(update, fiber, args),
+ entangleTransitionUpdate(update, queue, args)));
+ }
+ function dispatchSetState(fiber, queue, action) {
+ var args = arguments;
+ "function" === typeof args[3] &&
+ console.error(
+ "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ );
+ args = requestUpdateLane(fiber);
+ dispatchSetStateInternal(fiber, queue, action, args) &&
+ startUpdateTimerByLane(args);
+ }
+ function dispatchSetStateInternal(fiber, queue, action, lane) {
+ var update = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
+ else {
+ var alternate = fiber.alternate;
+ if (
+ 0 === fiber.lanes &&
+ (null === alternate || 0 === alternate.lanes) &&
+ ((alternate = queue.lastRenderedReducer), null !== alternate)
+ ) {
+ var prevDispatcher = ReactSharedInternals.H;
+ ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
- _instance = new Component(nextProps, state);
+ var currentState = queue.lastRenderedState,
+ eagerState = alternate(currentState, action);
+ update.hasEagerState = !0;
+ update.eagerState = eagerState;
+ if (objectIs(eagerState, currentState))
+ return (
+ enqueueUpdate$1(fiber, queue, update, 0),
+ null === workInProgressRoot &&
+ finishQueueingConcurrentUpdates(),
+ !1
+ );
+ } catch (error) {
} finally {
- setIsStrictModeForDevtools(!1);
+ ReactSharedInternals.H = prevDispatcher;
}
}
- state = workInProgress.memoizedState =
- null !== _instance.state && void 0 !== _instance.state
- ? _instance.state
- : null;
- _instance.updater = classComponentUpdater;
- workInProgress.stateNode = _instance;
- _instance._reactInternals = workInProgress;
- _instance._reactInternalInstance = fakeInternalInstance;
- "function" === typeof Component.getDerivedStateFromProps &&
- null === state &&
- ((state = getComponentNameFromType(Component) || "Component"),
- didWarnAboutUninitializedState.has(state) ||
- (didWarnAboutUninitializedState.add(state),
- console.error(
- "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
- state,
- null === _instance.state ? "null" : "undefined",
- state
- )));
- if (
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate
- ) {
- var foundWillUpdateName = (lane = state = null);
- "function" === typeof _instance.componentWillMount &&
- !0 !== _instance.componentWillMount.__suppressDeprecationWarning
- ? (state = "componentWillMount")
- : "function" === typeof _instance.UNSAFE_componentWillMount &&
- (state = "UNSAFE_componentWillMount");
- "function" === typeof _instance.componentWillReceiveProps &&
- !0 !==
- _instance.componentWillReceiveProps.__suppressDeprecationWarning
- ? (lane = "componentWillReceiveProps")
- : "function" ===
- typeof _instance.UNSAFE_componentWillReceiveProps &&
- (lane = "UNSAFE_componentWillReceiveProps");
- "function" === typeof _instance.componentWillUpdate &&
- !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning
- ? (foundWillUpdateName = "componentWillUpdate")
- : "function" === typeof _instance.UNSAFE_componentWillUpdate &&
- (foundWillUpdateName = "UNSAFE_componentWillUpdate");
- if (null !== state || null !== lane || null !== foundWillUpdateName) {
- _instance = getComponentNameFromType(Component) || "Component";
- var newApiName =
- "function" === typeof Component.getDerivedStateFromProps
- ? "getDerivedStateFromProps()"
- : "getSnapshotBeforeUpdate()";
- didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) ||
- (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance),
- console.error(
- "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
- _instance,
- newApiName,
- null !== state ? "\n " + state : "",
- null !== lane ? "\n " + lane : "",
- null !== foundWillUpdateName ? "\n " + foundWillUpdateName : ""
- ));
- }
- }
- _instance = workInProgress.stateNode;
- state = getComponentNameFromType(Component) || "Component";
- _instance.render ||
- (Component.prototype &&
- "function" === typeof Component.prototype.render
- ? console.error(
- "No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
- state
- )
- : console.error(
- "No `render` method found on the %s instance: you may have forgotten to define `render`.",
- state
- ));
- !_instance.getInitialState ||
- _instance.getInitialState.isReactClassApproved ||
- _instance.state ||
- console.error(
- "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
- state
- );
- _instance.getDefaultProps &&
- !_instance.getDefaultProps.isReactClassApproved &&
- console.error(
- "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
- state
- );
- _instance.contextType &&
- console.error(
- "contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
- state
- );
- Component.childContextTypes &&
- !didWarnAboutChildContextTypes.has(Component) &&
- (didWarnAboutChildContextTypes.add(Component),
- console.error(
- "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
- state
- ));
- Component.contextTypes &&
- !didWarnAboutContextTypes$1.has(Component) &&
- (didWarnAboutContextTypes$1.add(Component),
- console.error(
- "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
- state
- ));
- "function" === typeof _instance.componentShouldUpdate &&
- console.error(
- "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
- state
- );
- Component.prototype &&
- Component.prototype.isPureReactComponent &&
- "undefined" !== typeof _instance.shouldComponentUpdate &&
- console.error(
- "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
- getComponentNameFromType(Component) || "A pure component"
- );
- "function" === typeof _instance.componentDidUnmount &&
- console.error(
- "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
- state
- );
- "function" === typeof _instance.componentDidReceiveProps &&
- console.error(
- "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
- state
- );
- "function" === typeof _instance.componentWillRecieveProps &&
- console.error(
- "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
- state
- );
- "function" === typeof _instance.UNSAFE_componentWillRecieveProps &&
- console.error(
- "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
- state
- );
- lane = _instance.props !== nextProps;
- void 0 !== _instance.props &&
- lane &&
- console.error(
- "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
- state
- );
- _instance.defaultProps &&
- console.error(
- "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
- state,
- state
- );
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- "function" === typeof _instance.componentDidUpdate ||
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) ||
- (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component),
- console.error(
- "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
- getComponentNameFromType(Component)
- ));
- "function" === typeof _instance.getDerivedStateFromProps &&
- console.error(
- "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
- state
- );
- "function" === typeof _instance.getDerivedStateFromError &&
- console.error(
- "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
- state
- );
- "function" === typeof Component.getSnapshotBeforeUpdate &&
- console.error(
- "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
- state
- );
- (lane = _instance.state) &&
- ("object" !== typeof lane || isArrayImpl(lane)) &&
- console.error("%s.state: must be set to an object or null", state);
- "function" === typeof _instance.getChildContext &&
- "object" !== typeof Component.childContextTypes &&
- console.error(
- "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
- state
- );
- _instance = workInProgress.stateNode;
- _instance.props = nextProps;
- _instance.state = workInProgress.memoizedState;
- _instance.refs = {};
- initializeUpdateQueue(workInProgress);
- state = Component.contextType;
- _instance.context =
- "object" === typeof state && null !== state
- ? readContext(state)
- : emptyContextObject;
- _instance.state === nextProps &&
- ((state = getComponentNameFromType(Component) || "Component"),
- didWarnAboutDirectlyAssigningPropsToState.has(state) ||
- (didWarnAboutDirectlyAssigningPropsToState.add(state),
- console.error(
- "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
- state
- )));
- workInProgress.mode & StrictLegacyMode &&
- ReactStrictModeWarnings.recordLegacyContextWarning(
- workInProgress,
- _instance
+ action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
+ if (null !== action)
+ return (
+ scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane),
+ !0
);
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
- workInProgress,
- _instance
+ }
+ return !1;
+ }
+ function dispatchOptimisticSetState(
+ fiber,
+ throwIfDuringRender,
+ queue,
+ action
+ ) {
+ null === ReactSharedInternals.T &&
+ 0 === currentEntangledLane &&
+ console.error(
+ "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
);
- _instance.state = workInProgress.memoizedState;
- state = Component.getDerivedStateFromProps;
- "function" === typeof state &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- state,
- nextProps
- ),
- (_instance.state = workInProgress.memoizedState));
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate ||
- ("function" !== typeof _instance.UNSAFE_componentWillMount &&
- "function" !== typeof _instance.componentWillMount) ||
- ((state = _instance.state),
- "function" === typeof _instance.componentWillMount &&
- _instance.componentWillMount(),
- "function" === typeof _instance.UNSAFE_componentWillMount &&
- _instance.UNSAFE_componentWillMount(),
- state !== _instance.state &&
- (console.error(
- "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
- getComponentNameFromFiber(workInProgress) || "Component"
- ),
- classComponentUpdater.enqueueReplaceState(
- _instance,
- _instance.state,
- null
- )),
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction(),
- (_instance.state = workInProgress.memoizedState));
- "function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308);
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864);
- _instance = !0;
- } else if (null === current$jscomp$0) {
- _instance = workInProgress.stateNode;
- var unresolvedOldProps = workInProgress.memoizedProps;
- lane = resolveClassComponentProps(Component, unresolvedOldProps);
- _instance.props = lane;
- var oldContext = _instance.context;
- foundWillUpdateName = Component.contextType;
- state = emptyContextObject;
- "object" === typeof foundWillUpdateName &&
- null !== foundWillUpdateName &&
- (state = readContext(foundWillUpdateName));
- newApiName = Component.getDerivedStateFromProps;
- foundWillUpdateName =
- "function" === typeof newApiName ||
- "function" === typeof _instance.getSnapshotBeforeUpdate;
- unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
- foundWillUpdateName ||
- ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof _instance.componentWillReceiveProps) ||
- ((unresolvedOldProps || oldContext !== state) &&
- callComponentWillReceiveProps(
- workInProgress,
- _instance,
- nextProps,
- state
+ action = {
+ lane: 2,
+ revertLane: requestTransitionLane(),
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) {
+ if (throwIfDuringRender)
+ throw Error("Cannot update optimistic state while rendering.");
+ console.error("Cannot call startTransition while rendering.");
+ } else
+ (throwIfDuringRender = enqueueConcurrentHookUpdate(
+ fiber,
+ queue,
+ action,
+ 2
+ )),
+ null !== throwIfDuringRender &&
+ (startUpdateTimerByLane(2),
+ scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
+ }
+ function isRenderPhaseUpdate(fiber) {
+ var alternate = fiber.alternate;
+ return (
+ fiber === currentlyRenderingFiber ||
+ (null !== alternate && alternate === currentlyRenderingFiber)
+ );
+ }
+ function enqueueRenderPhaseUpdate(queue, update) {
+ didScheduleRenderPhaseUpdateDuringThisPass =
+ didScheduleRenderPhaseUpdate = !0;
+ var pending = queue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ queue.pending = update;
+ }
+ function entangleTransitionUpdate(root, queue, lane) {
+ if (0 !== (lane & 4194176)) {
+ var queueLanes = queue.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ queue.lanes = lane;
+ markRootEntangled(root, lane);
+ }
+ }
+ function pushDebugInfo(debugInfo) {
+ var previousDebugInfo = currentDebugInfo;
+ null != debugInfo &&
+ (currentDebugInfo =
+ null === previousDebugInfo
+ ? debugInfo
+ : previousDebugInfo.concat(debugInfo));
+ return previousDebugInfo;
+ }
+ function validateFragmentProps(element, fiber, returnFiber) {
+ for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if ("children" !== key && "key" !== key) {
+ null === fiber &&
+ ((fiber = createFiberFromElement(element, returnFiber.mode, 0)),
+ (fiber._debugInfo = currentDebugInfo),
+ (fiber.return = returnFiber));
+ runWithFiberInDEV(
+ fiber,
+ function (erroredKey) {
+ console.error(
+ "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
+ erroredKey
+ );
+ },
+ key
+ );
+ break;
+ }
+ }
+ }
+ function unwrapThenable(thenable) {
+ var index = thenableIndexCounter;
+ thenableIndexCounter += 1;
+ null === thenableState && (thenableState = createThenableState());
+ return trackUsedThenable(thenableState, thenable, index);
+ }
+ function coerceRef(workInProgress, element) {
+ element = element.props.ref;
+ workInProgress.ref = void 0 !== element ? element : null;
+ }
+ function throwOnInvalidObjectType(returnFiber, newChild) {
+ if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
+ throw Error(
+ 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
+ );
+ returnFiber = Object.prototype.toString.call(newChild);
+ throw Error(
+ "Objects are not valid as a React child (found: " +
+ ("[object Object]" === returnFiber
+ ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
+ : returnFiber) +
+ "). If you meant to render a collection of children, use an array instead."
+ );
+ }
+ function warnOnFunctionType(returnFiber, invalidChild) {
+ var parentName = getComponentNameFromFiber(returnFiber) || "Component";
+ ownerHasFunctionTypeWarning[parentName] ||
+ ((ownerHasFunctionTypeWarning[parentName] = !0),
+ (invalidChild =
+ invalidChild.displayName || invalidChild.name || "Component"),
+ 3 === returnFiber.tag
+ ? console.error(
+ "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)",
+ invalidChild,
+ invalidChild,
+ invalidChild
+ )
+ : console.error(
+ "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}%s>",
+ invalidChild,
+ invalidChild,
+ parentName,
+ invalidChild,
+ parentName
));
- hasForceUpdate = !1;
- var oldState = workInProgress.memoizedState;
- _instance.state = oldState;
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- oldContext = workInProgress.memoizedState;
- unresolvedOldProps || oldState !== oldContext || hasForceUpdate
- ? ("function" === typeof newApiName &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- newApiName,
- nextProps
- ),
- (oldContext = workInProgress.memoizedState)),
- (lane =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- lane,
- nextProps,
- oldState,
- oldContext,
- state
- ))
- ? (foundWillUpdateName ||
- ("function" !== typeof _instance.UNSAFE_componentWillMount &&
- "function" !== typeof _instance.componentWillMount) ||
- ("function" === typeof _instance.componentWillMount &&
- _instance.componentWillMount(),
- "function" === typeof _instance.UNSAFE_componentWillMount &&
- _instance.UNSAFE_componentWillMount()),
- "function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864))
- : ("function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = oldContext)),
- (_instance.props = nextProps),
- (_instance.state = oldContext),
- (_instance.context = state),
- (_instance = lane))
- : ("function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864),
- (_instance = !1));
- } else {
- _instance = workInProgress.stateNode;
- cloneUpdateQueue(current$jscomp$0, workInProgress);
- state = workInProgress.memoizedProps;
- foundWillUpdateName = resolveClassComponentProps(Component, state);
- _instance.props = foundWillUpdateName;
- newApiName = workInProgress.pendingProps;
- oldState = _instance.context;
- oldContext = Component.contextType;
- lane = emptyContextObject;
- "object" === typeof oldContext &&
- null !== oldContext &&
- (lane = readContext(oldContext));
- unresolvedOldProps = Component.getDerivedStateFromProps;
- (oldContext =
- "function" === typeof unresolvedOldProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate) ||
- ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof _instance.componentWillReceiveProps) ||
- ((state !== newApiName || oldState !== lane) &&
- callComponentWillReceiveProps(
- workInProgress,
- _instance,
- nextProps,
- lane
+ }
+ function warnOnSymbolType(returnFiber, invalidChild) {
+ var parentName = getComponentNameFromFiber(returnFiber) || "Component";
+ ownerHasSymbolTypeWarning[parentName] ||
+ ((ownerHasSymbolTypeWarning[parentName] = !0),
+ (invalidChild = String(invalidChild)),
+ 3 === returnFiber.tag
+ ? console.error(
+ "Symbols are not valid as a React child.\n root.render(%s)",
+ invalidChild
+ )
+ : console.error(
+ "Symbols are not valid as a React child.\n <%s>%s%s>",
+ parentName,
+ invalidChild,
+ parentName
));
- hasForceUpdate = !1;
- oldState = workInProgress.memoizedState;
- _instance.state = oldState;
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- var newState = workInProgress.memoizedState;
- state !== newApiName ||
- oldState !== newState ||
- hasForceUpdate ||
- (null !== current$jscomp$0 &&
- null !== current$jscomp$0.dependencies &&
- checkIfContextChanged(current$jscomp$0.dependencies))
- ? ("function" === typeof unresolvedOldProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- unresolvedOldProps,
- nextProps
- ),
- (newState = workInProgress.memoizedState)),
- (foundWillUpdateName =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- foundWillUpdateName,
- nextProps,
- oldState,
- newState,
- lane
- ) ||
- (null !== current$jscomp$0 &&
- null !== current$jscomp$0.dependencies &&
- checkIfContextChanged(current$jscomp$0.dependencies)))
- ? (oldContext ||
- ("function" !== typeof _instance.UNSAFE_componentWillUpdate &&
- "function" !== typeof _instance.componentWillUpdate) ||
- ("function" === typeof _instance.componentWillUpdate &&
- _instance.componentWillUpdate(nextProps, newState, lane),
- "function" === typeof _instance.UNSAFE_componentWillUpdate &&
- _instance.UNSAFE_componentWillUpdate(
- nextProps,
- newState,
- lane
- )),
- "function" === typeof _instance.componentDidUpdate &&
- (workInProgress.flags |= 4),
- "function" === typeof _instance.getSnapshotBeforeUpdate &&
- (workInProgress.flags |= 1024))
- : ("function" !== typeof _instance.componentDidUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 1024),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = newState)),
- (_instance.props = nextProps),
- (_instance.state = newState),
- (_instance.context = lane),
- (_instance = foundWillUpdateName))
- : ("function" !== typeof _instance.componentDidUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 1024),
- (_instance = !1));
- }
- lane = _instance;
- markRef(current$jscomp$0, workInProgress);
- state = 0 !== (workInProgress.flags & 128);
- if (lane || state) {
- lane = workInProgress.stateNode;
- ReactSharedInternals.getCurrentStack =
- null === workInProgress ? null : getCurrentFiberStackInDev;
- isRendering = !1;
- current = workInProgress;
- if (state && "function" !== typeof Component.getDerivedStateFromError)
- (Component = null), (profilerStartTime = -1);
- else if (
- ((Component = callRenderInDEV(lane)),
- workInProgress.mode & StrictLegacyMode)
- ) {
- setIsStrictModeForDevtools(!0);
- try {
- callRenderInDEV(lane);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- workInProgress.flags |= 1;
- null !== current$jscomp$0 && state
- ? ((workInProgress.child = reconcileChildFibers(
- workInProgress,
- current$jscomp$0.child,
- null,
- renderLanes
- )),
- (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- Component,
- renderLanes
- )))
- : reconcileChildren(
- current$jscomp$0,
- workInProgress,
- Component,
- renderLanes
- );
- workInProgress.memoizedState = lane.state;
- current$jscomp$0 = workInProgress.child;
- } else
- current$jscomp$0 = bailoutOnAlreadyFinishedWork(
- current$jscomp$0,
- workInProgress,
- renderLanes
- );
- renderLanes = workInProgress.stateNode;
- _instance &&
- renderLanes.props !== nextProps &&
- (didWarnAboutReassigningProps ||
- console.error(
- "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
- getComponentNameFromFiber(workInProgress) || "a component"
- ),
- (didWarnAboutReassigningProps = !0));
- return current$jscomp$0;
- }
- function mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextChildren,
- renderLanes
- ) {
- resetHydrationState();
- workInProgress.flags |= 256;
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
- }
- function validateFunctionComponentInDev(workInProgress, Component) {
- Component &&
- Component.childContextTypes &&
- console.error(
- "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...",
- Component.displayName || Component.name || "Component"
- );
- "function" === typeof Component.getDerivedStateFromProps &&
- ((workInProgress = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] ||
- (console.error(
- "%s: Function components do not support getDerivedStateFromProps.",
- workInProgress
- ),
- (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] =
- !0)));
- "object" === typeof Component.contextType &&
- null !== Component.contextType &&
- ((Component = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutContextTypeOnFunctionComponent[Component] ||
- (console.error(
- "%s: Function components do not support contextType.",
- Component
- ),
- (didWarnAboutContextTypeOnFunctionComponent[Component] = !0)));
- }
- function mountSuspenseOffscreenState(renderLanes) {
- return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
- }
- function getRemainingWorkInPrimaryTree(
- current,
- primaryTreeDidDefer,
- renderLanes
- ) {
- current = null !== current ? current.childLanes & ~renderLanes : 0;
- primaryTreeDidDefer && (current |= workInProgressDeferredLane);
- return current;
}
- function updateSuspenseComponent(current, workInProgress, renderLanes) {
- var JSCompiler_object_inline_componentStack_2330;
- var JSCompiler_object_inline_stack_2329 = workInProgress.pendingProps;
- shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128);
- var JSCompiler_object_inline_message_2327 = !1;
- var didSuspend = 0 !== (workInProgress.flags & 128);
- (JSCompiler_object_inline_componentStack_2330 = didSuspend) ||
- (JSCompiler_object_inline_componentStack_2330 =
- null !== current && null === current.memoizedState
- ? !1
- : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback));
- JSCompiler_object_inline_componentStack_2330 &&
- ((JSCompiler_object_inline_message_2327 = !0),
- (workInProgress.flags &= -129));
- JSCompiler_object_inline_componentStack_2330 =
- 0 !== (workInProgress.flags & 32);
- workInProgress.flags &= -33;
- if (null === current) {
- if (isHydrating) {
- JSCompiler_object_inline_message_2327
- ? pushPrimaryTreeSuspenseHandler(workInProgress)
- : reuseSuspenseHandlerOnStack(workInProgress);
- if (isHydrating) {
- var JSCompiler_object_inline_digest_2328 = nextHydratableInstance;
- var JSCompiler_temp;
- if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2328)) {
- c: {
- var instance = JSCompiler_object_inline_digest_2328;
- for (
- JSCompiler_temp = rootOrSingletonContext;
- 8 !== instance.nodeType;
-
- ) {
- if (!JSCompiler_temp) {
- JSCompiler_temp = null;
- break c;
- }
- instance = getNextHydratable(instance.nextSibling);
- if (null === instance) {
- JSCompiler_temp = null;
- break c;
- }
- }
- JSCompiler_temp = instance;
- }
- null !== JSCompiler_temp
- ? (warnIfNotHydrating(),
- (workInProgress.memoizedState = {
- dehydrated: JSCompiler_temp,
- treeContext:
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null,
- retryLane: 536870912
- }),
- (instance = createFiber(18, null, null, NoMode)),
- (instance.stateNode = JSCompiler_temp),
- (instance.return = workInProgress),
- (workInProgress.child = instance),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (JSCompiler_temp = !0))
- : (JSCompiler_temp = !1);
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp &&
- (warnNonHydratedInstance(
- workInProgress,
- JSCompiler_object_inline_digest_2328
- ),
- throwOnHydrationMismatch(workInProgress));
- }
- JSCompiler_object_inline_digest_2328 = workInProgress.memoizedState;
- if (
- null !== JSCompiler_object_inline_digest_2328 &&
- ((JSCompiler_object_inline_digest_2328 =
- JSCompiler_object_inline_digest_2328.dehydrated),
- null !== JSCompiler_object_inline_digest_2328)
- )
- return (
- isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328)
- ? (workInProgress.lanes = 16)
- : (workInProgress.lanes = 536870912),
- null
- );
- popSuspenseHandler(workInProgress);
+ function createChildReconciler(shouldTrackSideEffects) {
+ function deleteChild(returnFiber, childToDelete) {
+ if (shouldTrackSideEffects) {
+ var deletions = returnFiber.deletions;
+ null === deletions
+ ? ((returnFiber.deletions = [childToDelete]),
+ (returnFiber.flags |= 16))
+ : deletions.push(childToDelete);
}
- JSCompiler_object_inline_digest_2328 =
- JSCompiler_object_inline_stack_2329.children;
- JSCompiler_temp = JSCompiler_object_inline_stack_2329.fallback;
- if (JSCompiler_object_inline_message_2327)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_stack_2329 =
- mountSuspenseFallbackChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2328,
- JSCompiler_temp,
- renderLanes
- )),
- (JSCompiler_object_inline_message_2327 = workInProgress.child),
- (JSCompiler_object_inline_message_2327.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_message_2327.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2330,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- JSCompiler_object_inline_stack_2329
- );
- if (
- "number" ===
- typeof JSCompiler_object_inline_stack_2329.unstable_expectedLoadTime
- )
+ }
+ function deleteRemainingChildren(returnFiber, currentFirstChild) {
+ if (!shouldTrackSideEffects) return null;
+ for (; null !== currentFirstChild; )
+ deleteChild(returnFiber, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return null;
+ }
+ function mapRemainingChildren(currentFirstChild) {
+ for (var existingChildren = new Map(); null !== currentFirstChild; )
+ null !== currentFirstChild.key
+ ? existingChildren.set(currentFirstChild.key, currentFirstChild)
+ : existingChildren.set(currentFirstChild.index, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return existingChildren;
+ }
+ function useFiber(fiber, pendingProps) {
+ fiber = createWorkInProgress(fiber, pendingProps);
+ fiber.index = 0;
+ fiber.sibling = null;
+ return fiber;
+ }
+ function placeChild(newFiber, lastPlacedIndex, newIndex) {
+ newFiber.index = newIndex;
+ if (!shouldTrackSideEffects)
+ return (newFiber.flags |= 1048576), lastPlacedIndex;
+ newIndex = newFiber.alternate;
+ if (null !== newIndex)
return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_stack_2329 =
- mountSuspenseFallbackChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2328,
- JSCompiler_temp,
- renderLanes
- )),
- (JSCompiler_object_inline_message_2327 = workInProgress.child),
- (JSCompiler_object_inline_message_2327.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_message_2327.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2330,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress.lanes = 4194304),
- JSCompiler_object_inline_stack_2329
+ (newIndex = newIndex.index),
+ newIndex < lastPlacedIndex
+ ? ((newFiber.flags |= 33554434), lastPlacedIndex)
+ : newIndex
);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- return mountSuspensePrimaryChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2328
- );
+ newFiber.flags |= 33554434;
+ return lastPlacedIndex;
}
- var prevState = current.memoizedState;
- if (
- null !== prevState &&
- ((JSCompiler_object_inline_digest_2328 = prevState.dehydrated),
- null !== JSCompiler_object_inline_digest_2328)
- ) {
- if (didSuspend)
- workInProgress.flags & 256
- ? (pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags &= -257),
- (workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- )))
- : null !== workInProgress.memoizedState
- ? (reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.child = current.child),
- (workInProgress.flags |= 128),
- (workInProgress = null))
- : (reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_message_2327 =
- JSCompiler_object_inline_stack_2329.fallback),
- (JSCompiler_object_inline_digest_2328 = workInProgress.mode),
- (JSCompiler_object_inline_stack_2329 =
- mountWorkInProgressOffscreenFiber(
- {
- mode: "visible",
- children: JSCompiler_object_inline_stack_2329.children
- },
- JSCompiler_object_inline_digest_2328
- )),
- (JSCompiler_object_inline_message_2327 =
- createFiberFromFragment(
- JSCompiler_object_inline_message_2327,
- JSCompiler_object_inline_digest_2328,
- renderLanes,
- null
- )),
- (JSCompiler_object_inline_message_2327.flags |= 2),
- (JSCompiler_object_inline_stack_2329.return = workInProgress),
- (JSCompiler_object_inline_message_2327.return = workInProgress),
- (JSCompiler_object_inline_stack_2329.sibling =
- JSCompiler_object_inline_message_2327),
- (workInProgress.child = JSCompiler_object_inline_stack_2329),
- reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
- ),
- (JSCompiler_object_inline_stack_2329 = workInProgress.child),
- (JSCompiler_object_inline_stack_2329.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_stack_2329.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2330,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress = JSCompiler_object_inline_message_2327));
- else if (
- (pushPrimaryTreeSuspenseHandler(workInProgress),
- isHydrating &&
- console.error(
- "We should not be hydrating here. This is a bug in React. Please file a bug."
- ),
- isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328))
- ) {
- JSCompiler_object_inline_componentStack_2330 =
- JSCompiler_object_inline_digest_2328.nextSibling &&
- JSCompiler_object_inline_digest_2328.nextSibling.dataset;
- if (JSCompiler_object_inline_componentStack_2330) {
- JSCompiler_temp = JSCompiler_object_inline_componentStack_2330.dgst;
- var message = JSCompiler_object_inline_componentStack_2330.msg;
- instance = JSCompiler_object_inline_componentStack_2330.stck;
- var componentStack =
- JSCompiler_object_inline_componentStack_2330.cstck;
- }
- JSCompiler_object_inline_message_2327 = message;
- JSCompiler_object_inline_digest_2328 = JSCompiler_temp;
- JSCompiler_object_inline_stack_2329 = instance;
- JSCompiler_temp = JSCompiler_object_inline_componentStack_2330 =
- componentStack;
- "POSTPONE" !== JSCompiler_object_inline_digest_2328 &&
- ((JSCompiler_object_inline_componentStack_2330 =
- JSCompiler_object_inline_message_2327
- ? Error(JSCompiler_object_inline_message_2327)
- : Error(
- "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
- )),
- (JSCompiler_object_inline_componentStack_2330.stack =
- JSCompiler_object_inline_stack_2329 || ""),
- (JSCompiler_object_inline_componentStack_2330.digest =
- JSCompiler_object_inline_digest_2328),
- (JSCompiler_object_inline_stack_2329 =
- void 0 === JSCompiler_temp ? null : JSCompiler_temp),
- (JSCompiler_object_inline_message_2327 = {
- value: JSCompiler_object_inline_componentStack_2330,
- source: null,
- stack: JSCompiler_object_inline_stack_2329
- }),
- "string" === typeof JSCompiler_object_inline_stack_2329 &&
- CapturedStacks.set(
- JSCompiler_object_inline_componentStack_2330,
- JSCompiler_object_inline_message_2327
- ),
- queueHydrationError(JSCompiler_object_inline_message_2327));
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- );
- } else if (
- (didReceiveUpdate ||
- propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- (JSCompiler_object_inline_componentStack_2330 =
- 0 !== (renderLanes & current.childLanes)),
- didReceiveUpdate || JSCompiler_object_inline_componentStack_2330)
- ) {
- JSCompiler_object_inline_componentStack_2330 = workInProgressRoot;
- if (null !== JSCompiler_object_inline_componentStack_2330) {
- JSCompiler_object_inline_stack_2329 = renderLanes & -renderLanes;
- if (0 !== (JSCompiler_object_inline_stack_2329 & 42))
- JSCompiler_object_inline_stack_2329 = 1;
- else
- switch (JSCompiler_object_inline_stack_2329) {
- case 2:
- JSCompiler_object_inline_stack_2329 = 1;
- break;
- case 8:
- JSCompiler_object_inline_stack_2329 = 4;
- break;
- case 32:
- JSCompiler_object_inline_stack_2329 = 16;
- break;
- case 128:
- case 256:
- case 512:
- case 1024:
- case 2048:
- case 4096:
- case 8192:
- case 16384:
- case 32768:
- case 65536:
- case 131072:
- case 262144:
- case 524288:
- case 1048576:
- case 2097152:
- case 4194304:
- case 8388608:
- case 16777216:
- case 33554432:
- JSCompiler_object_inline_stack_2329 = 64;
- break;
- case 268435456:
- JSCompiler_object_inline_stack_2329 = 134217728;
- break;
- default:
- JSCompiler_object_inline_stack_2329 = 0;
- }
- JSCompiler_object_inline_stack_2329 =
- 0 !==
- (JSCompiler_object_inline_stack_2329 &
- (JSCompiler_object_inline_componentStack_2330.suspendedLanes |
- renderLanes))
- ? 0
- : JSCompiler_object_inline_stack_2329;
- if (
- 0 !== JSCompiler_object_inline_stack_2329 &&
- JSCompiler_object_inline_stack_2329 !== prevState.retryLane
- )
- throw (
- ((prevState.retryLane = JSCompiler_object_inline_stack_2329),
- enqueueConcurrentRenderForLane(
- current,
- JSCompiler_object_inline_stack_2329
- ),
- scheduleUpdateOnFiber(
- JSCompiler_object_inline_componentStack_2330,
- current,
- JSCompiler_object_inline_stack_2329
- ),
- SelectiveHydrationException)
- );
- }
- JSCompiler_object_inline_digest_2328.data ===
- SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible();
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
+ function placeSingleChild(newFiber) {
+ shouldTrackSideEffects &&
+ null === newFiber.alternate &&
+ (newFiber.flags |= 33554434);
+ return newFiber;
+ }
+ function updateTextNode(returnFiber, current, textContent, lanes) {
+ if (null === current || 6 !== current.tag)
+ return (
+ (current = createFiberFromText(
+ textContent,
+ returnFiber.mode,
+ lanes
+ )),
+ (current.return = returnFiber),
+ (current._debugOwner = returnFiber),
+ (current._debugTask = returnFiber._debugTask),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- } else
- JSCompiler_object_inline_digest_2328.data ===
- SUSPENSE_PENDING_START_DATA
- ? ((workInProgress.flags |= 192),
- (workInProgress.child = current.child),
- (workInProgress = null))
- : ((current = prevState.treeContext),
- (nextHydratableInstance = getNextHydratable(
- JSCompiler_object_inline_digest_2328.nextSibling
- )),
- (hydrationParentFiber = workInProgress),
- (isHydrating = !0),
- (hydrationErrors = null),
- (didSuspendOrErrorDEV = !1),
- (hydrationDiffRootDEV = null),
- (rootOrSingletonContext = !1),
- null !== current &&
- (warnIfNotHydrating(),
- (idStack[idStackIndex++] = treeContextId),
- (idStack[idStackIndex++] = treeContextOverflow),
- (idStack[idStackIndex++] = treeContextProvider),
- (treeContextId = current.id),
- (treeContextOverflow = current.overflow),
- (treeContextProvider = workInProgress)),
- (workInProgress = mountSuspensePrimaryChildren(
- workInProgress,
- JSCompiler_object_inline_stack_2329.children
- )),
- (workInProgress.flags |= 4096));
- return workInProgress;
+ current = useFiber(current, textContent);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- if (JSCompiler_object_inline_message_2327)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_message_2327 =
- JSCompiler_object_inline_stack_2329.fallback),
- (JSCompiler_object_inline_digest_2328 = workInProgress.mode),
- (JSCompiler_temp = current.child),
- (instance = JSCompiler_temp.sibling),
- (JSCompiler_object_inline_stack_2329 = createWorkInProgress(
- JSCompiler_temp,
- {
- mode: "hidden",
- children: JSCompiler_object_inline_stack_2329.children
- }
- )),
- (JSCompiler_object_inline_stack_2329.subtreeFlags =
- JSCompiler_temp.subtreeFlags & 31457280),
- null !== instance
- ? (JSCompiler_object_inline_message_2327 = createWorkInProgress(
- instance,
- JSCompiler_object_inline_message_2327
- ))
- : ((JSCompiler_object_inline_message_2327 = createFiberFromFragment(
- JSCompiler_object_inline_message_2327,
- JSCompiler_object_inline_digest_2328,
- renderLanes,
- null
- )),
- (JSCompiler_object_inline_message_2327.flags |= 2)),
- (JSCompiler_object_inline_message_2327.return = workInProgress),
- (JSCompiler_object_inline_stack_2329.return = workInProgress),
- (JSCompiler_object_inline_stack_2329.sibling =
- JSCompiler_object_inline_message_2327),
- (workInProgress.child = JSCompiler_object_inline_stack_2329),
- (JSCompiler_object_inline_stack_2329 =
- JSCompiler_object_inline_message_2327),
- (JSCompiler_object_inline_message_2327 = workInProgress.child),
- (JSCompiler_object_inline_digest_2328 = current.child.memoizedState),
- null === JSCompiler_object_inline_digest_2328
- ? (JSCompiler_object_inline_digest_2328 =
- mountSuspenseOffscreenState(renderLanes))
- : ((JSCompiler_temp =
- JSCompiler_object_inline_digest_2328.cachePool),
- null !== JSCompiler_temp
- ? ((instance = CacheContext._currentValue),
- (JSCompiler_temp =
- JSCompiler_temp.parent !== instance
- ? { parent: instance, pool: instance }
- : JSCompiler_temp))
- : (JSCompiler_temp = getSuspendedCache()),
- (JSCompiler_object_inline_digest_2328 = {
- baseLanes:
- JSCompiler_object_inline_digest_2328.baseLanes | renderLanes,
- cachePool: JSCompiler_temp
- })),
- (JSCompiler_object_inline_message_2327.memoizedState =
- JSCompiler_object_inline_digest_2328),
- (JSCompiler_object_inline_message_2327.childLanes =
- getRemainingWorkInPrimaryTree(
+ function updateElement(returnFiber, current, element, lanes) {
+ var elementType = element.type;
+ if (elementType === REACT_FRAGMENT_TYPE)
+ return (
+ (current = updateFragment(
+ returnFiber,
current,
- JSCompiler_object_inline_componentStack_2330,
- renderLanes
+ element.props.children,
+ lanes,
+ element.key
)),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- JSCompiler_object_inline_stack_2329
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- renderLanes = current.child;
- current = renderLanes.sibling;
- renderLanes = createWorkInProgress(renderLanes, {
- mode: "visible",
- children: JSCompiler_object_inline_stack_2329.children
- });
- renderLanes.return = workInProgress;
- renderLanes.sibling = null;
- null !== current &&
- ((JSCompiler_object_inline_componentStack_2330 =
- workInProgress.deletions),
- null === JSCompiler_object_inline_componentStack_2330
- ? ((workInProgress.deletions = [current]),
- (workInProgress.flags |= 16))
- : JSCompiler_object_inline_componentStack_2330.push(current));
- workInProgress.child = renderLanes;
- workInProgress.memoizedState = null;
- return renderLanes;
- }
- function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: primaryChildren },
- workInProgress.mode
- );
- primaryChildren.return = workInProgress;
- return (workInProgress.child = primaryChildren);
- }
- function mountSuspenseFallbackChildren(
- workInProgress,
- primaryChildren,
- fallbackChildren,
- renderLanes
- ) {
- var mode = workInProgress.mode;
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "hidden", children: primaryChildren },
- mode
- );
- fallbackChildren = createFiberFromFragment(
- fallbackChildren,
- mode,
- renderLanes,
- null
- );
- primaryChildren.return = workInProgress;
- fallbackChildren.return = workInProgress;
- primaryChildren.sibling = fallbackChildren;
- workInProgress.child = primaryChildren;
- return fallbackChildren;
- }
- function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
- return createFiberFromOffscreen(offscreenProps, mode, 0, null);
- }
- function retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- ) {
- reconcileChildFibers(workInProgress, current.child, null, renderLanes);
- current = mountSuspensePrimaryChildren(
- workInProgress,
- workInProgress.pendingProps.children
- );
- current.flags |= 2;
- workInProgress.memoizedState = null;
- return current;
- }
- function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
- fiber.lanes |= renderLanes;
- var alternate = fiber.alternate;
- null !== alternate && (alternate.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- fiber.return,
- renderLanes,
- propagationRoot
- );
- }
- function validateSuspenseListNestedChild(childSlot, index) {
- var isAnArray = isArrayImpl(childSlot);
- childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot);
- return isAnArray || childSlot
- ? ((isAnArray = isAnArray ? "array" : "iterable"),
- console.error(
- "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ",
- isAnArray,
- index,
- isAnArray
- ),
- !1)
- : !0;
- }
- function initSuspenseListRenderState(
- workInProgress,
- isBackwards,
- tail,
- lastContentRow,
- tailMode
- ) {
- var renderState = workInProgress.memoizedState;
- null === renderState
- ? (workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- renderingStartTime: 0,
- last: lastContentRow,
- tail: tail,
- tailMode: tailMode
- })
- : ((renderState.isBackwards = isBackwards),
- (renderState.rendering = null),
- (renderState.renderingStartTime = 0),
- (renderState.last = lastContentRow),
- (renderState.tail = tail),
- (renderState.tailMode = tailMode));
- }
- function updateSuspenseListComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- revealOrder = nextProps.revealOrder,
- tailMode = nextProps.tail;
- nextProps = nextProps.children;
- if (
- void 0 !== revealOrder &&
- "forwards" !== revealOrder &&
- "backwards" !== revealOrder &&
- "together" !== revealOrder &&
- !didWarnAboutRevealOrder[revealOrder]
- )
+ validateFragmentProps(element, current, returnFiber),
+ current
+ );
if (
- ((didWarnAboutRevealOrder[revealOrder] = !0),
- "string" === typeof revealOrder)
+ null !== current &&
+ (current.elementType === elementType ||
+ isCompatibleFamilyForHotReloading(current, element) ||
+ ("object" === typeof elementType &&
+ null !== elementType &&
+ elementType.$$typeof === REACT_LAZY_TYPE &&
+ callLazyInitInDEV(elementType) === current.type))
)
- switch (revealOrder.toLowerCase()) {
- case "together":
- case "forwards":
- case "backwards":
- console.error(
- '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.',
- revealOrder,
- revealOrder.toLowerCase()
- );
- break;
- case "forward":
- case "backward":
- console.error(
- '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.',
- revealOrder,
- revealOrder.toLowerCase()
- );
- break;
- default:
- console.error(
- '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?',
- revealOrder
- );
- }
- else
- console.error(
- '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?',
- revealOrder
+ return (
+ (current = useFiber(current, element.props)),
+ coerceRef(current, element),
+ (current.return = returnFiber),
+ (current._debugOwner = element._owner),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- void 0 === tailMode ||
- didWarnAboutTailOptions[tailMode] ||
- ("collapsed" !== tailMode && "hidden" !== tailMode
- ? ((didWarnAboutTailOptions[tailMode] = !0),
- console.error(
- '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?',
- tailMode
- ))
- : "forwards" !== revealOrder &&
- "backwards" !== revealOrder &&
- ((didWarnAboutTailOptions[tailMode] = !0),
- console.error(
- ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
- tailMode
- )));
- a: if (
- ("forwards" === revealOrder || "backwards" === revealOrder) &&
- void 0 !== nextProps &&
- null !== nextProps &&
- !1 !== nextProps
- )
- if (isArrayImpl(nextProps))
- for (var i = 0; i < nextProps.length; i++) {
- if (!validateSuspenseListNestedChild(nextProps[i], i)) break a;
- }
- else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) {
- if ((i = i.call(nextProps)))
- for (var step = i.next(), _i = 0; !step.done; step = i.next()) {
- if (!validateSuspenseListNestedChild(step.value, _i)) break a;
- _i++;
- }
- } else
- console.error(
- 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
- revealOrder
+ current = createFiberFromElement(element, returnFiber.mode, lanes);
+ coerceRef(current, element);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
+ }
+ function updatePortal(returnFiber, current, portal, lanes) {
+ if (
+ null === current ||
+ 4 !== current.tag ||
+ current.stateNode.containerInfo !== portal.containerInfo ||
+ current.stateNode.implementation !== portal.implementation
+ )
+ return (
+ (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- nextProps = suspenseStackCursor.current;
- if (0 !== (nextProps & ForceSuspenseFallback))
- (nextProps =
- (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback),
- (workInProgress.flags |= 128);
- else {
- if (null !== current && 0 !== (current.flags & 128))
- a: for (current = workInProgress.child; null !== current; ) {
- if (13 === current.tag)
- null !== current.memoizedState &&
- scheduleSuspenseWorkOnFiber(
- current,
- renderLanes,
- workInProgress
- );
- else if (19 === current.tag)
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (null !== current.child) {
- current.child.return = current;
- current = current.child;
- continue;
- }
- if (current === workInProgress) break a;
- for (; null === current.sibling; ) {
- if (null === current.return || current.return === workInProgress)
- break a;
- current = current.return;
- }
- current.sibling.return = current.return;
- current = current.sibling;
- }
- nextProps &= SubtreeSuspenseContextMask;
+ current = useFiber(current, portal.children || []);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- 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;
- renderLanes = revealOrder;
- revealOrder = current;
- }
- initSuspenseListRenderState(
- workInProgress,
- !0,
- renderLanes,
- null,
- tailMode
+ function updateFragment(returnFiber, current, fragment, lanes, key) {
+ if (null === current || 7 !== current.tag)
+ return (
+ (current = createFiberFromFragment(
+ fragment,
+ returnFiber.mode,
+ lanes,
+ key
+ )),
+ (current.return = returnFiber),
+ (current._debugOwner = returnFiber),
+ (current._debugTask = returnFiber._debugTask),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- break;
- case "together":
- initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
- break;
- default:
- workInProgress.memoizedState = null;
- }
- return workInProgress.child;
- }
- function bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- ) {
- null !== current && (workInProgress.dependencies = current.dependencies);
- profilerStartTime = -1;
- workInProgressRootSkippedLanes |= workInProgress.lanes;
- if (0 === (renderLanes & workInProgress.childLanes))
- if (null !== current) {
- if (
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- 0 === (renderLanes & workInProgress.childLanes))
- )
- return null;
- } else return null;
- if (null !== current && workInProgress.child !== current.child)
- throw Error("Resuming work not yet implemented.");
- if (null !== workInProgress.child) {
- current = workInProgress.child;
- renderLanes = createWorkInProgress(current, current.pendingProps);
- workInProgress.child = renderLanes;
- for (renderLanes.return = workInProgress; null !== current.sibling; )
- (current = current.sibling),
- (renderLanes = renderLanes.sibling =
- createWorkInProgress(current, current.pendingProps)),
- (renderLanes.return = workInProgress);
- renderLanes.sibling = null;
+ current = useFiber(current, fragment);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- return workInProgress.child;
- }
- function checkScheduledUpdateOrContext(current, renderLanes) {
- if (0 !== (current.lanes & renderLanes)) return !0;
- current = current.dependencies;
- return null !== current && checkIfContextChanged(current) ? !0 : !1;
- }
- function attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
- ) {
- switch (workInProgress.tag) {
- case 3:
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- pushProvider(
- workInProgress,
- CacheContext,
- current.memoizedState.cache
- );
- resetHydrationState();
- break;
- case 27:
- case 5:
- pushHostContext(workInProgress);
- break;
- case 4:
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- break;
- case 10:
- pushProvider(
- workInProgress,
- workInProgress.type,
- workInProgress.memoizedProps.value
+ function createChild(returnFiber, newChild, lanes) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (newChild = createFiberFromText(
+ "" + newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ (newChild._debugOwner = returnFiber),
+ (newChild._debugTask = returnFiber._debugTask),
+ (newChild._debugInfo = currentDebugInfo),
+ newChild
);
- break;
- case 12:
- 0 !== (renderLanes & workInProgress.childLanes) &&
- (workInProgress.flags |= 4);
- workInProgress.flags |= 2048;
- var stateNode = workInProgress.stateNode;
- stateNode.effectDuration = -0;
- stateNode.passiveEffectDuration = -0;
- break;
- case 13:
- stateNode = workInProgress.memoizedState;
- if (null !== stateNode) {
- if (null !== stateNode.dehydrated)
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
return (
- pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags |= 128),
- null
- );
- if (0 !== (renderLanes & workInProgress.child.childLanes))
- return updateSuspenseComponent(
- current,
- workInProgress,
- renderLanes
+ (lanes = createFiberFromElement(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (returnFiber = pushDebugInfo(newChild._debugInfo)),
+ (lanes._debugInfo = currentDebugInfo),
+ (currentDebugInfo = returnFiber),
+ lanes
);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- current = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- return null !== current ? current.sibling : null;
- }
- pushPrimaryTreeSuspenseHandler(workInProgress);
- break;
- case 19:
- var didSuspendBefore = 0 !== (current.flags & 128);
- stateNode = 0 !== (renderLanes & workInProgress.childLanes);
- stateNode ||
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
- if (didSuspendBefore) {
- if (stateNode)
- return updateSuspenseListComponent(
- current,
- workInProgress,
- renderLanes
+ case REACT_PORTAL_TYPE:
+ return (
+ (newChild = createFiberFromPortal(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ (newChild._debugInfo = currentDebugInfo),
+ newChild
);
- workInProgress.flags |= 128;
+ case REACT_LAZY_TYPE:
+ var _prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ newChild = callLazyInitInDEV(newChild);
+ returnFiber = createChild(returnFiber, newChild, lanes);
+ currentDebugInfo = _prevDebugInfo;
+ return returnFiber;
}
- didSuspendBefore = workInProgress.memoizedState;
- null !== didSuspendBefore &&
- ((didSuspendBefore.rendering = null),
- (didSuspendBefore.tail = null),
- (didSuspendBefore.lastEffect = null));
- push(
- suspenseStackCursor,
- suspenseStackCursor.current,
- workInProgress
- );
- if (stateNode) break;
- else return null;
- case 22:
- case 23:
- return (
- (workInProgress.lanes = 0),
- updateOffscreenComponent(current, workInProgress, renderLanes)
- );
- case 24:
- pushProvider(
- workInProgress,
- CacheContext,
- current.memoizedState.cache
- );
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
- }
- function beginWork(current, workInProgress, renderLanes) {
- if (workInProgress._debugNeedsRemount && null !== current) {
- renderLanes = createFiberFromTypeAndProps(
- workInProgress.type,
- workInProgress.key,
- workInProgress.pendingProps,
- workInProgress._debugOwner || null,
- workInProgress.mode,
- workInProgress.lanes
- );
- renderLanes._debugStack = workInProgress._debugStack;
- renderLanes._debugTask = workInProgress._debugTask;
- var returnFiber = workInProgress.return;
- if (null === returnFiber) throw Error("Cannot swap the root fiber.");
- current.alternate = null;
- workInProgress.alternate = null;
- renderLanes.index = workInProgress.index;
- renderLanes.sibling = workInProgress.sibling;
- renderLanes.return = workInProgress.return;
- renderLanes.ref = workInProgress.ref;
- renderLanes._debugInfo = workInProgress._debugInfo;
- if (workInProgress === returnFiber.child)
- returnFiber.child = renderLanes;
- else {
- var prevSibling = returnFiber.child;
- if (null === prevSibling)
- throw Error("Expected parent to have a child.");
- for (; prevSibling.sibling !== workInProgress; )
- if (((prevSibling = prevSibling.sibling), null === prevSibling))
- throw Error("Expected to find the previous sibling.");
- prevSibling.sibling = renderLanes;
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (lanes = createFiberFromFragment(
+ newChild,
+ returnFiber.mode,
+ lanes,
+ null
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (returnFiber = pushDebugInfo(newChild._debugInfo)),
+ (lanes._debugInfo = currentDebugInfo),
+ (currentDebugInfo = returnFiber),
+ lanes
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = createChild(
+ returnFiber,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = _prevDebugInfo),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return createChild(
+ returnFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
}
- workInProgress = returnFiber.deletions;
- null === workInProgress
- ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16))
- : workInProgress.push(current);
- renderLanes.flags |= 2;
- return renderLanes;
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
}
- if (null !== current)
+ function updateSlot(returnFiber, oldFiber, newChild, lanes) {
+ var key = null !== oldFiber ? oldFiber.key : null;
if (
- current.memoizedProps !== workInProgress.pendingProps ||
- workInProgress.type !== current.type
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
)
- didReceiveUpdate = !0;
- else {
+ return null !== key
+ ? null
+ : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return newChild.key === key
+ ? ((key = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateElement(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber)
+ : null;
+ case REACT_PORTAL_TYPE:
+ return newChild.key === key
+ ? updatePortal(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_LAZY_TYPE:
+ return (
+ (key = pushDebugInfo(newChild._debugInfo)),
+ (newChild = callLazyInitInDEV(newChild)),
+ (returnFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber
+ );
+ }
if (
- !checkScheduledUpdateOrContext(current, renderLanes) &&
- 0 === (workInProgress.flags & 128)
- )
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ ) {
+ if (null !== key) return null;
+ key = pushDebugInfo(newChild._debugInfo);
+ returnFiber = updateFragment(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes,
+ null
+ );
+ currentDebugInfo = key;
+ return returnFiber;
+ }
+ if ("function" === typeof newChild.then)
return (
- (didReceiveUpdate = !1),
- attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
- )
+ (key = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber
);
- didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateSlot(
+ returnFiber,
+ oldFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
}
- else {
- didReceiveUpdate = !1;
- if ((returnFiber = isHydrating))
- warnIfNotHydrating(),
- (returnFiber = 0 !== (workInProgress.flags & 1048576));
- returnFiber &&
- ((returnFiber = workInProgress.index),
- warnIfNotHydrating(),
- pushTreeId(workInProgress, treeForkCount, returnFiber));
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
}
- 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
- )),
- (workInProgress.tag = 1),
- (workInProgress.type = current =
- resolveFunctionForHotReloading(current)),
- (workInProgress = updateClassComponent(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- )))
- : ((workInProgress.tag = 0),
- validateFunctionComponentInDev(workInProgress, current),
- (workInProgress.type = current =
- resolveFunctionForHotReloading(current)),
- (workInProgress = updateFunctionComponent(
- null,
- workInProgress,
- current,
+ function updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ ) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
+ );
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return (
+ (newIdx =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ (existingChildren = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateElement(
returnFiber,
- renderLanes
- )));
- else {
- if (void 0 !== current && null !== current)
- if (
- ((prevSibling = current.$$typeof),
- prevSibling === REACT_FORWARD_REF_TYPE)
- ) {
- workInProgress.tag = 11;
- workInProgress.type = current =
- resolveForwardRefForHotReloading(current);
- workInProgress = updateForwardRef(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- );
- break a;
- } else if (prevSibling === REACT_MEMO_TYPE) {
- workInProgress.tag = 14;
- workInProgress = updateMemoComponent(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- );
- break a;
- }
- workInProgress = "";
- null !== current &&
- "object" === typeof current &&
- current.$$typeof === REACT_LAZY_TYPE &&
- (workInProgress =
- " Did you wrap a component in React.lazy() more than once?");
- current = getComponentNameFromType(current) || current;
- throw Error(
- "Element type is invalid. Received a promise that resolves to: " +
- current +
- ". Lazy element type must resolve to a class or function." +
- workInProgress
+ newIdx,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = existingChildren),
+ returnFiber
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updatePortal(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_LAZY_TYPE:
+ var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo);
+ newChild = callLazyInitInDEV(newChild);
+ returnFiber = updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ );
+ currentDebugInfo = _prevDebugInfo7;
+ return returnFiber;
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (newIdx = existingChildren.get(newIdx) || null),
+ (existingChildren = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateFragment(
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes,
+ null
+ )),
+ (currentDebugInfo = existingChildren),
+ returnFiber
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = _prevDebugInfo7),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
);
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
+ }
+ function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) {
+ if ("object" !== typeof child || null === child) return knownKeys;
+ switch (child.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ case REACT_PORTAL_TYPE:
+ warnForMissingKey(returnFiber, workInProgress, child);
+ var key = child.key;
+ if ("string" !== typeof key) break;
+ if (null === knownKeys) {
+ knownKeys = new Set();
+ knownKeys.add(key);
+ break;
+ }
+ if (!knownKeys.has(key)) {
+ knownKeys.add(key);
+ break;
+ }
+ runWithFiberInDEV(workInProgress, function () {
+ console.error(
+ "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.",
+ key
+ );
+ });
+ break;
+ case REACT_LAZY_TYPE:
+ (child = callLazyInitInDEV(child)),
+ warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys);
+ }
+ return knownKeys;
+ }
+ function reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ for (
+ var knownKeys = null,
+ resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null;
+ null !== oldFiber && newIdx < newChildren.length;
+ newIdx++
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ newChildren[newIdx],
+ lanes
+ );
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
}
- return workInProgress;
- case 0:
- return updateFunctionComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
+ knownKeys = warnOnInvalidKey(
+ returnFiber,
+ newFiber,
+ newChildren[newIdx],
+ knownKeys
);
- case 1:
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (newIdx === newChildren.length)
return (
- (returnFiber = workInProgress.type),
- (prevSibling = resolveClassComponentProps(
- returnFiber,
- workInProgress.pendingProps
- )),
- updateClassComponent(
- current,
- workInProgress,
- returnFiber,
- prevSibling,
- renderLanes
- )
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
);
- case 3:
- a: {
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- if (null === current)
- throw Error(
- "Should have a current fiber. This is a bug in React."
- );
- var nextProps = workInProgress.pendingProps;
- prevSibling = workInProgress.memoizedState;
- returnFiber = prevSibling.element;
- cloneUpdateQueue(current, workInProgress);
- processUpdateQueue(workInProgress, nextProps, null, renderLanes);
- var nextState = workInProgress.memoizedState;
- nextProps = nextState.cache;
- pushProvider(workInProgress, CacheContext, nextProps);
- nextProps !== prevSibling.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- );
- suspendIfUpdateReadFromEntangledAsyncAction();
- nextProps = nextState.element;
- if (prevSibling.isDehydrated)
- if (
- ((prevSibling = {
- element: nextProps,
- isDehydrated: !1,
- cache: nextState.cache
- }),
- (workInProgress.updateQueue.baseState = prevSibling),
- (workInProgress.memoizedState = prevSibling),
- workInProgress.flags & 256)
- ) {
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else if (nextProps !== returnFiber) {
- returnFiber = createCapturedValueAtFiber(
- Error(
- "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
- ),
- workInProgress
- );
- queueHydrationError(returnFiber);
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else
- for (
- nextHydratableInstance = getNextHydratable(
- workInProgress.stateNode.containerInfo.firstChild
- ),
- hydrationParentFiber = workInProgress,
- isHydrating = !0,
- hydrationErrors = null,
- didSuspendOrErrorDEV = !1,
- hydrationDiffRootDEV = null,
- rootOrSingletonContext = !0,
- current = mountChildFibers(
- workInProgress,
- null,
- nextProps,
- renderLanes
- ),
- workInProgress.child = current;
- current;
-
- )
- (current.flags = (current.flags & -3) | 4096),
- (current = current.sibling);
- else {
- resetHydrationState();
- if (nextProps === returnFiber) {
- workInProgress = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- break a;
- }
- reconcileChildren(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
+ if (null === oldFiber) {
+ for (; newIdx < newChildren.length; newIdx++)
+ (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
+ null !== oldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ oldFiber,
+ newChildren[newIdx],
+ knownKeys
+ )),
+ (currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ newIdx < newChildren.length;
+ newIdx++
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ newChildren[newIdx],
+ lanes
+ )),
+ null !== nextOldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ nextOldFiber,
+ newChildren[newIdx],
+ knownKeys
+ )),
+ shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
+ ),
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ function reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChildrenIterable,
+ lanes
+ ) {
+ var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
+ newChildren !== newChildrenIterable ||
+ (0 === returnFiber.tag &&
+ "[object AsyncGeneratorFunction]" ===
+ Object.prototype.toString.call(returnFiber.type) &&
+ "[object AsyncGenerator]" ===
+ Object.prototype.toString.call(newChildren)) ||
+ (didWarnAboutGenerators ||
+ console.error(
+ "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items."
+ ),
+ (didWarnAboutGenerators = !0));
+ if (null == newChildren)
+ throw Error("An iterable object provided no iterator.");
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ {
+ next: function () {
+ return unwrapThenable(newChildren.next());
}
- workInProgress = workInProgress.child;
+ },
+ lanes
+ );
+ }
+ function reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ if (null == newChildren)
+ throw Error("An iterable object provided no iterator.");
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null,
+ knownKeys = null,
+ step = newChildren.next();
+ null !== oldFiber && !step.done;
+ newIdx++, step = newChildren.next()
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
}
- return workInProgress;
- case 26:
- return (
- markRef(current, workInProgress),
- null === current
- ? (current = getResource(
- workInProgress.type,
- null,
- workInProgress.pendingProps,
- null
- ))
- ? (workInProgress.memoizedState = current)
- : isHydrating ||
- ((current = workInProgress.type),
- (renderLanes = workInProgress.pendingProps),
- (returnFiber = requiredContext(
- rootInstanceStackCursor.current
- )),
- (returnFiber =
- getOwnerDocumentFromRootContainer(
- returnFiber
- ).createElement(current)),
- (returnFiber[internalInstanceKey] = workInProgress),
- (returnFiber[internalPropsKey] = renderLanes),
- setInitialProperties(returnFiber, current, renderLanes),
- markNodeAsHoistable(returnFiber),
- (workInProgress.stateNode = returnFiber))
- : (workInProgress.memoizedState = getResource(
- workInProgress.type,
- current.memoizedProps,
- workInProgress.pendingProps,
- current.memoizedState
- )),
- null
+ knownKeys = warnOnInvalidKey(
+ returnFiber,
+ newFiber,
+ step.value,
+ knownKeys
);
- case 27:
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (step.done)
return (
- pushHostContext(workInProgress),
- null === current &&
- isHydrating &&
- ((prevSibling = requiredContext(rootInstanceStackCursor.current)),
- (returnFiber = getHostContext()),
- (prevSibling = workInProgress.stateNode =
- resolveSingletonInstance(
- workInProgress.type,
- workInProgress.pendingProps,
- prevSibling,
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; !step.done; newIdx++, step = newChildren.next())
+ (oldFiber = createChild(returnFiber, step.value, lanes)),
+ null !== oldFiber &&
+ ((knownKeys = warnOnInvalidKey(
returnFiber,
- !1
+ oldFiber,
+ step.value,
+ knownKeys
)),
- didSuspendOrErrorDEV ||
- ((returnFiber = diffHydratedProperties(
- prevSibling,
- workInProgress.type,
- workInProgress.pendingProps,
- returnFiber
+ (currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
)),
- null !== returnFiber &&
- (buildHydrationDiffNode(workInProgress, 0).serverProps =
- returnFiber)),
- (hydrationParentFiber = workInProgress),
- (rootOrSingletonContext = !0),
- (nextHydratableInstance = getNextHydratable(
- prevSibling.firstChild
- ))),
- (returnFiber = workInProgress.pendingProps.children),
- null !== current || isHydrating
- ? reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- )
- : (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- returnFiber,
- renderLanes
- )),
- markRef(current, workInProgress),
- workInProgress.child
- );
- case 5:
- return (
- null === current &&
- isHydrating &&
- ((nextProps = getHostContext()),
- (returnFiber = validateDOMNesting(
- workInProgress.type,
- nextProps.ancestorInfo
- )),
- (prevSibling = nextHydratableInstance),
- (nextState = !prevSibling) ||
- ((nextState = canHydrateInstance(
- prevSibling,
- workInProgress.type,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== nextState
- ? ((workInProgress.stateNode = nextState),
- didSuspendOrErrorDEV ||
- ((nextProps = diffHydratedProperties(
- nextState,
- workInProgress.type,
- workInProgress.pendingProps,
- nextProps
- )),
- null !== nextProps &&
- (buildHydrationDiffNode(workInProgress, 0).serverProps =
- nextProps)),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = getNextHydratable(
- nextState.firstChild
- )),
- (rootOrSingletonContext = !1),
- (nextProps = !0))
- : (nextProps = !1),
- (nextState = !nextProps)),
- nextState &&
- (returnFiber &&
- warnNonHydratedInstance(workInProgress, prevSibling),
- throwOnHydrationMismatch(workInProgress))),
- pushHostContext(workInProgress),
- (prevSibling = workInProgress.type),
- (nextProps = workInProgress.pendingProps),
- (nextState = null !== current ? current.memoizedProps : null),
- (returnFiber = nextProps.children),
- shouldSetTextContent(prevSibling, nextProps)
- ? (returnFiber = null)
- : null !== nextState &&
- shouldSetTextContent(prevSibling, nextState) &&
- (workInProgress.flags |= 32),
- null !== workInProgress.memoizedState &&
- ((prevSibling = renderWithHooks(
- current,
- workInProgress,
- TransitionAwareHostComponent,
- null,
- null,
- renderLanes
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ !step.done;
+ newIdx++, step = newChildren.next()
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ step.value,
+ lanes
+ )),
+ null !== nextOldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ nextOldFiber,
+ step.value,
+ knownKeys
)),
- (HostTransitionContext._currentValue = prevSibling)),
- markRef(current, workInProgress),
- reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- ),
- workInProgress.child
- );
- case 6:
- return (
- null === current &&
- isHydrating &&
- ((current = workInProgress.pendingProps),
- (renderLanes = getHostContext().ancestorInfo.current),
- (current =
- null != renderLanes
- ? validateTextNesting(current, renderLanes.tag)
- : !0),
- (renderLanes = nextHydratableInstance),
- (returnFiber = !renderLanes) ||
- ((returnFiber = canHydrateTextInstance(
- renderLanes,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== returnFiber
- ? ((workInProgress.stateNode = returnFiber),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (returnFiber = !0))
- : (returnFiber = !1),
- (returnFiber = !returnFiber)),
- returnFiber &&
- (current &&
- warnNonHydratedInstance(workInProgress, renderLanes),
- throwOnHydrationMismatch(workInProgress))),
- null
- );
- case 13:
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- case 4:
- return (
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- ),
- (returnFiber = workInProgress.pendingProps),
- null === current
- ? (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- returnFiber,
- renderLanes
- ))
- : reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
+ shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
),
- workInProgress.child
- );
- case 11:
- return updateForwardRef(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 7:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps,
- renderLanes
- ),
- workInProgress.child
- );
- case 8:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 12:
- return (
- (workInProgress.flags |= 4),
- (workInProgress.flags |= 2048),
- (returnFiber = workInProgress.stateNode),
- (returnFiber.effectDuration = -0),
- (returnFiber.passiveEffectDuration = -0),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 10:
- return (
- (returnFiber = workInProgress.type),
- (prevSibling = workInProgress.pendingProps),
- (nextProps = prevSibling.value),
- "value" in prevSibling ||
- hasWarnedAboutUsingNoValuePropOnContextProvider ||
- ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0),
- console.error(
- "The `value` prop is required for the ``. Did you misspell it or forget to pass it?"
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
)),
- pushProvider(workInProgress, returnFiber, nextProps),
- reconcileChildren(
- current,
- workInProgress,
- prevSibling.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 9:
- return (
- (prevSibling = workInProgress.type._context),
- (returnFiber = workInProgress.pendingProps.children),
- "function" !== typeof returnFiber &&
- console.error(
- "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
- ),
- prepareToReadContext(workInProgress),
- (prevSibling = readContext(prevSibling)),
- (returnFiber = callComponentInDEV(
- returnFiber,
- prevSibling,
- void 0
- )),
- (workInProgress.flags |= 1),
- reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- ),
- workInProgress.child
- );
- case 14:
- return updateMemoComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 15:
- return updateSimpleMemoComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 19:
- return updateSuspenseListComponent(
- current,
- workInProgress,
- renderLanes
- );
- case 22:
- return updateOffscreenComponent(current, workInProgress, renderLanes);
- case 24:
- return (
- prepareToReadContext(workInProgress),
- (returnFiber = readContext(CacheContext)),
- null === current
- ? ((prevSibling = peekCacheFromPool()),
- null === prevSibling &&
- ((prevSibling = workInProgressRoot),
- (nextProps = createCache()),
- (prevSibling.pooledCache = nextProps),
- retainCache(nextProps),
- null !== nextProps &&
- (prevSibling.pooledCacheLanes |= renderLanes),
- (prevSibling = nextProps)),
- (workInProgress.memoizedState = {
- parent: returnFiber,
- cache: prevSibling
- }),
- initializeUpdateQueue(workInProgress),
- pushProvider(workInProgress, CacheContext, prevSibling))
- : (0 !== (current.lanes & renderLanes) &&
- (cloneUpdateQueue(current, workInProgress),
- processUpdateQueue(workInProgress, null, null, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction()),
- (prevSibling = current.memoizedState),
- (nextProps = workInProgress.memoizedState),
- prevSibling.parent !== returnFiber
- ? ((prevSibling = {
- parent: returnFiber,
- cache: returnFiber
- }),
- (workInProgress.memoizedState = prevSibling),
- 0 === workInProgress.lanes &&
- (workInProgress.memoizedState =
- workInProgress.updateQueue.baseState =
- prevSibling),
- pushProvider(workInProgress, CacheContext, returnFiber))
- : ((returnFiber = nextProps.cache),
- pushProvider(workInProgress, CacheContext, returnFiber),
- returnFiber !== prevSibling.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- ))),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 29:
- throw workInProgress.pendingProps;
- }
- throw Error(
- "Unknown unit of work tag (" +
- workInProgress.tag +
- "). This error is likely caused by a bug in React. Please file an issue."
- );
- }
- function resetContextDependencies() {
- lastContextDependency = currentlyRenderingFiber = null;
- isDisallowedContextReadInDEV = !1;
- }
- function pushProvider(providerFiber, context, nextValue) {
- push(valueCursor, context._currentValue, providerFiber);
- context._currentValue = nextValue;
- push(rendererCursorDEV, context._currentRenderer, providerFiber);
- void 0 !== context._currentRenderer &&
- null !== context._currentRenderer &&
- context._currentRenderer !== rendererSigil &&
- console.error(
- "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
- );
- context._currentRenderer = rendererSigil;
- }
- function popProvider(context, providerFiber) {
- context._currentValue = valueCursor.current;
- var currentRenderer = rendererCursorDEV.current;
- pop(rendererCursorDEV, providerFiber);
- context._currentRenderer = currentRenderer;
- pop(valueCursor, providerFiber);
- }
- function scheduleContextWorkOnParentPath(
- parent,
- renderLanes,
- propagationRoot
- ) {
- for (; null !== parent; ) {
- var alternate = parent.alternate;
- (parent.childLanes & renderLanes) !== renderLanes
- ? ((parent.childLanes |= renderLanes),
- null !== alternate && (alternate.childLanes |= renderLanes))
- : null !== alternate &&
- (alternate.childLanes & renderLanes) !== renderLanes &&
- (alternate.childLanes |= renderLanes);
- if (parent === propagationRoot) break;
- parent = parent.return;
- }
- parent !== propagationRoot &&
- console.error(
- "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
- );
- }
- function propagateContextChanges(
- workInProgress,
- contexts,
- renderLanes,
- forcePropagateEntireTree
- ) {
- var fiber = workInProgress.child;
- null !== fiber && (fiber.return = workInProgress);
- for (; null !== fiber; ) {
- var list = fiber.dependencies;
- if (null !== list) {
- var nextFiber = fiber.child;
- list = list.firstContext;
- a: for (; null !== list; ) {
- var dependency = list;
- list = fiber;
- for (var i = 0; i < contexts.length; i++)
- if (dependency.context === contexts[i]) {
- list.lanes |= renderLanes;
- dependency = list.alternate;
- null !== dependency && (dependency.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- list.return,
- renderLanes,
- workInProgress
- );
- forcePropagateEntireTree || (nextFiber = null);
- break a;
- }
- list = dependency.next;
- }
- } else if (18 === fiber.tag) {
- nextFiber = fiber.return;
- if (null === nextFiber)
- throw Error(
- "We just came from a parent so we must have had a parent. This is a bug in React."
- );
- nextFiber.lanes |= renderLanes;
- list = nextFiber.alternate;
- null !== list && (list.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- nextFiber,
- renderLanes,
- workInProgress
- );
- nextFiber = null;
- } else nextFiber = fiber.child;
- if (null !== nextFiber) nextFiber.return = fiber;
- else
- for (nextFiber = fiber; null !== nextFiber; ) {
- if (nextFiber === workInProgress) {
- nextFiber = null;
- break;
- }
- fiber = nextFiber.sibling;
- if (null !== fiber) {
- fiber.return = nextFiber.return;
- nextFiber = fiber;
- break;
- }
- nextFiber = nextFiber.return;
- }
- fiber = nextFiber;
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
}
- }
- function propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- forcePropagateEntireTree
- ) {
- current = null;
- for (
- var parent = workInProgress, isInsidePropagationBailout = !1;
- null !== parent;
-
+ function reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
) {
- if (!isInsidePropagationBailout)
- if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
- else if (0 !== (parent.flags & 262144)) break;
- if (10 === parent.tag) {
- var currentParent = parent.alternate;
- if (null === currentParent)
- throw Error("Should have a current fiber. This is a bug in React.");
- currentParent = currentParent.memoizedProps;
- if (null !== currentParent) {
- var context = parent.type;
- objectIs(parent.pendingProps.value, currentParent.value) ||
- (null !== current
- ? current.push(context)
- : (current = [context]));
- }
- } else if (parent === hostTransitionProviderCursor.current) {
- currentParent = parent.alternate;
- if (null === currentParent)
- throw Error("Should have a current fiber. This is a bug in React.");
- currentParent.memoizedState.memoizedState !==
- parent.memoizedState.memoizedState &&
- (null !== current
- ? current.push(HostTransitionContext)
- : (current = [HostTransitionContext]));
- }
- parent = parent.return;
- }
- null !== current &&
- propagateContextChanges(
- workInProgress,
- current,
- renderLanes,
- forcePropagateEntireTree
- );
- workInProgress.flags |= 262144;
- }
- function checkIfContextChanged(currentDependencies) {
- for (
- currentDependencies = currentDependencies.firstContext;
- null !== currentDependencies;
+ "object" === typeof newChild &&
+ null !== newChild &&
+ newChild.type === REACT_FRAGMENT_TYPE &&
+ null === newChild.key &&
+ (validateFragmentProps(newChild, null, returnFiber),
+ (newChild = newChild.props.children));
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ var prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ a: {
+ for (var key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key) {
+ key = newChild.type;
+ if (key === REACT_FRAGMENT_TYPE) {
+ if (7 === currentFirstChild.tag) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ newChild.props.children
+ );
+ lanes.return = returnFiber;
+ lanes._debugOwner = newChild._owner;
+ lanes._debugInfo = currentDebugInfo;
+ validateFragmentProps(newChild, lanes, returnFiber);
+ returnFiber = lanes;
+ break a;
+ }
+ } else if (
+ currentFirstChild.elementType === key ||
+ isCompatibleFamilyForHotReloading(
+ currentFirstChild,
+ newChild
+ ) ||
+ ("object" === typeof key &&
+ null !== key &&
+ key.$$typeof === REACT_LAZY_TYPE &&
+ callLazyInitInDEV(key) === currentFirstChild.type)
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.props);
+ coerceRef(lanes, newChild);
+ lanes.return = returnFiber;
+ lanes._debugOwner = newChild._owner;
+ lanes._debugInfo = currentDebugInfo;
+ returnFiber = lanes;
+ break a;
+ }
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ } else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ newChild.type === REACT_FRAGMENT_TYPE
+ ? ((lanes = createFiberFromFragment(
+ newChild.props.children,
+ returnFiber.mode,
+ lanes,
+ newChild.key
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (lanes._debugInfo = currentDebugInfo),
+ validateFragmentProps(newChild, lanes, returnFiber),
+ (returnFiber = lanes))
+ : ((lanes = createFiberFromElement(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (lanes._debugInfo = currentDebugInfo),
+ (returnFiber = lanes));
+ }
+ returnFiber = placeSingleChild(returnFiber);
+ currentDebugInfo = prevDebugInfo;
+ return returnFiber;
+ case REACT_PORTAL_TYPE:
+ a: {
+ prevDebugInfo = newChild;
+ for (
+ newChild = prevDebugInfo.key;
+ null !== currentFirstChild;
- ) {
+ ) {
+ if (currentFirstChild.key === newChild)
+ if (
+ 4 === currentFirstChild.tag &&
+ currentFirstChild.stateNode.containerInfo ===
+ prevDebugInfo.containerInfo &&
+ currentFirstChild.stateNode.implementation ===
+ prevDebugInfo.implementation
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ prevDebugInfo.children || []
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ } else {
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ }
+ else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ lanes = createFiberFromPortal(
+ prevDebugInfo,
+ returnFiber.mode,
+ lanes
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_LAZY_TYPE:
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (newChild = callLazyInitInDEV(newChild)),
+ (returnFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ }
+ if (isArrayImpl(newChild))
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if (getIteratorFn(newChild)) {
+ prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ key = getIteratorFn(newChild);
+ if ("function" !== typeof key)
+ throw Error(
+ "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
+ );
+ var newChildren = key.call(newChild);
+ if (newChildren === newChild) {
+ if (
+ 0 !== returnFiber.tag ||
+ "[object GeneratorFunction]" !==
+ Object.prototype.toString.call(returnFiber.type) ||
+ "[object Generator]" !==
+ Object.prototype.toString.call(newChildren)
+ )
+ didWarnAboutGenerators ||
+ console.error(
+ "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
+ ),
+ (didWarnAboutGenerators = !0);
+ } else
+ newChild.entries !== key ||
+ didWarnAboutMaps ||
+ (console.error(
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
+ ),
+ (didWarnAboutMaps = !0));
+ returnFiber = reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ );
+ currentDebugInfo = prevDebugInfo;
+ return returnFiber;
+ }
+ if ("function" === typeof newChild[ASYNC_ITERATOR])
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
if (
- !objectIs(
- currentDependencies.context._currentValue,
- currentDependencies.memoizedValue
- )
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
)
- return !0;
- currentDependencies = currentDependencies.next;
- }
- return !1;
- }
- function prepareToReadContext(workInProgress) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- workInProgress = workInProgress.dependencies;
- null !== workInProgress && (workInProgress.firstContext = null);
- }
- function readContext(context) {
- isDisallowedContextReadInDEV &&
- console.error(
- "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
- );
- return readContextForConsumer(currentlyRenderingFiber, context);
- }
- function readContextDuringReconciliation(consumer, context) {
- null === currentlyRenderingFiber && prepareToReadContext(consumer);
- return readContextForConsumer(consumer, context);
- }
- function readContextForConsumer(consumer, context) {
- var value = context._currentValue;
- context = { context: context, memoizedValue: value, next: null };
- if (null === lastContextDependency) {
- if (null === consumer)
- throw Error(
- "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
+ return (
+ (prevDebugInfo = "" + newChild),
+ null !== currentFirstChild && 6 === currentFirstChild.tag
+ ? (deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ ),
+ (lanes = useFiber(currentFirstChild, prevDebugInfo)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : (deleteRemainingChildren(returnFiber, currentFirstChild),
+ (lanes = createFiberFromText(
+ prevDebugInfo,
+ returnFiber.mode,
+ lanes
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (lanes._debugInfo = currentDebugInfo),
+ (returnFiber = lanes)),
+ placeSingleChild(returnFiber)
);
- lastContextDependency = context;
- consumer.dependencies = {
- lanes: 0,
- firstContext: context,
- _debugThenableState: null
- };
- consumer.flags |= 524288;
- } else lastContextDependency = lastContextDependency.next = context;
- return value;
- }
- function initializeUpdateQueue(fiber) {
- fiber.updateQueue = {
- baseState: fiber.memoizedState,
- firstBaseUpdate: null,
- lastBaseUpdate: null,
- shared: { pending: null, lanes: 0, hiddenCallbacks: null },
- callbacks: null
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return deleteRemainingChildren(returnFiber, currentFirstChild);
+ }
+ return function (returnFiber, currentFirstChild, newChild, lanes) {
+ var prevDebugInfo = currentDebugInfo;
+ currentDebugInfo = null;
+ try {
+ thenableIndexCounter = 0;
+ var firstChildFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ thenableState = null;
+ return firstChildFiber;
+ } catch (x) {
+ if (x === SuspenseException || x === SuspenseActionException) throw x;
+ var fiber = createFiber(29, x, null, returnFiber.mode);
+ fiber.lanes = lanes;
+ fiber.return = returnFiber;
+ var debugInfo = (fiber._debugInfo = currentDebugInfo);
+ fiber._debugOwner = returnFiber._debugOwner;
+ fiber._debugTask = returnFiber._debugTask;
+ if (null != debugInfo)
+ for (var i = debugInfo.length - 1; 0 <= i; i--)
+ if ("string" === typeof debugInfo[i].stack) {
+ fiber._debugOwner = debugInfo[i];
+ fiber._debugTask = debugInfo[i].debugTask;
+ break;
+ }
+ return fiber;
+ } finally {
+ currentDebugInfo = prevDebugInfo;
+ }
};
}
- function cloneUpdateQueue(current, workInProgress) {
- current = current.updateQueue;
- workInProgress.updateQueue === current &&
- (workInProgress.updateQueue = {
- baseState: current.baseState,
- firstBaseUpdate: current.firstBaseUpdate,
- lastBaseUpdate: current.lastBaseUpdate,
- shared: current.shared,
- callbacks: null
- });
+ function pushPrimaryTreeSuspenseHandler(handler) {
+ var current = handler.alternate;
+ push(
+ suspenseStackCursor,
+ suspenseStackCursor.current & SubtreeSuspenseContextMask,
+ handler
+ );
+ push(suspenseHandlerStackCursor, handler, handler);
+ null === shellBoundary &&
+ (null === current || null !== currentTreeHiddenStackCursor.current
+ ? (shellBoundary = handler)
+ : null !== current.memoizedState && (shellBoundary = handler));
}
- function createUpdate(lane) {
- return {
- lane: lane,
- tag: UpdateState,
- payload: null,
- callback: null,
- next: null
- };
+ function pushOffscreenSuspenseHandler(fiber) {
+ if (22 === fiber.tag) {
+ if (
+ (push(suspenseStackCursor, suspenseStackCursor.current, fiber),
+ push(suspenseHandlerStackCursor, fiber, fiber),
+ null === shellBoundary)
+ ) {
+ var current = fiber.alternate;
+ null !== current &&
+ null !== current.memoizedState &&
+ (shellBoundary = fiber);
+ }
+ } else reuseSuspenseHandlerOnStack(fiber);
}
- function enqueueUpdate(fiber, update, lane) {
- var updateQueue = fiber.updateQueue;
- if (null === updateQueue) return null;
- updateQueue = updateQueue.shared;
- if (
- currentlyProcessingQueue === updateQueue &&
- !didWarnUpdateInsideUpdate
- ) {
- var componentName = getComponentNameFromFiber(fiber);
- console.error(
- "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s",
- componentName
- );
- didWarnUpdateInsideUpdate = !0;
- }
- if ((executionContext & RenderContext) !== NoContext)
- return (
- (componentName = updateQueue.pending),
- null === componentName
- ? (update.next = update)
- : ((update.next = componentName.next),
- (componentName.next = update)),
- (updateQueue.pending = update),
- (update = getRootForUpdatedFiber(fiber)),
- markUpdateLaneFromFiberToRoot(fiber, null, lane),
- update
- );
- enqueueUpdate$1(fiber, updateQueue, update, lane);
- return getRootForUpdatedFiber(fiber);
+ function reuseSuspenseHandlerOnStack(fiber) {
+ push(suspenseStackCursor, suspenseStackCursor.current, fiber);
+ push(
+ suspenseHandlerStackCursor,
+ suspenseHandlerStackCursor.current,
+ fiber
+ );
}
- function entangleTransitions(root, fiber, lane) {
- fiber = fiber.updateQueue;
- if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
- var queueLanes = fiber.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- fiber.lanes = lane;
- markRootEntangled(root, lane);
+ function popSuspenseHandler(fiber) {
+ pop(suspenseHandlerStackCursor, fiber);
+ shellBoundary === fiber && (shellBoundary = null);
+ pop(suspenseStackCursor, fiber);
+ }
+ function findFirstSuspended(row) {
+ for (var node = row; null !== node; ) {
+ if (13 === node.tag) {
+ var state = node.memoizedState;
+ if (
+ null !== state &&
+ ((state = state.dehydrated),
+ null === state ||
+ state.data === SUSPENSE_PENDING_START_DATA ||
+ isSuspenseInstanceFallback(state))
+ )
+ return node;
+ } else if (
+ 19 === node.tag &&
+ void 0 !== node.memoizedProps.revealOrder
+ ) {
+ if (0 !== (node.flags & 128)) return node;
+ } else if (null !== node.child) {
+ node.child.return = node;
+ node = node.child;
+ continue;
+ }
+ if (node === row) break;
+ for (; null === node.sibling; ) {
+ if (null === node.return || node.return === row) return null;
+ node = node.return;
+ }
+ node.sibling.return = node.return;
+ node = node.sibling;
}
+ return null;
}
- function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
- var queue = workInProgress.updateQueue,
- current = workInProgress.alternate;
+ function defaultOnUncaughtError(error) {
+ reportGlobalError(error);
+ console.warn(
+ "%s\n\n%s\n",
+ componentName
+ ? "An error occurred in the <" + componentName + "> component."
+ : "An error occurred in one of your React components.",
+ "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
+ );
+ }
+ function defaultOnCaughtError(error) {
+ var componentNameMessage = componentName
+ ? "The above error occurred in the <" + componentName + "> component."
+ : "The above error occurred in one of your React components.",
+ recreateMessage =
+ "React will try to recreate this component tree from scratch using the error boundary you provided, " +
+ ((errorBoundaryName || "Anonymous") + ".");
if (
- null !== current &&
- ((current = current.updateQueue), queue === current)
+ "object" === typeof error &&
+ null !== error &&
+ "string" === typeof error.environmentName
) {
- var newFirst = null,
- newLast = null;
- queue = queue.firstBaseUpdate;
- if (null !== queue) {
- do {
- var clone = {
- lane: queue.lane,
- tag: queue.tag,
- payload: queue.payload,
- callback: null,
- next: null
- };
- null === newLast
- ? (newFirst = newLast = clone)
- : (newLast = newLast.next = clone);
- queue = queue.next;
- } while (null !== queue);
- null === newLast
- ? (newFirst = newLast = capturedUpdate)
- : (newLast = newLast.next = capturedUpdate);
- } else newFirst = newLast = capturedUpdate;
- queue = {
- baseState: current.baseState,
- firstBaseUpdate: newFirst,
- lastBaseUpdate: newLast,
- shared: current.shared,
- callbacks: current.callbacks
- };
- workInProgress.updateQueue = queue;
- return;
+ var JSCompiler_inline_result = error.environmentName;
+ error = [
+ "%o\n\n%s\n\n%s\n",
+ error,
+ componentNameMessage,
+ recreateMessage
+ ].slice(0);
+ "string" === typeof error[0]
+ ? error.splice(
+ 0,
+ 1,
+ badgeFormat + error[0],
+ badgeStyle,
+ pad + JSCompiler_inline_result + pad,
+ resetStyle
+ )
+ : error.splice(
+ 0,
+ 0,
+ badgeFormat,
+ badgeStyle,
+ pad + JSCompiler_inline_result + pad,
+ resetStyle
+ );
+ error.unshift(console);
+ JSCompiler_inline_result = bind.apply(console.error, error);
+ JSCompiler_inline_result();
+ } else
+ console.error(
+ "%o\n\n%s\n\n%s\n",
+ error,
+ componentNameMessage,
+ recreateMessage
+ );
+ }
+ function defaultOnRecoverableError(error) {
+ reportGlobalError(error);
+ }
+ function logUncaughtError(root, errorInfo) {
+ try {
+ componentName = errorInfo.source
+ ? getComponentNameFromFiber(errorInfo.source)
+ : null;
+ errorBoundaryName = null;
+ var error = errorInfo.value;
+ if (null !== ReactSharedInternals.actQueue)
+ ReactSharedInternals.thrownErrors.push(error);
+ else {
+ var onUncaughtError = root.onUncaughtError;
+ onUncaughtError(error, { componentStack: errorInfo.stack });
+ }
+ } catch (e$4) {
+ setTimeout(function () {
+ throw e$4;
+ });
}
- workInProgress = queue.lastBaseUpdate;
- null === workInProgress
- ? (queue.firstBaseUpdate = capturedUpdate)
- : (workInProgress.next = capturedUpdate);
- queue.lastBaseUpdate = capturedUpdate;
}
- function suspendIfUpdateReadFromEntangledAsyncAction() {
- if (didReadFromEntangledAsyncAction) {
- var entangledActionThenable = currentEntangledActionThenable;
- if (null !== entangledActionThenable) throw entangledActionThenable;
+ function logCaughtError(root, boundary, errorInfo) {
+ try {
+ componentName = errorInfo.source
+ ? getComponentNameFromFiber(errorInfo.source)
+ : null;
+ errorBoundaryName = getComponentNameFromFiber(boundary);
+ var onCaughtError = root.onCaughtError;
+ onCaughtError(errorInfo.value, {
+ componentStack: errorInfo.stack,
+ errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
+ });
+ } catch (e$5) {
+ setTimeout(function () {
+ throw e$5;
+ });
}
}
- function processUpdateQueue(
- workInProgress,
- props,
- instance$jscomp$0,
- renderLanes
- ) {
- didReadFromEntangledAsyncAction = !1;
- var queue = workInProgress.updateQueue;
- hasForceUpdate = !1;
- currentlyProcessingQueue = queue.shared;
- var firstBaseUpdate = queue.firstBaseUpdate,
- lastBaseUpdate = queue.lastBaseUpdate,
- pendingQueue = queue.shared.pending;
- if (null !== pendingQueue) {
- queue.shared.pending = null;
- var lastPendingUpdate = pendingQueue,
- firstPendingUpdate = lastPendingUpdate.next;
- lastPendingUpdate.next = null;
- null === lastBaseUpdate
- ? (firstBaseUpdate = firstPendingUpdate)
- : (lastBaseUpdate.next = firstPendingUpdate);
- lastBaseUpdate = lastPendingUpdate;
- var current = workInProgress.alternate;
- null !== current &&
- ((current = current.updateQueue),
- (pendingQueue = current.lastBaseUpdate),
- pendingQueue !== lastBaseUpdate &&
- (null === pendingQueue
- ? (current.firstBaseUpdate = firstPendingUpdate)
- : (pendingQueue.next = firstPendingUpdate),
- (current.lastBaseUpdate = lastPendingUpdate)));
+ function createRootErrorUpdate(root, errorInfo, lane) {
+ lane = createUpdate(lane);
+ lane.tag = CaptureUpdate;
+ lane.payload = { element: null };
+ lane.callback = function () {
+ runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo);
+ };
+ return lane;
+ }
+ function createClassErrorUpdate(lane) {
+ lane = createUpdate(lane);
+ lane.tag = CaptureUpdate;
+ return lane;
+ }
+ function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
+ var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
+ if ("function" === typeof getDerivedStateFromError) {
+ var error = errorInfo.value;
+ update.payload = function () {
+ return getDerivedStateFromError(error);
+ };
+ update.callback = function () {
+ markFailedErrorBoundaryForHotReloading(fiber);
+ runWithFiberInDEV(
+ errorInfo.source,
+ logCaughtError,
+ root,
+ fiber,
+ errorInfo
+ );
+ };
}
- if (null !== firstBaseUpdate) {
- var newState = queue.baseState;
- lastBaseUpdate = 0;
- current = firstPendingUpdate = lastPendingUpdate = null;
- pendingQueue = firstBaseUpdate;
- do {
- var updateLane = pendingQueue.lane & -536870913,
- isHiddenUpdate = updateLane !== pendingQueue.lane;
- if (
- isHiddenUpdate
- ? (workInProgressRootRenderLanes & updateLane) === updateLane
- : (renderLanes & updateLane) === updateLane
- ) {
- 0 !== updateLane &&
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- null !== current &&
- (current = current.next =
- {
- lane: 0,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: null,
- next: null
- });
- a: {
- updateLane = workInProgress;
- var partialState = pendingQueue;
- var nextProps = props,
- instance = instance$jscomp$0;
- switch (partialState.tag) {
- case ReplaceState:
- partialState = partialState.payload;
- if ("function" === typeof partialState) {
- isDisallowedContextReadInDEV = !0;
- var nextState = partialState.call(
- instance,
- newState,
- nextProps
- );
- if (updateLane.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- partialState.call(instance, newState, nextProps);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- isDisallowedContextReadInDEV = !1;
- newState = nextState;
- break a;
- }
- newState = partialState;
- break a;
- case CaptureUpdate:
- updateLane.flags = (updateLane.flags & -65537) | 128;
- case UpdateState:
- nextState = partialState.payload;
- if ("function" === typeof nextState) {
- isDisallowedContextReadInDEV = !0;
- partialState = nextState.call(
- instance,
- newState,
- nextProps
- );
- if (updateLane.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- nextState.call(instance, newState, nextProps);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- isDisallowedContextReadInDEV = !1;
- } else partialState = nextState;
- if (null === partialState || void 0 === partialState) break a;
- newState = assign({}, newState, partialState);
- break a;
- case ForceUpdate:
- hasForceUpdate = !0;
- }
- }
- updateLane = pendingQueue.callback;
- null !== updateLane &&
- ((workInProgress.flags |= 64),
- isHiddenUpdate && (workInProgress.flags |= 8192),
- (isHiddenUpdate = queue.callbacks),
- null === isHiddenUpdate
- ? (queue.callbacks = [updateLane])
- : isHiddenUpdate.push(updateLane));
- } else
- (isHiddenUpdate = {
- lane: updateLane,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: pendingQueue.callback,
- next: null
- }),
- null === current
- ? ((firstPendingUpdate = current = isHiddenUpdate),
- (lastPendingUpdate = newState))
- : (current = current.next = isHiddenUpdate),
- (lastBaseUpdate |= updateLane);
- pendingQueue = pendingQueue.next;
- if (null === pendingQueue)
- if (((pendingQueue = queue.shared.pending), null === pendingQueue))
- break;
- else
- (isHiddenUpdate = pendingQueue),
- (pendingQueue = isHiddenUpdate.next),
- (isHiddenUpdate.next = null),
- (queue.lastBaseUpdate = isHiddenUpdate),
- (queue.shared.pending = null);
- } while (1);
- null === current && (lastPendingUpdate = newState);
- queue.baseState = lastPendingUpdate;
- queue.firstBaseUpdate = firstPendingUpdate;
- queue.lastBaseUpdate = current;
- null === firstBaseUpdate && (queue.shared.lanes = 0);
- workInProgressRootSkippedLanes |= lastBaseUpdate;
- workInProgress.lanes = lastBaseUpdate;
- workInProgress.memoizedState = newState;
+ var inst = fiber.stateNode;
+ null !== inst &&
+ "function" === typeof inst.componentDidCatch &&
+ (update.callback = function () {
+ markFailedErrorBoundaryForHotReloading(fiber);
+ runWithFiberInDEV(
+ errorInfo.source,
+ logCaughtError,
+ root,
+ fiber,
+ errorInfo
+ );
+ "function" !== typeof getDerivedStateFromError &&
+ (null === legacyErrorBoundariesThatAlreadyFailed
+ ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
+ : legacyErrorBoundariesThatAlreadyFailed.add(this));
+ callComponentDidCatchInDEV(this, errorInfo);
+ "function" === typeof getDerivedStateFromError ||
+ (0 === (fiber.lanes & 2) &&
+ console.error(
+ "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
+ getComponentNameFromFiber(fiber) || "Unknown"
+ ));
+ });
+ }
+ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
+ var currentSourceFiber = sourceFiber.alternate;
+ null !== currentSourceFiber &&
+ propagateParentContextChanges(
+ currentSourceFiber,
+ sourceFiber,
+ rootRenderLanes,
+ !0
+ );
+ }
+ function markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ) {
+ suspenseBoundary.flags |= 65536;
+ suspenseBoundary.lanes = rootRenderLanes;
+ return suspenseBoundary;
+ }
+ function throwException(
+ root,
+ returnFiber,
+ sourceFiber,
+ value,
+ rootRenderLanes
+ ) {
+ sourceFiber.flags |= 32768;
+ isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
+ if (
+ null !== value &&
+ "object" === typeof value &&
+ (value.$$typeof === REACT_POSTPONE_TYPE &&
+ (value = { then: function () {} }),
+ "function" === typeof value.then)
+ ) {
+ resetSuspendedComponent(sourceFiber, rootRenderLanes);
+ isHydrating && (didSuspendOrErrorDEV = !0);
+ var suspenseBoundary = suspenseHandlerStackCursor.current;
+ if (null !== suspenseBoundary) {
+ switch (suspenseBoundary.tag) {
+ case 13:
+ return (
+ null === shellBoundary
+ ? renderDidSuspendDelayIfPossible()
+ : null === suspenseBoundary.alternate &&
+ workInProgressRootExitStatus === RootInProgress &&
+ (workInProgressRootExitStatus = RootSuspended),
+ (suspenseBoundary.flags &= -257),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? (suspenseBoundary.updateQueue = new Set([value]))
+ : sourceFiber.add(value),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ case 22:
+ return (
+ (suspenseBoundary.flags |= 65536),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? ((sourceFiber = {
+ transitions: null,
+ markerInstances: null,
+ retryQueue: new Set([value])
+ }),
+ (suspenseBoundary.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 (" +
+ suspenseBoundary.tag +
+ "). This is a bug in React."
+ );
+ }
+ attachPingListener(root, value, rootRenderLanes);
+ renderDidSuspendDelayIfPossible();
+ return !1;
+ }
+ if (isHydrating)
+ return (
+ (didSuspendOrErrorDEV = !0),
+ (suspenseBoundary = suspenseHandlerStackCursor.current),
+ null !== suspenseBoundary
+ ? (0 === (suspenseBoundary.flags & 65536) &&
+ (suspenseBoundary.flags |= 256),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value !== HydrationMismatchException &&
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ ))
+ : (value !== HydrationMismatchException &&
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ ),
+ (root = root.current.alternate),
+ (root.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (root.lanes |= rootRenderLanes),
+ (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
+ (rootRenderLanes = createRootErrorUpdate(
+ root.stateNode,
+ sourceFiber,
+ rootRenderLanes
+ )),
+ enqueueCapturedUpdate(root, rootRenderLanes),
+ workInProgressRootExitStatus !== RootSuspendedWithDelay &&
+ (workInProgressRootExitStatus = RootErrored)),
+ !1
+ );
+ queueConcurrentError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ );
+ workInProgressRootExitStatus !== RootSuspendedWithDelay &&
+ (workInProgressRootExitStatus = RootErrored);
+ if (null === returnFiber) return !0;
+ sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
+ value = returnFiber;
+ do {
+ switch (value.tag) {
+ case 3:
+ return (
+ (value.flags |= 65536),
+ (root = rootRenderLanes & -rootRenderLanes),
+ (value.lanes |= root),
+ (root = createRootErrorUpdate(
+ value.stateNode,
+ sourceFiber,
+ root
+ )),
+ enqueueCapturedUpdate(value, root),
+ !1
+ );
+ case 1:
+ if (
+ ((returnFiber = value.type),
+ (suspenseBoundary = value.stateNode),
+ 0 === (value.flags & 128) &&
+ ("function" === typeof returnFiber.getDerivedStateFromError ||
+ (null !== suspenseBoundary &&
+ "function" === typeof suspenseBoundary.componentDidCatch &&
+ (null === legacyErrorBoundariesThatAlreadyFailed ||
+ !legacyErrorBoundariesThatAlreadyFailed.has(
+ suspenseBoundary
+ )))))
+ )
+ return (
+ (value.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (value.lanes |= rootRenderLanes),
+ (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
+ initializeClassErrorUpdate(
+ rootRenderLanes,
+ root,
+ value,
+ sourceFiber
+ ),
+ enqueueCapturedUpdate(value, rootRenderLanes),
+ !1
+ );
+ }
+ value = value.return;
+ } while (null !== value);
+ return !1;
+ }
+ function reconcileChildren(
+ current,
+ workInProgress,
+ nextChildren,
+ renderLanes
+ ) {
+ workInProgress.child =
+ null === current
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
+ : reconcileChildFibers(
+ workInProgress,
+ current.child,
+ nextChildren,
+ renderLanes
+ );
+ }
+ function updateForwardRef(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ Component = Component.render;
+ var ref = workInProgress.ref;
+ if ("ref" in nextProps) {
+ var propsWithoutRef = {};
+ for (var key in nextProps)
+ "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
+ } else propsWithoutRef = nextProps;
+ prepareToReadContext(workInProgress);
+ nextProps = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ propsWithoutRef,
+ ref,
+ renderLanes
+ );
+ key = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && key && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+ }
+ function updateMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (null === current) {
+ var type = Component.type;
+ if (
+ "function" === typeof type &&
+ !shouldConstruct(type) &&
+ void 0 === type.defaultProps &&
+ null === Component.compare
+ )
+ return (
+ (Component = resolveFunctionForHotReloading(type)),
+ (workInProgress.tag = 15),
+ (workInProgress.type = Component),
+ validateFunctionComponentInDev(workInProgress, type),
+ updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ )
+ );
+ current = createFiberFromTypeAndProps(
+ Component.type,
+ null,
+ nextProps,
+ workInProgress,
+ workInProgress.mode,
+ renderLanes
+ );
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ type = current.child;
+ if (!checkScheduledUpdateOrContext(current, renderLanes)) {
+ var prevProps = type.memoizedProps;
+ Component = Component.compare;
+ Component = null !== Component ? Component : shallowEqual;
+ if (
+ Component(prevProps, nextProps) &&
+ current.ref === workInProgress.ref
+ )
+ return bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ }
+ workInProgress.flags |= 1;
+ current = createWorkInProgress(type, nextProps);
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ function updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (null !== current) {
+ var prevProps = current.memoizedProps;
+ if (
+ shallowEqual(prevProps, nextProps) &&
+ current.ref === workInProgress.ref &&
+ workInProgress.type === current.type
+ )
+ if (
+ ((didReceiveUpdate = !1),
+ (workInProgress.pendingProps = nextProps = prevProps),
+ checkScheduledUpdateOrContext(current, renderLanes))
+ )
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
+ else
+ return (
+ (workInProgress.lanes = current.lanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ }
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ );
+ }
+ function updateOffscreenComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ nextChildren = nextProps.children,
+ nextIsDetached =
+ 0 !==
+ (workInProgress.stateNode._pendingVisibility & OffscreenDetached),
+ prevState = null !== current ? current.memoizedState : null;
+ markRef(current, workInProgress);
+ if ("hidden" === nextProps.mode || nextIsDetached) {
+ if (0 !== (workInProgress.flags & 128)) {
+ nextProps =
+ null !== prevState
+ ? prevState.baseLanes | renderLanes
+ : renderLanes;
+ if (null !== current) {
+ nextChildren = workInProgress.child = current.child;
+ for (nextIsDetached = 0; null !== nextChildren; )
+ (nextIsDetached =
+ nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
+ (nextChildren = nextChildren.sibling);
+ workInProgress.childLanes = nextIsDetached & ~nextProps;
+ } else (workInProgress.childLanes = 0), (workInProgress.child = null);
+ return deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ }
+ if (0 !== (renderLanes & 536870912))
+ (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
+ null !== current &&
+ pushTransition(
+ workInProgress,
+ null !== prevState ? prevState.cachePool : null
+ ),
+ null !== prevState
+ ? pushHiddenContext(workInProgress, prevState)
+ : reuseHiddenContextOnStack(workInProgress),
+ pushOffscreenSuspenseHandler(workInProgress);
+ else
+ return (
+ (workInProgress.lanes = workInProgress.childLanes = 536870912),
+ deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ null !== prevState
+ ? prevState.baseLanes | renderLanes
+ : renderLanes,
+ renderLanes
+ )
+ );
+ } else
+ null !== prevState
+ ? (pushTransition(workInProgress, prevState.cachePool),
+ pushHiddenContext(workInProgress, prevState),
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.memoizedState = null))
+ : (null !== current && pushTransition(workInProgress, null),
+ reuseHiddenContextOnStack(workInProgress),
+ reuseSuspenseHandlerOnStack(workInProgress));
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+ }
+ function deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ nextBaseLanes,
+ renderLanes
+ ) {
+ var JSCompiler_inline_result = peekCacheFromPool();
+ JSCompiler_inline_result =
+ null === JSCompiler_inline_result
+ ? null
+ : {
+ parent: CacheContext._currentValue,
+ pool: JSCompiler_inline_result
+ };
+ workInProgress.memoizedState = {
+ baseLanes: nextBaseLanes,
+ cachePool: JSCompiler_inline_result
+ };
+ null !== current && pushTransition(workInProgress, null);
+ reuseHiddenContextOnStack(workInProgress);
+ pushOffscreenSuspenseHandler(workInProgress);
+ null !== current &&
+ propagateParentContextChanges(current, workInProgress, renderLanes, !0);
+ return null;
+ }
+ function markRef(current, workInProgress) {
+ var ref = workInProgress.ref;
+ if (null === ref)
+ null !== current &&
+ null !== current.ref &&
+ (workInProgress.flags |= 2097664);
+ else {
+ if ("function" !== typeof ref && "object" !== typeof ref)
+ throw Error(
+ "Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
+ );
+ if (null === current || current.ref !== ref)
+ workInProgress.flags |= 2097664;
+ }
+ }
+ function updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (
+ Component.prototype &&
+ "function" === typeof Component.prototype.render
+ ) {
+ var componentName = getComponentNameFromType(Component) || "Unknown";
+ didWarnAboutBadClass[componentName] ||
+ (console.error(
+ "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
+ componentName,
+ componentName
+ ),
+ (didWarnAboutBadClass[componentName] = !0));
+ }
+ workInProgress.mode & StrictLegacyMode &&
+ ReactStrictModeWarnings.recordLegacyContextWarning(
+ workInProgress,
+ null
+ );
+ null === current &&
+ (validateFunctionComponentInDev(workInProgress, workInProgress.type),
+ Component.contextTypes &&
+ ((componentName = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutContextTypes[componentName] ||
+ ((didWarnAboutContextTypes[componentName] = !0),
+ console.error(
+ "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
+ componentName
+ ))));
+ prepareToReadContext(workInProgress);
+ Component = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ void 0,
+ renderLanes
+ );
+ nextProps = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, Component, renderLanes);
+ return workInProgress.child;
+ }
+ function replayFunctionComponent(
+ current,
+ workInProgress,
+ nextProps,
+ Component,
+ secondArg,
+ renderLanes
+ ) {
+ prepareToReadContext(workInProgress);
+ hookTypesUpdateIndexDev = -1;
+ ignorePreviousDependencies =
+ null !== current && current.type !== workInProgress.type;
+ workInProgress.updateQueue = null;
+ nextProps = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ nextProps,
+ secondArg
+ );
+ finishRenderingHooks(current, workInProgress);
+ Component = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && Component && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+ }
+ function updateClassComponent(
+ current$jscomp$0,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ switch (shouldErrorImpl(workInProgress)) {
+ case !1:
+ var _instance = workInProgress.stateNode,
+ state = new workInProgress.type(
+ workInProgress.memoizedProps,
+ _instance.context
+ ).state;
+ _instance.updater.enqueueSetState(_instance, state, null);
+ break;
+ case !0:
+ workInProgress.flags |= 128;
+ workInProgress.flags |= 65536;
+ _instance = Error("Simulated error coming from DevTools");
+ var lane = renderLanes & -renderLanes;
+ workInProgress.lanes |= lane;
+ state = workInProgressRoot;
+ if (null === state)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
+ );
+ lane = createClassErrorUpdate(lane);
+ initializeClassErrorUpdate(
+ lane,
+ state,
+ workInProgress,
+ createCapturedValueAtFiber(_instance, workInProgress)
+ );
+ enqueueCapturedUpdate(workInProgress, lane);
+ }
+ prepareToReadContext(workInProgress);
+ if (null === workInProgress.stateNode) {
+ state = emptyContextObject;
+ _instance = Component.contextType;
+ "contextType" in Component &&
+ null !== _instance &&
+ (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) &&
+ !didWarnAboutInvalidateContextType.has(Component) &&
+ (didWarnAboutInvalidateContextType.add(Component),
+ (lane =
+ void 0 === _instance
+ ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."
+ : "object" !== typeof _instance
+ ? " However, it is set to a " + typeof _instance + "."
+ : _instance.$$typeof === REACT_CONSUMER_TYPE
+ ? " Did you accidentally pass the Context.Consumer instead?"
+ : " However, it is set to an object with keys {" +
+ Object.keys(_instance).join(", ") +
+ "}."),
+ console.error(
+ "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
+ getComponentNameFromType(Component) || "Component",
+ lane
+ ));
+ "object" === typeof _instance &&
+ null !== _instance &&
+ (state = readContext(_instance));
+ _instance = new Component(nextProps, state);
+ if (workInProgress.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ _instance = new Component(nextProps, state);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ state = workInProgress.memoizedState =
+ null !== _instance.state && void 0 !== _instance.state
+ ? _instance.state
+ : null;
+ _instance.updater = classComponentUpdater;
+ workInProgress.stateNode = _instance;
+ _instance._reactInternals = workInProgress;
+ _instance._reactInternalInstance = fakeInternalInstance;
+ "function" === typeof Component.getDerivedStateFromProps &&
+ null === state &&
+ ((state = getComponentNameFromType(Component) || "Component"),
+ didWarnAboutUninitializedState.has(state) ||
+ (didWarnAboutUninitializedState.add(state),
+ console.error(
+ "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
+ state,
+ null === _instance.state ? "null" : "undefined",
+ state
+ )));
+ if (
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate
+ ) {
+ var foundWillUpdateName = (lane = state = null);
+ "function" === typeof _instance.componentWillMount &&
+ !0 !== _instance.componentWillMount.__suppressDeprecationWarning
+ ? (state = "componentWillMount")
+ : "function" === typeof _instance.UNSAFE_componentWillMount &&
+ (state = "UNSAFE_componentWillMount");
+ "function" === typeof _instance.componentWillReceiveProps &&
+ !0 !==
+ _instance.componentWillReceiveProps.__suppressDeprecationWarning
+ ? (lane = "componentWillReceiveProps")
+ : "function" ===
+ typeof _instance.UNSAFE_componentWillReceiveProps &&
+ (lane = "UNSAFE_componentWillReceiveProps");
+ "function" === typeof _instance.componentWillUpdate &&
+ !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning
+ ? (foundWillUpdateName = "componentWillUpdate")
+ : "function" === typeof _instance.UNSAFE_componentWillUpdate &&
+ (foundWillUpdateName = "UNSAFE_componentWillUpdate");
+ if (null !== state || null !== lane || null !== foundWillUpdateName) {
+ _instance = getComponentNameFromType(Component) || "Component";
+ var newApiName =
+ "function" === typeof Component.getDerivedStateFromProps
+ ? "getDerivedStateFromProps()"
+ : "getSnapshotBeforeUpdate()";
+ didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) ||
+ (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance),
+ console.error(
+ "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
+ _instance,
+ newApiName,
+ null !== state ? "\n " + state : "",
+ null !== lane ? "\n " + lane : "",
+ null !== foundWillUpdateName ? "\n " + foundWillUpdateName : ""
+ ));
+ }
+ }
+ _instance = workInProgress.stateNode;
+ state = getComponentNameFromType(Component) || "Component";
+ _instance.render ||
+ (Component.prototype &&
+ "function" === typeof Component.prototype.render
+ ? console.error(
+ "No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
+ state
+ )
+ : console.error(
+ "No `render` method found on the %s instance: you may have forgotten to define `render`.",
+ state
+ ));
+ !_instance.getInitialState ||
+ _instance.getInitialState.isReactClassApproved ||
+ _instance.state ||
+ console.error(
+ "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
+ state
+ );
+ _instance.getDefaultProps &&
+ !_instance.getDefaultProps.isReactClassApproved &&
+ console.error(
+ "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
+ state
+ );
+ _instance.contextType &&
+ console.error(
+ "contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
+ state
+ );
+ Component.childContextTypes &&
+ !didWarnAboutChildContextTypes.has(Component) &&
+ (didWarnAboutChildContextTypes.add(Component),
+ console.error(
+ "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
+ state
+ ));
+ Component.contextTypes &&
+ !didWarnAboutContextTypes$1.has(Component) &&
+ (didWarnAboutContextTypes$1.add(Component),
+ console.error(
+ "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
+ state
+ ));
+ "function" === typeof _instance.componentShouldUpdate &&
+ console.error(
+ "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
+ state
+ );
+ Component.prototype &&
+ Component.prototype.isPureReactComponent &&
+ "undefined" !== typeof _instance.shouldComponentUpdate &&
+ console.error(
+ "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
+ getComponentNameFromType(Component) || "A pure component"
+ );
+ "function" === typeof _instance.componentDidUnmount &&
+ console.error(
+ "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
+ state
+ );
+ "function" === typeof _instance.componentDidReceiveProps &&
+ console.error(
+ "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
+ state
+ );
+ "function" === typeof _instance.componentWillRecieveProps &&
+ console.error(
+ "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
+ state
+ );
+ "function" === typeof _instance.UNSAFE_componentWillRecieveProps &&
+ console.error(
+ "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
+ state
+ );
+ lane = _instance.props !== nextProps;
+ void 0 !== _instance.props &&
+ lane &&
+ console.error(
+ "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
+ state
+ );
+ _instance.defaultProps &&
+ console.error(
+ "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
+ state,
+ state
+ );
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ "function" === typeof _instance.componentDidUpdate ||
+ didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) ||
+ (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component),
+ console.error(
+ "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
+ getComponentNameFromType(Component)
+ ));
+ "function" === typeof _instance.getDerivedStateFromProps &&
+ console.error(
+ "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
+ state
+ );
+ "function" === typeof _instance.getDerivedStateFromError &&
+ console.error(
+ "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
+ state
+ );
+ "function" === typeof Component.getSnapshotBeforeUpdate &&
+ console.error(
+ "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
+ state
+ );
+ (lane = _instance.state) &&
+ ("object" !== typeof lane || isArrayImpl(lane)) &&
+ console.error("%s.state: must be set to an object or null", state);
+ "function" === typeof _instance.getChildContext &&
+ "object" !== typeof Component.childContextTypes &&
+ console.error(
+ "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
+ state
+ );
+ _instance = workInProgress.stateNode;
+ _instance.props = nextProps;
+ _instance.state = workInProgress.memoizedState;
+ _instance.refs = {};
+ initializeUpdateQueue(workInProgress);
+ state = Component.contextType;
+ _instance.context =
+ "object" === typeof state && null !== state
+ ? readContext(state)
+ : emptyContextObject;
+ _instance.state === nextProps &&
+ ((state = getComponentNameFromType(Component) || "Component"),
+ didWarnAboutDirectlyAssigningPropsToState.has(state) ||
+ (didWarnAboutDirectlyAssigningPropsToState.add(state),
+ console.error(
+ "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
+ state
+ )));
+ workInProgress.mode & StrictLegacyMode &&
+ ReactStrictModeWarnings.recordLegacyContextWarning(
+ workInProgress,
+ _instance
+ );
+ ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
+ workInProgress,
+ _instance
+ );
+ _instance.state = workInProgress.memoizedState;
+ state = Component.getDerivedStateFromProps;
+ "function" === typeof state &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ state,
+ nextProps
+ ),
+ (_instance.state = workInProgress.memoizedState));
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate ||
+ ("function" !== typeof _instance.UNSAFE_componentWillMount &&
+ "function" !== typeof _instance.componentWillMount) ||
+ ((state = _instance.state),
+ "function" === typeof _instance.componentWillMount &&
+ _instance.componentWillMount(),
+ "function" === typeof _instance.UNSAFE_componentWillMount &&
+ _instance.UNSAFE_componentWillMount(),
+ state !== _instance.state &&
+ (console.error(
+ "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
+ getComponentNameFromFiber(workInProgress) || "Component"
+ ),
+ classComponentUpdater.enqueueReplaceState(
+ _instance,
+ _instance.state,
+ null
+ )),
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction(),
+ (_instance.state = workInProgress.memoizedState));
+ "function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308);
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864);
+ _instance = !0;
+ } else if (null === current$jscomp$0) {
+ _instance = workInProgress.stateNode;
+ var unresolvedOldProps = workInProgress.memoizedProps;
+ lane = resolveClassComponentProps(Component, unresolvedOldProps);
+ _instance.props = lane;
+ var oldContext = _instance.context;
+ foundWillUpdateName = Component.contextType;
+ state = emptyContextObject;
+ "object" === typeof foundWillUpdateName &&
+ null !== foundWillUpdateName &&
+ (state = readContext(foundWillUpdateName));
+ newApiName = Component.getDerivedStateFromProps;
+ foundWillUpdateName =
+ "function" === typeof newApiName ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate;
+ unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
+ foundWillUpdateName ||
+ ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof _instance.componentWillReceiveProps) ||
+ ((unresolvedOldProps || oldContext !== state) &&
+ callComponentWillReceiveProps(
+ workInProgress,
+ _instance,
+ nextProps,
+ state
+ ));
+ hasForceUpdate = !1;
+ var oldState = workInProgress.memoizedState;
+ _instance.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ oldContext = workInProgress.memoizedState;
+ unresolvedOldProps || oldState !== oldContext || hasForceUpdate
+ ? ("function" === typeof newApiName &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ newApiName,
+ nextProps
+ ),
+ (oldContext = workInProgress.memoizedState)),
+ (lane =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ lane,
+ nextProps,
+ oldState,
+ oldContext,
+ state
+ ))
+ ? (foundWillUpdateName ||
+ ("function" !== typeof _instance.UNSAFE_componentWillMount &&
+ "function" !== typeof _instance.componentWillMount) ||
+ ("function" === typeof _instance.componentWillMount &&
+ _instance.componentWillMount(),
+ "function" === typeof _instance.UNSAFE_componentWillMount &&
+ _instance.UNSAFE_componentWillMount()),
+ "function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864))
+ : ("function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = oldContext)),
+ (_instance.props = nextProps),
+ (_instance.state = oldContext),
+ (_instance.context = state),
+ (_instance = lane))
+ : ("function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864),
+ (_instance = !1));
+ } else {
+ _instance = workInProgress.stateNode;
+ cloneUpdateQueue(current$jscomp$0, workInProgress);
+ state = workInProgress.memoizedProps;
+ foundWillUpdateName = resolveClassComponentProps(Component, state);
+ _instance.props = foundWillUpdateName;
+ newApiName = workInProgress.pendingProps;
+ oldState = _instance.context;
+ oldContext = Component.contextType;
+ lane = emptyContextObject;
+ "object" === typeof oldContext &&
+ null !== oldContext &&
+ (lane = readContext(oldContext));
+ unresolvedOldProps = Component.getDerivedStateFromProps;
+ (oldContext =
+ "function" === typeof unresolvedOldProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate) ||
+ ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof _instance.componentWillReceiveProps) ||
+ ((state !== newApiName || oldState !== lane) &&
+ callComponentWillReceiveProps(
+ workInProgress,
+ _instance,
+ nextProps,
+ lane
+ ));
+ hasForceUpdate = !1;
+ oldState = workInProgress.memoizedState;
+ _instance.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ var newState = workInProgress.memoizedState;
+ state !== newApiName ||
+ oldState !== newState ||
+ hasForceUpdate ||
+ (null !== current$jscomp$0 &&
+ null !== current$jscomp$0.dependencies &&
+ checkIfContextChanged(current$jscomp$0.dependencies))
+ ? ("function" === typeof unresolvedOldProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ unresolvedOldProps,
+ nextProps
+ ),
+ (newState = workInProgress.memoizedState)),
+ (foundWillUpdateName =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ foundWillUpdateName,
+ nextProps,
+ oldState,
+ newState,
+ lane
+ ) ||
+ (null !== current$jscomp$0 &&
+ null !== current$jscomp$0.dependencies &&
+ checkIfContextChanged(current$jscomp$0.dependencies)))
+ ? (oldContext ||
+ ("function" !== typeof _instance.UNSAFE_componentWillUpdate &&
+ "function" !== typeof _instance.componentWillUpdate) ||
+ ("function" === typeof _instance.componentWillUpdate &&
+ _instance.componentWillUpdate(nextProps, newState, lane),
+ "function" === typeof _instance.UNSAFE_componentWillUpdate &&
+ _instance.UNSAFE_componentWillUpdate(
+ nextProps,
+ newState,
+ lane
+ )),
+ "function" === typeof _instance.componentDidUpdate &&
+ (workInProgress.flags |= 4),
+ "function" === typeof _instance.getSnapshotBeforeUpdate &&
+ (workInProgress.flags |= 1024))
+ : ("function" !== typeof _instance.componentDidUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = newState)),
+ (_instance.props = nextProps),
+ (_instance.state = newState),
+ (_instance.context = lane),
+ (_instance = foundWillUpdateName))
+ : ("function" !== typeof _instance.componentDidUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (_instance = !1));
+ }
+ lane = _instance;
+ markRef(current$jscomp$0, workInProgress);
+ state = 0 !== (workInProgress.flags & 128);
+ if (lane || state) {
+ lane = workInProgress.stateNode;
+ ReactSharedInternals.getCurrentStack =
+ null === workInProgress ? null : getCurrentFiberStackInDev;
+ isRendering = !1;
+ current = workInProgress;
+ if (state && "function" !== typeof Component.getDerivedStateFromError)
+ (Component = null), (profilerStartTime = -1);
+ else if (
+ ((Component = callRenderInDEV(lane)),
+ workInProgress.mode & StrictLegacyMode)
+ ) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ callRenderInDEV(lane);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ workInProgress.flags |= 1;
+ null !== current$jscomp$0 && state
+ ? ((workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ current$jscomp$0.child,
+ null,
+ renderLanes
+ )),
+ (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ Component,
+ renderLanes
+ )))
+ : reconcileChildren(
+ current$jscomp$0,
+ workInProgress,
+ Component,
+ renderLanes
+ );
+ workInProgress.memoizedState = lane.state;
+ current$jscomp$0 = workInProgress.child;
+ } else
+ current$jscomp$0 = bailoutOnAlreadyFinishedWork(
+ current$jscomp$0,
+ workInProgress,
+ renderLanes
+ );
+ renderLanes = workInProgress.stateNode;
+ _instance &&
+ renderLanes.props !== nextProps &&
+ (didWarnAboutReassigningProps ||
+ console.error(
+ "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
+ getComponentNameFromFiber(workInProgress) || "a component"
+ ),
+ (didWarnAboutReassigningProps = !0));
+ return current$jscomp$0;
+ }
+ function mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextChildren,
+ renderLanes
+ ) {
+ resetHydrationState();
+ workInProgress.flags |= 256;
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+ }
+ function validateFunctionComponentInDev(workInProgress, Component) {
+ Component &&
+ Component.childContextTypes &&
+ console.error(
+ "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...",
+ Component.displayName || Component.name || "Component"
+ );
+ "function" === typeof Component.getDerivedStateFromProps &&
+ ((workInProgress = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] ||
+ (console.error(
+ "%s: Function components do not support getDerivedStateFromProps.",
+ workInProgress
+ ),
+ (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] =
+ !0)));
+ "object" === typeof Component.contextType &&
+ null !== Component.contextType &&
+ ((Component = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutContextTypeOnFunctionComponent[Component] ||
+ (console.error(
+ "%s: Function components do not support contextType.",
+ Component
+ ),
+ (didWarnAboutContextTypeOnFunctionComponent[Component] = !0)));
+ }
+ function mountSuspenseOffscreenState(renderLanes) {
+ return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
+ }
+ function getRemainingWorkInPrimaryTree(
+ current,
+ primaryTreeDidDefer,
+ renderLanes
+ ) {
+ current = null !== current ? current.childLanes & ~renderLanes : 0;
+ primaryTreeDidDefer && (current |= workInProgressDeferredLane);
+ return current;
+ }
+ function updateSuspenseComponent(current, workInProgress, renderLanes) {
+ var JSCompiler_object_inline_componentStack_2333;
+ var JSCompiler_object_inline_stack_2332 = workInProgress.pendingProps;
+ shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128);
+ var JSCompiler_object_inline_message_2330 = !1;
+ var didSuspend = 0 !== (workInProgress.flags & 128);
+ (JSCompiler_object_inline_componentStack_2333 = didSuspend) ||
+ (JSCompiler_object_inline_componentStack_2333 =
+ null !== current && null === current.memoizedState
+ ? !1
+ : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback));
+ JSCompiler_object_inline_componentStack_2333 &&
+ ((JSCompiler_object_inline_message_2330 = !0),
+ (workInProgress.flags &= -129));
+ JSCompiler_object_inline_componentStack_2333 =
+ 0 !== (workInProgress.flags & 32);
+ workInProgress.flags &= -33;
+ if (null === current) {
+ if (isHydrating) {
+ JSCompiler_object_inline_message_2330
+ ? pushPrimaryTreeSuspenseHandler(workInProgress)
+ : reuseSuspenseHandlerOnStack(workInProgress);
+ if (isHydrating) {
+ var JSCompiler_object_inline_digest_2331 = nextHydratableInstance;
+ var JSCompiler_temp;
+ if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2331)) {
+ c: {
+ var instance = JSCompiler_object_inline_digest_2331;
+ for (
+ JSCompiler_temp = rootOrSingletonContext;
+ 8 !== instance.nodeType;
+
+ ) {
+ if (!JSCompiler_temp) {
+ JSCompiler_temp = null;
+ break c;
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) {
+ JSCompiler_temp = null;
+ break c;
+ }
+ }
+ JSCompiler_temp = instance;
+ }
+ null !== JSCompiler_temp
+ ? (warnIfNotHydrating(),
+ (workInProgress.memoizedState = {
+ dehydrated: JSCompiler_temp,
+ treeContext:
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null,
+ retryLane: 536870912,
+ hydrationErrors: null
+ }),
+ (instance = createFiber(18, null, null, NoMode)),
+ (instance.stateNode = JSCompiler_temp),
+ (instance.return = workInProgress),
+ (workInProgress.child = instance),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (JSCompiler_temp = !0))
+ : (JSCompiler_temp = !1);
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp &&
+ (warnNonHydratedInstance(
+ workInProgress,
+ JSCompiler_object_inline_digest_2331
+ ),
+ throwOnHydrationMismatch(workInProgress));
+ }
+ JSCompiler_object_inline_digest_2331 = workInProgress.memoizedState;
+ if (
+ null !== JSCompiler_object_inline_digest_2331 &&
+ ((JSCompiler_object_inline_digest_2331 =
+ JSCompiler_object_inline_digest_2331.dehydrated),
+ null !== JSCompiler_object_inline_digest_2331)
+ )
+ return (
+ isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2331)
+ ? (workInProgress.lanes = 32)
+ : (workInProgress.lanes = 536870912),
+ null
+ );
+ popSuspenseHandler(workInProgress);
+ }
+ JSCompiler_object_inline_digest_2331 =
+ JSCompiler_object_inline_stack_2332.children;
+ JSCompiler_temp = JSCompiler_object_inline_stack_2332.fallback;
+ if (JSCompiler_object_inline_message_2330)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_stack_2332 =
+ mountSuspenseFallbackChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2331,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (JSCompiler_object_inline_message_2330 = workInProgress.child),
+ (JSCompiler_object_inline_message_2330.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_message_2330.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2333,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ JSCompiler_object_inline_stack_2332
+ );
+ if (
+ "number" ===
+ typeof JSCompiler_object_inline_stack_2332.unstable_expectedLoadTime
+ )
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_stack_2332 =
+ mountSuspenseFallbackChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2331,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (JSCompiler_object_inline_message_2330 = workInProgress.child),
+ (JSCompiler_object_inline_message_2330.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_message_2330.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2333,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress.lanes = 4194304),
+ JSCompiler_object_inline_stack_2332
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ return mountSuspensePrimaryChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2331
+ );
+ }
+ var prevState = current.memoizedState;
+ if (
+ null !== prevState &&
+ ((JSCompiler_object_inline_digest_2331 = prevState.dehydrated),
+ null !== JSCompiler_object_inline_digest_2331)
+ ) {
+ if (didSuspend)
+ workInProgress.flags & 256
+ ? (pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags &= -257),
+ (workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ )))
+ : null !== workInProgress.memoizedState
+ ? (reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.child = current.child),
+ (workInProgress.flags |= 128),
+ (workInProgress = null))
+ : (reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_message_2330 =
+ JSCompiler_object_inline_stack_2332.fallback),
+ (JSCompiler_object_inline_digest_2331 = workInProgress.mode),
+ (JSCompiler_object_inline_stack_2332 =
+ mountWorkInProgressOffscreenFiber(
+ {
+ mode: "visible",
+ children: JSCompiler_object_inline_stack_2332.children
+ },
+ JSCompiler_object_inline_digest_2331
+ )),
+ (JSCompiler_object_inline_message_2330 =
+ createFiberFromFragment(
+ JSCompiler_object_inline_message_2330,
+ JSCompiler_object_inline_digest_2331,
+ renderLanes,
+ null
+ )),
+ (JSCompiler_object_inline_message_2330.flags |= 2),
+ (JSCompiler_object_inline_stack_2332.return = workInProgress),
+ (JSCompiler_object_inline_message_2330.return = workInProgress),
+ (JSCompiler_object_inline_stack_2332.sibling =
+ JSCompiler_object_inline_message_2330),
+ (workInProgress.child = JSCompiler_object_inline_stack_2332),
+ reconcileChildFibers(
+ workInProgress,
+ current.child,
+ null,
+ renderLanes
+ ),
+ (JSCompiler_object_inline_stack_2332 = workInProgress.child),
+ (JSCompiler_object_inline_stack_2332.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_stack_2332.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2333,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress = JSCompiler_object_inline_message_2330));
+ else if (
+ (pushPrimaryTreeSuspenseHandler(workInProgress),
+ isHydrating &&
+ console.error(
+ "We should not be hydrating here. This is a bug in React. Please file a bug."
+ ),
+ isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2331))
+ ) {
+ JSCompiler_object_inline_componentStack_2333 =
+ JSCompiler_object_inline_digest_2331.nextSibling &&
+ JSCompiler_object_inline_digest_2331.nextSibling.dataset;
+ if (JSCompiler_object_inline_componentStack_2333) {
+ JSCompiler_temp = JSCompiler_object_inline_componentStack_2333.dgst;
+ var message = JSCompiler_object_inline_componentStack_2333.msg;
+ instance = JSCompiler_object_inline_componentStack_2333.stck;
+ var componentStack =
+ JSCompiler_object_inline_componentStack_2333.cstck;
+ }
+ JSCompiler_object_inline_message_2330 = message;
+ JSCompiler_object_inline_digest_2331 = JSCompiler_temp;
+ JSCompiler_object_inline_stack_2332 = instance;
+ JSCompiler_temp = JSCompiler_object_inline_componentStack_2333 =
+ componentStack;
+ "POSTPONE" !== JSCompiler_object_inline_digest_2331 &&
+ ((JSCompiler_object_inline_componentStack_2333 =
+ JSCompiler_object_inline_message_2330
+ ? Error(JSCompiler_object_inline_message_2330)
+ : Error(
+ "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
+ )),
+ (JSCompiler_object_inline_componentStack_2333.stack =
+ JSCompiler_object_inline_stack_2332 || ""),
+ (JSCompiler_object_inline_componentStack_2333.digest =
+ JSCompiler_object_inline_digest_2331),
+ (JSCompiler_object_inline_stack_2332 =
+ void 0 === JSCompiler_temp ? null : JSCompiler_temp),
+ (JSCompiler_object_inline_message_2330 = {
+ value: JSCompiler_object_inline_componentStack_2333,
+ source: null,
+ stack: JSCompiler_object_inline_stack_2332
+ }),
+ "string" === typeof JSCompiler_object_inline_stack_2332 &&
+ CapturedStacks.set(
+ JSCompiler_object_inline_componentStack_2333,
+ JSCompiler_object_inline_message_2330
+ ),
+ queueHydrationError(JSCompiler_object_inline_message_2330));
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else if (
+ (didReceiveUpdate ||
+ propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (JSCompiler_object_inline_componentStack_2333 =
+ 0 !== (renderLanes & current.childLanes)),
+ didReceiveUpdate || JSCompiler_object_inline_componentStack_2333)
+ ) {
+ JSCompiler_object_inline_componentStack_2333 = workInProgressRoot;
+ if (
+ null !== JSCompiler_object_inline_componentStack_2333 &&
+ ((JSCompiler_object_inline_stack_2332 = renderLanes & -renderLanes),
+ (JSCompiler_object_inline_stack_2332 =
+ 0 !== (JSCompiler_object_inline_stack_2332 & 42)
+ ? 1
+ : getBumpedLaneForHydrationByLane(
+ JSCompiler_object_inline_stack_2332
+ )),
+ (JSCompiler_object_inline_stack_2332 =
+ 0 !==
+ (JSCompiler_object_inline_stack_2332 &
+ (JSCompiler_object_inline_componentStack_2333.suspendedLanes |
+ renderLanes))
+ ? 0
+ : JSCompiler_object_inline_stack_2332),
+ 0 !== JSCompiler_object_inline_stack_2332 &&
+ JSCompiler_object_inline_stack_2332 !== prevState.retryLane)
+ )
+ throw (
+ ((prevState.retryLane = JSCompiler_object_inline_stack_2332),
+ enqueueConcurrentRenderForLane(
+ current,
+ JSCompiler_object_inline_stack_2332
+ ),
+ scheduleUpdateOnFiber(
+ JSCompiler_object_inline_componentStack_2333,
+ current,
+ JSCompiler_object_inline_stack_2332
+ ),
+ SelectiveHydrationException)
+ );
+ JSCompiler_object_inline_digest_2331.data ===
+ SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible();
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else
+ JSCompiler_object_inline_digest_2331.data ===
+ SUSPENSE_PENDING_START_DATA
+ ? ((workInProgress.flags |= 192),
+ (workInProgress.child = current.child),
+ (workInProgress = null))
+ : ((current = prevState.treeContext),
+ (nextHydratableInstance = getNextHydratable(
+ JSCompiler_object_inline_digest_2331.nextSibling
+ )),
+ (hydrationParentFiber = workInProgress),
+ (isHydrating = !0),
+ (hydrationErrors = null),
+ (didSuspendOrErrorDEV = !1),
+ (hydrationDiffRootDEV = null),
+ (rootOrSingletonContext = !1),
+ null !== current &&
+ (warnIfNotHydrating(),
+ (idStack[idStackIndex++] = treeContextId),
+ (idStack[idStackIndex++] = treeContextOverflow),
+ (idStack[idStackIndex++] = treeContextProvider),
+ (treeContextId = current.id),
+ (treeContextOverflow = current.overflow),
+ (treeContextProvider = workInProgress)),
+ (workInProgress = mountSuspensePrimaryChildren(
+ workInProgress,
+ JSCompiler_object_inline_stack_2332.children
+ )),
+ (workInProgress.flags |= 4096));
+ return workInProgress;
+ }
+ if (JSCompiler_object_inline_message_2330)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_message_2330 =
+ JSCompiler_object_inline_stack_2332.fallback),
+ (JSCompiler_object_inline_digest_2331 = workInProgress.mode),
+ (JSCompiler_temp = current.child),
+ (instance = JSCompiler_temp.sibling),
+ (JSCompiler_object_inline_stack_2332 = createWorkInProgress(
+ JSCompiler_temp,
+ {
+ mode: "hidden",
+ children: JSCompiler_object_inline_stack_2332.children
+ }
+ )),
+ (JSCompiler_object_inline_stack_2332.subtreeFlags =
+ JSCompiler_temp.subtreeFlags & 31457280),
+ null !== instance
+ ? (JSCompiler_object_inline_message_2330 = createWorkInProgress(
+ instance,
+ JSCompiler_object_inline_message_2330
+ ))
+ : ((JSCompiler_object_inline_message_2330 = createFiberFromFragment(
+ JSCompiler_object_inline_message_2330,
+ JSCompiler_object_inline_digest_2331,
+ renderLanes,
+ null
+ )),
+ (JSCompiler_object_inline_message_2330.flags |= 2)),
+ (JSCompiler_object_inline_message_2330.return = workInProgress),
+ (JSCompiler_object_inline_stack_2332.return = workInProgress),
+ (JSCompiler_object_inline_stack_2332.sibling =
+ JSCompiler_object_inline_message_2330),
+ (workInProgress.child = JSCompiler_object_inline_stack_2332),
+ (JSCompiler_object_inline_stack_2332 =
+ JSCompiler_object_inline_message_2330),
+ (JSCompiler_object_inline_message_2330 = workInProgress.child),
+ (JSCompiler_object_inline_digest_2331 = current.child.memoizedState),
+ null === JSCompiler_object_inline_digest_2331
+ ? (JSCompiler_object_inline_digest_2331 =
+ mountSuspenseOffscreenState(renderLanes))
+ : ((JSCompiler_temp =
+ JSCompiler_object_inline_digest_2331.cachePool),
+ null !== JSCompiler_temp
+ ? ((instance = CacheContext._currentValue),
+ (JSCompiler_temp =
+ JSCompiler_temp.parent !== instance
+ ? { parent: instance, pool: instance }
+ : JSCompiler_temp))
+ : (JSCompiler_temp = getSuspendedCache()),
+ (JSCompiler_object_inline_digest_2331 = {
+ baseLanes:
+ JSCompiler_object_inline_digest_2331.baseLanes | renderLanes,
+ cachePool: JSCompiler_temp
+ })),
+ (JSCompiler_object_inline_message_2330.memoizedState =
+ JSCompiler_object_inline_digest_2331),
+ (JSCompiler_object_inline_message_2330.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2333,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ JSCompiler_object_inline_stack_2332
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ renderLanes = current.child;
+ current = renderLanes.sibling;
+ renderLanes = createWorkInProgress(renderLanes, {
+ mode: "visible",
+ children: JSCompiler_object_inline_stack_2332.children
+ });
+ renderLanes.return = workInProgress;
+ renderLanes.sibling = null;
+ null !== current &&
+ ((JSCompiler_object_inline_componentStack_2333 =
+ workInProgress.deletions),
+ null === JSCompiler_object_inline_componentStack_2333
+ ? ((workInProgress.deletions = [current]),
+ (workInProgress.flags |= 16))
+ : JSCompiler_object_inline_componentStack_2333.push(current));
+ workInProgress.child = renderLanes;
+ workInProgress.memoizedState = null;
+ return renderLanes;
+ }
+ function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: primaryChildren },
+ workInProgress.mode
+ );
+ primaryChildren.return = workInProgress;
+ return (workInProgress.child = primaryChildren);
+ }
+ function mountSuspenseFallbackChildren(
+ workInProgress,
+ primaryChildren,
+ fallbackChildren,
+ renderLanes
+ ) {
+ var mode = workInProgress.mode;
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "hidden", children: primaryChildren },
+ mode
+ );
+ fallbackChildren = createFiberFromFragment(
+ fallbackChildren,
+ mode,
+ renderLanes,
+ null
+ );
+ primaryChildren.return = workInProgress;
+ fallbackChildren.return = workInProgress;
+ primaryChildren.sibling = fallbackChildren;
+ workInProgress.child = primaryChildren;
+ return fallbackChildren;
+ }
+ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
+ return createFiberFromOffscreen(offscreenProps, mode, 0, null);
+ }
+ function retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
+ current = mountSuspensePrimaryChildren(
+ workInProgress,
+ workInProgress.pendingProps.children
+ );
+ current.flags |= 2;
+ workInProgress.memoizedState = null;
+ return current;
+ }
+ function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
+ fiber.lanes |= renderLanes;
+ var alternate = fiber.alternate;
+ null !== alternate && (alternate.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ fiber.return,
+ renderLanes,
+ propagationRoot
+ );
+ }
+ function validateSuspenseListNestedChild(childSlot, index) {
+ var isAnArray = isArrayImpl(childSlot);
+ childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot);
+ return isAnArray || childSlot
+ ? ((isAnArray = isAnArray ? "array" : "iterable"),
+ console.error(
+ "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ",
+ isAnArray,
+ index,
+ isAnArray
+ ),
+ !1)
+ : !0;
+ }
+ function initSuspenseListRenderState(
+ workInProgress,
+ isBackwards,
+ tail,
+ lastContentRow,
+ tailMode
+ ) {
+ var renderState = workInProgress.memoizedState;
+ null === renderState
+ ? (workInProgress.memoizedState = {
+ isBackwards: isBackwards,
+ rendering: null,
+ renderingStartTime: 0,
+ last: lastContentRow,
+ tail: tail,
+ tailMode: tailMode
+ })
+ : ((renderState.isBackwards = isBackwards),
+ (renderState.rendering = null),
+ (renderState.renderingStartTime = 0),
+ (renderState.last = lastContentRow),
+ (renderState.tail = tail),
+ (renderState.tailMode = tailMode));
+ }
+ function updateSuspenseListComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ revealOrder = nextProps.revealOrder,
+ tailMode = nextProps.tail;
+ nextProps = nextProps.children;
+ if (
+ void 0 !== revealOrder &&
+ "forwards" !== revealOrder &&
+ "backwards" !== revealOrder &&
+ "together" !== revealOrder &&
+ !didWarnAboutRevealOrder[revealOrder]
+ )
+ if (
+ ((didWarnAboutRevealOrder[revealOrder] = !0),
+ "string" === typeof revealOrder)
+ )
+ switch (revealOrder.toLowerCase()) {
+ case "together":
+ case "forwards":
+ case "backwards":
+ console.error(
+ '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.',
+ revealOrder,
+ revealOrder.toLowerCase()
+ );
+ break;
+ case "forward":
+ case "backward":
+ console.error(
+ '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.',
+ revealOrder,
+ revealOrder.toLowerCase()
+ );
+ break;
+ default:
+ console.error(
+ '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?',
+ revealOrder
+ );
+ }
+ else
+ console.error(
+ '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?',
+ revealOrder
+ );
+ void 0 === tailMode ||
+ didWarnAboutTailOptions[tailMode] ||
+ ("collapsed" !== tailMode && "hidden" !== tailMode
+ ? ((didWarnAboutTailOptions[tailMode] = !0),
+ console.error(
+ '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?',
+ tailMode
+ ))
+ : "forwards" !== revealOrder &&
+ "backwards" !== revealOrder &&
+ ((didWarnAboutTailOptions[tailMode] = !0),
+ console.error(
+ ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
+ tailMode
+ )));
+ a: if (
+ ("forwards" === revealOrder || "backwards" === revealOrder) &&
+ void 0 !== nextProps &&
+ null !== nextProps &&
+ !1 !== nextProps
+ )
+ if (isArrayImpl(nextProps))
+ for (var i = 0; i < nextProps.length; i++) {
+ if (!validateSuspenseListNestedChild(nextProps[i], i)) break a;
+ }
+ else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) {
+ if ((i = i.call(nextProps)))
+ for (var step = i.next(), _i = 0; !step.done; step = i.next()) {
+ if (!validateSuspenseListNestedChild(step.value, _i)) break a;
+ _i++;
+ }
+ } else
+ console.error(
+ 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
+ revealOrder
+ );
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ nextProps = suspenseStackCursor.current;
+ if (0 !== (nextProps & ForceSuspenseFallback))
+ (nextProps =
+ (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback),
+ (workInProgress.flags |= 128);
+ else {
+ if (null !== current && 0 !== (current.flags & 128))
+ a: for (current = workInProgress.child; null !== current; ) {
+ if (13 === current.tag)
+ null !== current.memoizedState &&
+ scheduleSuspenseWorkOnFiber(
+ current,
+ renderLanes,
+ workInProgress
+ );
+ else if (19 === current.tag)
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (null !== current.child) {
+ current.child.return = current;
+ current = current.child;
+ continue;
+ }
+ if (current === workInProgress) break a;
+ for (; null === current.sibling; ) {
+ if (null === current.return || current.return === workInProgress)
+ break a;
+ current = current.return;
+ }
+ current.sibling.return = current.return;
+ current = current.sibling;
+ }
+ nextProps &= SubtreeSuspenseContextMask;
+ }
+ push(suspenseStackCursor, nextProps, workInProgress);
+ switch (revealOrder) {
+ case "forwards":
+ renderLanes = workInProgress.child;
+ for (revealOrder = null; null !== renderLanes; )
+ (current = renderLanes.alternate),
+ null !== current &&
+ null === findFirstSuspended(current) &&
+ (revealOrder = renderLanes),
+ (renderLanes = renderLanes.sibling);
+ renderLanes = revealOrder;
+ null === renderLanes
+ ? ((revealOrder = workInProgress.child),
+ (workInProgress.child = null))
+ : ((revealOrder = renderLanes.sibling),
+ (renderLanes.sibling = null));
+ initSuspenseListRenderState(
+ workInProgress,
+ !1,
+ revealOrder,
+ renderLanes,
+ tailMode
+ );
+ break;
+ case "backwards":
+ renderLanes = null;
+ revealOrder = workInProgress.child;
+ for (workInProgress.child = null; null !== revealOrder; ) {
+ current = revealOrder.alternate;
+ if (null !== current && null === findFirstSuspended(current)) {
+ workInProgress.child = revealOrder;
+ break;
+ }
+ current = revealOrder.sibling;
+ revealOrder.sibling = renderLanes;
+ renderLanes = revealOrder;
+ revealOrder = current;
+ }
+ initSuspenseListRenderState(
+ workInProgress,
+ !0,
+ renderLanes,
+ null,
+ tailMode
+ );
+ break;
+ case "together":
+ initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
+ break;
+ default:
+ workInProgress.memoizedState = null;
+ }
+ return workInProgress.child;
+ }
+ function bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ null !== current && (workInProgress.dependencies = current.dependencies);
+ profilerStartTime = -1;
+ workInProgressRootSkippedLanes |= workInProgress.lanes;
+ if (0 === (renderLanes & workInProgress.childLanes))
+ if (null !== current) {
+ if (
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ 0 === (renderLanes & workInProgress.childLanes))
+ )
+ return null;
+ } else return null;
+ if (null !== current && workInProgress.child !== current.child)
+ throw Error("Resuming work not yet implemented.");
+ if (null !== workInProgress.child) {
+ current = workInProgress.child;
+ renderLanes = createWorkInProgress(current, current.pendingProps);
+ workInProgress.child = renderLanes;
+ for (renderLanes.return = workInProgress; null !== current.sibling; )
+ (current = current.sibling),
+ (renderLanes = renderLanes.sibling =
+ createWorkInProgress(current, current.pendingProps)),
+ (renderLanes.return = workInProgress);
+ renderLanes.sibling = null;
+ }
+ return workInProgress.child;
+ }
+ function checkScheduledUpdateOrContext(current, renderLanes) {
+ if (0 !== (current.lanes & renderLanes)) return !0;
+ current = current.dependencies;
+ return null !== current && checkIfContextChanged(current) ? !0 : !1;
+ }
+ function attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ switch (workInProgress.tag) {
+ case 3:
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ pushProvider(
+ workInProgress,
+ CacheContext,
+ current.memoizedState.cache
+ );
+ resetHydrationState();
+ break;
+ case 27:
+ case 5:
+ pushHostContext(workInProgress);
+ break;
+ case 4:
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ break;
+ case 10:
+ pushProvider(
+ workInProgress,
+ workInProgress.type,
+ workInProgress.memoizedProps.value
+ );
+ break;
+ case 12:
+ 0 !== (renderLanes & workInProgress.childLanes) &&
+ (workInProgress.flags |= 4);
+ workInProgress.flags |= 2048;
+ var stateNode = workInProgress.stateNode;
+ stateNode.effectDuration = -0;
+ stateNode.passiveEffectDuration = -0;
+ break;
+ case 13:
+ stateNode = workInProgress.memoizedState;
+ if (null !== stateNode) {
+ if (null !== stateNode.dehydrated)
+ return (
+ pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags |= 128),
+ null
+ );
+ if (0 !== (renderLanes & workInProgress.child.childLanes))
+ return updateSuspenseComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ current = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ return null !== current ? current.sibling : null;
+ }
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ break;
+ case 19:
+ var didSuspendBefore = 0 !== (current.flags & 128);
+ stateNode = 0 !== (renderLanes & workInProgress.childLanes);
+ stateNode ||
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
+ if (didSuspendBefore) {
+ if (stateNode)
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ workInProgress.flags |= 128;
+ }
+ didSuspendBefore = workInProgress.memoizedState;
+ null !== didSuspendBefore &&
+ ((didSuspendBefore.rendering = null),
+ (didSuspendBefore.tail = null),
+ (didSuspendBefore.lastEffect = null));
+ push(
+ suspenseStackCursor,
+ suspenseStackCursor.current,
+ workInProgress
+ );
+ if (stateNode) break;
+ else return null;
+ case 22:
+ case 23:
+ return (
+ (workInProgress.lanes = 0),
+ updateOffscreenComponent(current, workInProgress, renderLanes)
+ );
+ case 24:
+ pushProvider(
+ workInProgress,
+ CacheContext,
+ current.memoizedState.cache
+ );
+ }
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+ }
+ function beginWork(current, workInProgress, renderLanes) {
+ if (workInProgress._debugNeedsRemount && null !== current) {
+ renderLanes = createFiberFromTypeAndProps(
+ workInProgress.type,
+ workInProgress.key,
+ workInProgress.pendingProps,
+ workInProgress._debugOwner || null,
+ workInProgress.mode,
+ workInProgress.lanes
+ );
+ renderLanes._debugStack = workInProgress._debugStack;
+ renderLanes._debugTask = workInProgress._debugTask;
+ var returnFiber = workInProgress.return;
+ if (null === returnFiber) throw Error("Cannot swap the root fiber.");
+ current.alternate = null;
+ workInProgress.alternate = null;
+ renderLanes.index = workInProgress.index;
+ renderLanes.sibling = workInProgress.sibling;
+ renderLanes.return = workInProgress.return;
+ renderLanes.ref = workInProgress.ref;
+ renderLanes._debugInfo = workInProgress._debugInfo;
+ if (workInProgress === returnFiber.child)
+ returnFiber.child = renderLanes;
+ else {
+ var prevSibling = returnFiber.child;
+ if (null === prevSibling)
+ throw Error("Expected parent to have a child.");
+ for (; prevSibling.sibling !== workInProgress; )
+ if (((prevSibling = prevSibling.sibling), null === prevSibling))
+ throw Error("Expected to find the previous sibling.");
+ prevSibling.sibling = renderLanes;
+ }
+ workInProgress = returnFiber.deletions;
+ null === workInProgress
+ ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16))
+ : workInProgress.push(current);
+ renderLanes.flags |= 2;
+ return renderLanes;
+ }
+ if (null !== current)
+ if (
+ current.memoizedProps !== workInProgress.pendingProps ||
+ workInProgress.type !== current.type
+ )
+ didReceiveUpdate = !0;
+ else {
+ if (
+ !checkScheduledUpdateOrContext(current, renderLanes) &&
+ 0 === (workInProgress.flags & 128)
+ )
+ return (
+ (didReceiveUpdate = !1),
+ attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ )
+ );
+ didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ }
+ else {
+ didReceiveUpdate = !1;
+ if ((returnFiber = isHydrating))
+ warnIfNotHydrating(),
+ (returnFiber = 0 !== (workInProgress.flags & 1048576));
+ returnFiber &&
+ ((returnFiber = workInProgress.index),
+ warnIfNotHydrating(),
+ pushTreeId(workInProgress, treeForkCount, returnFiber));
+ }
+ workInProgress.lanes = 0;
+ switch (workInProgress.tag) {
+ case 16:
+ a: if (
+ ((returnFiber = workInProgress.pendingProps),
+ (current = callLazyInitInDEV(workInProgress.elementType)),
+ (workInProgress.type = current),
+ "function" === typeof current)
+ )
+ shouldConstruct(current)
+ ? ((returnFiber = resolveClassComponentProps(
+ current,
+ returnFiber
+ )),
+ (workInProgress.tag = 1),
+ (workInProgress.type = current =
+ resolveFunctionForHotReloading(current)),
+ (workInProgress = updateClassComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ )))
+ : ((workInProgress.tag = 0),
+ validateFunctionComponentInDev(workInProgress, current),
+ (workInProgress.type = current =
+ resolveFunctionForHotReloading(current)),
+ (workInProgress = updateFunctionComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ )));
+ else {
+ if (void 0 !== current && null !== current)
+ if (
+ ((prevSibling = current.$$typeof),
+ prevSibling === REACT_FORWARD_REF_TYPE)
+ ) {
+ workInProgress.tag = 11;
+ workInProgress.type = current =
+ resolveForwardRefForHotReloading(current);
+ workInProgress = updateForwardRef(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ );
+ break a;
+ } else if (prevSibling === REACT_MEMO_TYPE) {
+ workInProgress.tag = 14;
+ workInProgress = updateMemoComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ );
+ break a;
+ }
+ workInProgress = "";
+ null !== current &&
+ "object" === typeof current &&
+ current.$$typeof === REACT_LAZY_TYPE &&
+ (workInProgress =
+ " Did you wrap a component in React.lazy() more than once?");
+ current = getComponentNameFromType(current) || current;
+ throw Error(
+ "Element type is invalid. Received a promise that resolves to: " +
+ current +
+ ". Lazy element type must resolve to a class or function." +
+ workInProgress
+ );
+ }
+ return workInProgress;
+ case 0:
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 1:
+ return (
+ (returnFiber = workInProgress.type),
+ (prevSibling = resolveClassComponentProps(
+ returnFiber,
+ workInProgress.pendingProps
+ )),
+ updateClassComponent(
+ current,
+ workInProgress,
+ returnFiber,
+ prevSibling,
+ renderLanes
+ )
+ );
+ case 3:
+ a: {
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ if (null === current)
+ throw Error(
+ "Should have a current fiber. This is a bug in React."
+ );
+ var nextProps = workInProgress.pendingProps;
+ prevSibling = workInProgress.memoizedState;
+ returnFiber = prevSibling.element;
+ cloneUpdateQueue(current, workInProgress);
+ processUpdateQueue(workInProgress, nextProps, null, renderLanes);
+ var nextState = workInProgress.memoizedState;
+ nextProps = nextState.cache;
+ pushProvider(workInProgress, CacheContext, nextProps);
+ nextProps !== prevSibling.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ );
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ nextProps = nextState.element;
+ if (prevSibling.isDehydrated)
+ if (
+ ((prevSibling = {
+ element: nextProps,
+ isDehydrated: !1,
+ cache: nextState.cache
+ }),
+ (workInProgress.updateQueue.baseState = prevSibling),
+ (workInProgress.memoizedState = prevSibling),
+ workInProgress.flags & 256)
+ ) {
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else if (nextProps !== returnFiber) {
+ returnFiber = createCapturedValueAtFiber(
+ Error(
+ "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
+ ),
+ workInProgress
+ );
+ queueHydrationError(returnFiber);
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else
+ for (
+ nextHydratableInstance = getNextHydratable(
+ workInProgress.stateNode.containerInfo.firstChild
+ ),
+ hydrationParentFiber = workInProgress,
+ isHydrating = !0,
+ hydrationErrors = null,
+ didSuspendOrErrorDEV = !1,
+ hydrationDiffRootDEV = null,
+ rootOrSingletonContext = !0,
+ current = mountChildFibers(
+ workInProgress,
+ null,
+ nextProps,
+ renderLanes
+ ),
+ workInProgress.child = current;
+ current;
+
+ )
+ (current.flags = (current.flags & -3) | 4096),
+ (current = current.sibling);
+ else {
+ resetHydrationState();
+ if (nextProps === returnFiber) {
+ workInProgress = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ break a;
+ }
+ reconcileChildren(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ }
+ workInProgress = workInProgress.child;
+ }
+ return workInProgress;
+ case 26:
+ return (
+ markRef(current, workInProgress),
+ null === current
+ ? (current = getResource(
+ workInProgress.type,
+ null,
+ workInProgress.pendingProps,
+ null
+ ))
+ ? (workInProgress.memoizedState = current)
+ : isHydrating ||
+ ((current = workInProgress.type),
+ (renderLanes = workInProgress.pendingProps),
+ (returnFiber = requiredContext(
+ rootInstanceStackCursor.current
+ )),
+ (returnFiber =
+ getOwnerDocumentFromRootContainer(
+ returnFiber
+ ).createElement(current)),
+ (returnFiber[internalInstanceKey] = workInProgress),
+ (returnFiber[internalPropsKey] = renderLanes),
+ setInitialProperties(returnFiber, current, renderLanes),
+ markNodeAsHoistable(returnFiber),
+ (workInProgress.stateNode = returnFiber))
+ : (workInProgress.memoizedState = getResource(
+ workInProgress.type,
+ current.memoizedProps,
+ workInProgress.pendingProps,
+ current.memoizedState
+ )),
+ null
+ );
+ case 27:
+ return (
+ pushHostContext(workInProgress),
+ null === current &&
+ isHydrating &&
+ ((prevSibling = requiredContext(rootInstanceStackCursor.current)),
+ (returnFiber = getHostContext()),
+ (prevSibling = workInProgress.stateNode =
+ resolveSingletonInstance(
+ workInProgress.type,
+ workInProgress.pendingProps,
+ prevSibling,
+ returnFiber,
+ !1
+ )),
+ didSuspendOrErrorDEV ||
+ ((returnFiber = diffHydratedProperties(
+ prevSibling,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ returnFiber
+ )),
+ null !== returnFiber &&
+ (buildHydrationDiffNode(workInProgress, 0).serverProps =
+ returnFiber)),
+ (hydrationParentFiber = workInProgress),
+ (rootOrSingletonContext = !0),
+ (nextHydratableInstance = getNextHydratable(
+ prevSibling.firstChild
+ ))),
+ (returnFiber = workInProgress.pendingProps.children),
+ null !== current || isHydrating
+ ? reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ )
+ : (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ returnFiber,
+ renderLanes
+ )),
+ markRef(current, workInProgress),
+ workInProgress.child
+ );
+ case 5:
+ return (
+ null === current &&
+ isHydrating &&
+ ((nextProps = getHostContext()),
+ (returnFiber = validateDOMNesting(
+ workInProgress.type,
+ nextProps.ancestorInfo
+ )),
+ (prevSibling = nextHydratableInstance),
+ (nextState = !prevSibling) ||
+ ((nextState = canHydrateInstance(
+ prevSibling,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== nextState
+ ? ((workInProgress.stateNode = nextState),
+ didSuspendOrErrorDEV ||
+ ((nextProps = diffHydratedProperties(
+ nextState,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ nextProps
+ )),
+ null !== nextProps &&
+ (buildHydrationDiffNode(workInProgress, 0).serverProps =
+ nextProps)),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = getNextHydratable(
+ nextState.firstChild
+ )),
+ (rootOrSingletonContext = !1),
+ (nextProps = !0))
+ : (nextProps = !1),
+ (nextState = !nextProps)),
+ nextState &&
+ (returnFiber &&
+ warnNonHydratedInstance(workInProgress, prevSibling),
+ throwOnHydrationMismatch(workInProgress))),
+ pushHostContext(workInProgress),
+ (prevSibling = workInProgress.type),
+ (nextProps = workInProgress.pendingProps),
+ (nextState = null !== current ? current.memoizedProps : null),
+ (returnFiber = nextProps.children),
+ shouldSetTextContent(prevSibling, nextProps)
+ ? (returnFiber = null)
+ : null !== nextState &&
+ shouldSetTextContent(prevSibling, nextState) &&
+ (workInProgress.flags |= 32),
+ null !== workInProgress.memoizedState &&
+ ((prevSibling = renderWithHooks(
+ current,
+ workInProgress,
+ TransitionAwareHostComponent,
+ null,
+ null,
+ renderLanes
+ )),
+ (HostTransitionContext._currentValue = prevSibling)),
+ markRef(current, workInProgress),
+ reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 6:
+ return (
+ null === current &&
+ isHydrating &&
+ ((current = workInProgress.pendingProps),
+ (renderLanes = getHostContext().ancestorInfo.current),
+ (current =
+ null != renderLanes
+ ? validateTextNesting(current, renderLanes.tag)
+ : !0),
+ (renderLanes = nextHydratableInstance),
+ (returnFiber = !renderLanes) ||
+ ((returnFiber = canHydrateTextInstance(
+ renderLanes,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== returnFiber
+ ? ((workInProgress.stateNode = returnFiber),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (returnFiber = !0))
+ : (returnFiber = !1),
+ (returnFiber = !returnFiber)),
+ returnFiber &&
+ (current &&
+ warnNonHydratedInstance(workInProgress, renderLanes),
+ throwOnHydrationMismatch(workInProgress))),
+ null
+ );
+ case 13:
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ case 4:
+ return (
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ ),
+ (returnFiber = workInProgress.pendingProps),
+ null === current
+ ? (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ returnFiber,
+ renderLanes
+ ))
+ : reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 11:
+ return updateForwardRef(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 7:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 8:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 12:
+ return (
+ (workInProgress.flags |= 4),
+ (workInProgress.flags |= 2048),
+ (returnFiber = workInProgress.stateNode),
+ (returnFiber.effectDuration = -0),
+ (returnFiber.passiveEffectDuration = -0),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 10:
+ return (
+ (returnFiber = workInProgress.type),
+ (prevSibling = workInProgress.pendingProps),
+ (nextProps = prevSibling.value),
+ "value" in prevSibling ||
+ hasWarnedAboutUsingNoValuePropOnContextProvider ||
+ ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0),
+ console.error(
+ "The `value` prop is required for the ``. Did you misspell it or forget to pass it?"
+ )),
+ pushProvider(workInProgress, returnFiber, nextProps),
+ reconcileChildren(
+ current,
+ workInProgress,
+ prevSibling.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 9:
+ return (
+ (prevSibling = workInProgress.type._context),
+ (returnFiber = workInProgress.pendingProps.children),
+ "function" !== typeof returnFiber &&
+ console.error(
+ "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
+ ),
+ prepareToReadContext(workInProgress),
+ (prevSibling = readContext(prevSibling)),
+ (returnFiber = callComponentInDEV(
+ returnFiber,
+ prevSibling,
+ void 0
+ )),
+ (workInProgress.flags |= 1),
+ reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 14:
+ return updateMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 15:
+ return updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 19:
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ case 22:
+ return updateOffscreenComponent(current, workInProgress, renderLanes);
+ case 24:
+ return (
+ prepareToReadContext(workInProgress),
+ (returnFiber = readContext(CacheContext)),
+ null === current
+ ? ((prevSibling = peekCacheFromPool()),
+ null === prevSibling &&
+ ((prevSibling = workInProgressRoot),
+ (nextProps = createCache()),
+ (prevSibling.pooledCache = nextProps),
+ retainCache(nextProps),
+ null !== nextProps &&
+ (prevSibling.pooledCacheLanes |= renderLanes),
+ (prevSibling = nextProps)),
+ (workInProgress.memoizedState = {
+ parent: returnFiber,
+ cache: prevSibling
+ }),
+ initializeUpdateQueue(workInProgress),
+ pushProvider(workInProgress, CacheContext, prevSibling))
+ : (0 !== (current.lanes & renderLanes) &&
+ (cloneUpdateQueue(current, workInProgress),
+ processUpdateQueue(workInProgress, null, null, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction()),
+ (prevSibling = current.memoizedState),
+ (nextProps = workInProgress.memoizedState),
+ prevSibling.parent !== returnFiber
+ ? ((prevSibling = {
+ parent: returnFiber,
+ cache: returnFiber
+ }),
+ (workInProgress.memoizedState = prevSibling),
+ 0 === workInProgress.lanes &&
+ (workInProgress.memoizedState =
+ workInProgress.updateQueue.baseState =
+ prevSibling),
+ pushProvider(workInProgress, CacheContext, returnFiber))
+ : ((returnFiber = nextProps.cache),
+ pushProvider(workInProgress, CacheContext, returnFiber),
+ returnFiber !== prevSibling.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ ))),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 29:
+ throw workInProgress.pendingProps;
}
- currentlyProcessingQueue = null;
- }
- function callCallback(callback, context) {
- if ("function" !== typeof callback)
- throw Error(
- "Invalid argument passed as callback. Expected a function. Instead received: " +
- callback
- );
- callback.call(context);
- }
- function commitHiddenCallbacks(updateQueue, context) {
- var hiddenCallbacks = updateQueue.shared.hiddenCallbacks;
- if (null !== hiddenCallbacks)
- for (
- updateQueue.shared.hiddenCallbacks = null, updateQueue = 0;
- updateQueue < hiddenCallbacks.length;
- updateQueue++
- )
- callCallback(hiddenCallbacks[updateQueue], context);
- }
- function commitCallbacks(updateQueue, context) {
- var callbacks = updateQueue.callbacks;
- if (null !== callbacks)
- for (
- updateQueue.callbacks = null, updateQueue = 0;
- updateQueue < callbacks.length;
- updateQueue++
- )
- callCallback(callbacks[updateQueue], context);
+ throw Error(
+ "Unknown unit of work tag (" +
+ workInProgress.tag +
+ "). This error is likely caused by a bug in React. Please file an issue."
+ );
}
function shouldProfile(current) {
return (current.mode & ProfileMode) !== NoMode;
@@ -12742,6 +12803,7 @@
(parentFiber = parentFiber.sibling);
}
function disappearLayoutEffects(finishedWork) {
+ var prevEffectStart = pushComponentEffectStart();
switch (finishedWork.tag) {
case 0:
case 11:
@@ -12779,6 +12841,17 @@
default:
recursivelyTraverseDisappearLayoutEffects(finishedWork);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
for (parentFiber = parentFiber.child; null !== parentFiber; )
@@ -12791,7 +12864,8 @@
finishedWork,
includeWorkInProgressEffects
) {
- var flags = finishedWork.flags;
+ var prevEffectStart = pushComponentEffectStart(),
+ flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
case 11:
@@ -12906,6 +12980,17 @@
includeWorkInProgressEffects
);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseReappearLayoutEffects(
finishedRoot,
@@ -12978,39 +13063,16 @@
endTime
) {
var prevEffectStart = pushComponentEffectStart();
- if (
- (finishedWork.mode & ProfileMode) !== NoMode &&
+ (finishedWork.mode & ProfileMode) !== NoMode &&
0 < finishedWork.actualStartTime &&
- 0 !== (finishedWork.flags & 1)
- ) {
- var startTime = finishedWork.actualStartTime,
- name = getComponentNameFromFiber(finishedWork);
- if (null !== name && supportsUserTiming) {
- var selfTime = finishedWork.actualDuration;
- if (
- null === finishedWork.alternate ||
- finishedWork.alternate.child !== finishedWork.child
- )
- for (
- var child = finishedWork.child;
- null !== child;
- child = child.sibling
- )
- selfTime -= child.actualDuration;
- reusableComponentDevToolDetails.color =
- 0.5 > selfTime
- ? "primary-light"
- : 10 > selfTime
- ? "primary"
- : 100 > selfTime
- ? "primary-dark"
- : "error";
- reusableComponentOptions.start = startTime;
- reusableComponentOptions.end = endTime;
- performance.measure(name, reusableComponentOptions);
- }
- }
- name = finishedWork.flags;
+ 0 !== (finishedWork.flags & 1) &&
+ logComponentRender(
+ finishedWork,
+ finishedWork.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
case 11:
@@ -13022,11 +13084,16 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ flags & 2048 &&
commitHookPassiveMountEffects(finishedWork, Passive | HasEffect);
break;
case 3:
- startTime = pushNestedEffectDurations();
+ var prevEffectDuration = pushNestedEffectDurations(),
+ wasInHydratedSubtree = inHydratedSubtree;
+ inHydratedSubtree =
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 === (finishedWork.flags & 256);
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13034,7 +13101,8 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ inHydratedSubtree = wasInHydratedSubtree;
+ flags & 2048 &&
((committedLanes = null),
null !== finishedWork.alternate &&
(committedLanes = finishedWork.alternate.memoizedState.cache),
@@ -13043,11 +13111,11 @@
(retainCache(committedTransitions),
null != committedLanes && releaseCache(committedLanes)));
finishedRoot.passiveEffectDuration +=
- popNestedEffectDurations(startTime);
+ popNestedEffectDurations(prevEffectDuration);
break;
case 12:
- if (name & 2048) {
- startTime = pushNestedEffectDurations();
+ if (flags & 2048) {
+ prevEffectDuration = pushNestedEffectDurations();
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13057,7 +13125,7 @@
);
finishedRoot = finishedWork.stateNode;
finishedRoot.passiveEffectDuration +=
- bubbleNestedEffectDurations(startTime);
+ bubbleNestedEffectDurations(prevEffectDuration);
try {
runWithFiberInDEV(
finishedWork,
@@ -13079,12 +13147,73 @@
endTime
);
break;
+ case 13:
+ prevEffectDuration = inHydratedSubtree;
+ flags =
+ null !== finishedWork.alternate
+ ? finishedWork.alternate.memoizedState
+ : null;
+ wasInHydratedSubtree = finishedWork.memoizedState;
+ if (
+ null === flags ||
+ null === flags.dehydrated ||
+ (null !== wasInHydratedSubtree &&
+ null !== wasInHydratedSubtree.dehydrated)
+ )
+ inHydratedSubtree = !1;
+ else if (
+ ((wasInHydratedSubtree = finishedWork.deletions),
+ null !== wasInHydratedSubtree &&
+ 0 < wasInHydratedSubtree.length &&
+ 18 === wasInHydratedSubtree[0].tag)
+ ) {
+ if (
+ ((inHydratedSubtree = !1),
+ (flags = flags.hydrationErrors),
+ null !== flags &&
+ ((wasInHydratedSubtree = finishedWork.actualStartTime),
+ supportsUserTiming))
+ ) {
+ for (var properties = [], i = 0; i < flags.length; i++) {
+ var error$jscomp$0 = flags[i].value;
+ properties.push([
+ "Error",
+ "object" === typeof error$jscomp$0 &&
+ null !== error$jscomp$0 &&
+ "string" === typeof error$jscomp$0.message
+ ? String(error$jscomp$0.message)
+ : String(error$jscomp$0)
+ ]);
+ }
+ performance.measure("Suspense", {
+ start: wasInHydratedSubtree,
+ end: endTime,
+ detail: {
+ devtools: {
+ color: "error",
+ track: COMPONENTS_TRACK,
+ tooltipText: "Hydration failed",
+ properties: properties
+ }
+ }
+ });
+ }
+ } else inHydratedSubtree = !0;
+ recursivelyTraversePassiveMountEffects(
+ finishedRoot,
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
+ inHydratedSubtree = prevEffectDuration;
+ break;
case 23:
break;
case 22:
- startTime = finishedWork.stateNode;
+ prevEffectDuration = finishedWork.stateNode;
null !== finishedWork.memoizedState
- ? startTime._visibility & OffscreenPassiveEffectsConnected
+ ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected
? recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13094,9 +13223,12 @@
)
: recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
)
- : startTime._visibility & OffscreenPassiveEffectsConnected
+ : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected
? recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13104,15 +13236,17 @@
committedTransitions,
endTime
)
- : ((startTime._visibility |= OffscreenPassiveEffectsConnected),
+ : ((prevEffectDuration._visibility |=
+ OffscreenPassiveEffectsConnected),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
committedLanes,
committedTransitions,
- 0 !== (finishedWork.subtreeFlags & 10256)
+ 0 !== (finishedWork.subtreeFlags & 10256),
+ endTime
));
- name & 2048 &&
+ flags & 2048 &&
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork
@@ -13126,7 +13260,7 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ flags & 2048 &&
commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
break;
default:
@@ -13155,28 +13289,43 @@
parentFiber,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
) {
includeWorkInProgressEffects =
includeWorkInProgressEffects &&
0 !== (parentFiber.subtreeFlags & 10256);
- for (parentFiber = parentFiber.child; null !== parentFiber; )
+ for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ var nextSibling = parentFiber.sibling;
reconnectPassiveEffects(
finishedRoot,
parentFiber,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
- ),
- (parentFiber = parentFiber.sibling);
+ includeWorkInProgressEffects,
+ null !== nextSibling ? nextSibling.actualStartTime : endTime
+ );
+ parentFiber = nextSibling;
+ }
}
function reconnectPassiveEffects(
finishedRoot,
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
) {
+ var prevEffectStart = pushComponentEffectStart();
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 < finishedWork.actualStartTime &&
+ 0 !== (finishedWork.flags & 1) &&
+ logComponentRender(
+ finishedWork,
+ finishedWork.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
var flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
@@ -13187,7 +13336,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
commitHookPassiveMountEffects(finishedWork, Passive);
break;
@@ -13202,11 +13352,15 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
)
: recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
)
: ((_instance2._visibility |= OffscreenPassiveEffectsConnected),
recursivelyTraverseReconnectPassiveEffects(
@@ -13214,7 +13368,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
));
includeWorkInProgressEffects &&
flags & 2048 &&
@@ -13229,7 +13384,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
includeWorkInProgressEffects &&
flags & 2048 &&
@@ -13241,49 +13397,82 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseAtomicPassiveEffects(
finishedRoot$jscomp$0,
- parentFiber
+ parentFiber,
+ committedLanes$jscomp$0,
+ committedTransitions$jscomp$0,
+ endTime$jscomp$0
) {
if (parentFiber.subtreeFlags & 10256)
- for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ for (var child = parentFiber.child; null !== child; ) {
+ parentFiber = child.sibling;
var finishedRoot = finishedRoot$jscomp$0,
- finishedWork = parentFiber,
- flags = finishedWork.flags;
- switch (finishedWork.tag) {
+ committedLanes = committedLanes$jscomp$0,
+ committedTransitions = committedTransitions$jscomp$0,
+ endTime =
+ null !== parentFiber
+ ? parentFiber.actualStartTime
+ : endTime$jscomp$0;
+ (child.mode & ProfileMode) !== NoMode &&
+ 0 < child.actualStartTime &&
+ 0 !== (child.flags & 1) &&
+ logComponentRender(
+ child,
+ child.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = child.flags;
+ switch (child.tag) {
case 22:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
flags & 2048 &&
- commitOffscreenPassiveMountEffects(
- finishedWork.alternate,
- finishedWork
- );
+ commitOffscreenPassiveMountEffects(child.alternate, child);
break;
case 24:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
flags & 2048 &&
- commitCachePassiveMountEffect(
- finishedWork.alternate,
- finishedWork
- );
+ commitCachePassiveMountEffect(child.alternate, child);
break;
default:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
}
- parentFiber = parentFiber.sibling;
+ child = parentFiber;
}
}
function recursivelyAccumulateSuspenseyCommit(parentFiber) {
@@ -13457,11 +13646,13 @@
}
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
deletedSubtreeRoot,
- nearestMountedAncestor
+ nearestMountedAncestor$jscomp$0
) {
for (; null !== nextEffect; ) {
var fiber = nextEffect,
- current = fiber;
+ current = fiber,
+ nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
+ prevEffectStart = pushComponentEffectStart();
switch (current.tag) {
case 0:
case 11:
@@ -13476,30 +13667,42 @@
case 22:
null !== current.memoizedState &&
null !== current.memoizedState.cachePool &&
- ((current = current.memoizedState.cachePool.pool),
- null != current && retainCache(current));
+ ((nearestMountedAncestor = current.memoizedState.cachePool.pool),
+ null != nearestMountedAncestor &&
+ retainCache(nearestMountedAncestor));
break;
case 24:
releaseCache(current.memoizedState.cache);
}
+ (current.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ current,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
current = fiber.child;
if (null !== current) (current.return = fiber), (nextEffect = current);
else
a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
current = nextEffect;
- var sibling = current.sibling,
- returnFiber = current.return;
+ prevEffectStart = current.sibling;
+ nearestMountedAncestor = current.return;
detachFiberAfterEffects(current);
if (current === fiber) {
nextEffect = null;
break a;
}
- if (null !== sibling) {
- sibling.return = returnFiber;
- nextEffect = sibling;
+ if (null !== prevEffectStart) {
+ prevEffectStart.return = nearestMountedAncestor;
+ nextEffect = prevEffectStart;
break a;
}
- nextEffect = returnFiber;
+ nextEffect = nearestMountedAncestor;
}
}
}
@@ -13990,16 +14193,16 @@
case 1:
return bubbleProperties(workInProgress), null;
case 3:
- newProps = workInProgress.stateNode;
- renderLanes = null;
- null !== current && (renderLanes = current.memoizedState.cache);
- workInProgress.memoizedState.cache !== renderLanes &&
+ renderLanes = workInProgress.stateNode;
+ newProps = null;
+ null !== current && (newProps = current.memoizedState.cache);
+ workInProgress.memoizedState.cache !== newProps &&
(workInProgress.flags |= 2048);
popProvider(CacheContext, workInProgress);
popHostContainer(workInProgress);
- newProps.pendingContext &&
- ((newProps.context = newProps.pendingContext),
- (newProps.pendingContext = null));
+ renderLanes.pendingContext &&
+ ((renderLanes.context = renderLanes.pendingContext),
+ (renderLanes.pendingContext = null));
if (null === current || null === current.child)
popHydrationState(workInProgress)
? (emitPendingHydrationWarnings(), markUpdate(workInProgress))
@@ -14007,9 +14210,7 @@
(current.memoizedState.isDehydrated &&
0 === (workInProgress.flags & 256)) ||
((workInProgress.flags |= 1024),
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)));
+ upgradeHydrationErrorsToRecoverable());
bubbleProperties(workInProgress);
return null;
case 26:
@@ -14218,9 +14419,9 @@
renderLanes = getHostContext();
if (popHydrationState(workInProgress)) {
current = workInProgress.stateNode;
- newProps = workInProgress.memoizedProps;
+ renderLanes = workInProgress.memoizedProps;
_type = !didSuspendOrErrorDEV;
- renderLanes = null;
+ newProps = null;
var returnFiber = hydrationParentFiber;
if (null !== returnFiber)
switch (returnFiber.tag) {
@@ -14228,8 +14429,8 @@
_type &&
((_type = diffHydratedTextForDevWarnings(
current,
- newProps,
- renderLanes
+ renderLanes,
+ newProps
)),
null !== _type &&
(buildHydrationDiffNode(workInProgress, 0).serverProps =
@@ -14237,12 +14438,12 @@
break;
case 27:
case 5:
- (renderLanes = returnFiber.memoizedProps),
+ (newProps = returnFiber.memoizedProps),
_type &&
((_type = diffHydratedTextForDevWarnings(
current,
- newProps,
- renderLanes
+ renderLanes,
+ newProps
)),
null !== _type &&
(buildHydrationDiffNode(
@@ -14252,10 +14453,10 @@
}
current[internalInstanceKey] = workInProgress;
current =
- current.nodeValue === newProps ||
- (null !== renderLanes &&
- !0 === renderLanes.suppressHydrationWarning) ||
- checkForUnmatchedText(current.nodeValue, newProps)
+ current.nodeValue === renderLanes ||
+ (null !== newProps &&
+ !0 === newProps.suppressHydrationWarning) ||
+ checkForUnmatchedText(current.nodeValue, renderLanes)
? !0
: !1;
current || throwOnHydrationMismatch(workInProgress);
@@ -14315,9 +14516,10 @@
_type.treeBaseDuration));
_type = !1;
} else
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)),
+ (_type = upgradeHydrationErrorsToRecoverable()),
+ null !== current &&
+ null !== current.memoizedState &&
+ (current.memoizedState.hydrationErrors = _type),
(_type = !0);
if (!_type) {
if (workInProgress.flags & 256)
@@ -14334,27 +14536,27 @@
transferActualDuration(workInProgress),
workInProgress
);
- newProps = null !== newProps;
+ renderLanes = null !== newProps;
current = null !== current && null !== current.memoizedState;
- newProps &&
- ((renderLanes = workInProgress.child),
+ renderLanes &&
+ ((newProps = workInProgress.child),
(_type = null),
- null !== renderLanes.alternate &&
- null !== renderLanes.alternate.memoizedState &&
- null !== renderLanes.alternate.memoizedState.cachePool &&
- (_type = renderLanes.alternate.memoizedState.cachePool.pool),
+ null !== newProps.alternate &&
+ null !== newProps.alternate.memoizedState &&
+ null !== newProps.alternate.memoizedState.cachePool &&
+ (_type = newProps.alternate.memoizedState.cachePool.pool),
(returnFiber = null),
- null !== renderLanes.memoizedState &&
- null !== renderLanes.memoizedState.cachePool &&
- (returnFiber = renderLanes.memoizedState.cachePool.pool),
- returnFiber !== _type && (renderLanes.flags |= 2048));
- newProps !== current &&
- newProps &&
+ null !== newProps.memoizedState &&
+ null !== newProps.memoizedState.cachePool &&
+ (returnFiber = newProps.memoizedState.cachePool.pool),
+ returnFiber !== _type && (newProps.flags |= 2048));
+ renderLanes !== current &&
+ renderLanes &&
(workInProgress.child.flags |= 8192);
scheduleRetryEffect(workInProgress, workInProgress.updateQueue);
bubbleProperties(workInProgress);
(workInProgress.mode & ProfileMode) !== NoMode &&
- newProps &&
+ renderLanes &&
((current = workInProgress.child),
null !== current &&
(workInProgress.treeBaseDuration -= current.treeBaseDuration));
@@ -14398,9 +14600,13 @@
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
current = renderLanes;
- for (newProps = workInProgress.child; null !== newProps; )
- resetWorkInProgress(newProps, current),
- (newProps = newProps.sibling);
+ for (
+ renderLanes = workInProgress.child;
+ null !== renderLanes;
+
+ )
+ resetWorkInProgress(renderLanes, current),
+ (renderLanes = renderLanes.sibling);
push(
suspenseStackCursor,
(suspenseStackCursor.current &
@@ -14488,27 +14694,27 @@
workInProgress.subtreeFlags & 6 &&
(workInProgress.flags |= 8192))
: bubbleProperties(workInProgress),
- (newProps = workInProgress.updateQueue),
- null !== newProps &&
- scheduleRetryEffect(workInProgress, newProps.retryQueue),
- (newProps = null),
+ (renderLanes = workInProgress.updateQueue),
+ null !== renderLanes &&
+ scheduleRetryEffect(workInProgress, renderLanes.retryQueue),
+ (renderLanes = null),
null !== current &&
null !== current.memoizedState &&
null !== current.memoizedState.cachePool &&
- (newProps = current.memoizedState.cachePool.pool),
- (renderLanes = null),
+ (renderLanes = current.memoizedState.cachePool.pool),
+ (newProps = null),
null !== workInProgress.memoizedState &&
null !== workInProgress.memoizedState.cachePool &&
- (renderLanes = workInProgress.memoizedState.cachePool.pool),
- renderLanes !== newProps && (workInProgress.flags |= 2048),
+ (newProps = workInProgress.memoizedState.cachePool.pool),
+ newProps !== renderLanes && (workInProgress.flags |= 2048),
null !== current && pop(resumedCache, workInProgress),
null
);
case 24:
return (
- (newProps = null),
- null !== current && (newProps = current.memoizedState.cache),
- workInProgress.memoizedState.cache !== newProps &&
+ (renderLanes = null),
+ null !== current && (renderLanes = current.memoizedState.cache),
+ workInProgress.memoizedState.cache !== renderLanes &&
(workInProgress.flags |= 2048),
popProvider(CacheContext, workInProgress),
bubbleProperties(workInProgress),
@@ -14830,23 +15036,20 @@
a: {
startTime = root;
yieldDuration = renderWasConcurrent;
- var errorRetryLanes$jscomp$0 = errorRetryLanes;
renderWasConcurrent = workInProgressRootConcurrentErrors;
- (errorRetryLanes =
- startTime.current.memoizedState.isDehydrated) &&
- (prepareFreshStack(
- startTime,
- errorRetryLanes$jscomp$0
- ).flags |= 256);
- errorRetryLanes$jscomp$0 = renderRootSync(
+ var wasRootDehydrated =
+ startTime.current.memoizedState.isDehydrated;
+ wasRootDehydrated &&
+ (prepareFreshStack(startTime, errorRetryLanes).flags |= 256);
+ errorRetryLanes = renderRootSync(
startTime,
- errorRetryLanes$jscomp$0,
+ errorRetryLanes,
!1
);
- if (errorRetryLanes$jscomp$0 !== RootErrored) {
+ if (errorRetryLanes !== RootErrored) {
if (
workInProgressRootDidAttachPingListener &&
- !errorRetryLanes
+ !wasRootDehydrated
) {
startTime.errorRecoveryDisabledLanes |= yieldDuration;
workInProgressRootInterleavedUpdatedLanes |= yieldDuration;
@@ -14855,9 +15058,15 @@
}
startTime = workInProgressRootRecoverableErrors;
workInProgressRootRecoverableErrors = renderWasConcurrent;
- null !== startTime && queueRecoverableErrors(startTime);
+ null !== startTime &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = startTime)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ startTime
+ ));
}
- yieldDuration = errorRetryLanes$jscomp$0;
+ yieldDuration = errorRetryLanes;
}
renderWasConcurrent = !1;
if (yieldDuration !== RootErrored) continue;
@@ -14882,7 +15091,7 @@
if ((lanes & 4194176) !== lanes) break;
case RootSuspendedAtTheShell:
setCurrentTrackFromLanes(lanes);
- logSuspendedRenderPhase(renderStartTime, startTime);
+ logSuspendedRenderPhase(renderStartTime, startTime, lanes);
finalizeRender(lanes, startTime);
yieldEndTime = lanes;
0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60)
@@ -14982,14 +15191,6 @@
} while (1);
ensureRootIsScheduled(root);
}
- function queueRecoverableErrors(errors) {
- null === workInProgressRootRecoverableErrors
- ? (workInProgressRootRecoverableErrors = errors)
- : workInProgressRootRecoverableErrors.push.apply(
- workInProgressRootRecoverableErrors,
- errors
- );
- }
function commitRootWhenReady(
root,
finishedWork,
@@ -15148,14 +15349,26 @@
workInProgressRootExitStatus === RootSuspended ||
workInProgressRootExitStatus === RootSuspendedWithDelay
)
- logSuspendedRenderPhase(previousRenderStartTime, renderStartTime);
+ logSuspendedRenderPhase(
+ previousRenderStartTime,
+ renderStartTime,
+ lanes
+ );
else {
var endTime = renderStartTime;
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Interrupted Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prewarm"
+ : (lanes & 201326677) === lanes
+ ? "Interrupted Hydration"
+ : "Interrupted Render",
+ reusableLaneOptions
+ ));
}
finalizeRender(workInProgressRootRenderLanes, renderStartTime);
}
@@ -15176,7 +15389,8 @@
? endTime
: 0 <= previousRenderStartTime
? previousRenderStartTime
- : renderStartTime
+ : renderStartTime,
+ lanes
));
var eventType = blockingEventType,
eventIsRepeat = blockingEventIsRepeat,
@@ -15198,7 +15412,10 @@
reusableLaneOptions
)),
0 < previousRenderStartTime &&
- ((reusableLaneDevToolDetails.color = "primary-light"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes
+ ? "tertiary-light"
+ : "primary-light"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = renderStartTime$jscomp$0),
performance.measure("Blocked", reusableLaneOptions)));
@@ -15227,7 +15444,8 @@
? eventType
: 0 <= endTime
? endTime
- : renderStartTime
+ : renderStartTime,
+ lanes
));
eventIsRepeat = transitionEventType;
renderStartTime$jscomp$0 = transitionEventIsRepeat;
@@ -15312,7 +15530,7 @@
return previousRenderStartTime;
}
function handleThrow(root, thrownValue) {
- currentlyRenderingFiber$1 = null;
+ currentlyRenderingFiber = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactSharedInternals.getCurrentStack = null;
isRendering = !1;
@@ -15876,7 +16094,22 @@
completedRenderStartTime,
completedRenderEndTime
)
- : logRenderPhase(completedRenderStartTime, completedRenderEndTime);
+ : null !== recoverableErrors
+ ? logRecoveredRenderPhase(
+ completedRenderStartTime,
+ completedRenderEndTime,
+ didIncludeRenderPhaseUpdate,
+ recoverableErrors,
+ null !== finishedWork &&
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 !== (finishedWork.flags & 256)
+ )
+ : logRenderPhase(
+ completedRenderStartTime,
+ completedRenderEndTime,
+ didIncludeRenderPhaseUpdate
+ );
if (null === finishedWork) return null;
0 === didIncludeRenderPhaseUpdate &&
console.error(
@@ -15888,9 +16121,6 @@
throw Error(
"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
);
- root.callbackNode = null;
- root.callbackPriority = 0;
- root.cancelPendingCommit = null;
exitStatus = finishedWork.lanes | finishedWork.childLanes;
exitStatus |= concurrentlyUpdatedLanes;
markRootFinished(
@@ -15904,19 +16134,25 @@
root === workInProgressRoot &&
((workInProgress = workInProgressRoot = null),
(workInProgressRootRenderLanes = 0));
- (0 === finishedWork.actualDuration &&
- 0 === (finishedWork.subtreeFlags & 10256) &&
- 0 === (finishedWork.flags & 10256)) ||
- rootDoesHavePassiveEffects ||
- ((rootDoesHavePassiveEffects = !0),
- (pendingPassiveEffectsRemainingLanes = exitStatus),
- (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
- (pendingPassiveTransitions = transitions),
- scheduleCallback$1(NormalPriority$1, function () {
- schedulerEvent = window.event;
- flushPassiveEffects(!0);
- return null;
- }));
+ spawnedLane = !1;
+ 0 !== finishedWork.actualDuration ||
+ 0 !== (finishedWork.subtreeFlags & 10256) ||
+ 0 !== (finishedWork.flags & 10256)
+ ? ((spawnedLane = !0),
+ (pendingPassiveEffectsRemainingLanes = exitStatus),
+ (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
+ (pendingPassiveTransitions = transitions),
+ (root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null),
+ scheduleCallback$1(NormalPriority$1, function () {
+ schedulerEvent = window.event;
+ flushPassiveEffects(!0);
+ return null;
+ }))
+ : ((root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null));
commitStartTime = now();
suspendedCommitReason === SUSPENDED_COMMIT
? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime)
@@ -15926,9 +16162,9 @@
0 !== (finishedWork.subtreeFlags & 15990) || transitions
? ((transitions = ReactSharedInternals.T),
(ReactSharedInternals.T = null),
- (spawnedLane = ReactDOMSharedInternals.p),
+ (updatedLanes = ReactDOMSharedInternals.p),
(ReactDOMSharedInternals.p = DiscreteEventPriority),
- (updatedLanes = executionContext),
+ (suspendedRetryLanes = executionContext),
(executionContext |= CommitContext),
commitBeforeMutationEffects(root, finishedWork),
commitMutationEffects(
@@ -15942,8 +16178,8 @@
(root.current = finishedWork),
commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate),
requestPaint(),
- (executionContext = updatedLanes),
- (ReactDOMSharedInternals.p = spawnedLane),
+ (executionContext = suspendedRetryLanes),
+ (ReactDOMSharedInternals.p = updatedLanes),
(ReactSharedInternals.T = transitions))
: (root.current = finishedWork);
commitEndTime = now();
@@ -15953,8 +16189,8 @@
: commitStartTime,
commitEndTime
);
- (suspendedCommitReason = rootDoesHavePassiveEffects)
- ? ((rootDoesHavePassiveEffects = !1),
+ (suspendedCommitReason = spawnedLane)
+ ? ((spawnedLane = !1),
(rootWithPendingPassiveEffects = root),
(pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate))
: (releaseRootPooledCache(root, exitStatus),
@@ -15966,7 +16202,6 @@
onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel);
isDevToolsPresent && root.memoizedUpdaters.clear();
onCommitRoot();
- ensureRootIsScheduled(root);
if (null !== recoverableErrors)
for (
renderPriorityLevel = root.onRecoverableError,
@@ -15983,6 +16218,7 @@
exitStatus
);
0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects();
+ ensureRootIsScheduled(root);
exitStatus = root.pendingLanes;
0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42)
? ((nestedUpdateScheduled = !0),
@@ -16314,7 +16550,7 @@
shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber),
reappearLayoutEffects(root, fiber.alternate, fiber, !1),
shouldDoubleInvokePassiveEffects &&
- reconnectPassiveEffects(root, fiber, 0, null, !1);
+ reconnectPassiveEffects(root, fiber, 0, null, !1, 0);
} finally {
setIsStrictModeForDevtools(!1);
}
@@ -18746,7 +18982,7 @@
console.error(
"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
);
- else if (canDiffStyleForHydrationWarning) {
+ else {
var clientValue;
var delimiter = (clientValue = ""),
styleName;
@@ -19165,42 +19401,36 @@
}
case "src":
case "href":
- if (
- !(
- "" !== propKey ||
- ("a" === tag && "href" === value) ||
- ("object" === tag && "data" === value)
- )
- ) {
- "src" === value
- ? console.error(
- 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
- value,
- value
- )
- : console.error(
- 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
- value,
- value
- );
- hydrateSanitizedAttribute(
- domElement,
- value,
- value,
- null,
- extraAttributes,
- serverDifferences
- );
- continue;
- }
- hydrateSanitizedAttribute(
- domElement,
- value,
- value,
- propKey,
- extraAttributes,
- serverDifferences
- );
+ "" !== propKey ||
+ ("a" === tag && "href" === value) ||
+ ("object" === tag && "data" === value)
+ ? hydrateSanitizedAttribute(
+ domElement,
+ value,
+ value,
+ propKey,
+ extraAttributes,
+ serverDifferences
+ )
+ : ("src" === value
+ ? console.error(
+ 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
+ value,
+ value
+ )
+ : console.error(
+ 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
+ value,
+ value
+ ),
+ hydrateSanitizedAttribute(
+ domElement,
+ value,
+ value,
+ null,
+ extraAttributes,
+ serverDifferences
+ ));
continue;
case "action":
case "formAction":
@@ -21318,8 +21548,12 @@
queuedTarget.blockedOn = targetInst;
runWithPriority(queuedTarget.priority, function () {
if (13 === nearestMounted.tag) {
- var lane = requestUpdateLane(nearestMounted),
- root = enqueueConcurrentRenderForLane(nearestMounted, lane);
+ var lane = requestUpdateLane(nearestMounted);
+ lane = getBumpedLaneForHydrationByLane(lane);
+ var root = enqueueConcurrentRenderForLane(
+ nearestMounted,
+ lane
+ );
null !== root &&
scheduleUpdateOnFiber(root, nearestMounted, lane);
markRetryLaneIfNotHydrated(nearestMounted, lane);
@@ -21535,7 +21769,6 @@
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy");
Symbol.for("react.scope");
- Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker");
@@ -21619,11 +21852,6 @@
allNativeEvents = new Set(),
registrationNameDependencies = {},
possibleRegistrationNames = {},
- canUseDOM = !(
- "undefined" === typeof window ||
- "undefined" === typeof window.document ||
- "undefined" === typeof window.document.createElement
- ),
hasReadOnlyValue = {
button: !0,
checkbox: !0,
@@ -21670,8 +21898,6 @@
containerTagInScope: null
},
didWarn = {},
- MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML",
- SVG_NAMESPACE = "http://www.w3.org/2000/svg",
shorthandToLonghand = {
animation:
"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(
@@ -21822,6 +22048,8 @@
" "
)
),
+ MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML",
+ SVG_NAMESPACE = "http://www.w3.org/2000/svg",
aliases = new Map([
["acceptCharset", "accept-charset"],
["htmlFor", "for"],
@@ -22470,6 +22698,11 @@
restoreTarget = null,
restoreQueue = null,
isInsideEventHandler = !1,
+ canUseDOM = !(
+ "undefined" === typeof window ||
+ "undefined" === typeof window.document ||
+ "undefined" === typeof window.document.createElement
+ ),
passiveBrowserEventsSupported = !1;
if (canUseDOM)
try {
@@ -22797,19 +23030,21 @@
supportsUserTiming =
"undefined" !== typeof performance &&
"function" === typeof performance.measure,
+ COMPONENTS_TRACK = "Components \u269b",
reusableComponentDevToolDetails = {
color: "primary",
- track: "Components \u269b"
+ track: COMPONENTS_TRACK
},
reusableComponentOptions = {
start: -0,
end: -0,
detail: { devtools: reusableComponentDevToolDetails }
},
+ LANES_TRACK_GROUP = "Scheduler \u269b",
reusableLaneDevToolDetails = {
color: "primary",
track: "Blocking",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
},
reusableLaneOptions = {
start: -0,
@@ -22817,42 +23052,42 @@
detail: { devtools: reusableLaneDevToolDetails }
},
blockingLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Blocking",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
transitionLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Transition",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
suspenseLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Suspense",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
idleLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Idle",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
@@ -22898,6 +23133,59 @@
yieldStartTime = -1.1,
currentUpdateIsNested = !1,
nestedUpdateScheduled = !1,
+ valueCursor = createCursor(null);
+ var rendererCursorDEV = createCursor(null);
+ var rendererSigil = {};
+ var currentlyRenderingFiber$1 = null,
+ lastContextDependency = null,
+ isDisallowedContextReadInDEV = !1,
+ currentEntangledListeners = null,
+ currentEntangledPendingCount = 0,
+ currentEntangledLane = 0,
+ currentEntangledActionThenable = null,
+ UpdateState = 0,
+ ReplaceState = 1,
+ ForceUpdate = 2,
+ CaptureUpdate = 3,
+ hasForceUpdate = !1;
+ var didWarnUpdateInsideUpdate = !1;
+ var currentlyProcessingQueue = null;
+ var didReadFromEntangledAsyncAction = !1,
+ NoFlags = 0,
+ HasEffect = 1,
+ Insertion = 2,
+ Layout = 4,
+ Passive = 8,
+ AbortControllerLocal =
+ "undefined" !== typeof AbortController
+ ? AbortController
+ : function () {
+ var listeners = [],
+ signal = (this.signal = {
+ aborted: !1,
+ addEventListener: function (type, listener) {
+ listeners.push(listener);
+ }
+ });
+ this.abort = function () {
+ signal.aborted = !0;
+ listeners.forEach(function (listener) {
+ return listener();
+ });
+ };
+ },
+ scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
+ NormalPriority = Scheduler.unstable_NormalPriority,
+ CacheContext = {
+ $$typeof: REACT_CONTEXT_TYPE,
+ Consumer: null,
+ Provider: null,
+ _currentValue: null,
+ _currentValue2: null,
+ _threadCount: 0,
+ _currentRenderer: null,
+ _currentRenderer2: null
+ },
ReactStrictModeWarnings = {
recordUnsafeLifecycleWarnings: function () {},
flushPendingUnsafeLifecycleWarnings: function () {},
@@ -23092,7 +23380,79 @@
pendingUNSAFE_ComponentWillUpdateWarnings = [];
pendingLegacyContextWarning = new Map();
};
- var CapturedStacks = new WeakMap(),
+ var fakeInternalInstance = {};
+ var didWarnAboutStateAssignmentForComponent = new Set();
+ var didWarnAboutUninitializedState = new Set();
+ var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
+ var didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
+ var didWarnAboutDirectlyAssigningPropsToState = new Set();
+ var didWarnAboutUndefinedDerivedState = new Set();
+ var didWarnAboutContextTypes$1 = new Set();
+ var didWarnAboutChildContextTypes = new Set();
+ var didWarnAboutInvalidateContextType = new Set();
+ var didWarnOnInvalidCallback = new Set();
+ Object.freeze(fakeInternalInstance);
+ var classComponentUpdater = {
+ isMounted: function (component) {
+ var owner = current;
+ if (null !== owner && isRendering && 1 === owner.tag) {
+ var instance = owner.stateNode;
+ instance._warnedAboutRefsInRender ||
+ console.error(
+ "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",
+ getComponentNameFromFiber(owner) || "A component"
+ );
+ instance._warnedAboutRefsInRender = !0;
+ }
+ return (component = component._reactInternals)
+ ? getNearestMountedFiber(component) === component
+ : !1;
+ },
+ enqueueSetState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.payload = payload;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueReplaceState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.tag = ReplaceState;
+ update.payload = payload;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueForceUpdate: function (inst, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.tag = ForceUpdate;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ callback = enqueueUpdate(inst, update, lane);
+ null !== callback &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(callback, inst, lane),
+ entangleTransitions(callback, inst, lane));
+ }
+ },
+ CapturedStacks = new WeakMap(),
forkStack = [],
forkStackIndex = 0,
treeForkProvider = null,
@@ -23107,68 +23467,29 @@
isHydrating = !1,
didSuspendOrErrorDEV = !1,
hydrationDiffRootDEV = null,
- hydrationErrors = null,
- rootOrSingletonContext = !1,
- HydrationMismatchException = Error(
- "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
- ),
- SuspenseException = Error(
- "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
- ),
- SuspenseyCommitException = Error(
- "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
- ),
- SuspenseActionException = Error(
- "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
- ),
- noopSuspenseyCommitThenable = {
- then: function () {
- console.error(
- 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
- );
- }
- },
- suspendedThenable = null,
- needsToResetSuspendedThenableDEV = !1,
- NoFlags = 0,
- HasEffect = 1,
- Insertion = 2,
- Layout = 4,
- Passive = 8,
- AbortControllerLocal =
- "undefined" !== typeof AbortController
- ? AbortController
- : function () {
- var listeners = [],
- signal = (this.signal = {
- aborted: !1,
- addEventListener: function (type, listener) {
- listeners.push(listener);
- }
- });
- this.abort = function () {
- signal.aborted = !0;
- listeners.forEach(function (listener) {
- return listener();
- });
- };
- },
- scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
- NormalPriority = Scheduler.unstable_NormalPriority,
- CacheContext = {
- $$typeof: REACT_CONTEXT_TYPE,
- Consumer: null,
- Provider: null,
- _currentValue: null,
- _currentValue2: null,
- _threadCount: 0,
- _currentRenderer: null,
- _currentRenderer2: null
+ hydrationErrors = null,
+ rootOrSingletonContext = !1,
+ HydrationMismatchException = Error(
+ "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
+ ),
+ SuspenseException = Error(
+ "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
+ ),
+ SuspenseyCommitException = Error(
+ "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
+ ),
+ SuspenseActionException = Error(
+ "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
+ ),
+ noopSuspenseyCommitThenable = {
+ then: function () {
+ console.error(
+ 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
+ );
+ }
},
- currentEntangledListeners = null,
- currentEntangledPendingCount = 0,
- currentEntangledLane = 0,
- currentEntangledActionThenable = null,
+ suspendedThenable = null,
+ needsToResetSuspendedThenableDEV = !1,
currentTreeHiddenStackCursor = createCursor(null),
prevEntangledRenderLanesCursor = createCursor(0),
prevOnStartTransitionFinish = ReactSharedInternals.S;
@@ -23202,7 +23523,7 @@
var didWarnAboutAsyncClientComponent = new Set();
var didWarnAboutUseFormState = new Set();
var renderLanes = 0,
- currentlyRenderingFiber$1 = null,
+ currentlyRenderingFiber = null,
currentHook = null,
workInProgressHook = null,
didScheduleRenderPhaseUpdate = !1,
@@ -23216,36 +23537,33 @@
currentHookNameInDev = null,
hookTypesDev = null,
hookTypesUpdateIndexDev = -1,
- ignorePreviousDependencies = !1;
- var createFunctionComponentUpdateQueue = function () {
- return { lastEffect: null, events: null, stores: null, memoCache: null };
- };
- var ContextOnlyDispatcher = {
- readContext: readContext,
- use: use,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useInsertionEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError,
- useSyncExternalStore: throwInvalidHookError,
- useId: throwInvalidHookError
- };
- ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
- ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
+ ignorePreviousDependencies = !1,
+ ContextOnlyDispatcher = {
+ readContext: readContext,
+ use: use,
+ useCallback: throwInvalidHookError,
+ useContext: throwInvalidHookError,
+ useEffect: throwInvalidHookError,
+ useImperativeHandle: throwInvalidHookError,
+ useLayoutEffect: throwInvalidHookError,
+ useInsertionEffect: throwInvalidHookError,
+ useMemo: throwInvalidHookError,
+ useReducer: throwInvalidHookError,
+ useRef: throwInvalidHookError,
+ useState: throwInvalidHookError,
+ useDebugValue: throwInvalidHookError,
+ useDeferredValue: throwInvalidHookError,
+ useTransition: throwInvalidHookError,
+ useSyncExternalStore: throwInvalidHookError,
+ useId: throwInvalidHookError,
+ useHostTransitionStatus: throwInvalidHookError,
+ useFormState: throwInvalidHookError,
+ useActionState: throwInvalidHookError,
+ useOptimistic: throwInvalidHookError,
+ useMemoCache: throwInvalidHookError,
+ useCacheRefresh: throwInvalidHookError
+ };
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
- ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
- ContextOnlyDispatcher.useFormState = throwInvalidHookError;
- ContextOnlyDispatcher.useActionState = throwInvalidHookError;
- ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
var HooksDispatcherOnMountInDEV = null,
HooksDispatcherOnMountWithHookTypesInDEV = null,
HooksDispatcherOnUpdateInDEV = null,
@@ -23364,39 +23682,35 @@
mountHookTypesDev();
return mountId();
},
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ mountHookTypesDev();
+ warnOnUseFormStateInDev();
+ return mountActionState(action, initialState);
+ },
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ mountHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ mountHookTypesDev();
+ return mountOptimistic(passthrough);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
mountHookTypesDev();
return mountRefresh();
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ mountHookTypesDev();
+ return mountEvent(callback);
}
};
- HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- mountHookTypesDev();
- return mountEvent(callback);
- };
- HooksDispatcherOnMountInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
- currentHookNameInDev = "useFormState";
- mountHookTypesDev();
- warnOnUseFormStateInDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) {
- currentHookNameInDev = "useOptimistic";
- mountHookTypesDev();
- return mountOptimistic(passthrough);
- };
HooksDispatcherOnMountWithHookTypesInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23502,46 +23816,35 @@
updateHookTypesDev();
return mountId();
},
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return mountOptimistic(passthrough);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return mountRefresh();
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return mountEvent(callback);
}
};
- HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function (
- callback
- ) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return mountEvent(callback);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function (
- passthrough
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return mountOptimistic(passthrough);
- };
HooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23647,39 +23950,35 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return updateActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return updateActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return updateOptimistic(passthrough, reducer);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return updateEvent(callback);
}
};
- HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return updateEvent(callback);
- };
- HooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnUpdateInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return updateActionState(action);
- };
- HooksDispatcherOnUpdateInDEV.useActionState = function (action) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return updateActionState(action);
- };
- HooksDispatcherOnUpdateInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return updateOptimistic(passthrough, reducer);
- };
HooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23785,39 +24084,35 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return rerenderActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return rerenderActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return rerenderOptimistic(passthrough, reducer);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return updateEvent(callback);
}
};
- HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return updateEvent(callback);
- };
- HooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnRerenderInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return rerenderActionState(action);
- };
- HooksDispatcherOnRerenderInDEV.useActionState = function (action) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- HooksDispatcherOnRerenderInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return rerenderOptimistic(passthrough, reducer);
- };
InvalidNestedHooksDispatcherOnMountInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -23942,15 +24237,34 @@
mountHookTypesDev();
return mountId();
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
mountHookTypesDev();
- return mountRefresh();
+ return mountActionState(action, initialState);
+ },
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ mountHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ mountHookTypesDev();
+ return mountOptimistic(passthrough);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ mountHookTypesDev();
+ return mountRefresh();
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -23958,34 +24272,6 @@
return mountEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function (
- passthrough
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountOptimistic(passthrough);
- };
InvalidNestedHooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -24110,15 +24396,34 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
updateHookTypesDev();
- return updateWorkInProgressHook().memoizedState;
+ return updateActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return updateActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return updateOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ updateHookTypesDev();
+ return updateWorkInProgressHook().memoizedState;
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -24126,31 +24431,6 @@
return updateEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateActionState(action);
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function (
- action
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateActionState(action);
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateOptimistic(passthrough, reducer);
- };
InvalidNestedHooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -24275,15 +24555,34 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
updateHookTypesDev();
- return updateWorkInProgressHook().memoizedState;
+ return rerenderActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return rerenderActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return rerenderOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ updateHookTypesDev();
+ return updateWorkInProgressHook().memoizedState;
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -24291,33 +24590,6 @@
return updateEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function (
- action
- ) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function (
- action
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderOptimistic(passthrough, reducer);
- };
var callComponent = {
"react-stack-bottom-frame": function (Component, props, secondArg) {
var wasRendering = isRendering;
@@ -24503,78 +24775,6 @@
SubtreeSuspenseContextMask = 1,
ForceSuspenseFallback = 2,
suspenseStackCursor = createCursor(0),
- fakeInternalInstance = {};
- var didWarnAboutStateAssignmentForComponent = new Set();
- var didWarnAboutUninitializedState = new Set();
- var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
- var didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
- var didWarnAboutDirectlyAssigningPropsToState = new Set();
- var didWarnAboutUndefinedDerivedState = new Set();
- var didWarnAboutContextTypes$1 = new Set();
- var didWarnAboutChildContextTypes = new Set();
- var didWarnAboutInvalidateContextType = new Set();
- var didWarnOnInvalidCallback = new Set();
- Object.freeze(fakeInternalInstance);
- var classComponentUpdater = {
- isMounted: function (component) {
- var owner = current;
- if (null !== owner && isRendering && 1 === owner.tag) {
- var instance = owner.stateNode;
- instance._warnedAboutRefsInRender ||
- console.error(
- "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",
- getComponentNameFromFiber(owner) || "A component"
- );
- instance._warnedAboutRefsInRender = !0;
- }
- return (component = component._reactInternals)
- ? getNearestMountedFiber(component) === component
- : !1;
- },
- enqueueSetState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.payload = payload;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueReplaceState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.tag = ReplaceState;
- update.payload = payload;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueForceUpdate: function (inst, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.tag = ForceUpdate;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- callback = enqueueUpdate(inst, update, lane);
- null !== callback &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(callback, inst, lane),
- entangleTransitions(callback, inst, lane));
- }
- },
reportGlobalError =
"function" === typeof reportError
? reportError
@@ -24620,23 +24820,10 @@
var SUSPENDED_MARKER = {
dehydrated: null,
treeContext: null,
- retryLane: 0
+ retryLane: 0,
+ hydrationErrors: null
},
hasWarnedAboutUsingNoValuePropOnContextProvider = !1,
- valueCursor = createCursor(null);
- var rendererCursorDEV = createCursor(null);
- var rendererSigil = {};
- var currentlyRenderingFiber = null,
- lastContextDependency = null,
- isDisallowedContextReadInDEV = !1,
- UpdateState = 0,
- ReplaceState = 1,
- ForceUpdate = 2,
- CaptureUpdate = 3,
- hasForceUpdate = !1;
- var didWarnUpdateInsideUpdate = !1;
- var currentlyProcessingQueue = null;
- var didReadFromEntangledAsyncAction = !1,
didWarnAboutUndefinedSnapshotBeforeUpdate = null;
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
var offscreenSubtreeIsHidden = !1,
@@ -24650,6 +24837,7 @@
hostParent = null,
hostParentIsContainer = !1,
currentHoistableRoot = null,
+ inHydratedSubtree = !1,
suspenseyCommitFlag = 8192;
var hasBadMapPolyfill = !1;
try {
@@ -24727,7 +24915,6 @@
RENDER_TIMEOUT_MS = 500,
workInProgressTransitions = null,
legacyErrorBoundariesThatAlreadyFailed = null,
- rootDoesHavePassiveEffects = !1,
rootWithPendingPassiveEffects = null,
pendingPassiveEffectsLanes = 0,
pendingPassiveEffectsRemainingLanes = 0,
@@ -24827,7 +25014,6 @@
didWarnFormActionMethod = !1,
didWarnPopoverTargetObject = !1;
var didWarnForNewBooleanPropsWithEmptyValue = {};
- var canDiffStyleForHydrationWarning = !0;
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g,
NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g,
xlinkNamespace = "http://www.w3.org/1999/xlink",
@@ -25222,52 +25408,43 @@
),
lastScheduledReplayQueue = null;
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
- function (children, JSCompiler_OptimizeArgumentsArray_p2) {
+ function (children) {
var root = this._internalRoot;
if (null === root) throw Error("Cannot update an unmounted root.");
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p2
+ var args = arguments;
+ "function" === typeof args[1]
? console.error(
"does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
)
- : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2)
+ : isValidContainer(args[1])
? console.error(
"You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."
)
- : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 &&
+ : "undefined" !== typeof args[1] &&
console.error(
"You passed a second argument to root.render(...) but it only accepts one argument."
);
- JSCompiler_OptimizeArgumentsArray_p2 = root.current;
- var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2);
- updateContainerImpl(
- JSCompiler_OptimizeArgumentsArray_p2,
- lane,
- children,
- root,
- null,
- null
- );
+ args = children;
+ var current = root.current,
+ lane = requestUpdateLane(current);
+ updateContainerImpl(current, lane, args, root, null, null);
};
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount =
- function (JSCompiler_OptimizeArgumentsArray_p3) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 &&
+ function () {
+ var args = arguments;
+ "function" === typeof args[0] &&
console.error(
"does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
);
- JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot;
- if (null !== JSCompiler_OptimizeArgumentsArray_p3) {
+ args = this._internalRoot;
+ if (null !== args) {
this._internalRoot = null;
- var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo;
+ var container = args.containerInfo;
(executionContext & (RenderContext | CommitContext)) !== NoContext &&
console.error(
"Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."
);
- updateContainerSync(
- null,
- JSCompiler_OptimizeArgumentsArray_p3,
- null,
- null
- );
+ updateContainerSync(null, args, null, null);
flushSyncWork$1();
container[internalContainerInstanceKey] = null;
}
@@ -25291,11 +25468,11 @@
};
(function () {
var isomorphicReactPackageVersion = React.version;
- if ("19.0.0-experimental-372ec00c-20241209" !== isomorphicReactPackageVersion)
+ if ("19.1.0-experimental-518d06d2-20241219" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
- "\n - react-dom: 19.0.0-experimental-372ec00c-20241209\nLearn more: https://react.dev/warnings/version-mismatch")
+ "\n - react-dom: 19.1.0-experimental-518d06d2-20241219\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -25332,11 +25509,10 @@
!(function () {
var internals = {
bundleType: 1,
- version: "19.0.0-experimental-372ec00c-20241209",
+ version: "19.1.0-experimental-518d06d2-20241219",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
- findFiberByHostInstance: getClosestInstanceFromNode,
- reconcilerVersion: "19.0.0-experimental-372ec00c-20241209"
+ reconcilerVersion: "19.1.0-experimental-518d06d2-20241219"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -25468,17 +25644,19 @@
initialChildren.context = getContextForSubtree(null);
options = initialChildren.current;
isStrictMode = requestUpdateLane(options);
+ isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
identifierPrefix = createUpdate(isStrictMode);
identifierPrefix.callback = null;
enqueueUpdate(options, identifierPrefix, isStrictMode);
- initialChildren.current.lanes = isStrictMode;
- markRootUpdated$1(initialChildren, isStrictMode);
+ options = isStrictMode;
+ initialChildren.current.lanes = options;
+ markRootUpdated$1(initialChildren, options);
ensureRootIsScheduled(initialChildren);
container[internalContainerInstanceKey] = initialChildren.current;
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
- exports.version = "19.0.0-experimental-372ec00c-20241209";
+ exports.version = "19.1.0-experimental-518d06d2-20241219";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js
index 8eb3bede6865d..6ff59c6b3174e 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js
@@ -51,7 +51,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy");
Symbol.for("react.scope");
-Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker");
@@ -286,13 +285,11 @@ function describeFiber(fiber) {
return describeBuiltInComponentFrame("SuspenseList");
case 0:
case 15:
- return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber;
+ return describeNativeComponentFrame(fiber.type, !1);
case 11:
- return (
- (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber
- );
+ return describeNativeComponentFrame(fiber.type.render, !1);
case 1:
- return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber;
+ return describeNativeComponentFrame(fiber.type, !0);
default:
return "";
}
@@ -774,6 +771,46 @@ function markRootEntangled(root, entangledLanes) {
rootEntangledLanes &= ~lane;
}
}
+function getBumpedLaneForHydrationByLane(lane) {
+ switch (lane) {
+ case 2:
+ lane = 1;
+ break;
+ case 8:
+ lane = 4;
+ break;
+ case 32:
+ lane = 16;
+ break;
+ case 128:
+ case 256:
+ case 512:
+ case 1024:
+ case 2048:
+ case 4096:
+ case 8192:
+ case 16384:
+ case 32768:
+ case 65536:
+ case 131072:
+ case 262144:
+ case 524288:
+ case 1048576:
+ case 2097152:
+ case 4194304:
+ case 8388608:
+ case 16777216:
+ case 33554432:
+ lane = 64;
+ break;
+ case 268435456:
+ lane = 134217728;
+ break;
+ default:
+ lane = 0;
+ }
+ return lane;
+}
function lanesToEventPriority(lanes) {
lanes &= -lanes;
return 2 < lanes
@@ -890,12 +927,7 @@ function registerDirectEvent(registrationName, dependencies) {
)
allNativeEvents.add(dependencies[registrationName]);
}
-var canUseDOM = !(
- "undefined" === typeof window ||
- "undefined" === typeof window.document ||
- "undefined" === typeof window.document.createElement
- ),
- VALID_ATTRIBUTE_NAME_REGEX = RegExp(
+var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
"^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
),
illegalAttributeNameCache = {},
@@ -1504,7 +1536,12 @@ function getListener(inst, registrationName) {
);
return stateNode;
}
-var passiveBrowserEventsSupported = !1;
+var canUseDOM = !(
+ "undefined" === typeof window ||
+ "undefined" === typeof window.document ||
+ "undefined" === typeof window.document.createElement
+ ),
+ passiveBrowserEventsSupported = !1;
if (canUseDOM)
try {
var options = {};
@@ -1991,19 +2028,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) {
}
var isInputEventSupported = !1;
if (canUseDOM) {
- var JSCompiler_inline_result$jscomp$285;
+ var JSCompiler_inline_result$jscomp$283;
if (canUseDOM) {
- var isSupported$jscomp$inline_420 = "oninput" in document;
- if (!isSupported$jscomp$inline_420) {
- var element$jscomp$inline_421 = document.createElement("div");
- element$jscomp$inline_421.setAttribute("oninput", "return;");
- isSupported$jscomp$inline_420 =
- "function" === typeof element$jscomp$inline_421.oninput;
+ var isSupported$jscomp$inline_412 = "oninput" in document;
+ if (!isSupported$jscomp$inline_412) {
+ var element$jscomp$inline_413 = document.createElement("div");
+ element$jscomp$inline_413.setAttribute("oninput", "return;");
+ isSupported$jscomp$inline_412 =
+ "function" === typeof element$jscomp$inline_413.oninput;
}
- JSCompiler_inline_result$jscomp$285 = isSupported$jscomp$inline_420;
- } else JSCompiler_inline_result$jscomp$285 = !1;
+ JSCompiler_inline_result$jscomp$283 = isSupported$jscomp$inline_412;
+ } else JSCompiler_inline_result$jscomp$283 = !1;
isInputEventSupported =
- JSCompiler_inline_result$jscomp$285 &&
+ JSCompiler_inline_result$jscomp$283 &&
(!document.documentMode || 9 < document.documentMode);
}
function stopWatchingForValueChange() {
@@ -2424,380 +2461,195 @@ function getRootForUpdatedFiber(sourceFiber) {
return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
}
var emptyContextObject = {},
- CapturedStacks = new WeakMap();
-function createCapturedValueAtFiber(value, source) {
- if ("object" === typeof value && null !== value) {
- var existing = CapturedStacks.get(value);
- if (void 0 !== existing) return existing;
- source = {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- CapturedStacks.set(value, source);
- return source;
- }
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
-}
-var forkStack = [],
- forkStackIndex = 0,
- treeForkProvider = null,
- treeForkCount = 0,
- idStack = [],
- idStackIndex = 0,
- treeContextProvider = null,
- treeContextId = 1,
- treeContextOverflow = "";
-function pushTreeFork(workInProgress, totalChildren) {
- forkStack[forkStackIndex++] = treeForkCount;
- forkStack[forkStackIndex++] = treeForkProvider;
- treeForkProvider = workInProgress;
- treeForkCount = totalChildren;
+ valueCursor = createCursor(null),
+ currentlyRenderingFiber$1 = null,
+ lastContextDependency = null;
+function pushProvider(providerFiber, context, nextValue) {
+ push(valueCursor, context._currentValue);
+ context._currentValue = nextValue;
}
-function pushTreeId(workInProgress, totalChildren, index) {
- idStack[idStackIndex++] = treeContextId;
- idStack[idStackIndex++] = treeContextOverflow;
- idStack[idStackIndex++] = treeContextProvider;
- treeContextProvider = workInProgress;
- var baseIdWithLeadingBit = treeContextId;
- workInProgress = treeContextOverflow;
- var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
- baseIdWithLeadingBit &= ~(1 << baseLength);
- index += 1;
- var length = 32 - clz32(totalChildren) + baseLength;
- if (30 < length) {
- var numberOfOverflowBits = baseLength - (baseLength % 5);
- length = (
- baseIdWithLeadingBit &
- ((1 << numberOfOverflowBits) - 1)
- ).toString(32);
- baseIdWithLeadingBit >>= numberOfOverflowBits;
- baseLength -= numberOfOverflowBits;
- treeContextId =
- (1 << (32 - clz32(totalChildren) + baseLength)) |
- (index << baseLength) |
- baseIdWithLeadingBit;
- treeContextOverflow = length + workInProgress;
- } else
- (treeContextId =
- (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
- (treeContextOverflow = workInProgress);
+function popProvider(context) {
+ context._currentValue = valueCursor.current;
+ pop(valueCursor);
}
-function pushMaterializedTreeId(workInProgress) {
- null !== workInProgress.return &&
- (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
+function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
+ for (; null !== parent; ) {
+ var alternate = parent.alternate;
+ (parent.childLanes & renderLanes) !== renderLanes
+ ? ((parent.childLanes |= renderLanes),
+ null !== alternate && (alternate.childLanes |= renderLanes))
+ : null !== alternate &&
+ (alternate.childLanes & renderLanes) !== renderLanes &&
+ (alternate.childLanes |= renderLanes);
+ if (parent === propagationRoot) break;
+ parent = parent.return;
+ }
}
-function popTreeContext(workInProgress) {
- for (; workInProgress === treeForkProvider; )
- (treeForkProvider = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null),
- (treeForkCount = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null);
- for (; workInProgress === treeContextProvider; )
- (treeContextProvider = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextOverflow = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextId = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null);
+function propagateContextChanges(
+ workInProgress,
+ contexts,
+ renderLanes,
+ forcePropagateEntireTree
+) {
+ var fiber = workInProgress.child;
+ null !== fiber && (fiber.return = workInProgress);
+ for (; null !== fiber; ) {
+ var list = fiber.dependencies;
+ if (null !== list) {
+ var nextFiber = fiber.child;
+ list = list.firstContext;
+ a: for (; null !== list; ) {
+ var dependency = list;
+ list = fiber;
+ for (var i = 0; i < contexts.length; i++)
+ if (dependency.context === contexts[i]) {
+ list.lanes |= renderLanes;
+ dependency = list.alternate;
+ null !== dependency && (dependency.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ list.return,
+ renderLanes,
+ workInProgress
+ );
+ forcePropagateEntireTree || (nextFiber = null);
+ break a;
+ }
+ list = dependency.next;
+ }
+ } else if (18 === fiber.tag) {
+ nextFiber = fiber.return;
+ if (null === nextFiber) throw Error(formatProdErrorMessage(341));
+ nextFiber.lanes |= renderLanes;
+ list = nextFiber.alternate;
+ null !== list && (list.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);
+ nextFiber = null;
+ } else nextFiber = fiber.child;
+ if (null !== nextFiber) nextFiber.return = fiber;
+ else
+ for (nextFiber = fiber; null !== nextFiber; ) {
+ if (nextFiber === workInProgress) {
+ nextFiber = null;
+ break;
+ }
+ fiber = nextFiber.sibling;
+ if (null !== fiber) {
+ fiber.return = nextFiber.return;
+ nextFiber = fiber;
+ break;
+ }
+ nextFiber = nextFiber.return;
+ }
+ fiber = nextFiber;
+ }
}
-var hydrationParentFiber = null,
- nextHydratableInstance = null,
- isHydrating = !1,
- hydrationErrors = null,
- rootOrSingletonContext = !1,
- HydrationMismatchException = Error(formatProdErrorMessage(519));
-function throwOnHydrationMismatch(fiber) {
- var error = Error(formatProdErrorMessage(418, ""));
- queueHydrationError(createCapturedValueAtFiber(error, fiber));
- throw HydrationMismatchException;
+function propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ forcePropagateEntireTree
+) {
+ current = null;
+ for (
+ var parent = workInProgress, isInsidePropagationBailout = !1;
+ null !== parent;
+
+ ) {
+ if (!isInsidePropagationBailout)
+ if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
+ else if (0 !== (parent.flags & 262144)) break;
+ if (10 === parent.tag) {
+ var currentParent = parent.alternate;
+ if (null === currentParent) throw Error(formatProdErrorMessage(387));
+ currentParent = currentParent.memoizedProps;
+ if (null !== currentParent) {
+ var context = parent.type;
+ objectIs(parent.pendingProps.value, currentParent.value) ||
+ (null !== current ? current.push(context) : (current = [context]));
+ }
+ } else if (parent === hostTransitionProviderCursor.current) {
+ currentParent = parent.alternate;
+ if (null === currentParent) throw Error(formatProdErrorMessage(387));
+ currentParent.memoizedState.memoizedState !==
+ parent.memoizedState.memoizedState &&
+ (null !== current
+ ? current.push(HostTransitionContext)
+ : (current = [HostTransitionContext]));
+ }
+ parent = parent.return;
+ }
+ null !== current &&
+ propagateContextChanges(
+ workInProgress,
+ current,
+ renderLanes,
+ forcePropagateEntireTree
+ );
+ workInProgress.flags |= 262144;
}
-function prepareToHydrateHostInstance(fiber) {
- var instance = fiber.stateNode,
- type = fiber.type,
- props = fiber.memoizedProps;
- instance[internalInstanceKey] = fiber;
- instance[internalPropsKey] = props;
- switch (type) {
- case "dialog":
- listenToNonDelegatedEvent("cancel", instance);
- listenToNonDelegatedEvent("close", instance);
- break;
- case "iframe":
- case "object":
- case "embed":
- listenToNonDelegatedEvent("load", instance);
- break;
- case "video":
- case "audio":
- for (type = 0; type < mediaEventTypes.length; type++)
- listenToNonDelegatedEvent(mediaEventTypes[type], instance);
- break;
- case "source":
- listenToNonDelegatedEvent("error", instance);
- break;
- case "img":
- case "image":
- case "link":
- listenToNonDelegatedEvent("error", instance);
- listenToNonDelegatedEvent("load", instance);
- break;
- case "details":
- listenToNonDelegatedEvent("toggle", instance);
- break;
- case "input":
- listenToNonDelegatedEvent("invalid", instance);
- initInput(
- instance,
- props.value,
- props.defaultValue,
- props.checked,
- props.defaultChecked,
- props.type,
- props.name,
- !0
- );
- track(instance);
- break;
- case "select":
- listenToNonDelegatedEvent("invalid", instance);
- break;
- case "textarea":
- listenToNonDelegatedEvent("invalid", instance),
- initTextarea(instance, props.value, props.defaultValue, props.children),
- track(instance);
+function checkIfContextChanged(currentDependencies) {
+ for (
+ currentDependencies = currentDependencies.firstContext;
+ null !== currentDependencies;
+
+ ) {
+ if (
+ !objectIs(
+ currentDependencies.context._currentValue,
+ currentDependencies.memoizedValue
+ )
+ )
+ return !0;
+ currentDependencies = currentDependencies.next;
}
- type = props.children;
- ("string" !== typeof type &&
- "number" !== typeof type &&
- "bigint" !== typeof type) ||
- instance.textContent === "" + type ||
- !0 === props.suppressHydrationWarning ||
- checkForUnmatchedText(instance.textContent, type)
- ? (null != props.popover &&
- (listenToNonDelegatedEvent("beforetoggle", instance),
- listenToNonDelegatedEvent("toggle", instance)),
- null != props.onScroll && listenToNonDelegatedEvent("scroll", instance),
- null != props.onScrollEnd &&
- listenToNonDelegatedEvent("scrollend", instance),
- null != props.onClick && (instance.onclick = noop$1),
- (instance = !0))
- : (instance = !1);
- instance || throwOnHydrationMismatch(fiber);
-}
-function popToNextHostParent(fiber) {
- for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
- switch (hydrationParentFiber.tag) {
- case 3:
- case 27:
- rootOrSingletonContext = !0;
- return;
- case 5:
- case 13:
- rootOrSingletonContext = !1;
- return;
- default:
- hydrationParentFiber = hydrationParentFiber.return;
- }
+ return !1;
}
-function popHydrationState(fiber) {
- if (fiber !== hydrationParentFiber) return !1;
- if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;
- var shouldClear = !1,
- JSCompiler_temp;
- if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
- if ((JSCompiler_temp = 5 === fiber.tag))
- (JSCompiler_temp = fiber.type),
- (JSCompiler_temp =
- !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
- shouldSetTextContent(fiber.type, fiber.memoizedProps));
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp && (shouldClear = !0);
- shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber);
- popToNextHostParent(fiber);
- if (13 === fiber.tag) {
- fiber = fiber.memoizedState;
- fiber = null !== fiber ? fiber.dehydrated : null;
- if (!fiber) throw Error(formatProdErrorMessage(317));
- a: {
- fiber = fiber.nextSibling;
- for (shouldClear = 0; fiber; ) {
- if (8 === fiber.nodeType)
- if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) {
- if (0 === shouldClear) {
- nextHydratableInstance = getNextHydratable(fiber.nextSibling);
- break a;
- }
- shouldClear--;
- } else
- ("$" !== JSCompiler_temp &&
- "$!" !== JSCompiler_temp &&
- "$?" !== JSCompiler_temp) ||
- shouldClear++;
- fiber = fiber.nextSibling;
- }
- nextHydratableInstance = null;
- }
- } else
- nextHydratableInstance = hydrationParentFiber
- ? getNextHydratable(fiber.stateNode.nextSibling)
- : null;
- return !0;
+function prepareToReadContext(workInProgress) {
+ currentlyRenderingFiber$1 = workInProgress;
+ lastContextDependency = null;
+ workInProgress = workInProgress.dependencies;
+ null !== workInProgress && (workInProgress.firstContext = null);
}
-function resetHydrationState() {
- nextHydratableInstance = hydrationParentFiber = null;
- isHydrating = !1;
+function readContext(context) {
+ return readContextForConsumer(currentlyRenderingFiber$1, context);
}
-function queueHydrationError(error) {
- null === hydrationErrors
- ? (hydrationErrors = [error])
- : hydrationErrors.push(error);
+function readContextDuringReconciliation(consumer, context) {
+ null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
+ return readContextForConsumer(consumer, context);
}
-var SuspenseException = Error(formatProdErrorMessage(460)),
- SuspenseyCommitException = Error(formatProdErrorMessage(474)),
- SuspenseActionException = Error(formatProdErrorMessage(542)),
- noopSuspenseyCommitThenable = { then: function () {} };
-function isThenableResolved(thenable) {
- thenable = thenable.status;
- return "fulfilled" === thenable || "rejected" === thenable;
+function readContextForConsumer(consumer, context) {
+ var value = context._currentValue;
+ context = { context: context, memoizedValue: value, next: null };
+ if (null === lastContextDependency) {
+ if (null === consumer) throw Error(formatProdErrorMessage(308));
+ lastContextDependency = context;
+ consumer.dependencies = { lanes: 0, firstContext: context };
+ consumer.flags |= 524288;
+ } else lastContextDependency = lastContextDependency.next = context;
+ return value;
}
-function noop$3() {}
-function trackUsedThenable(thenableState, thenable, index) {
- index = thenableState[index];
- void 0 === index
- ? thenableState.push(thenable)
- : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index));
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- default:
- if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
- else {
- thenableState = workInProgressRoot;
- if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
- throw Error(formatProdErrorMessage(482));
- thenableState = thenable;
- thenableState.status = "pending";
- thenableState.then(
- function (fulfilledValue) {
- if ("pending" === thenable.status) {
- var fulfilledThenable = thenable;
- fulfilledThenable.status = "fulfilled";
- fulfilledThenable.value = fulfilledValue;
- }
- },
- function (error) {
- if ("pending" === thenable.status) {
- var rejectedThenable = thenable;
- rejectedThenable.status = "rejected";
- rejectedThenable.reason = error;
- }
- }
- );
- }
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
+var currentEntangledListeners = null,
+ currentEntangledPendingCount = 0,
+ currentEntangledLane = 0,
+ currentEntangledActionThenable = null;
+function entangleAsyncAction(transition, thenable) {
+ if (null === currentEntangledListeners) {
+ var entangledListeners = (currentEntangledListeners = []);
+ currentEntangledPendingCount = 0;
+ currentEntangledLane = requestTransitionLane();
+ currentEntangledActionThenable = {
+ status: "pending",
+ value: void 0,
+ then: function (resolve) {
+ entangledListeners.push(resolve);
}
- suspendedThenable = thenable;
- throw SuspenseException;
+ };
}
-}
-var suspendedThenable = null;
-function getSuspendedThenable() {
- if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
- var thenable = suspendedThenable;
- suspendedThenable = null;
+ currentEntangledPendingCount++;
+ thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
return thenable;
}
-function checkIfUseWrappedInAsyncCatch(rejectedReason) {
- if (
- rejectedReason === SuspenseException ||
- rejectedReason === SuspenseActionException
- )
- throw Error(formatProdErrorMessage(483));
-}
-var AbortControllerLocal =
- "undefined" !== typeof AbortController
- ? AbortController
- : function () {
- var listeners = [],
- signal = (this.signal = {
- aborted: !1,
- addEventListener: function (type, listener) {
- listeners.push(listener);
- }
- });
- this.abort = function () {
- signal.aborted = !0;
- listeners.forEach(function (listener) {
- return listener();
- });
- };
- },
- scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
- NormalPriority = Scheduler.unstable_NormalPriority,
- CacheContext = {
- $$typeof: REACT_CONTEXT_TYPE,
- Consumer: null,
- Provider: null,
- _currentValue: null,
- _currentValue2: null,
- _threadCount: 0
- };
-function createCache() {
- return {
- controller: new AbortControllerLocal(),
- data: new Map(),
- refCount: 0
- };
-}
-function releaseCache(cache) {
- cache.refCount--;
- 0 === cache.refCount &&
- scheduleCallback$2(NormalPriority, function () {
- cache.controller.abort();
- });
-}
-var currentEntangledListeners = null,
- currentEntangledPendingCount = 0,
- currentEntangledLane = 0,
- currentEntangledActionThenable = null;
-function entangleAsyncAction(transition, thenable) {
- if (null === currentEntangledListeners) {
- var entangledListeners = (currentEntangledListeners = []);
- currentEntangledPendingCount = 0;
- currentEntangledLane = requestTransitionLane();
- currentEntangledActionThenable = {
- status: "pending",
- value: void 0,
- then: function (resolve) {
- entangledListeners.push(resolve);
- }
- };
- }
- currentEntangledPendingCount++;
- thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
- return thenable;
-}
-function pingEngtangledActionScope() {
+function pingEngtangledActionScope() {
if (
0 === --currentEntangledPendingCount &&
null !== currentEntangledListeners
@@ -2836,1327 +2688,1152 @@ function chainThenableValue(thenable, result) {
);
return thenableWithOverride;
}
-var currentTreeHiddenStackCursor = createCursor(null),
- prevEntangledRenderLanesCursor = createCursor(0);
-function pushHiddenContext(fiber, context) {
- fiber = entangledRenderLanes;
- push(prevEntangledRenderLanesCursor, fiber);
- push(currentTreeHiddenStackCursor, context);
- entangledRenderLanes = fiber | context.baseLanes;
-}
-function reuseHiddenContextOnStack() {
- push(prevEntangledRenderLanesCursor, entangledRenderLanes);
- push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
+var hasForceUpdate = !1;
+function initializeUpdateQueue(fiber) {
+ fiber.updateQueue = {
+ baseState: fiber.memoizedState,
+ firstBaseUpdate: null,
+ lastBaseUpdate: null,
+ shared: { pending: null, lanes: 0, hiddenCallbacks: null },
+ callbacks: null
+ };
}
-function popHiddenContext() {
- entangledRenderLanes = prevEntangledRenderLanesCursor.current;
- pop(currentTreeHiddenStackCursor);
- pop(prevEntangledRenderLanesCursor);
+function cloneUpdateQueue(current, workInProgress) {
+ current = current.updateQueue;
+ workInProgress.updateQueue === current &&
+ (workInProgress.updateQueue = {
+ baseState: current.baseState,
+ firstBaseUpdate: current.firstBaseUpdate,
+ lastBaseUpdate: current.lastBaseUpdate,
+ shared: current.shared,
+ callbacks: null
+ });
}
-var prevOnStartTransitionFinish = ReactSharedInternals.S;
-ReactSharedInternals.S = function (transition, returnValue) {
- "object" === typeof returnValue &&
- null !== returnValue &&
- "function" === typeof returnValue.then &&
- entangleAsyncAction(transition, returnValue);
- null !== prevOnStartTransitionFinish &&
- prevOnStartTransitionFinish(transition, returnValue);
-};
-var resumedCache = createCursor(null);
-function peekCacheFromPool() {
- var cacheResumedFromPreviousRender = resumedCache.current;
- return null !== cacheResumedFromPreviousRender
- ? cacheResumedFromPreviousRender
- : workInProgressRoot.pooledCache;
+function createUpdate(lane) {
+ return { lane: lane, tag: 0, payload: null, callback: null, next: null };
}
-function pushTransition(offscreenWorkInProgress, prevCachePool) {
- null === prevCachePool
- ? push(resumedCache, resumedCache.current)
- : push(resumedCache, prevCachePool.pool);
+function enqueueUpdate(fiber, update, lane) {
+ var updateQueue = fiber.updateQueue;
+ if (null === updateQueue) return null;
+ updateQueue = updateQueue.shared;
+ if (0 !== (executionContext & 2)) {
+ var pending = updateQueue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ updateQueue.pending = update;
+ update = getRootForUpdatedFiber(fiber);
+ markUpdateLaneFromFiberToRoot(fiber, null, lane);
+ return update;
+ }
+ enqueueUpdate$1(fiber, updateQueue, update, lane);
+ return getRootForUpdatedFiber(fiber);
}
-function getSuspendedCache() {
- var cacheFromPool = peekCacheFromPool();
- return null === cacheFromPool
- ? null
- : { parent: CacheContext._currentValue, pool: cacheFromPool };
+function entangleTransitions(root, fiber, lane) {
+ fiber = fiber.updateQueue;
+ if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
+ var queueLanes = fiber.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ fiber.lanes = lane;
+ markRootEntangled(root, lane);
+ }
}
-var renderLanes = 0,
- currentlyRenderingFiber$1 = null,
- currentHook = null,
- workInProgressHook = null,
- didScheduleRenderPhaseUpdate = !1,
- didScheduleRenderPhaseUpdateDuringThisPass = !1,
- shouldDoubleInvokeUserFnsInHooksDEV = !1,
- localIdCounter = 0,
- thenableIndexCounter$1 = 0,
- thenableState$1 = null,
- globalClientIdCounter = 0;
-function throwInvalidHookError() {
- throw Error(formatProdErrorMessage(321));
+function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
+ var queue = workInProgress.updateQueue,
+ current = workInProgress.alternate;
+ if (
+ null !== current &&
+ ((current = current.updateQueue), queue === current)
+ ) {
+ var newFirst = null,
+ newLast = null;
+ queue = queue.firstBaseUpdate;
+ if (null !== queue) {
+ do {
+ var clone = {
+ lane: queue.lane,
+ tag: queue.tag,
+ payload: queue.payload,
+ callback: null,
+ next: null
+ };
+ null === newLast
+ ? (newFirst = newLast = clone)
+ : (newLast = newLast.next = clone);
+ queue = queue.next;
+ } while (null !== queue);
+ null === newLast
+ ? (newFirst = newLast = capturedUpdate)
+ : (newLast = newLast.next = capturedUpdate);
+ } else newFirst = newLast = capturedUpdate;
+ queue = {
+ baseState: current.baseState,
+ firstBaseUpdate: newFirst,
+ lastBaseUpdate: newLast,
+ shared: current.shared,
+ callbacks: current.callbacks
+ };
+ workInProgress.updateQueue = queue;
+ return;
+ }
+ workInProgress = queue.lastBaseUpdate;
+ null === workInProgress
+ ? (queue.firstBaseUpdate = capturedUpdate)
+ : (workInProgress.next = capturedUpdate);
+ queue.lastBaseUpdate = capturedUpdate;
}
-function areHookInputsEqual(nextDeps, prevDeps) {
- if (null === prevDeps) return !1;
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
- if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
- return !0;
+var didReadFromEntangledAsyncAction = !1;
+function suspendIfUpdateReadFromEntangledAsyncAction() {
+ if (didReadFromEntangledAsyncAction) {
+ var entangledActionThenable = currentEntangledActionThenable;
+ if (null !== entangledActionThenable) throw entangledActionThenable;
+ }
}
-function renderWithHooks(
- current,
- workInProgress,
- Component,
+function processUpdateQueue(
+ workInProgress$jscomp$0,
props,
- secondArg,
- nextRenderLanes
+ instance$jscomp$0,
+ renderLanes
) {
- renderLanes = nextRenderLanes;
- currentlyRenderingFiber$1 = workInProgress;
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.lanes = 0;
- ReactSharedInternals.H =
- null === current || null === current.memoizedState
- ? HooksDispatcherOnMount
- : HooksDispatcherOnUpdate;
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- nextRenderLanes = Component(props, secondArg);
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- didScheduleRenderPhaseUpdateDuringThisPass &&
- (nextRenderLanes = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- ));
- finishRenderingHooks(current);
- return nextRenderLanes;
-}
-function finishRenderingHooks(current) {
- ReactSharedInternals.H = ContextOnlyDispatcher;
- var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
- renderLanes = 0;
- workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
- didScheduleRenderPhaseUpdate = !1;
- thenableIndexCounter$1 = 0;
- thenableState$1 = null;
- if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
- null === current ||
- didReceiveUpdate ||
- ((current = current.dependencies),
- null !== current &&
- checkIfContextChanged(current) &&
- (didReceiveUpdate = !0));
-}
-function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
- currentlyRenderingFiber$1 = workInProgress;
- var numberOfReRenders = 0;
- do {
- didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
- thenableIndexCounter$1 = 0;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
- numberOfReRenders += 1;
- workInProgressHook = currentHook = null;
- if (null != workInProgress.updateQueue) {
- var children = workInProgress.updateQueue;
- children.lastEffect = null;
- children.events = null;
- children.stores = null;
- null != children.memoCache && (children.memoCache.index = 0);
- }
- ReactSharedInternals.H = HooksDispatcherOnRerender;
- children = Component(props, secondArg);
- } while (didScheduleRenderPhaseUpdateDuringThisPass);
- return children;
-}
-function TransitionAwareHostComponent() {
- var dispatcher = ReactSharedInternals.H,
- maybeThenable = dispatcher.useState()[0];
- maybeThenable =
- "function" === typeof maybeThenable.then
- ? useThenable(maybeThenable)
- : maybeThenable;
- dispatcher = dispatcher.useState()[0];
- (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
- (currentlyRenderingFiber$1.flags |= 1024);
- return maybeThenable;
-}
-function checkDidRenderIdHook() {
- var didRenderIdHook = 0 !== localIdCounter;
- localIdCounter = 0;
- return didRenderIdHook;
-}
-function bailoutHooks(current, workInProgress, lanes) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.flags &= -2053;
- current.lanes &= ~lanes;
-}
-function resetHooksOnUnwind(workInProgress) {
- if (didScheduleRenderPhaseUpdate) {
- for (
- workInProgress = workInProgress.memoizedState;
- null !== workInProgress;
-
- ) {
- var queue = workInProgress.queue;
- null !== queue && (queue.pending = null);
- workInProgress = workInProgress.next;
- }
- didScheduleRenderPhaseUpdate = !1;
- }
- renderLanes = 0;
- workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- thenableIndexCounter$1 = localIdCounter = 0;
- thenableState$1 = null;
-}
-function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- baseQueue: null,
- queue: null,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
- : (workInProgressHook = workInProgressHook.next = hook);
- return workInProgressHook;
-}
-function updateWorkInProgressHook() {
- if (null === currentHook) {
- var nextCurrentHook = currentlyRenderingFiber$1.alternate;
- nextCurrentHook =
- null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
- } else nextCurrentHook = currentHook.next;
- var nextWorkInProgressHook =
- null === workInProgressHook
- ? currentlyRenderingFiber$1.memoizedState
- : workInProgressHook.next;
- if (null !== nextWorkInProgressHook)
- (workInProgressHook = nextWorkInProgressHook),
- (currentHook = nextCurrentHook);
- else {
- if (null === nextCurrentHook) {
- if (null === currentlyRenderingFiber$1.alternate)
- throw Error(formatProdErrorMessage(467));
- throw Error(formatProdErrorMessage(310));
- }
- currentHook = nextCurrentHook;
- nextCurrentHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- baseQueue: currentHook.baseQueue,
- queue: currentHook.queue,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook =
- nextCurrentHook)
- : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
- }
- return workInProgressHook;
-}
-var createFunctionComponentUpdateQueue;
-createFunctionComponentUpdateQueue = function () {
- return { lastEffect: null, events: null, stores: null, memoCache: null };
-};
-function useThenable(thenable) {
- var index = thenableIndexCounter$1;
- thenableIndexCounter$1 += 1;
- null === thenableState$1 && (thenableState$1 = []);
- thenable = trackUsedThenable(thenableState$1, thenable, index);
- index = currentlyRenderingFiber$1;
- null ===
- (null === workInProgressHook
- ? index.memoizedState
- : workInProgressHook.next) &&
- ((index = index.alternate),
- (ReactSharedInternals.H =
- null === index || null === index.memoizedState
- ? HooksDispatcherOnMount
- : HooksDispatcherOnUpdate));
- return thenable;
-}
-function use(usable) {
- if (null !== usable && "object" === typeof usable) {
- if ("function" === typeof usable.then) return useThenable(usable);
- if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
- }
- throw Error(formatProdErrorMessage(438, String(usable)));
-}
-function useMemoCache(size) {
- var memoCache = null,
- updateQueue = currentlyRenderingFiber$1.updateQueue;
- null !== updateQueue && (memoCache = updateQueue.memoCache);
- if (null == memoCache) {
- var current = currentlyRenderingFiber$1.alternate;
+ didReadFromEntangledAsyncAction = !1;
+ var queue = workInProgress$jscomp$0.updateQueue;
+ hasForceUpdate = !1;
+ var firstBaseUpdate = queue.firstBaseUpdate,
+ lastBaseUpdate = queue.lastBaseUpdate,
+ pendingQueue = queue.shared.pending;
+ if (null !== pendingQueue) {
+ queue.shared.pending = null;
+ var lastPendingUpdate = pendingQueue,
+ firstPendingUpdate = lastPendingUpdate.next;
+ lastPendingUpdate.next = null;
+ null === lastBaseUpdate
+ ? (firstBaseUpdate = firstPendingUpdate)
+ : (lastBaseUpdate.next = firstPendingUpdate);
+ lastBaseUpdate = lastPendingUpdate;
+ var current = workInProgress$jscomp$0.alternate;
null !== current &&
((current = current.updateQueue),
- null !== current &&
- ((current = current.memoCache),
- null != current &&
- (memoCache = {
- data: current.data.map(function (array) {
- return array.slice();
- }),
- index: 0
- })));
- }
- null == memoCache && (memoCache = { data: [], index: 0 });
- null === updateQueue &&
- ((updateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = updateQueue));
- updateQueue.memoCache = memoCache;
- updateQueue = memoCache.data[memoCache.index];
- if (void 0 === updateQueue)
- for (
- updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
- current < size;
- current++
- )
- updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
- memoCache.index++;
- return updateQueue;
-}
-function basicStateReducer(state, action) {
- return "function" === typeof action ? action(state) : action;
-}
-function updateReducer(reducer) {
- var hook = updateWorkInProgressHook();
- return updateReducerImpl(hook, currentHook, reducer);
-}
-function updateReducerImpl(hook, current, reducer) {
- var queue = hook.queue;
- if (null === queue) throw Error(formatProdErrorMessage(311));
- queue.lastRenderedReducer = reducer;
- var baseQueue = hook.baseQueue,
- pendingQueue = queue.pending;
- if (null !== pendingQueue) {
- if (null !== baseQueue) {
- var baseFirst = baseQueue.next;
- baseQueue.next = pendingQueue.next;
- pendingQueue.next = baseFirst;
- }
- current.baseQueue = baseQueue = pendingQueue;
- queue.pending = null;
+ (pendingQueue = current.lastBaseUpdate),
+ pendingQueue !== lastBaseUpdate &&
+ (null === pendingQueue
+ ? (current.firstBaseUpdate = firstPendingUpdate)
+ : (pendingQueue.next = firstPendingUpdate),
+ (current.lastBaseUpdate = lastPendingUpdate)));
}
- pendingQueue = hook.baseState;
- if (null === baseQueue) hook.memoizedState = pendingQueue;
- else {
- current = baseQueue.next;
- var newBaseQueueFirst = (baseFirst = null),
- newBaseQueueLast = null,
- update = current,
- didReadFromEntangledAsyncAction$26 = !1;
+ if (null !== firstBaseUpdate) {
+ var newState = queue.baseState;
+ lastBaseUpdate = 0;
+ current = firstPendingUpdate = lastPendingUpdate = null;
+ pendingQueue = firstBaseUpdate;
do {
- var updateLane = update.lane & -536870913;
+ var updateLane = pendingQueue.lane & -536870913,
+ isHiddenUpdate = updateLane !== pendingQueue.lane;
if (
- updateLane !== update.lane
+ isHiddenUpdate
? (workInProgressRootRenderLanes & updateLane) === updateLane
: (renderLanes & updateLane) === updateLane
) {
- var revertLane = update.revertLane;
- if (0 === revertLane)
- null !== newBaseQueueLast &&
- (newBaseQueueLast = newBaseQueueLast.next =
- {
- lane: 0,
- revertLane: 0,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction$26 = !0);
- else if ((renderLanes & revertLane) === revertLane) {
- update = update.next;
- revertLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction$26 = !0);
- continue;
- } else
- (updateLane = {
- lane: 0,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
- (currentlyRenderingFiber$1.lanes |= revertLane),
- (workInProgressRootSkippedLanes |= revertLane);
- updateLane = update.action;
- shouldDoubleInvokeUserFnsInHooksDEV &&
- reducer(pendingQueue, updateLane);
- pendingQueue = update.hasEagerState
- ? update.eagerState
- : reducer(pendingQueue, updateLane);
+ 0 !== updateLane &&
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ null !== current &&
+ (current = current.next =
+ {
+ lane: 0,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: null,
+ next: null
+ });
+ a: {
+ var workInProgress = workInProgress$jscomp$0,
+ update = pendingQueue;
+ updateLane = props;
+ var instance = instance$jscomp$0;
+ switch (update.tag) {
+ case 1:
+ workInProgress = update.payload;
+ if ("function" === typeof workInProgress) {
+ newState = workInProgress.call(instance, newState, updateLane);
+ break a;
+ }
+ newState = workInProgress;
+ break a;
+ case 3:
+ workInProgress.flags = (workInProgress.flags & -65537) | 128;
+ case 0:
+ workInProgress = update.payload;
+ updateLane =
+ "function" === typeof workInProgress
+ ? workInProgress.call(instance, newState, updateLane)
+ : workInProgress;
+ if (null === updateLane || void 0 === updateLane) break a;
+ newState = assign({}, newState, updateLane);
+ break a;
+ case 2:
+ hasForceUpdate = !0;
+ }
+ }
+ updateLane = pendingQueue.callback;
+ null !== updateLane &&
+ ((workInProgress$jscomp$0.flags |= 64),
+ isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),
+ (isHiddenUpdate = queue.callbacks),
+ null === isHiddenUpdate
+ ? (queue.callbacks = [updateLane])
+ : isHiddenUpdate.push(updateLane));
} else
- (revertLane = {
+ (isHiddenUpdate = {
lane: updateLane,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: pendingQueue.callback,
next: null
}),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
- (currentlyRenderingFiber$1.lanes |= updateLane),
- (workInProgressRootSkippedLanes |= updateLane);
- update = update.next;
- } while (null !== update && update !== current);
- null === newBaseQueueLast
- ? (baseFirst = pendingQueue)
- : (newBaseQueueLast.next = newBaseQueueFirst);
- if (
- !objectIs(pendingQueue, hook.memoizedState) &&
- ((didReceiveUpdate = !0),
- didReadFromEntangledAsyncAction$26 &&
- ((reducer = currentEntangledActionThenable), null !== reducer))
- )
- throw reducer;
- hook.memoizedState = pendingQueue;
- hook.baseState = baseFirst;
- hook.baseQueue = newBaseQueueLast;
- queue.lastRenderedState = pendingQueue;
+ null === current
+ ? ((firstPendingUpdate = current = isHiddenUpdate),
+ (lastPendingUpdate = newState))
+ : (current = current.next = isHiddenUpdate),
+ (lastBaseUpdate |= updateLane);
+ pendingQueue = pendingQueue.next;
+ if (null === pendingQueue)
+ if (((pendingQueue = queue.shared.pending), null === pendingQueue))
+ break;
+ else
+ (isHiddenUpdate = pendingQueue),
+ (pendingQueue = isHiddenUpdate.next),
+ (isHiddenUpdate.next = null),
+ (queue.lastBaseUpdate = isHiddenUpdate),
+ (queue.shared.pending = null);
+ } while (1);
+ null === current && (lastPendingUpdate = newState);
+ queue.baseState = lastPendingUpdate;
+ queue.firstBaseUpdate = firstPendingUpdate;
+ queue.lastBaseUpdate = current;
+ null === firstBaseUpdate && (queue.shared.lanes = 0);
+ workInProgressRootSkippedLanes |= lastBaseUpdate;
+ workInProgress$jscomp$0.lanes = lastBaseUpdate;
+ workInProgress$jscomp$0.memoizedState = newState;
}
- null === baseQueue && (queue.lanes = 0);
- return [hook.memoizedState, queue.dispatch];
}
-function rerenderReducer(reducer) {
- var hook = updateWorkInProgressHook(),
- queue = hook.queue;
- if (null === queue) throw Error(formatProdErrorMessage(311));
- queue.lastRenderedReducer = reducer;
- var dispatch = queue.dispatch,
- lastRenderPhaseUpdate = queue.pending,
- newState = hook.memoizedState;
- if (null !== lastRenderPhaseUpdate) {
- queue.pending = null;
- var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
- do (newState = reducer(newState, update.action)), (update = update.next);
- while (update !== lastRenderPhaseUpdate);
- objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
- hook.memoizedState = newState;
- null === hook.baseQueue && (hook.baseState = newState);
- queue.lastRenderedState = newState;
- }
- return [newState, dispatch];
+function callCallback(callback, context) {
+ if ("function" !== typeof callback)
+ throw Error(formatProdErrorMessage(191, callback));
+ callback.call(context);
}
-function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = updateWorkInProgressHook(),
- isHydrating$jscomp$0 = isHydrating;
- if (isHydrating$jscomp$0) {
- if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
- getServerSnapshot = getServerSnapshot();
- } else getServerSnapshot = getSnapshot();
- var snapshotChanged = !objectIs(
- (currentHook || hook).memoizedState,
- getServerSnapshot
- );
- snapshotChanged &&
- ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));
- hook = hook.queue;
- updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
- subscribe
- ]);
- if (
- hook.getSnapshot !== getSnapshot ||
- snapshotChanged ||
- (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)
- ) {
- fiber.flags |= 2048;
- pushSimpleEffect(
- 9,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- hook,
- getServerSnapshot,
- getSnapshot
- ),
- null
- );
- if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
- isHydrating$jscomp$0 ||
- 0 !== (renderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- return getServerSnapshot;
+function commitCallbacks(updateQueue, context) {
+ var callbacks = updateQueue.callbacks;
+ if (null !== callbacks)
+ for (
+ updateQueue.callbacks = null, updateQueue = 0;
+ updateQueue < callbacks.length;
+ updateQueue++
+ )
+ callCallback(callbacks[updateQueue], context);
}
-function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
- fiber.flags |= 16384;
- fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
- getSnapshot = currentlyRenderingFiber$1.updateQueue;
- null === getSnapshot
- ? ((getSnapshot = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = getSnapshot),
- (getSnapshot.stores = [fiber]))
- : ((renderedSnapshot = getSnapshot.stores),
- null === renderedSnapshot
- ? (getSnapshot.stores = [fiber])
- : renderedSnapshot.push(fiber));
+var AbortControllerLocal =
+ "undefined" !== typeof AbortController
+ ? AbortController
+ : function () {
+ var listeners = [],
+ signal = (this.signal = {
+ aborted: !1,
+ addEventListener: function (type, listener) {
+ listeners.push(listener);
+ }
+ });
+ this.abort = function () {
+ signal.aborted = !0;
+ listeners.forEach(function (listener) {
+ return listener();
+ });
+ };
+ },
+ scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
+ NormalPriority = Scheduler.unstable_NormalPriority,
+ CacheContext = {
+ $$typeof: REACT_CONTEXT_TYPE,
+ Consumer: null,
+ Provider: null,
+ _currentValue: null,
+ _currentValue2: null,
+ _threadCount: 0
+ };
+function createCache() {
+ return {
+ controller: new AbortControllerLocal(),
+ data: new Map(),
+ refCount: 0
+ };
}
-function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
- inst.value = nextSnapshot;
- inst.getSnapshot = getSnapshot;
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+function releaseCache(cache) {
+ cache.refCount--;
+ 0 === cache.refCount &&
+ scheduleCallback$2(NormalPriority, function () {
+ cache.controller.abort();
+ });
}
-function subscribeToStore(fiber, inst, subscribe) {
- return subscribe(function () {
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
- });
+function applyDerivedStateFromProps(
+ workInProgress,
+ ctor,
+ getDerivedStateFromProps,
+ nextProps
+) {
+ ctor = workInProgress.memoizedState;
+ getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
+ getDerivedStateFromProps =
+ null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
+ ? ctor
+ : assign({}, ctor, getDerivedStateFromProps);
+ workInProgress.memoizedState = getDerivedStateFromProps;
+ 0 === workInProgress.lanes &&
+ (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
}
-function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- inst = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(inst, nextValue);
- } catch (error) {
- return !0;
+var classComponentUpdater = {
+ isMounted: function (component) {
+ return (component = component._reactInternals)
+ ? getNearestMountedFiber(component) === component
+ : !1;
+ },
+ enqueueSetState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.payload = payload;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueReplaceState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.tag = 1;
+ update.payload = payload;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueForceUpdate: function (inst, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.tag = 2;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ callback = enqueueUpdate(inst, update, lane);
+ null !== callback &&
+ (scheduleUpdateOnFiber(callback, inst, lane),
+ entangleTransitions(callback, inst, lane));
}
+};
+function checkShouldComponentUpdate(
+ workInProgress,
+ ctor,
+ oldProps,
+ newProps,
+ oldState,
+ newState,
+ nextContext
+) {
+ workInProgress = workInProgress.stateNode;
+ return "function" === typeof workInProgress.shouldComponentUpdate
+ ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
+ : ctor.prototype && ctor.prototype.isPureReactComponent
+ ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
+ : !0;
}
-function forceStoreRerender(fiber) {
- var root = enqueueConcurrentRenderForLane(fiber, 2);
- null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+function callComponentWillReceiveProps(
+ workInProgress,
+ instance,
+ newProps,
+ nextContext
+) {
+ workInProgress = instance.state;
+ "function" === typeof instance.componentWillReceiveProps &&
+ instance.componentWillReceiveProps(newProps, nextContext);
+ "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
+ instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
+ instance.state !== workInProgress &&
+ classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
}
-function mountStateImpl(initialState) {
- var hook = mountWorkInProgressHook();
- if ("function" === typeof initialState) {
- var initialStateInitializer = initialState;
- initialState = initialStateInitializer();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- initialStateInitializer();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
+function resolveClassComponentProps(Component, baseProps) {
+ var newProps = baseProps;
+ if ("ref" in baseProps) {
+ newProps = {};
+ for (var propName in baseProps)
+ "ref" !== propName && (newProps[propName] = baseProps[propName]);
}
- hook.memoizedState = hook.baseState = initialState;
- hook.queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- return hook;
-}
-function updateOptimisticImpl(hook, current, passthrough, reducer) {
- hook.baseState = passthrough;
- return updateReducerImpl(
- hook,
- currentHook,
- "function" === typeof reducer ? reducer : basicStateReducer
- );
+ if ((Component = Component.defaultProps)) {
+ newProps === baseProps && (newProps = assign({}, newProps));
+ for (var propName$28 in Component)
+ void 0 === newProps[propName$28] &&
+ (newProps[propName$28] = Component[propName$28]);
+ }
+ return newProps;
}
-function dispatchActionState(
- fiber,
- actionQueue,
- setPendingState,
- setState,
- payload
-) {
- if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
- fiber = actionQueue.action;
- if (null !== fiber) {
- var actionNode = {
- payload: payload,
- action: fiber,
- next: null,
- isTransition: !0,
- status: "pending",
- value: null,
- reason: null,
- listeners: [],
- then: function (listener) {
- actionNode.listeners.push(listener);
- }
+var CapturedStacks = new WeakMap();
+function createCapturedValueAtFiber(value, source) {
+ if ("object" === typeof value && null !== value) {
+ var existing = CapturedStacks.get(value);
+ if (void 0 !== existing) return existing;
+ source = {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
};
- null !== ReactSharedInternals.T
- ? setPendingState(!0)
- : (actionNode.isTransition = !1);
- setState(actionNode);
- setPendingState = actionQueue.pending;
- null === setPendingState
- ? ((actionNode.next = actionQueue.pending = actionNode),
- runActionStateAction(actionQueue, actionNode))
- : ((actionNode.next = setPendingState.next),
- (actionQueue.pending = setPendingState.next = actionNode));
+ CapturedStacks.set(value, source);
+ return source;
}
+ return {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
+ };
}
-function runActionStateAction(actionQueue, node) {
- var action = node.action,
- payload = node.payload,
- prevState = actionQueue.state;
- if (node.isTransition) {
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- try {
- var returnValue = action(prevState, payload),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- handleActionReturnValue(actionQueue, node, returnValue);
- } catch (error) {
- onActionError(actionQueue, node, error);
- } finally {
- ReactSharedInternals.T = prevTransition;
- }
+var forkStack = [],
+ forkStackIndex = 0,
+ treeForkProvider = null,
+ treeForkCount = 0,
+ idStack = [],
+ idStackIndex = 0,
+ treeContextProvider = null,
+ treeContextId = 1,
+ treeContextOverflow = "";
+function pushTreeFork(workInProgress, totalChildren) {
+ forkStack[forkStackIndex++] = treeForkCount;
+ forkStack[forkStackIndex++] = treeForkProvider;
+ treeForkProvider = workInProgress;
+ treeForkCount = totalChildren;
+}
+function pushTreeId(workInProgress, totalChildren, index) {
+ idStack[idStackIndex++] = treeContextId;
+ idStack[idStackIndex++] = treeContextOverflow;
+ idStack[idStackIndex++] = treeContextProvider;
+ treeContextProvider = workInProgress;
+ var baseIdWithLeadingBit = treeContextId;
+ workInProgress = treeContextOverflow;
+ var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
+ baseIdWithLeadingBit &= ~(1 << baseLength);
+ index += 1;
+ var length = 32 - clz32(totalChildren) + baseLength;
+ if (30 < length) {
+ var numberOfOverflowBits = baseLength - (baseLength % 5);
+ length = (
+ baseIdWithLeadingBit &
+ ((1 << numberOfOverflowBits) - 1)
+ ).toString(32);
+ baseIdWithLeadingBit >>= numberOfOverflowBits;
+ baseLength -= numberOfOverflowBits;
+ treeContextId =
+ (1 << (32 - clz32(totalChildren) + baseLength)) |
+ (index << baseLength) |
+ baseIdWithLeadingBit;
+ treeContextOverflow = length + workInProgress;
} else
- try {
- (prevTransition = action(prevState, payload)),
- handleActionReturnValue(actionQueue, node, prevTransition);
- } catch (error$32) {
- onActionError(actionQueue, node, error$32);
- }
+ (treeContextId =
+ (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
+ (treeContextOverflow = workInProgress);
}
-function handleActionReturnValue(actionQueue, node, returnValue) {
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
- ? returnValue.then(
- function (nextState) {
- onActionSuccess(actionQueue, node, nextState);
- },
- function (error) {
- return onActionError(actionQueue, node, error);
- }
- )
- : onActionSuccess(actionQueue, node, returnValue);
+function pushMaterializedTreeId(workInProgress) {
+ null !== workInProgress.return &&
+ (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
}
-function onActionSuccess(actionQueue, actionNode, nextState) {
- actionNode.status = "fulfilled";
- actionNode.value = nextState;
- notifyActionListeners(actionNode);
- actionQueue.state = nextState;
- actionNode = actionQueue.pending;
- null !== actionNode &&
- ((nextState = actionNode.next),
- nextState === actionNode
- ? (actionQueue.pending = null)
- : ((nextState = nextState.next),
- (actionNode.next = nextState),
- runActionStateAction(actionQueue, nextState)));
+function popTreeContext(workInProgress) {
+ for (; workInProgress === treeForkProvider; )
+ (treeForkProvider = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null),
+ (treeForkCount = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null);
+ for (; workInProgress === treeContextProvider; )
+ (treeContextProvider = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextOverflow = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextId = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null);
}
-function onActionError(actionQueue, actionNode, error) {
- var last = actionQueue.pending;
- actionQueue.pending = null;
- if (null !== last) {
- last = last.next;
- do
- (actionNode.status = "rejected"),
- (actionNode.reason = error),
- notifyActionListeners(actionNode),
- (actionNode = actionNode.next);
- while (actionNode !== last);
- }
- actionQueue.action = null;
+var hydrationParentFiber = null,
+ nextHydratableInstance = null,
+ isHydrating = !1,
+ hydrationErrors = null,
+ rootOrSingletonContext = !1,
+ HydrationMismatchException = Error(formatProdErrorMessage(519));
+function throwOnHydrationMismatch(fiber) {
+ var error = Error(formatProdErrorMessage(418, ""));
+ queueHydrationError(createCapturedValueAtFiber(error, fiber));
+ throw HydrationMismatchException;
}
-function notifyActionListeners(actionNode) {
- actionNode = actionNode.listeners;
- for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+function prepareToHydrateHostInstance(fiber) {
+ var instance = fiber.stateNode,
+ type = fiber.type,
+ props = fiber.memoizedProps;
+ instance[internalInstanceKey] = fiber;
+ instance[internalPropsKey] = props;
+ switch (type) {
+ case "dialog":
+ listenToNonDelegatedEvent("cancel", instance);
+ listenToNonDelegatedEvent("close", instance);
+ break;
+ case "iframe":
+ case "object":
+ case "embed":
+ listenToNonDelegatedEvent("load", instance);
+ break;
+ case "video":
+ case "audio":
+ for (type = 0; type < mediaEventTypes.length; type++)
+ listenToNonDelegatedEvent(mediaEventTypes[type], instance);
+ break;
+ case "source":
+ listenToNonDelegatedEvent("error", instance);
+ break;
+ case "img":
+ case "image":
+ case "link":
+ listenToNonDelegatedEvent("error", instance);
+ listenToNonDelegatedEvent("load", instance);
+ break;
+ case "details":
+ listenToNonDelegatedEvent("toggle", instance);
+ break;
+ case "input":
+ listenToNonDelegatedEvent("invalid", instance);
+ initInput(
+ instance,
+ props.value,
+ props.defaultValue,
+ props.checked,
+ props.defaultChecked,
+ props.type,
+ props.name,
+ !0
+ );
+ track(instance);
+ break;
+ case "select":
+ listenToNonDelegatedEvent("invalid", instance);
+ break;
+ case "textarea":
+ listenToNonDelegatedEvent("invalid", instance),
+ initTextarea(instance, props.value, props.defaultValue, props.children),
+ track(instance);
+ }
+ type = props.children;
+ ("string" !== typeof type &&
+ "number" !== typeof type &&
+ "bigint" !== typeof type) ||
+ instance.textContent === "" + type ||
+ !0 === props.suppressHydrationWarning ||
+ checkForUnmatchedText(instance.textContent, type)
+ ? (null != props.popover &&
+ (listenToNonDelegatedEvent("beforetoggle", instance),
+ listenToNonDelegatedEvent("toggle", instance)),
+ null != props.onScroll && listenToNonDelegatedEvent("scroll", instance),
+ null != props.onScrollEnd &&
+ listenToNonDelegatedEvent("scrollend", instance),
+ null != props.onClick && (instance.onclick = noop$1),
+ (instance = !0))
+ : (instance = !1);
+ instance || throwOnHydrationMismatch(fiber);
}
-function actionStateReducer(oldState, newState) {
- return newState;
+function popToNextHostParent(fiber) {
+ for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
+ switch (hydrationParentFiber.tag) {
+ case 3:
+ case 27:
+ rootOrSingletonContext = !0;
+ return;
+ case 5:
+ case 13:
+ rootOrSingletonContext = !1;
+ return;
+ default:
+ hydrationParentFiber = hydrationParentFiber.return;
+ }
}
-function mountActionState(action, initialStateProp) {
- if (isHydrating) {
- var ssrFormState = workInProgressRoot.formState;
- if (null !== ssrFormState) {
- a: {
- var JSCompiler_inline_result = currentlyRenderingFiber$1;
- if (isHydrating) {
- if (nextHydratableInstance) {
- b: {
- var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
- for (
- var inRootOrSingleton = rootOrSingletonContext;
- 8 !== JSCompiler_inline_result$jscomp$0.nodeType;
-
- ) {
- if (!inRootOrSingleton) {
- JSCompiler_inline_result$jscomp$0 = null;
- break b;
- }
- JSCompiler_inline_result$jscomp$0 = getNextHydratable(
- JSCompiler_inline_result$jscomp$0.nextSibling
- );
- if (null === JSCompiler_inline_result$jscomp$0) {
- JSCompiler_inline_result$jscomp$0 = null;
- break b;
- }
- }
- inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
- JSCompiler_inline_result$jscomp$0 =
- "F!" === inRootOrSingleton || "F" === inRootOrSingleton
- ? JSCompiler_inline_result$jscomp$0
- : null;
- }
- if (JSCompiler_inline_result$jscomp$0) {
- nextHydratableInstance = getNextHydratable(
- JSCompiler_inline_result$jscomp$0.nextSibling
- );
- JSCompiler_inline_result =
- "F!" === JSCompiler_inline_result$jscomp$0.data;
+function popHydrationState(fiber) {
+ if (fiber !== hydrationParentFiber) return !1;
+ if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;
+ var shouldClear = !1,
+ JSCompiler_temp;
+ if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
+ if ((JSCompiler_temp = 5 === fiber.tag))
+ (JSCompiler_temp = fiber.type),
+ (JSCompiler_temp =
+ !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
+ shouldSetTextContent(fiber.type, fiber.memoizedProps));
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp && (shouldClear = !0);
+ shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber);
+ popToNextHostParent(fiber);
+ if (13 === fiber.tag) {
+ fiber = fiber.memoizedState;
+ fiber = null !== fiber ? fiber.dehydrated : null;
+ if (!fiber) throw Error(formatProdErrorMessage(317));
+ a: {
+ fiber = fiber.nextSibling;
+ for (shouldClear = 0; fiber; ) {
+ if (8 === fiber.nodeType)
+ if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) {
+ if (0 === shouldClear) {
+ nextHydratableInstance = getNextHydratable(fiber.nextSibling);
break a;
}
- }
- throwOnHydrationMismatch(JSCompiler_inline_result);
- }
- JSCompiler_inline_result = !1;
+ shouldClear--;
+ } else
+ ("$" !== JSCompiler_temp &&
+ "$!" !== JSCompiler_temp &&
+ "$?" !== JSCompiler_temp) ||
+ shouldClear++;
+ fiber = fiber.nextSibling;
}
- JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
+ nextHydratableInstance = null;
}
- }
- ssrFormState = mountWorkInProgressHook();
- ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
- JSCompiler_inline_result = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: actionStateReducer,
- lastRenderedState: initialStateProp
- };
- ssrFormState.queue = JSCompiler_inline_result;
- ssrFormState = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- JSCompiler_inline_result
- );
- JSCompiler_inline_result.dispatch = ssrFormState;
- JSCompiler_inline_result = mountStateImpl(!1);
- inRootOrSingleton = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !1,
- JSCompiler_inline_result.queue
- );
- JSCompiler_inline_result = mountWorkInProgressHook();
- JSCompiler_inline_result$jscomp$0 = {
- state: initialStateProp,
- dispatch: null,
- action: action,
- pending: null
- };
- JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
- ssrFormState = dispatchActionState.bind(
- null,
- currentlyRenderingFiber$1,
- JSCompiler_inline_result$jscomp$0,
- inRootOrSingleton,
- ssrFormState
- );
- JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
- JSCompiler_inline_result.memoizedState = action;
- return [initialStateProp, ssrFormState, !1];
+ } else
+ nextHydratableInstance = hydrationParentFiber
+ ? getNextHydratable(fiber.stateNode.nextSibling)
+ : null;
+ return !0;
}
-function updateActionState(action) {
- var stateHook = updateWorkInProgressHook();
- return updateActionStateImpl(stateHook, currentHook, action);
+function resetHydrationState() {
+ nextHydratableInstance = hydrationParentFiber = null;
+ isHydrating = !1;
}
-function updateActionStateImpl(stateHook, currentStateHook, action) {
- currentStateHook = updateReducerImpl(
- stateHook,
- currentStateHook,
- actionStateReducer
- )[0];
- stateHook = updateReducer(basicStateReducer)[0];
- if (
- "object" === typeof currentStateHook &&
- null !== currentStateHook &&
- "function" === typeof currentStateHook.then
- )
- try {
- var state = useThenable(currentStateHook);
- } catch (x) {
- if (x === SuspenseException) throw SuspenseActionException;
- throw x;
- }
- else state = currentStateHook;
- currentStateHook = updateWorkInProgressHook();
- var actionQueue = currentStateHook.queue,
- dispatch = actionQueue.dispatch;
- action !== currentStateHook.memoizedState &&
- ((currentlyRenderingFiber$1.flags |= 2048),
- pushSimpleEffect(
- 9,
- createEffectInstance(),
- actionStateActionEffect.bind(null, actionQueue, action),
- null
- ));
- return [state, dispatch, stateHook];
+function upgradeHydrationErrorsToRecoverable() {
+ var queuedErrors = hydrationErrors;
+ null !== queuedErrors &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = queuedErrors)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ queuedErrors
+ ),
+ (hydrationErrors = null));
+ return queuedErrors;
}
-function actionStateActionEffect(actionQueue, action) {
- actionQueue.action = action;
+function queueHydrationError(error) {
+ null === hydrationErrors
+ ? (hydrationErrors = [error])
+ : hydrationErrors.push(error);
}
-function rerenderActionState(action) {
- var stateHook = updateWorkInProgressHook(),
- currentStateHook = currentHook;
- if (null !== currentStateHook)
- return updateActionStateImpl(stateHook, currentStateHook, action);
- updateWorkInProgressHook();
- stateHook = stateHook.memoizedState;
- currentStateHook = updateWorkInProgressHook();
- var dispatch = currentStateHook.queue.dispatch;
- currentStateHook.memoizedState = action;
- return [stateHook, dispatch, !1];
+var SuspenseException = Error(formatProdErrorMessage(460)),
+ SuspenseyCommitException = Error(formatProdErrorMessage(474)),
+ SuspenseActionException = Error(formatProdErrorMessage(542)),
+ noopSuspenseyCommitThenable = { then: function () {} };
+function isThenableResolved(thenable) {
+ thenable = thenable.status;
+ return "fulfilled" === thenable || "rejected" === thenable;
}
-function pushSimpleEffect(tag, inst, create, deps) {
- tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
- inst = currentlyRenderingFiber$1.updateQueue;
- null === inst &&
- ((inst = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = inst));
- create = inst.lastEffect;
- null === create
- ? (inst.lastEffect = tag.next = tag)
- : ((deps = create.next),
- (create.next = tag),
- (tag.next = deps),
- (inst.lastEffect = tag));
- return tag;
+function noop$3() {}
+function trackUsedThenable(thenableState, thenable, index) {
+ index = thenableState[index];
+ void 0 === index
+ ? thenableState.push(thenable)
+ : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index));
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ default:
+ if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
+ else {
+ thenableState = workInProgressRoot;
+ if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
+ throw Error(formatProdErrorMessage(482));
+ thenableState = thenable;
+ thenableState.status = "pending";
+ thenableState.then(
+ function (fulfilledValue) {
+ if ("pending" === thenable.status) {
+ var fulfilledThenable = thenable;
+ fulfilledThenable.status = "fulfilled";
+ fulfilledThenable.value = fulfilledValue;
+ }
+ },
+ function (error) {
+ if ("pending" === thenable.status) {
+ var rejectedThenable = thenable;
+ rejectedThenable.status = "rejected";
+ rejectedThenable.reason = error;
+ }
+ }
+ );
+ }
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ }
+ suspendedThenable = thenable;
+ throw SuspenseException;
+ }
}
-function createEffectInstance() {
- return { destroy: void 0, resource: void 0 };
+var suspendedThenable = null;
+function getSuspendedThenable() {
+ if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
+ var thenable = suspendedThenable;
+ suspendedThenable = null;
+ return thenable;
}
-function updateRef() {
- return updateWorkInProgressHook().memoizedState;
+function checkIfUseWrappedInAsyncCatch(rejectedReason) {
+ if (
+ rejectedReason === SuspenseException ||
+ rejectedReason === SuspenseActionException
+ )
+ throw Error(formatProdErrorMessage(483));
}
-function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- currentlyRenderingFiber$1.flags |= fiberFlags;
- hook.memoizedState = pushSimpleEffect(
- 1 | hookFlags,
- createEffectInstance(),
- create,
- deps
- );
+var currentTreeHiddenStackCursor = createCursor(null),
+ prevEntangledRenderLanesCursor = createCursor(0);
+function pushHiddenContext(fiber, context) {
+ fiber = entangledRenderLanes;
+ push(prevEntangledRenderLanesCursor, fiber);
+ push(currentTreeHiddenStackCursor, context);
+ entangledRenderLanes = fiber | context.baseLanes;
}
-function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var inst = hook.memoizedState.inst;
- null !== currentHook &&
- null !== deps &&
- areHookInputsEqual(deps, currentHook.memoizedState.deps)
- ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
- : ((currentlyRenderingFiber$1.flags |= fiberFlags),
- (hook.memoizedState = pushSimpleEffect(
- 1 | hookFlags,
- inst,
- create,
- deps
- )));
+function reuseHiddenContextOnStack() {
+ push(prevEntangledRenderLanesCursor, entangledRenderLanes);
+ push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
}
-function mountEffect(create, deps) {
- mountEffectImpl(8390656, 8, create, deps);
+function popHiddenContext() {
+ entangledRenderLanes = prevEntangledRenderLanesCursor.current;
+ pop(currentTreeHiddenStackCursor);
+ pop(prevEntangledRenderLanesCursor);
}
-function updateEffect(create, deps) {
- updateEffectImpl(2048, 8, create, deps);
+var prevOnStartTransitionFinish = ReactSharedInternals.S;
+ReactSharedInternals.S = function (transition, returnValue) {
+ "object" === typeof returnValue &&
+ null !== returnValue &&
+ "function" === typeof returnValue.then &&
+ entangleAsyncAction(transition, returnValue);
+ null !== prevOnStartTransitionFinish &&
+ prevOnStartTransitionFinish(transition, returnValue);
+};
+var resumedCache = createCursor(null);
+function peekCacheFromPool() {
+ var cacheResumedFromPreviousRender = resumedCache.current;
+ return null !== cacheResumedFromPreviousRender
+ ? cacheResumedFromPreviousRender
+ : workInProgressRoot.pooledCache;
}
-function useEffectEventImpl(payload) {
- currentlyRenderingFiber$1.flags |= 4;
- var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
- if (null === componentUpdateQueue)
- (componentUpdateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue),
- (componentUpdateQueue.events = [payload]);
- else {
- var events = componentUpdateQueue.events;
- null === events
- ? (componentUpdateQueue.events = [payload])
- : events.push(payload);
- }
+function pushTransition(offscreenWorkInProgress, prevCachePool) {
+ null === prevCachePool
+ ? push(resumedCache, resumedCache.current)
+ : push(resumedCache, prevCachePool.pool);
}
-function updateEvent(callback) {
- var ref = updateWorkInProgressHook().memoizedState;
- useEffectEventImpl({ ref: ref, nextImpl: callback });
- return function () {
- if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
- return ref.impl.apply(void 0, arguments);
- };
+function getSuspendedCache() {
+ var cacheFromPool = peekCacheFromPool();
+ return null === cacheFromPool
+ ? null
+ : { parent: CacheContext._currentValue, pool: cacheFromPool };
}
-function updateInsertionEffect(create, deps) {
- return updateEffectImpl(4, 2, create, deps);
+var renderLanes = 0,
+ currentlyRenderingFiber = null,
+ currentHook = null,
+ workInProgressHook = null,
+ didScheduleRenderPhaseUpdate = !1,
+ didScheduleRenderPhaseUpdateDuringThisPass = !1,
+ shouldDoubleInvokeUserFnsInHooksDEV = !1,
+ localIdCounter = 0,
+ thenableIndexCounter$1 = 0,
+ thenableState$1 = null,
+ globalClientIdCounter = 0;
+function throwInvalidHookError() {
+ throw Error(formatProdErrorMessage(321));
}
-function updateLayoutEffect(create, deps) {
- return updateEffectImpl(4, 4, create, deps);
+function areHookInputsEqual(nextDeps, prevDeps) {
+ if (null === prevDeps) return !1;
+ for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
+ if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
+ return !0;
}
-function imperativeHandleEffect(create, ref) {
- if ("function" === typeof ref) {
- create = create();
- var refCleanup = ref(create);
- return function () {
- "function" === typeof refCleanup ? refCleanup() : ref(null);
- };
- }
- if (null !== ref && void 0 !== ref)
- return (
- (create = create()),
- (ref.current = create),
- function () {
- ref.current = null;
- }
- );
-}
-function updateImperativeHandle(ref, create, deps) {
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
+function renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ props,
+ secondArg,
+ nextRenderLanes
+) {
+ renderLanes = nextRenderLanes;
+ currentlyRenderingFiber = workInProgress;
+ workInProgress.memoizedState = null;
+ workInProgress.updateQueue = null;
+ workInProgress.lanes = 0;
+ ReactSharedInternals.H =
+ null === current || null === current.memoizedState
+ ? HooksDispatcherOnMount
+ : HooksDispatcherOnUpdate;
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ nextRenderLanes = Component(props, secondArg);
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ didScheduleRenderPhaseUpdateDuringThisPass &&
+ (nextRenderLanes = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ ));
+ finishRenderingHooks(current);
+ return nextRenderLanes;
}
-function mountDebugValue() {}
-function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- hook.memoizedState = [callback, deps];
- return callback;
+function finishRenderingHooks(current) {
+ ReactSharedInternals.H = ContextOnlyDispatcher;
+ var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
+ renderLanes = 0;
+ workInProgressHook = currentHook = currentlyRenderingFiber = null;
+ didScheduleRenderPhaseUpdate = !1;
+ thenableIndexCounter$1 = 0;
+ thenableState$1 = null;
+ if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
+ null === current ||
+ didReceiveUpdate ||
+ ((current = current.dependencies),
+ null !== current &&
+ checkIfContextChanged(current) &&
+ (didReceiveUpdate = !0));
}
-function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- prevState = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
+function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
+ currentlyRenderingFiber = workInProgress;
+ var numberOfReRenders = 0;
+ do {
+ didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
+ thenableIndexCounter$1 = 0;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
+ numberOfReRenders += 1;
+ workInProgressHook = currentHook = null;
+ if (null != workInProgress.updateQueue) {
+ var children = workInProgress.updateQueue;
+ children.lastEffect = null;
+ children.events = null;
+ children.stores = null;
+ null != children.memoCache && (children.memoCache.index = 0);
}
- }
- hook.memoizedState = [prevState, deps];
- return prevState;
+ ReactSharedInternals.H = HooksDispatcherOnRerender;
+ children = Component(props, secondArg);
+ } while (didScheduleRenderPhaseUpdateDuringThisPass);
+ return children;
}
-function mountDeferredValueImpl(hook, value, initialValue) {
- if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
- return (hook.memoizedState = value);
- hook.memoizedState = initialValue;
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return initialValue;
+function TransitionAwareHostComponent() {
+ var dispatcher = ReactSharedInternals.H,
+ maybeThenable = dispatcher.useState()[0];
+ maybeThenable =
+ "function" === typeof maybeThenable.then
+ ? useThenable(maybeThenable)
+ : maybeThenable;
+ dispatcher = dispatcher.useState()[0];
+ (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
+ (currentlyRenderingFiber.flags |= 1024);
+ return maybeThenable;
}
-function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
- if (objectIs(value, prevValue)) return value;
- if (null !== currentTreeHiddenStackCursor.current)
- return (
- (hook = mountDeferredValueImpl(hook, value, initialValue)),
- objectIs(hook, prevValue) || (didReceiveUpdate = !0),
- hook
- );
- if (0 === (renderLanes & 42))
- return (didReceiveUpdate = !0), (hook.memoizedState = value);
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return prevValue;
+function checkDidRenderIdHook() {
+ var didRenderIdHook = 0 !== localIdCounter;
+ localIdCounter = 0;
+ return didRenderIdHook;
}
-function startTransition(fiber, queue, pendingState, finishedState, callback) {
- var previousPriority = ReactDOMSharedInternals.p;
- ReactDOMSharedInternals.p =
- 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- dispatchOptimisticSetState(fiber, !1, queue, pendingState);
- try {
- var returnValue = callback(),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- if (
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
+function bailoutHooks(current, workInProgress, lanes) {
+ workInProgress.updateQueue = current.updateQueue;
+ workInProgress.flags &= -2053;
+ current.lanes &= ~lanes;
+}
+function resetHooksOnUnwind(workInProgress) {
+ if (didScheduleRenderPhaseUpdate) {
+ for (
+ workInProgress = workInProgress.memoizedState;
+ null !== workInProgress;
+
) {
- var thenableForFinishedState = chainThenableValue(
- returnValue,
- finishedState
- );
- dispatchSetStateInternal(
- fiber,
- queue,
- thenableForFinishedState,
- requestUpdateLane(fiber)
- );
- } else
- dispatchSetStateInternal(
- fiber,
- queue,
- finishedState,
- requestUpdateLane(fiber)
- );
- } catch (error) {
- dispatchSetStateInternal(
- fiber,
- queue,
- { then: function () {}, status: "rejected", reason: error },
- requestUpdateLane()
- );
- } finally {
- (ReactDOMSharedInternals.p = previousPriority),
- (ReactSharedInternals.T = prevTransition);
+ var queue = workInProgress.queue;
+ null !== queue && (queue.pending = null);
+ workInProgress = workInProgress.next;
+ }
+ didScheduleRenderPhaseUpdate = !1;
}
+ renderLanes = 0;
+ workInProgressHook = currentHook = currentlyRenderingFiber = null;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ thenableIndexCounter$1 = localIdCounter = 0;
+ thenableState$1 = null;
}
-function noop$2() {}
-function startHostTransition(formFiber, pendingState, action, formData) {
- if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
- var queue = ensureFormComponentIsStateful(formFiber).queue;
- startTransition(
- formFiber,
- queue,
- pendingState,
- sharedNotPendingObject,
- null === action
- ? noop$2
- : function () {
- requestFormReset$1(formFiber);
- return action(formData);
- }
- );
-}
-function ensureFormComponentIsStateful(formFiber) {
- var existingStateHook = formFiber.memoizedState;
- if (null !== existingStateHook) return existingStateHook;
- existingStateHook = {
- memoizedState: sharedNotPendingObject,
- baseState: sharedNotPendingObject,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: sharedNotPendingObject
- },
- next: null
- };
- var initialResetState = {};
- existingStateHook.next = {
- memoizedState: initialResetState,
- baseState: initialResetState,
+function mountWorkInProgressHook() {
+ var hook = {
+ memoizedState: null,
+ baseState: null,
baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialResetState
- },
+ queue: null,
next: null
};
- formFiber.memoizedState = existingStateHook;
- formFiber = formFiber.alternate;
- null !== formFiber && (formFiber.memoizedState = existingStateHook);
- return existingStateHook;
-}
-function requestFormReset$1(formFiber) {
- var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
- dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
-}
-function useHostTransitionStatus() {
- return readContext(HostTransitionContext);
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)
+ : (workInProgressHook = workInProgressHook.next = hook);
+ return workInProgressHook;
}
-function updateId() {
- return updateWorkInProgressHook().memoizedState;
-}
-function updateRefresh() {
- return updateWorkInProgressHook().memoizedState;
-}
-function refreshCache(fiber, seedKey, seedValue) {
- for (var provider = fiber.return; null !== provider; ) {
- switch (provider.tag) {
- case 24:
- case 3:
- var lane = requestUpdateLane();
- fiber = createUpdate(lane);
- var root$35 = enqueueUpdate(provider, fiber, lane);
- null !== root$35 &&
- (scheduleUpdateOnFiber(root$35, provider, lane),
- entangleTransitions(root$35, provider, lane));
- provider = createCache();
- null !== seedKey &&
- void 0 !== seedKey &&
- null !== root$35 &&
- provider.data.set(seedKey, seedValue);
- fiber.payload = { cache: provider };
- return;
+function updateWorkInProgressHook() {
+ if (null === currentHook) {
+ var nextCurrentHook = currentlyRenderingFiber.alternate;
+ nextCurrentHook =
+ null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
+ } else nextCurrentHook = currentHook.next;
+ var nextWorkInProgressHook =
+ null === workInProgressHook
+ ? currentlyRenderingFiber.memoizedState
+ : workInProgressHook.next;
+ if (null !== nextWorkInProgressHook)
+ (workInProgressHook = nextWorkInProgressHook),
+ (currentHook = nextCurrentHook);
+ else {
+ if (null === nextCurrentHook) {
+ if (null === currentlyRenderingFiber.alternate)
+ throw Error(formatProdErrorMessage(467));
+ throw Error(formatProdErrorMessage(310));
}
- provider = provider.return;
+ currentHook = nextCurrentHook;
+ nextCurrentHook = {
+ memoizedState: currentHook.memoizedState,
+ baseState: currentHook.baseState,
+ baseQueue: currentHook.baseQueue,
+ queue: currentHook.queue,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook =
+ nextCurrentHook)
+ : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
}
+ return workInProgressHook;
}
-function dispatchReducerAction(fiber, queue, action) {
- var lane = requestUpdateLane();
- action = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- isRenderPhaseUpdate(fiber)
- ? enqueueRenderPhaseUpdate(queue, action)
- : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),
- null !== action &&
- (scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane)));
+function createFunctionComponentUpdateQueue() {
+ return { lastEffect: null, events: null, stores: null, memoCache: null };
}
-function dispatchSetState(fiber, queue, action) {
- var lane = requestUpdateLane();
- dispatchSetStateInternal(fiber, queue, action, lane);
+function useThenable(thenable) {
+ var index = thenableIndexCounter$1;
+ thenableIndexCounter$1 += 1;
+ null === thenableState$1 && (thenableState$1 = []);
+ thenable = trackUsedThenable(thenableState$1, thenable, index);
+ index = currentlyRenderingFiber;
+ null ===
+ (null === workInProgressHook
+ ? index.memoizedState
+ : workInProgressHook.next) &&
+ ((index = index.alternate),
+ (ReactSharedInternals.H =
+ null === index || null === index.memoizedState
+ ? HooksDispatcherOnMount
+ : HooksDispatcherOnUpdate));
+ return thenable;
}
-function dispatchSetStateInternal(fiber, queue, action, lane) {
- var update = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
- else {
- var alternate = fiber.alternate;
- if (
- 0 === fiber.lanes &&
- (null === alternate || 0 === alternate.lanes) &&
- ((alternate = queue.lastRenderedReducer), null !== alternate)
- )
- try {
- var currentState = queue.lastRenderedState,
- eagerState = alternate(currentState, action);
- update.hasEagerState = !0;
- update.eagerState = eagerState;
- if (objectIs(eagerState, currentState))
- return (
- enqueueUpdate$1(fiber, queue, update, 0),
- null === workInProgressRoot && finishQueueingConcurrentUpdates(),
- !1
- );
- } catch (error) {
- } finally {
- }
- action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
- if (null !== action)
- return (
- scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane),
- !0
- );
+function use(usable) {
+ if (null !== usable && "object" === typeof usable) {
+ if ("function" === typeof usable.then) return useThenable(usable);
+ if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
}
- return !1;
-}
-function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
- action = {
- lane: 2,
- revertLane: requestTransitionLane(),
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) {
- if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
- } else
- (throwIfDuringRender = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- 2
- )),
- null !== throwIfDuringRender &&
- scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
+ throw Error(formatProdErrorMessage(438, String(usable)));
}
-function isRenderPhaseUpdate(fiber) {
- var alternate = fiber.alternate;
- return (
- fiber === currentlyRenderingFiber$1 ||
- (null !== alternate && alternate === currentlyRenderingFiber$1)
- );
+function useMemoCache(size) {
+ var memoCache = null,
+ updateQueue = currentlyRenderingFiber.updateQueue;
+ null !== updateQueue && (memoCache = updateQueue.memoCache);
+ if (null == memoCache) {
+ var current = currentlyRenderingFiber.alternate;
+ null !== current &&
+ ((current = current.updateQueue),
+ null !== current &&
+ ((current = current.memoCache),
+ null != current &&
+ (memoCache = {
+ data: current.data.map(function (array) {
+ return array.slice();
+ }),
+ index: 0
+ })));
+ }
+ null == memoCache && (memoCache = { data: [], index: 0 });
+ null === updateQueue &&
+ ((updateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = updateQueue));
+ updateQueue.memoCache = memoCache;
+ updateQueue = memoCache.data[memoCache.index];
+ if (void 0 === updateQueue)
+ for (
+ updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
+ current < size;
+ current++
+ )
+ updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
+ memoCache.index++;
+ return updateQueue;
}
-function enqueueRenderPhaseUpdate(queue, update) {
- didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
- !0;
- var pending = queue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- queue.pending = update;
+function basicStateReducer(state, action) {
+ return "function" === typeof action ? action(state) : action;
}
-function entangleTransitionUpdate(root, queue, lane) {
- if (0 !== (lane & 4194176)) {
- var queueLanes = queue.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- queue.lanes = lane;
- markRootEntangled(root, lane);
- }
+function updateReducer(reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateReducerImpl(hook, currentHook, reducer);
}
-var ContextOnlyDispatcher = {
- readContext: readContext,
- use: use,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useInsertionEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError,
- useSyncExternalStore: throwInvalidHookError,
- useId: throwInvalidHookError
-};
-ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
-ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
-ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
-ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
-ContextOnlyDispatcher.useFormState = throwInvalidHookError;
-ContextOnlyDispatcher.useActionState = throwInvalidHookError;
-ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
-var HooksDispatcherOnMount = {
- readContext: readContext,
- use: use,
- useCallback: function (callback, deps) {
- mountWorkInProgressHook().memoizedState = [
- callback,
- void 0 === deps ? null : deps
- ];
- return callback;
- },
- useContext: readContext,
- useEffect: mountEffect,
- useImperativeHandle: function (ref, create, deps) {
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- mountEffectImpl(
- 4194308,
- 4,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
- },
- useLayoutEffect: function (create, deps) {
- return mountEffectImpl(4194308, 4, create, deps);
- },
- useInsertionEffect: function (create, deps) {
- mountEffectImpl(4, 2, create, deps);
- },
- useMemo: function (nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var nextValue = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
+function updateReducerImpl(hook, current, reducer) {
+ var queue = hook.queue;
+ if (null === queue) throw Error(formatProdErrorMessage(311));
+ queue.lastRenderedReducer = reducer;
+ var baseQueue = hook.baseQueue,
+ pendingQueue = queue.pending;
+ if (null !== pendingQueue) {
+ if (null !== baseQueue) {
+ var baseFirst = baseQueue.next;
+ baseQueue.next = pendingQueue.next;
+ pendingQueue.next = baseFirst;
}
- hook.memoizedState = [nextValue, deps];
- return nextValue;
- },
- useReducer: function (reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- if (void 0 !== init) {
- var initialState = init(initialArg);
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- init(initialArg);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- } else initialState = initialArg;
- hook.memoizedState = hook.baseState = initialState;
- reducer = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- hook.queue = reducer;
- reducer = reducer.dispatch = dispatchReducerAction.bind(
- null,
- currentlyRenderingFiber$1,
- reducer
- );
- return [hook.memoizedState, reducer];
- },
- useRef: function (initialValue) {
- var hook = mountWorkInProgressHook();
- initialValue = { current: initialValue };
- return (hook.memoizedState = initialValue);
- },
- useState: function (initialState) {
- initialState = mountStateImpl(initialState);
- var queue = initialState.queue,
- dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
- queue.dispatch = dispatch;
- return [initialState.memoizedState, dispatch];
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = mountWorkInProgressHook();
- return mountDeferredValueImpl(hook, value, initialValue);
- },
- useTransition: function () {
- var stateHook = mountStateImpl(!1);
- stateHook = startTransition.bind(
- null,
- currentlyRenderingFiber$1,
- stateHook.queue,
- !0,
- !1
- );
- mountWorkInProgressHook().memoizedState = stateHook;
- return [!1, stateHook];
- },
- useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = mountWorkInProgressHook();
- if (isHydrating) {
- if (void 0 === getServerSnapshot)
- throw Error(formatProdErrorMessage(407));
- getServerSnapshot = getServerSnapshot();
- } else {
- getServerSnapshot = getSnapshot();
- if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
- 0 !== (workInProgressRootRenderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- hook.memoizedState = getServerSnapshot;
- var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };
- hook.queue = inst;
- mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
- subscribe
- ]);
+ current.baseQueue = baseQueue = pendingQueue;
+ queue.pending = null;
+ }
+ pendingQueue = hook.baseState;
+ if (null === baseQueue) hook.memoizedState = pendingQueue;
+ else {
+ current = baseQueue.next;
+ var newBaseQueueFirst = (baseFirst = null),
+ newBaseQueueLast = null,
+ update = current,
+ didReadFromEntangledAsyncAction$33 = !1;
+ do {
+ var updateLane = update.lane & -536870913;
+ if (
+ updateLane !== update.lane
+ ? (workInProgressRootRenderLanes & updateLane) === updateLane
+ : (renderLanes & updateLane) === updateLane
+ ) {
+ var revertLane = update.revertLane;
+ if (0 === revertLane)
+ null !== newBaseQueueLast &&
+ (newBaseQueueLast = newBaseQueueLast.next =
+ {
+ lane: 0,
+ revertLane: 0,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction$33 = !0);
+ else if ((renderLanes & revertLane) === revertLane) {
+ update = update.next;
+ revertLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction$33 = !0);
+ continue;
+ } else
+ (updateLane = {
+ lane: 0,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
+ (currentlyRenderingFiber.lanes |= revertLane),
+ (workInProgressRootSkippedLanes |= revertLane);
+ updateLane = update.action;
+ shouldDoubleInvokeUserFnsInHooksDEV &&
+ reducer(pendingQueue, updateLane);
+ pendingQueue = update.hasEagerState
+ ? update.eagerState
+ : reducer(pendingQueue, updateLane);
+ } else
+ (revertLane = {
+ lane: updateLane,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
+ (currentlyRenderingFiber.lanes |= updateLane),
+ (workInProgressRootSkippedLanes |= updateLane);
+ update = update.next;
+ } while (null !== update && update !== current);
+ null === newBaseQueueLast
+ ? (baseFirst = pendingQueue)
+ : (newBaseQueueLast.next = newBaseQueueFirst);
+ if (
+ !objectIs(pendingQueue, hook.memoizedState) &&
+ ((didReceiveUpdate = !0),
+ didReadFromEntangledAsyncAction$33 &&
+ ((reducer = currentEntangledActionThenable), null !== reducer))
+ )
+ throw reducer;
+ hook.memoizedState = pendingQueue;
+ hook.baseState = baseFirst;
+ hook.baseQueue = newBaseQueueLast;
+ queue.lastRenderedState = pendingQueue;
+ }
+ null === baseQueue && (queue.lanes = 0);
+ return [hook.memoizedState, queue.dispatch];
+}
+function rerenderReducer(reducer) {
+ var hook = updateWorkInProgressHook(),
+ queue = hook.queue;
+ if (null === queue) throw Error(formatProdErrorMessage(311));
+ queue.lastRenderedReducer = reducer;
+ var dispatch = queue.dispatch,
+ lastRenderPhaseUpdate = queue.pending,
+ newState = hook.memoizedState;
+ if (null !== lastRenderPhaseUpdate) {
+ queue.pending = null;
+ var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
+ do (newState = reducer(newState, update.action)), (update = update.next);
+ while (update !== lastRenderPhaseUpdate);
+ objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
+ hook.memoizedState = newState;
+ null === hook.baseQueue && (hook.baseState = newState);
+ queue.lastRenderedState = newState;
+ }
+ return [newState, dispatch];
+}
+function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = updateWorkInProgressHook(),
+ isHydrating$jscomp$0 = isHydrating;
+ if (isHydrating$jscomp$0) {
+ if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
+ getServerSnapshot = getServerSnapshot();
+ } else getServerSnapshot = getSnapshot();
+ var snapshotChanged = !objectIs(
+ (currentHook || hook).memoizedState,
+ getServerSnapshot
+ );
+ snapshotChanged &&
+ ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));
+ hook = hook.queue;
+ updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
+ subscribe
+ ]);
+ if (
+ hook.getSnapshot !== getSnapshot ||
+ snapshotChanged ||
+ (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)
+ ) {
fiber.flags |= 2048;
pushSimpleEffect(
9,
@@ -4164,1094 +3841,1878 @@ var HooksDispatcherOnMount = {
updateStoreInstance.bind(
null,
fiber,
- inst,
+ hook,
getServerSnapshot,
getSnapshot
),
null
);
- return getServerSnapshot;
- },
- useId: function () {
- var hook = mountWorkInProgressHook(),
- identifierPrefix = workInProgressRoot.identifierPrefix;
- if (isHydrating) {
- var JSCompiler_inline_result = treeContextOverflow;
- var idWithLeadingBit = treeContextId;
- JSCompiler_inline_result =
- (
- idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
- ).toString(32) + JSCompiler_inline_result;
- identifierPrefix =
- ":" + identifierPrefix + "R" + JSCompiler_inline_result;
- JSCompiler_inline_result = localIdCounter++;
- 0 < JSCompiler_inline_result &&
- (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
- identifierPrefix += ":";
- } else
- (JSCompiler_inline_result = globalClientIdCounter++),
- (identifierPrefix =
- ":" +
- identifierPrefix +
- "r" +
- JSCompiler_inline_result.toString(32) +
- ":");
- return (hook.memoizedState = identifierPrefix);
- },
- useCacheRefresh: function () {
- return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
- null,
- currentlyRenderingFiber$1
- ));
+ if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
+ isHydrating$jscomp$0 ||
+ 0 !== (renderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
}
-};
-HooksDispatcherOnMount.useMemoCache = useMemoCache;
-HooksDispatcherOnMount.useEffectEvent = function (callback) {
- var hook = mountWorkInProgressHook(),
- ref = { impl: callback };
- hook.memoizedState = ref;
- return function () {
- if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
- return ref.impl.apply(void 0, arguments);
- };
-};
-HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnMount.useFormState = mountActionState;
-HooksDispatcherOnMount.useActionState = mountActionState;
-HooksDispatcherOnMount.useOptimistic = function (passthrough) {
+ return getServerSnapshot;
+}
+function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
+ fiber.flags |= 16384;
+ fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
+ getSnapshot = currentlyRenderingFiber.updateQueue;
+ null === getSnapshot
+ ? ((getSnapshot = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = getSnapshot),
+ (getSnapshot.stores = [fiber]))
+ : ((renderedSnapshot = getSnapshot.stores),
+ null === renderedSnapshot
+ ? (getSnapshot.stores = [fiber])
+ : renderedSnapshot.push(fiber));
+}
+function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
+ inst.value = nextSnapshot;
+ inst.getSnapshot = getSnapshot;
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+}
+function subscribeToStore(fiber, inst, subscribe) {
+ return subscribe(function () {
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ });
+}
+function checkIfSnapshotChanged(inst) {
+ var latestGetSnapshot = inst.getSnapshot;
+ inst = inst.value;
+ try {
+ var nextValue = latestGetSnapshot();
+ return !objectIs(inst, nextValue);
+ } catch (error) {
+ return !0;
+ }
+}
+function forceStoreRerender(fiber) {
+ var root = enqueueConcurrentRenderForLane(fiber, 2);
+ null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+}
+function mountStateImpl(initialState) {
var hook = mountWorkInProgressHook();
- hook.memoizedState = hook.baseState = passthrough;
- var queue = {
+ if ("function" === typeof initialState) {
+ var initialStateInitializer = initialState;
+ initialState = initialStateInitializer();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ initialStateInitializer();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ }
+ hook.memoizedState = hook.baseState = initialState;
+ hook.queue = {
pending: null,
lanes: 0,
dispatch: null,
- lastRenderedReducer: null,
- lastRenderedState: null
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialState
};
- hook.queue = queue;
- hook = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !0,
- queue
+ return hook;
+}
+function updateOptimisticImpl(hook, current, passthrough, reducer) {
+ hook.baseState = passthrough;
+ return updateReducerImpl(
+ hook,
+ currentHook,
+ "function" === typeof reducer ? reducer : basicStateReducer
);
- queue.dispatch = hook;
- return [passthrough, hook];
-};
-var HooksDispatcherOnUpdate = {
- readContext: readContext,
- use: use,
- useCallback: updateCallback,
- useContext: readContext,
- useEffect: updateEffect,
- useImperativeHandle: updateImperativeHandle,
- useInsertionEffect: updateInsertionEffect,
- useLayoutEffect: updateLayoutEffect,
- useMemo: updateMemo,
- useReducer: updateReducer,
- useRef: updateRef,
- useState: function () {
- return updateReducer(basicStateReducer);
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = updateWorkInProgressHook();
- return updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
- },
- useTransition: function () {
- var booleanOrThenable = updateReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- },
- useSyncExternalStore: updateSyncExternalStore,
- useId: updateId
-};
-HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
-HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
-HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
-HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnUpdate.useFormState = updateActionState;
-HooksDispatcherOnUpdate.useActionState = updateActionState;
-HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
-};
-var HooksDispatcherOnRerender = {
- readContext: readContext,
- use: use,
- useCallback: updateCallback,
- useContext: readContext,
- useEffect: updateEffect,
- useImperativeHandle: updateImperativeHandle,
- useInsertionEffect: updateInsertionEffect,
- useLayoutEffect: updateLayoutEffect,
- useMemo: updateMemo,
- useReducer: rerenderReducer,
- useRef: updateRef,
- useState: function () {
- return rerenderReducer(basicStateReducer);
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = updateWorkInProgressHook();
- return null === currentHook
- ? mountDeferredValueImpl(hook, value, initialValue)
- : updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
- },
- useTransition: function () {
- var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- },
- useSyncExternalStore: updateSyncExternalStore,
- useId: updateId
-};
-HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
-HooksDispatcherOnRerender.useMemoCache = useMemoCache;
-HooksDispatcherOnRerender.useEffectEvent = updateEvent;
-HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnRerender.useFormState = rerenderActionState;
-HooksDispatcherOnRerender.useActionState = rerenderActionState;
-HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- if (null !== currentHook)
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- hook.baseState = passthrough;
- return [passthrough, hook.queue.dispatch];
-};
-var thenableState = null,
- thenableIndexCounter = 0;
-function unwrapThenable(thenable) {
- var index = thenableIndexCounter;
- thenableIndexCounter += 1;
- null === thenableState && (thenableState = []);
- return trackUsedThenable(thenableState, thenable, index);
}
-function coerceRef(workInProgress, element) {
- element = element.props.ref;
- workInProgress.ref = void 0 !== element ? element : null;
+function dispatchActionState(
+ fiber,
+ actionQueue,
+ setPendingState,
+ setState,
+ payload
+) {
+ if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
+ fiber = actionQueue.action;
+ if (null !== fiber) {
+ var actionNode = {
+ payload: payload,
+ action: fiber,
+ next: null,
+ isTransition: !0,
+ status: "pending",
+ value: null,
+ reason: null,
+ listeners: [],
+ then: function (listener) {
+ actionNode.listeners.push(listener);
+ }
+ };
+ null !== ReactSharedInternals.T
+ ? setPendingState(!0)
+ : (actionNode.isTransition = !1);
+ setState(actionNode);
+ setPendingState = actionQueue.pending;
+ null === setPendingState
+ ? ((actionNode.next = actionQueue.pending = actionNode),
+ runActionStateAction(actionQueue, actionNode))
+ : ((actionNode.next = setPendingState.next),
+ (actionQueue.pending = setPendingState.next = actionNode));
+ }
}
-function throwOnInvalidObjectType(returnFiber, newChild) {
- if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
- throw Error(formatProdErrorMessage(525));
- returnFiber = Object.prototype.toString.call(newChild);
- throw Error(
- formatProdErrorMessage(
- 31,
- "[object Object]" === returnFiber
- ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
- : returnFiber
- )
- );
+function runActionStateAction(actionQueue, node) {
+ var action = node.action,
+ payload = node.payload,
+ prevState = actionQueue.state;
+ if (node.isTransition) {
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ try {
+ var returnValue = action(prevState, payload),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ handleActionReturnValue(actionQueue, node, returnValue);
+ } catch (error) {
+ onActionError(actionQueue, node, error);
+ } finally {
+ ReactSharedInternals.T = prevTransition;
+ }
+ } else
+ try {
+ (prevTransition = action(prevState, payload)),
+ handleActionReturnValue(actionQueue, node, prevTransition);
+ } catch (error$39) {
+ onActionError(actionQueue, node, error$39);
+ }
}
-function resolveLazy(lazyType) {
- var init = lazyType._init;
- return init(lazyType._payload);
+function handleActionReturnValue(actionQueue, node, returnValue) {
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ? returnValue.then(
+ function (nextState) {
+ onActionSuccess(actionQueue, node, nextState);
+ },
+ function (error) {
+ return onActionError(actionQueue, node, error);
+ }
+ )
+ : onActionSuccess(actionQueue, node, returnValue);
}
-function createChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (shouldTrackSideEffects) {
- var deletions = returnFiber.deletions;
- null === deletions
- ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))
- : deletions.push(childToDelete);
- }
- }
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) return null;
- for (; null !== currentFirstChild; )
- deleteChild(returnFiber, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return null;
- }
- function mapRemainingChildren(currentFirstChild) {
- for (var existingChildren = new Map(); null !== currentFirstChild; )
- null !== currentFirstChild.key
- ? existingChildren.set(currentFirstChild.key, currentFirstChild)
- : existingChildren.set(currentFirstChild.index, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return existingChildren;
+function onActionSuccess(actionQueue, actionNode, nextState) {
+ actionNode.status = "fulfilled";
+ actionNode.value = nextState;
+ notifyActionListeners(actionNode);
+ actionQueue.state = nextState;
+ actionNode = actionQueue.pending;
+ null !== actionNode &&
+ ((nextState = actionNode.next),
+ nextState === actionNode
+ ? (actionQueue.pending = null)
+ : ((nextState = nextState.next),
+ (actionNode.next = nextState),
+ runActionStateAction(actionQueue, nextState)));
+}
+function onActionError(actionQueue, actionNode, error) {
+ var last = actionQueue.pending;
+ actionQueue.pending = null;
+ if (null !== last) {
+ last = last.next;
+ do
+ (actionNode.status = "rejected"),
+ (actionNode.reason = error),
+ notifyActionListeners(actionNode),
+ (actionNode = actionNode.next);
+ while (actionNode !== last);
}
- function useFiber(fiber, pendingProps) {
- fiber = createWorkInProgress(fiber, pendingProps);
- fiber.index = 0;
- fiber.sibling = null;
- return fiber;
+ actionQueue.action = null;
+}
+function notifyActionListeners(actionNode) {
+ actionNode = actionNode.listeners;
+ for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+}
+function actionStateReducer(oldState, newState) {
+ return newState;
+}
+function mountActionState(action, initialStateProp) {
+ if (isHydrating) {
+ var ssrFormState = workInProgressRoot.formState;
+ if (null !== ssrFormState) {
+ a: {
+ var JSCompiler_inline_result = currentlyRenderingFiber;
+ if (isHydrating) {
+ if (nextHydratableInstance) {
+ b: {
+ var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
+ for (
+ var inRootOrSingleton = rootOrSingletonContext;
+ 8 !== JSCompiler_inline_result$jscomp$0.nodeType;
+
+ ) {
+ if (!inRootOrSingleton) {
+ JSCompiler_inline_result$jscomp$0 = null;
+ break b;
+ }
+ JSCompiler_inline_result$jscomp$0 = getNextHydratable(
+ JSCompiler_inline_result$jscomp$0.nextSibling
+ );
+ if (null === JSCompiler_inline_result$jscomp$0) {
+ JSCompiler_inline_result$jscomp$0 = null;
+ break b;
+ }
+ }
+ inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
+ JSCompiler_inline_result$jscomp$0 =
+ "F!" === inRootOrSingleton || "F" === inRootOrSingleton
+ ? JSCompiler_inline_result$jscomp$0
+ : null;
+ }
+ if (JSCompiler_inline_result$jscomp$0) {
+ nextHydratableInstance = getNextHydratable(
+ JSCompiler_inline_result$jscomp$0.nextSibling
+ );
+ JSCompiler_inline_result =
+ "F!" === JSCompiler_inline_result$jscomp$0.data;
+ break a;
+ }
+ }
+ throwOnHydrationMismatch(JSCompiler_inline_result);
+ }
+ JSCompiler_inline_result = !1;
+ }
+ JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
+ }
}
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
- if (!shouldTrackSideEffects)
- return (newFiber.flags |= 1048576), lastPlacedIndex;
- newIndex = newFiber.alternate;
- if (null !== newIndex)
- return (
- (newIndex = newIndex.index),
- newIndex < lastPlacedIndex
- ? ((newFiber.flags |= 33554434), lastPlacedIndex)
- : newIndex
- );
- newFiber.flags |= 33554434;
- return lastPlacedIndex;
- }
- function placeSingleChild(newFiber) {
- shouldTrackSideEffects &&
- null === newFiber.alternate &&
- (newFiber.flags |= 33554434);
- return newFiber;
+ ssrFormState = mountWorkInProgressHook();
+ ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
+ JSCompiler_inline_result = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: actionStateReducer,
+ lastRenderedState: initialStateProp
+ };
+ ssrFormState.queue = JSCompiler_inline_result;
+ ssrFormState = dispatchSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ JSCompiler_inline_result
+ );
+ JSCompiler_inline_result.dispatch = ssrFormState;
+ JSCompiler_inline_result = mountStateImpl(!1);
+ inRootOrSingleton = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !1,
+ JSCompiler_inline_result.queue
+ );
+ JSCompiler_inline_result = mountWorkInProgressHook();
+ JSCompiler_inline_result$jscomp$0 = {
+ state: initialStateProp,
+ dispatch: null,
+ action: action,
+ pending: null
+ };
+ JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
+ ssrFormState = dispatchActionState.bind(
+ null,
+ currentlyRenderingFiber,
+ JSCompiler_inline_result$jscomp$0,
+ inRootOrSingleton,
+ ssrFormState
+ );
+ JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
+ JSCompiler_inline_result.memoizedState = action;
+ return [initialStateProp, ssrFormState, !1];
+}
+function updateActionState(action) {
+ var stateHook = updateWorkInProgressHook();
+ return updateActionStateImpl(stateHook, currentHook, action);
+}
+function updateActionStateImpl(stateHook, currentStateHook, action) {
+ currentStateHook = updateReducerImpl(
+ stateHook,
+ currentStateHook,
+ actionStateReducer
+ )[0];
+ stateHook = updateReducer(basicStateReducer)[0];
+ if (
+ "object" === typeof currentStateHook &&
+ null !== currentStateHook &&
+ "function" === typeof currentStateHook.then
+ )
+ try {
+ var state = useThenable(currentStateHook);
+ } catch (x) {
+ if (x === SuspenseException) throw SuspenseActionException;
+ throw x;
+ }
+ else state = currentStateHook;
+ currentStateHook = updateWorkInProgressHook();
+ var actionQueue = currentStateHook.queue,
+ dispatch = actionQueue.dispatch;
+ action !== currentStateHook.memoizedState &&
+ ((currentlyRenderingFiber.flags |= 2048),
+ pushSimpleEffect(
+ 9,
+ createEffectInstance(),
+ actionStateActionEffect.bind(null, actionQueue, action),
+ null
+ ));
+ return [state, dispatch, stateHook];
+}
+function actionStateActionEffect(actionQueue, action) {
+ actionQueue.action = action;
+}
+function rerenderActionState(action) {
+ var stateHook = updateWorkInProgressHook(),
+ currentStateHook = currentHook;
+ if (null !== currentStateHook)
+ return updateActionStateImpl(stateHook, currentStateHook, action);
+ updateWorkInProgressHook();
+ stateHook = stateHook.memoizedState;
+ currentStateHook = updateWorkInProgressHook();
+ var dispatch = currentStateHook.queue.dispatch;
+ currentStateHook.memoizedState = action;
+ return [stateHook, dispatch, !1];
+}
+function pushSimpleEffect(tag, inst, create, deps) {
+ tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
+ inst = currentlyRenderingFiber.updateQueue;
+ null === inst &&
+ ((inst = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = inst));
+ create = inst.lastEffect;
+ null === create
+ ? (inst.lastEffect = tag.next = tag)
+ : ((deps = create.next),
+ (create.next = tag),
+ (tag.next = deps),
+ (inst.lastEffect = tag));
+ return tag;
+}
+function createEffectInstance() {
+ return { destroy: void 0, resource: void 0 };
+}
+function updateRef() {
+ return updateWorkInProgressHook().memoizedState;
+}
+function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ currentlyRenderingFiber.flags |= fiberFlags;
+ hook.memoizedState = pushSimpleEffect(
+ 1 | hookFlags,
+ createEffectInstance(),
+ create,
+ deps
+ );
+}
+function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var inst = hook.memoizedState.inst;
+ null !== currentHook &&
+ null !== deps &&
+ areHookInputsEqual(deps, currentHook.memoizedState.deps)
+ ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
+ : ((currentlyRenderingFiber.flags |= fiberFlags),
+ (hook.memoizedState = pushSimpleEffect(
+ 1 | hookFlags,
+ inst,
+ create,
+ deps
+ )));
+}
+function mountEffect(create, deps) {
+ mountEffectImpl(8390656, 8, create, deps);
+}
+function updateEffect(create, deps) {
+ updateEffectImpl(2048, 8, create, deps);
+}
+function useEffectEventImpl(payload) {
+ currentlyRenderingFiber.flags |= 4;
+ var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
+ if (null === componentUpdateQueue)
+ (componentUpdateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = componentUpdateQueue),
+ (componentUpdateQueue.events = [payload]);
+ else {
+ var events = componentUpdateQueue.events;
+ null === events
+ ? (componentUpdateQueue.events = [payload])
+ : events.push(payload);
}
- function updateTextNode(returnFiber, current, textContent, lanes) {
- if (null === current || 6 !== current.tag)
- return (
- (current = createFiberFromText(textContent, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- current
- );
- current = useFiber(current, textContent);
- current.return = returnFiber;
- return current;
+}
+function updateEvent(callback) {
+ var ref = updateWorkInProgressHook().memoizedState;
+ useEffectEventImpl({ ref: ref, nextImpl: callback });
+ return function () {
+ if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
+ return ref.impl.apply(void 0, arguments);
+ };
+}
+function updateInsertionEffect(create, deps) {
+ return updateEffectImpl(4, 2, create, deps);
+}
+function updateLayoutEffect(create, deps) {
+ return updateEffectImpl(4, 4, create, deps);
+}
+function imperativeHandleEffect(create, ref) {
+ if ("function" === typeof ref) {
+ create = create();
+ var refCleanup = ref(create);
+ return function () {
+ "function" === typeof refCleanup ? refCleanup() : ref(null);
+ };
}
- function updateElement(returnFiber, current, element, lanes) {
- var elementType = element.type;
- if (elementType === REACT_FRAGMENT_TYPE)
- return updateFragment(
- returnFiber,
- current,
- element.props.children,
- lanes,
- element.key
- );
- if (
- null !== current &&
- (current.elementType === elementType ||
- ("object" === typeof elementType &&
- null !== elementType &&
- elementType.$$typeof === REACT_LAZY_TYPE &&
- resolveLazy(elementType) === current.type))
- )
- return (
- (current = useFiber(current, element.props)),
- coerceRef(current, element),
- (current.return = returnFiber),
- current
- );
- current = createFiberFromTypeAndProps(
- element.type,
- element.key,
- element.props,
- null,
- returnFiber.mode,
- lanes
+ if (null !== ref && void 0 !== ref)
+ return (
+ (create = create()),
+ (ref.current = create),
+ function () {
+ ref.current = null;
+ }
);
- coerceRef(current, element);
- current.return = returnFiber;
- return current;
- }
- function updatePortal(returnFiber, current, portal, lanes) {
- if (
- null === current ||
- 4 !== current.tag ||
- current.stateNode.containerInfo !== portal.containerInfo ||
- current.stateNode.implementation !== portal.implementation
- )
- return (
- (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- current
- );
- current = useFiber(current, portal.children || []);
- current.return = returnFiber;
- return current;
- }
- function updateFragment(returnFiber, current, fragment, lanes, key) {
- if (null === current || 7 !== current.tag)
- return (
- (current = createFiberFromFragment(
- fragment,
- returnFiber.mode,
- lanes,
- key
- )),
- (current.return = returnFiber),
- current
+}
+function updateImperativeHandle(ref, create, deps) {
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
+}
+function mountDebugValue() {}
+function updateCallback(callback, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ hook.memoizedState = [callback, deps];
+ return callback;
+}
+function updateMemo(nextCreate, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ prevState = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ hook.memoizedState = [prevState, deps];
+ return prevState;
+}
+function mountDeferredValueImpl(hook, value, initialValue) {
+ if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
+ return (hook.memoizedState = value);
+ hook.memoizedState = initialValue;
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return initialValue;
+}
+function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
+ if (objectIs(value, prevValue)) return value;
+ if (null !== currentTreeHiddenStackCursor.current)
+ return (
+ (hook = mountDeferredValueImpl(hook, value, initialValue)),
+ objectIs(hook, prevValue) || (didReceiveUpdate = !0),
+ hook
+ );
+ if (0 === (renderLanes & 42))
+ return (didReceiveUpdate = !0), (hook.memoizedState = value);
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return prevValue;
+}
+function startTransition(fiber, queue, pendingState, finishedState, callback) {
+ var previousPriority = ReactDOMSharedInternals.p;
+ ReactDOMSharedInternals.p =
+ 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ dispatchOptimisticSetState(fiber, !1, queue, pendingState);
+ try {
+ var returnValue = callback(),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ if (
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ) {
+ var thenableForFinishedState = chainThenableValue(
+ returnValue,
+ finishedState
);
- current = useFiber(current, fragment);
- current.return = returnFiber;
- return current;
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ thenableForFinishedState,
+ requestUpdateLane(fiber)
+ );
+ } else
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ finishedState,
+ requestUpdateLane(fiber)
+ );
+ } catch (error) {
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ { then: function () {}, status: "rejected", reason: error },
+ requestUpdateLane()
+ );
+ } finally {
+ (ReactDOMSharedInternals.p = previousPriority),
+ (ReactSharedInternals.T = prevTransition);
}
- function createChild(returnFiber, newChild, lanes) {
+}
+function noop$2() {}
+function startHostTransition(formFiber, pendingState, action, formData) {
+ if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
+ var queue = ensureFormComponentIsStateful(formFiber).queue;
+ startTransition(
+ formFiber,
+ queue,
+ pendingState,
+ sharedNotPendingObject,
+ null === action
+ ? noop$2
+ : function () {
+ requestFormReset$1(formFiber);
+ return action(formData);
+ }
+ );
+}
+function ensureFormComponentIsStateful(formFiber) {
+ var existingStateHook = formFiber.memoizedState;
+ if (null !== existingStateHook) return existingStateHook;
+ existingStateHook = {
+ memoizedState: sharedNotPendingObject,
+ baseState: sharedNotPendingObject,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: sharedNotPendingObject
+ },
+ next: null
+ };
+ var initialResetState = {};
+ existingStateHook.next = {
+ memoizedState: initialResetState,
+ baseState: initialResetState,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialResetState
+ },
+ next: null
+ };
+ formFiber.memoizedState = existingStateHook;
+ formFiber = formFiber.alternate;
+ null !== formFiber && (formFiber.memoizedState = existingStateHook);
+ return existingStateHook;
+}
+function requestFormReset$1(formFiber) {
+ var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
+ dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
+}
+function useHostTransitionStatus() {
+ return readContext(HostTransitionContext);
+}
+function updateId() {
+ return updateWorkInProgressHook().memoizedState;
+}
+function updateRefresh() {
+ return updateWorkInProgressHook().memoizedState;
+}
+function refreshCache(fiber, seedKey, seedValue) {
+ for (var provider = fiber.return; null !== provider; ) {
+ switch (provider.tag) {
+ case 24:
+ case 3:
+ var lane = requestUpdateLane();
+ fiber = createUpdate(lane);
+ var root$42 = enqueueUpdate(provider, fiber, lane);
+ null !== root$42 &&
+ (scheduleUpdateOnFiber(root$42, provider, lane),
+ entangleTransitions(root$42, provider, lane));
+ provider = createCache();
+ null !== seedKey &&
+ void 0 !== seedKey &&
+ null !== root$42 &&
+ provider.data.set(seedKey, seedValue);
+ fiber.payload = { cache: provider };
+ return;
+ }
+ provider = provider.return;
+ }
+}
+function dispatchReducerAction(fiber, queue, action) {
+ var lane = requestUpdateLane();
+ action = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ isRenderPhaseUpdate(fiber)
+ ? enqueueRenderPhaseUpdate(queue, action)
+ : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),
+ null !== action &&
+ (scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane)));
+}
+function dispatchSetState(fiber, queue, action) {
+ var lane = requestUpdateLane();
+ dispatchSetStateInternal(fiber, queue, action, lane);
+}
+function dispatchSetStateInternal(fiber, queue, action, lane) {
+ var update = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
+ else {
+ var alternate = fiber.alternate;
if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
+ 0 === fiber.lanes &&
+ (null === alternate || 0 === alternate.lanes) &&
+ ((alternate = queue.lastRenderedReducer), null !== alternate)
)
- return (
- (newChild = createFiberFromText(
- "" + newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- newChild
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
+ try {
+ var currentState = queue.lastRenderedState,
+ eagerState = alternate(currentState, action);
+ update.hasEagerState = !0;
+ update.eagerState = eagerState;
+ if (objectIs(eagerState, currentState))
return (
- (lanes = createFiberFromTypeAndProps(
- newChild.type,
- newChild.key,
- newChild.props,
- null,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- lanes
- );
- case REACT_PORTAL_TYPE:
- return (
- (newChild = createFiberFromPortal(
- newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- newChild
+ enqueueUpdate$1(fiber, queue, update, 0),
+ null === workInProgressRoot && finishQueueingConcurrentUpdates(),
+ !1
);
- case REACT_LAZY_TYPE:
- var init = newChild._init;
- newChild = init(newChild._payload);
- return createChild(returnFiber, newChild, lanes);
+ } catch (error) {
+ } finally {
}
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (newChild = createFiberFromFragment(
- newChild,
- returnFiber.mode,
- lanes,
- null
- )),
- (newChild.return = returnFiber),
- newChild
- );
- if ("function" === typeof newChild.then)
- return createChild(returnFiber, unwrapThenable(newChild), lanes);
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return createChild(
- returnFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- return null;
+ action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
+ if (null !== action)
+ return (
+ scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane),
+ !0
+ );
}
- function updateSlot(returnFiber, oldFiber, newChild, lanes) {
- var key = null !== oldFiber ? oldFiber.key : null;
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return null !== key
- ? null
- : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return newChild.key === key
- ? updateElement(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_PORTAL_TYPE:
- return newChild.key === key
- ? updatePortal(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_LAZY_TYPE:
- return (
- (key = newChild._init),
- (newChild = key(newChild._payload)),
- updateSlot(returnFiber, oldFiber, newChild, lanes)
- );
- }
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return null !== key
- ? null
- : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
- if ("function" === typeof newChild.then)
- return updateSlot(
- returnFiber,
- oldFiber,
- unwrapThenable(newChild),
- lanes
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateSlot(
- returnFiber,
- oldFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- return null;
+ return !1;
+}
+function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
+ action = {
+ lane: 2,
+ revertLane: requestTransitionLane(),
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) {
+ if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
+ } else
+ (throwIfDuringRender = enqueueConcurrentHookUpdate(
+ fiber,
+ queue,
+ action,
+ 2
+ )),
+ null !== throwIfDuringRender &&
+ scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
+}
+function isRenderPhaseUpdate(fiber) {
+ var alternate = fiber.alternate;
+ return (
+ fiber === currentlyRenderingFiber ||
+ (null !== alternate && alternate === currentlyRenderingFiber)
+ );
+}
+function enqueueRenderPhaseUpdate(queue, update) {
+ didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
+ !0;
+ var pending = queue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ queue.pending = update;
+}
+function entangleTransitionUpdate(root, queue, lane) {
+ if (0 !== (lane & 4194176)) {
+ var queueLanes = queue.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ queue.lanes = lane;
+ markRootEntangled(root, lane);
}
- function updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- ) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
+}
+var ContextOnlyDispatcher = {
+ readContext: readContext,
+ use: use,
+ useCallback: throwInvalidHookError,
+ useContext: throwInvalidHookError,
+ useEffect: throwInvalidHookError,
+ useImperativeHandle: throwInvalidHookError,
+ useLayoutEffect: throwInvalidHookError,
+ useInsertionEffect: throwInvalidHookError,
+ useMemo: throwInvalidHookError,
+ useReducer: throwInvalidHookError,
+ useRef: throwInvalidHookError,
+ useState: throwInvalidHookError,
+ useDebugValue: throwInvalidHookError,
+ useDeferredValue: throwInvalidHookError,
+ useTransition: throwInvalidHookError,
+ useSyncExternalStore: throwInvalidHookError,
+ useId: throwInvalidHookError,
+ useHostTransitionStatus: throwInvalidHookError,
+ useFormState: throwInvalidHookError,
+ useActionState: throwInvalidHookError,
+ useOptimistic: throwInvalidHookError,
+ useMemoCache: throwInvalidHookError,
+ useCacheRefresh: throwInvalidHookError
+};
+ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
+var HooksDispatcherOnMount = {
+ readContext: readContext,
+ use: use,
+ useCallback: function (callback, deps) {
+ mountWorkInProgressHook().memoizedState = [
+ callback,
+ void 0 === deps ? null : deps
+ ];
+ return callback;
+ },
+ useContext: readContext,
+ useEffect: mountEffect,
+ useImperativeHandle: function (ref, create, deps) {
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ mountEffectImpl(
+ 4194308,
+ 4,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updateElement(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_PORTAL_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updatePortal(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_LAZY_TYPE:
- var init = newChild._init;
- newChild = init(newChild._payload);
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- );
+ },
+ useLayoutEffect: function (create, deps) {
+ return mountEffectImpl(4194308, 4, create, deps);
+ },
+ useInsertionEffect: function (create, deps) {
+ mountEffectImpl(4, 2, create, deps);
+ },
+ useMemo: function (nextCreate, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var nextValue = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
}
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateFragment(returnFiber, existingChildren, newChild, lanes, null)
- );
- if ("function" === typeof newChild.then)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- unwrapThenable(newChild),
- lanes
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- return null;
- }
- function reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null;
- null !== oldFiber && newIdx < newChildren.length;
- newIdx++
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- lanes
+ hook.memoizedState = [nextValue, deps];
+ return nextValue;
+ },
+ useReducer: function (reducer, initialArg, init) {
+ var hook = mountWorkInProgressHook();
+ if (void 0 !== init) {
+ var initialState = init(initialArg);
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ init(initialArg);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ } else initialState = initialArg;
+ hook.memoizedState = hook.baseState = initialState;
+ reducer = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: reducer,
+ lastRenderedState: initialState
+ };
+ hook.queue = reducer;
+ reducer = reducer.dispatch = dispatchReducerAction.bind(
+ null,
+ currentlyRenderingFiber,
+ reducer
);
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
+ return [hook.memoizedState, reducer];
+ },
+ useRef: function (initialValue) {
+ var hook = mountWorkInProgressHook();
+ initialValue = { current: initialValue };
+ return (hook.memoizedState = initialValue);
+ },
+ useState: function (initialState) {
+ initialState = mountStateImpl(initialState);
+ var queue = initialState.queue,
+ dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
+ queue.dispatch = dispatch;
+ return [initialState.memoizedState, dispatch];
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = mountWorkInProgressHook();
+ return mountDeferredValueImpl(hook, value, initialValue);
+ },
+ useTransition: function () {
+ var stateHook = mountStateImpl(!1);
+ stateHook = startTransition.bind(
+ null,
+ currentlyRenderingFiber,
+ stateHook.queue,
+ !0,
+ !1
+ );
+ mountWorkInProgressHook().memoizedState = stateHook;
+ return [!1, stateHook];
+ },
+ useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = mountWorkInProgressHook();
+ if (isHydrating) {
+ if (void 0 === getServerSnapshot)
+ throw Error(formatProdErrorMessage(407));
+ getServerSnapshot = getServerSnapshot();
+ } else {
+ getServerSnapshot = getSnapshot();
+ if (null === workInProgressRoot)
+ throw Error(formatProdErrorMessage(349));
+ 0 !== (workInProgressRootRenderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
}
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (newIdx === newChildren.length)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ hook.memoizedState = getServerSnapshot;
+ var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };
+ hook.queue = inst;
+ mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
+ subscribe
+ ]);
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ 9,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ inst,
+ getServerSnapshot,
+ getSnapshot
+ ),
+ null
);
- if (null === oldFiber) {
- for (; newIdx < newChildren.length; newIdx++)
- (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
- null !== oldFiber &&
- ((currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ return getServerSnapshot;
+ },
+ useId: function () {
+ var hook = mountWorkInProgressHook(),
+ identifierPrefix = workInProgressRoot.identifierPrefix;
+ if (isHydrating) {
+ var JSCompiler_inline_result = treeContextOverflow;
+ var idWithLeadingBit = treeContextId;
+ JSCompiler_inline_result =
+ (
+ idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
+ ).toString(32) + JSCompiler_inline_result;
+ identifierPrefix =
+ ":" + identifierPrefix + "R" + JSCompiler_inline_result;
+ JSCompiler_inline_result = localIdCounter++;
+ 0 < JSCompiler_inline_result &&
+ (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
+ identifierPrefix += ":";
+ } else
+ (JSCompiler_inline_result = globalClientIdCounter++),
+ (identifierPrefix =
+ ":" +
+ identifierPrefix +
+ "r" +
+ JSCompiler_inline_result.toString(32) +
+ ":");
+ return (hook.memoizedState = identifierPrefix);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: mountActionState,
+ useActionState: mountActionState,
+ useOptimistic: function (passthrough) {
+ var hook = mountWorkInProgressHook();
+ hook.memoizedState = hook.baseState = passthrough;
+ var queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: null,
+ lastRenderedState: null
+ };
+ hook.queue = queue;
+ hook = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !0,
+ queue
+ );
+ queue.dispatch = hook;
+ return [passthrough, hook];
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: function () {
+ return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
+ null,
+ currentlyRenderingFiber
+ ));
+ },
+ useEffectEvent: function (callback) {
+ var hook = mountWorkInProgressHook(),
+ ref = { impl: callback };
+ hook.memoizedState = ref;
+ return function () {
+ if (0 !== (executionContext & 2))
+ throw Error(formatProdErrorMessage(440));
+ return ref.impl.apply(void 0, arguments);
+ };
}
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- newIdx < newChildren.length;
- newIdx++
+ },
+ HooksDispatcherOnUpdate = {
+ readContext: readContext,
+ use: use,
+ useCallback: updateCallback,
+ useContext: readContext,
+ useEffect: updateEffect,
+ useImperativeHandle: updateImperativeHandle,
+ useInsertionEffect: updateInsertionEffect,
+ useLayoutEffect: updateLayoutEffect,
+ useMemo: updateMemo,
+ useReducer: updateReducer,
+ useRef: updateRef,
+ useState: function () {
+ return updateReducer(basicStateReducer);
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
+ );
+ },
+ useTransition: function () {
+ var booleanOrThenable = updateReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ },
+ useSyncExternalStore: updateSyncExternalStore,
+ useId: updateId,
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: updateActionState,
+ useActionState: updateActionState,
+ useOptimistic: function (passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: updateRefresh
+ };
+HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
+var HooksDispatcherOnRerender = {
+ readContext: readContext,
+ use: use,
+ useCallback: updateCallback,
+ useContext: readContext,
+ useEffect: updateEffect,
+ useImperativeHandle: updateImperativeHandle,
+ useInsertionEffect: updateInsertionEffect,
+ useLayoutEffect: updateLayoutEffect,
+ useMemo: updateMemo,
+ useReducer: rerenderReducer,
+ useRef: updateRef,
+ useState: function () {
+ return rerenderReducer(basicStateReducer);
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return null === currentHook
+ ? mountDeferredValueImpl(hook, value, initialValue)
+ : updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
+ );
+ },
+ useTransition: function () {
+ var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ },
+ useSyncExternalStore: updateSyncExternalStore,
+ useId: updateId,
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: rerenderActionState,
+ useActionState: rerenderActionState,
+ useOptimistic: function (passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ if (null !== currentHook)
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ hook.baseState = passthrough;
+ return [passthrough, hook.queue.dispatch];
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: updateRefresh
+};
+HooksDispatcherOnRerender.useEffectEvent = updateEvent;
+var thenableState = null,
+ thenableIndexCounter = 0;
+function unwrapThenable(thenable) {
+ var index = thenableIndexCounter;
+ thenableIndexCounter += 1;
+ null === thenableState && (thenableState = []);
+ return trackUsedThenable(thenableState, thenable, index);
+}
+function coerceRef(workInProgress, element) {
+ element = element.props.ref;
+ workInProgress.ref = void 0 !== element ? element : null;
+}
+function throwOnInvalidObjectType(returnFiber, newChild) {
+ if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
+ throw Error(formatProdErrorMessage(525));
+ returnFiber = Object.prototype.toString.call(newChild);
+ throw Error(
+ formatProdErrorMessage(
+ 31,
+ "[object Object]" === returnFiber
+ ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
+ : returnFiber
)
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- newChildren[newIdx],
- lanes
- )),
- null !== nextOldFiber &&
- (shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ );
+}
+function resolveLazy(lazyType) {
+ var init = lazyType._init;
+ return init(lazyType._payload);
+}
+function createChildReconciler(shouldTrackSideEffects) {
+ function deleteChild(returnFiber, childToDelete) {
+ if (shouldTrackSideEffects) {
+ var deletions = returnFiber.deletions;
+ null === deletions
+ ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))
+ : deletions.push(childToDelete);
+ }
}
- function reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChildrenIterable,
- lanes
- ) {
- var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
- if (null == newChildren) throw Error(formatProdErrorMessage(151));
- return reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- {
- next: function () {
- return unwrapThenable(newChildren.next());
- }
- },
- lanes
- );
+ function deleteRemainingChildren(returnFiber, currentFirstChild) {
+ if (!shouldTrackSideEffects) return null;
+ for (; null !== currentFirstChild; )
+ deleteChild(returnFiber, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return null;
}
- function reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- if (null == newChildren) throw Error(formatProdErrorMessage(151));
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null,
- step = newChildren.next();
- null !== oldFiber && !step.done;
- newIdx++, step = newChildren.next()
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (step.done)
+ function mapRemainingChildren(currentFirstChild) {
+ for (var existingChildren = new Map(); null !== currentFirstChild; )
+ null !== currentFirstChild.key
+ ? existingChildren.set(currentFirstChild.key, currentFirstChild)
+ : existingChildren.set(currentFirstChild.index, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return existingChildren;
+ }
+ function useFiber(fiber, pendingProps) {
+ fiber = createWorkInProgress(fiber, pendingProps);
+ fiber.index = 0;
+ fiber.sibling = null;
+ return fiber;
+ }
+ function placeChild(newFiber, lastPlacedIndex, newIndex) {
+ newFiber.index = newIndex;
+ if (!shouldTrackSideEffects)
+ return (newFiber.flags |= 1048576), lastPlacedIndex;
+ newIndex = newFiber.alternate;
+ if (null !== newIndex)
return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ (newIndex = newIndex.index),
+ newIndex < lastPlacedIndex
+ ? ((newFiber.flags |= 33554434), lastPlacedIndex)
+ : newIndex
);
- if (null === oldFiber) {
- for (; !step.done; newIdx++, step = newChildren.next())
- (step = createChild(returnFiber, step.value, lanes)),
- null !== step &&
- ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
- null === previousNewFiber
- ? (resultingFirstChild = step)
- : (previousNewFiber.sibling = step),
- (previousNewFiber = step));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- !step.done;
- newIdx++, step = newChildren.next()
- )
- (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
- null !== step &&
- (shouldTrackSideEffects &&
- null !== step.alternate &&
- oldFiber.delete(null === step.key ? newIdx : step.key),
- (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
- null === previousNewFiber
- ? (resultingFirstChild = step)
- : (previousNewFiber.sibling = step),
- (previousNewFiber = step));
+ newFiber.flags |= 33554434;
+ return lastPlacedIndex;
+ }
+ function placeSingleChild(newFiber) {
shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ null === newFiber.alternate &&
+ (newFiber.flags |= 33554434);
+ return newFiber;
}
- function reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- ) {
- "object" === typeof newChild &&
- null !== newChild &&
- newChild.type === REACT_FRAGMENT_TYPE &&
- null === newChild.key &&
- (newChild = newChild.props.children);
+ function updateTextNode(returnFiber, current, textContent, lanes) {
+ if (null === current || 6 !== current.tag)
+ return (
+ (current = createFiberFromText(textContent, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, textContent);
+ current.return = returnFiber;
+ return current;
+ }
+ function updateElement(returnFiber, current, element, lanes) {
+ var elementType = element.type;
+ if (elementType === REACT_FRAGMENT_TYPE)
+ return updateFragment(
+ returnFiber,
+ current,
+ element.props.children,
+ lanes,
+ element.key
+ );
+ if (
+ null !== current &&
+ (current.elementType === elementType ||
+ ("object" === typeof elementType &&
+ null !== elementType &&
+ elementType.$$typeof === REACT_LAZY_TYPE &&
+ resolveLazy(elementType) === current.type))
+ )
+ return (
+ (current = useFiber(current, element.props)),
+ coerceRef(current, element),
+ (current.return = returnFiber),
+ current
+ );
+ current = createFiberFromTypeAndProps(
+ element.type,
+ element.key,
+ element.props,
+ null,
+ returnFiber.mode,
+ lanes
+ );
+ coerceRef(current, element);
+ current.return = returnFiber;
+ return current;
+ }
+ function updatePortal(returnFiber, current, portal, lanes) {
+ if (
+ null === current ||
+ 4 !== current.tag ||
+ current.stateNode.containerInfo !== portal.containerInfo ||
+ current.stateNode.implementation !== portal.implementation
+ )
+ return (
+ (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, portal.children || []);
+ current.return = returnFiber;
+ return current;
+ }
+ function updateFragment(returnFiber, current, fragment, lanes, key) {
+ if (null === current || 7 !== current.tag)
+ return (
+ (current = createFiberFromFragment(
+ fragment,
+ returnFiber.mode,
+ lanes,
+ key
+ )),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, fragment);
+ current.return = returnFiber;
+ return current;
+ }
+ function createChild(returnFiber, newChild, lanes) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (newChild = createFiberFromText(
+ "" + newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ newChild
+ );
if ("object" === typeof newChild && null !== newChild) {
switch (newChild.$$typeof) {
case REACT_ELEMENT_TYPE:
- a: {
- for (var key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key) {
- key = newChild.type;
- if (key === REACT_FRAGMENT_TYPE) {
- if (7 === currentFirstChild.tag) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- newChild.props.children
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- }
- } else if (
- currentFirstChild.elementType === key ||
- ("object" === typeof key &&
- null !== key &&
- key.$$typeof === REACT_LAZY_TYPE &&
- resolveLazy(key) === currentFirstChild.type)
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.props);
- coerceRef(lanes, newChild);
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- }
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- } else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- newChild.type === REACT_FRAGMENT_TYPE
- ? ((lanes = createFiberFromFragment(
- newChild.props.children,
- returnFiber.mode,
- lanes,
- newChild.key
- )),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : ((lanes = createFiberFromTypeAndProps(
- newChild.type,
- newChild.key,
- newChild.props,
- null,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (returnFiber = lanes));
- }
- return placeSingleChild(returnFiber);
- case REACT_PORTAL_TYPE:
- a: {
- for (key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key)
- if (
- 4 === currentFirstChild.tag &&
- currentFirstChild.stateNode.containerInfo ===
- newChild.containerInfo &&
- currentFirstChild.stateNode.implementation ===
- newChild.implementation
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.children || []);
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- } else {
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- }
- else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
- lanes.return = returnFiber;
- returnFiber = lanes;
- }
- return placeSingleChild(returnFiber);
- case REACT_LAZY_TYPE:
return (
- (key = newChild._init),
- (newChild = key(newChild._payload)),
- reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
+ (lanes = createFiberFromTypeAndProps(
+ newChild.type,
+ newChild.key,
+ newChild.props,
+ null,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ lanes
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (newChild = createFiberFromPortal(
newChild,
+ returnFiber.mode,
lanes
- )
+ )),
+ (newChild.return = returnFiber),
+ newChild
);
+ case REACT_LAZY_TYPE:
+ var init = newChild._init;
+ newChild = init(newChild._payload);
+ return createChild(returnFiber, newChild, lanes);
}
- if (isArrayImpl(newChild))
- return reconcileChildrenArray(
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (newChild = createFiberFromFragment(
+ newChild,
+ returnFiber.mode,
+ lanes,
+ null
+ )),
+ (newChild.return = returnFiber),
+ newChild
+ );
+ if ("function" === typeof newChild.then)
+ return createChild(returnFiber, unwrapThenable(newChild), lanes);
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return createChild(
returnFiber,
- currentFirstChild,
- newChild,
+ readContextDuringReconciliation(returnFiber, newChild),
lanes
);
- if (getIteratorFn(newChild)) {
- key = getIteratorFn(newChild);
- if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
- newChild = key.call(newChild);
- return reconcileChildrenIterator(
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return null;
+ }
+ function updateSlot(returnFiber, oldFiber, newChild, lanes) {
+ var key = null !== oldFiber ? oldFiber.key : null;
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return null !== key
+ ? null
+ : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return newChild.key === key
+ ? updateElement(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_PORTAL_TYPE:
+ return newChild.key === key
+ ? updatePortal(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_LAZY_TYPE:
+ return (
+ (key = newChild._init),
+ (newChild = key(newChild._payload)),
+ updateSlot(returnFiber, oldFiber, newChild, lanes)
+ );
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return null !== key
+ ? null
+ : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
+ if ("function" === typeof newChild.then)
+ return updateSlot(
returnFiber,
- currentFirstChild,
- newChild,
+ oldFiber,
+ unwrapThenable(newChild),
lanes
);
- }
- if ("function" === typeof newChild[ASYNC_ITERATOR])
- return reconcileChildrenAsyncIteratable(
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateSlot(
returnFiber,
- currentFirstChild,
- newChild,
+ oldFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
lanes
);
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return null;
+ }
+ function updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ ) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
+ );
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updateElement(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updatePortal(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_LAZY_TYPE:
+ var init = newChild._init;
+ newChild = init(newChild._payload);
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ );
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateFragment(returnFiber, existingChildren, newChild, lanes, null)
+ );
if ("function" === typeof newChild.then)
- return reconcileChildFibersImpl(
+ return updateFromMap(
+ existingChildren,
returnFiber,
- currentFirstChild,
+ newIdx,
unwrapThenable(newChild),
lanes
);
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return reconcileChildFibersImpl(
+ return updateFromMap(
+ existingChildren,
returnFiber,
- currentFirstChild,
+ newIdx,
readContextDuringReconciliation(returnFiber, newChild),
lanes
);
throwOnInvalidObjectType(returnFiber, newChild);
}
- return ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- ? ((newChild = "" + newChild),
- null !== currentFirstChild && 6 === currentFirstChild.tag
- ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
- (lanes = useFiber(currentFirstChild, newChild)),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : (deleteRemainingChildren(returnFiber, currentFirstChild),
- (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),
- (lanes.return = returnFiber),
- (returnFiber = lanes)),
- placeSingleChild(returnFiber))
- : deleteRemainingChildren(returnFiber, currentFirstChild);
+ return null;
}
- return function (returnFiber, currentFirstChild, newChild, lanes) {
- try {
- thenableIndexCounter = 0;
- var firstChildFiber = reconcileChildFibersImpl(
+ function reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null;
+ null !== oldFiber && newIdx < newChildren.length;
+ newIdx++
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(
returnFiber,
- currentFirstChild,
- newChild,
+ oldFiber,
+ newChildren[newIdx],
lanes
);
- thenableState = null;
- return firstChildFiber;
- } catch (x) {
- if (x === SuspenseException || x === SuspenseActionException) throw x;
- var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
- fiber.lanes = lanes;
- fiber.return = returnFiber;
- return fiber;
- } finally {
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
+ }
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
}
- };
-}
-var reconcileChildFibers = createChildReconciler(!0),
- mountChildFibers = createChildReconciler(!1),
- suspenseHandlerStackCursor = createCursor(null),
- shellBoundary = null;
-function pushPrimaryTreeSuspenseHandler(handler) {
- var current = handler.alternate;
- push(suspenseStackCursor, suspenseStackCursor.current & 1);
- push(suspenseHandlerStackCursor, handler);
- null === shellBoundary &&
- (null === current || null !== currentTreeHiddenStackCursor.current
- ? (shellBoundary = handler)
- : null !== current.memoizedState && (shellBoundary = handler));
-}
-function pushOffscreenSuspenseHandler(fiber) {
- if (22 === fiber.tag) {
- if (
- (push(suspenseStackCursor, suspenseStackCursor.current),
- push(suspenseHandlerStackCursor, fiber),
- null === shellBoundary)
- ) {
- var current = fiber.alternate;
- null !== current &&
- null !== current.memoizedState &&
- (shellBoundary = fiber);
+ if (newIdx === newChildren.length)
+ return (
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; newIdx < newChildren.length; newIdx++)
+ (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
+ null !== oldFiber &&
+ ((currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
}
- } else reuseSuspenseHandlerOnStack(fiber);
-}
-function reuseSuspenseHandlerOnStack() {
- push(suspenseStackCursor, suspenseStackCursor.current);
- push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
-}
-function popSuspenseHandler(fiber) {
- pop(suspenseHandlerStackCursor);
- shellBoundary === fiber && (shellBoundary = null);
- pop(suspenseStackCursor);
-}
-var suspenseStackCursor = createCursor(0);
-function findFirstSuspended(row) {
- for (var node = row; null !== node; ) {
- if (13 === node.tag) {
- var state = node.memoizedState;
- if (
- null !== state &&
- ((state = state.dehydrated),
- null === state ||
- "$?" === state.data ||
- isSuspenseInstanceFallback(state))
- )
- return node;
- } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
- if (0 !== (node.flags & 128)) return node;
- } else if (null !== node.child) {
- node.child.return = node;
- node = node.child;
- continue;
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ newIdx < newChildren.length;
+ newIdx++
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ newChildren[newIdx],
+ lanes
+ )),
+ null !== nextOldFiber &&
+ (shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
+ ),
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ function reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChildrenIterable,
+ lanes
+ ) {
+ var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
+ if (null == newChildren) throw Error(formatProdErrorMessage(151));
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ {
+ next: function () {
+ return unwrapThenable(newChildren.next());
+ }
+ },
+ lanes
+ );
+ }
+ function reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ if (null == newChildren) throw Error(formatProdErrorMessage(151));
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null,
+ step = newChildren.next();
+ null !== oldFiber && !step.done;
+ newIdx++, step = newChildren.next()
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
+ }
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
}
- if (node === row) break;
- for (; null === node.sibling; ) {
- if (null === node.return || node.return === row) return null;
- node = node.return;
+ if (step.done)
+ return (
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; !step.done; newIdx++, step = newChildren.next())
+ (step = createChild(returnFiber, step.value, lanes)),
+ null !== step &&
+ ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
+ null === previousNewFiber
+ ? (resultingFirstChild = step)
+ : (previousNewFiber.sibling = step),
+ (previousNewFiber = step));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
}
- node.sibling.return = node.return;
- node = node.sibling;
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ !step.done;
+ newIdx++, step = newChildren.next()
+ )
+ (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
+ null !== step &&
+ (shouldTrackSideEffects &&
+ null !== step.alternate &&
+ oldFiber.delete(null === step.key ? newIdx : step.key),
+ (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
+ null === previousNewFiber
+ ? (resultingFirstChild = step)
+ : (previousNewFiber.sibling = step),
+ (previousNewFiber = step));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
}
- return null;
-}
-function applyDerivedStateFromProps(
- workInProgress,
- ctor,
- getDerivedStateFromProps,
- nextProps
-) {
- ctor = workInProgress.memoizedState;
- getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
- getDerivedStateFromProps =
- null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
- ? ctor
- : assign({}, ctor, getDerivedStateFromProps);
- workInProgress.memoizedState = getDerivedStateFromProps;
- 0 === workInProgress.lanes &&
- (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
-}
-var classComponentUpdater = {
- isMounted: function (component) {
- return (component = component._reactInternals)
- ? getNearestMountedFiber(component) === component
- : !1;
- },
- enqueueSetState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.payload = payload;
- void 0 !== callback && null !== callback && (update.callback = callback);
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueReplaceState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.tag = 1;
- update.payload = payload;
- void 0 !== callback && null !== callback && (update.callback = callback);
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueForceUpdate: function (inst, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.tag = 2;
- void 0 !== callback && null !== callback && (update.callback = callback);
- callback = enqueueUpdate(inst, update, lane);
- null !== callback &&
- (scheduleUpdateOnFiber(callback, inst, lane),
- entangleTransitions(callback, inst, lane));
+ function reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ ) {
+ "object" === typeof newChild &&
+ null !== newChild &&
+ newChild.type === REACT_FRAGMENT_TYPE &&
+ null === newChild.key &&
+ (newChild = newChild.props.children);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ a: {
+ for (var key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key) {
+ key = newChild.type;
+ if (key === REACT_FRAGMENT_TYPE) {
+ if (7 === currentFirstChild.tag) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ newChild.props.children
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ }
+ } else if (
+ currentFirstChild.elementType === key ||
+ ("object" === typeof key &&
+ null !== key &&
+ key.$$typeof === REACT_LAZY_TYPE &&
+ resolveLazy(key) === currentFirstChild.type)
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.props);
+ coerceRef(lanes, newChild);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ }
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ } else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ newChild.type === REACT_FRAGMENT_TYPE
+ ? ((lanes = createFiberFromFragment(
+ newChild.props.children,
+ returnFiber.mode,
+ lanes,
+ newChild.key
+ )),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : ((lanes = createFiberFromTypeAndProps(
+ newChild.type,
+ newChild.key,
+ newChild.props,
+ null,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes));
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_PORTAL_TYPE:
+ a: {
+ for (key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key)
+ if (
+ 4 === currentFirstChild.tag &&
+ currentFirstChild.stateNode.containerInfo ===
+ newChild.containerInfo &&
+ currentFirstChild.stateNode.implementation ===
+ newChild.implementation
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.children || []);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ } else {
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ }
+ else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_LAZY_TYPE:
+ return (
+ (key = newChild._init),
+ (newChild = key(newChild._payload)),
+ reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )
+ );
+ }
+ if (isArrayImpl(newChild))
+ return reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ if (getIteratorFn(newChild)) {
+ key = getIteratorFn(newChild);
+ if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
+ newChild = key.call(newChild);
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ }
+ if ("function" === typeof newChild[ASYNC_ITERATOR])
+ return reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ if ("function" === typeof newChild.then)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ unwrapThenable(newChild),
+ lanes
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ ? ((newChild = "" + newChild),
+ null !== currentFirstChild && 6 === currentFirstChild.tag
+ ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
+ (lanes = useFiber(currentFirstChild, newChild)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : (deleteRemainingChildren(returnFiber, currentFirstChild),
+ (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes)),
+ placeSingleChild(returnFiber))
+ : deleteRemainingChildren(returnFiber, currentFirstChild);
}
-};
-function checkShouldComponentUpdate(
- workInProgress,
- ctor,
- oldProps,
- newProps,
- oldState,
- newState,
- nextContext
-) {
- workInProgress = workInProgress.stateNode;
- return "function" === typeof workInProgress.shouldComponentUpdate
- ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
- : ctor.prototype && ctor.prototype.isPureReactComponent
- ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
- : !0;
-}
-function callComponentWillReceiveProps(
- workInProgress,
- instance,
- newProps,
- nextContext
-) {
- workInProgress = instance.state;
- "function" === typeof instance.componentWillReceiveProps &&
- instance.componentWillReceiveProps(newProps, nextContext);
- "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- instance.state !== workInProgress &&
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
+ return function (returnFiber, currentFirstChild, newChild, lanes) {
+ try {
+ thenableIndexCounter = 0;
+ var firstChildFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ thenableState = null;
+ return firstChildFiber;
+ } catch (x) {
+ if (x === SuspenseException || x === SuspenseActionException) throw x;
+ var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
+ fiber.lanes = lanes;
+ fiber.return = returnFiber;
+ return fiber;
+ } finally {
+ }
+ };
}
-function resolveClassComponentProps(Component, baseProps) {
- var newProps = baseProps;
- if ("ref" in baseProps) {
- newProps = {};
- for (var propName in baseProps)
- "ref" !== propName && (newProps[propName] = baseProps[propName]);
- }
- if ((Component = Component.defaultProps)) {
- newProps === baseProps && (newProps = assign({}, newProps));
- for (var propName$68 in Component)
- void 0 === newProps[propName$68] &&
- (newProps[propName$68] = Component[propName$68]);
+var reconcileChildFibers = createChildReconciler(!0),
+ mountChildFibers = createChildReconciler(!1),
+ suspenseHandlerStackCursor = createCursor(null),
+ shellBoundary = null;
+function pushPrimaryTreeSuspenseHandler(handler) {
+ var current = handler.alternate;
+ push(suspenseStackCursor, suspenseStackCursor.current & 1);
+ push(suspenseHandlerStackCursor, handler);
+ null === shellBoundary &&
+ (null === current || null !== currentTreeHiddenStackCursor.current
+ ? (shellBoundary = handler)
+ : null !== current.memoizedState && (shellBoundary = handler));
+}
+function pushOffscreenSuspenseHandler(fiber) {
+ if (22 === fiber.tag) {
+ if (
+ (push(suspenseStackCursor, suspenseStackCursor.current),
+ push(suspenseHandlerStackCursor, fiber),
+ null === shellBoundary)
+ ) {
+ var current = fiber.alternate;
+ null !== current &&
+ null !== current.memoizedState &&
+ (shellBoundary = fiber);
+ }
+ } else reuseSuspenseHandlerOnStack(fiber);
+}
+function reuseSuspenseHandlerOnStack() {
+ push(suspenseStackCursor, suspenseStackCursor.current);
+ push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
+}
+function popSuspenseHandler(fiber) {
+ pop(suspenseHandlerStackCursor);
+ shellBoundary === fiber && (shellBoundary = null);
+ pop(suspenseStackCursor);
+}
+var suspenseStackCursor = createCursor(0);
+function findFirstSuspended(row) {
+ for (var node = row; null !== node; ) {
+ if (13 === node.tag) {
+ var state = node.memoizedState;
+ if (
+ null !== state &&
+ ((state = state.dehydrated),
+ null === state ||
+ "$?" === state.data ||
+ isSuspenseInstanceFallback(state))
+ )
+ return node;
+ } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
+ if (0 !== (node.flags & 128)) return node;
+ } else if (null !== node.child) {
+ node.child.return = node;
+ node = node.child;
+ continue;
+ }
+ if (node === row) break;
+ for (; null === node.sibling; ) {
+ if (null === node.return || node.return === row) return null;
+ node = node.return;
+ }
+ node.sibling.return = node.return;
+ node = node.sibling;
}
- return newProps;
+ return null;
}
var reportGlobalError =
"function" === typeof reportError
@@ -5295,9 +5756,9 @@ function logUncaughtError(root, errorInfo) {
try {
var onUncaughtError = root.onUncaughtError;
onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
- } catch (e$69) {
+ } catch (e$75) {
setTimeout(function () {
- throw e$69;
+ throw e$75;
});
}
}
@@ -5308,9 +5769,9 @@ function logCaughtError(root, boundary, errorInfo) {
componentStack: errorInfo.stack,
errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
});
- } catch (e$70) {
+ } catch (e$76) {
setTimeout(function () {
- throw e$70;
+ throw e$76;
});
}
}
@@ -5407,2234 +5868,1795 @@ function throwException(
returnFiber,
sourceFiber,
root,
- rootRenderLanes
- ),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? (suspenseBoundary.updateQueue = new Set([value]))
- : sourceFiber.add(value),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- case 22:
- return (
- (suspenseBoundary.flags |= 65536),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? ((sourceFiber = {
- transitions: null,
- markerInstances: null,
- retryQueue: new Set([value])
- }),
- (suspenseBoundary.updateQueue = sourceFiber))
- : ((returnFiber = sourceFiber.retryQueue),
- null === returnFiber
- ? (sourceFiber.retryQueue = new Set([value]))
- : returnFiber.add(value)),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- }
- throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
- }
- attachPingListener(root, value, rootRenderLanes);
- renderDidSuspendDelayIfPossible();
- return !1;
- }
- if (isHydrating)
- return (
- (suspenseBoundary = suspenseHandlerStackCursor.current),
- null !== suspenseBoundary
- ? (0 === (suspenseBoundary.flags & 65536) &&
- (suspenseBoundary.flags |= 256),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value !== HydrationMismatchException &&
- ((root = Error(formatProdErrorMessage(422), { cause: value })),
- queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))
- : (value !== HydrationMismatchException &&
- ((returnFiber = Error(formatProdErrorMessage(423), {
- cause: value
- })),
- queueHydrationError(
- createCapturedValueAtFiber(returnFiber, sourceFiber)
- )),
- (root = root.current.alternate),
- (root.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (root.lanes |= rootRenderLanes),
- (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
- (rootRenderLanes = createRootErrorUpdate(
- root.stateNode,
- sourceFiber,
- rootRenderLanes
- )),
- enqueueCapturedUpdate(root, rootRenderLanes),
- 4 !== workInProgressRootExitStatus &&
- (workInProgressRootExitStatus = 2)),
- !1
- );
- suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value });
- queueConcurrentError(
- createCapturedValueAtFiber(suspenseBoundary, sourceFiber)
- );
- 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
- if (null === returnFiber) return !0;
- sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
- do {
- switch (returnFiber.tag) {
- case 3:
- return (
- (returnFiber.flags |= 65536),
- (root = rootRenderLanes & -rootRenderLanes),
- (returnFiber.lanes |= root),
- (root = createRootErrorUpdate(
- returnFiber.stateNode,
- sourceFiber,
- root
- )),
- enqueueCapturedUpdate(returnFiber, root),
- !1
- );
- case 1:
- if (
- ((value = returnFiber.type),
- (suspenseBoundary = returnFiber.stateNode),
- 0 === (returnFiber.flags & 128) &&
- ("function" === typeof value.getDerivedStateFromError ||
- (null !== suspenseBoundary &&
- "function" === typeof suspenseBoundary.componentDidCatch &&
- (null === legacyErrorBoundariesThatAlreadyFailed ||
- !legacyErrorBoundariesThatAlreadyFailed.has(
- suspenseBoundary
- )))))
- )
- return (
- (returnFiber.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (returnFiber.lanes |= rootRenderLanes),
- (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
- initializeClassErrorUpdate(
- rootRenderLanes,
- root,
- returnFiber,
- sourceFiber
- ),
- enqueueCapturedUpdate(returnFiber, rootRenderLanes),
- !1
- );
- }
- returnFiber = returnFiber.return;
- } while (null !== returnFiber);
- return !1;
-}
-var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
- didReceiveUpdate = !1;
-function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
- workInProgress.child =
- null === current
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
- : reconcileChildFibers(
- workInProgress,
- current.child,
- nextChildren,
- renderLanes
- );
-}
-function updateForwardRef(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- Component = Component.render;
- var ref = workInProgress.ref;
- if ("ref" in nextProps) {
- var propsWithoutRef = {};
- for (var key in nextProps)
- "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
- } else propsWithoutRef = nextProps;
- prepareToReadContext(workInProgress);
- nextProps = renderWithHooks(
- current,
- workInProgress,
- Component,
- propsWithoutRef,
- ref,
- renderLanes
- );
- key = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && key && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
-}
-function updateMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- if (null === current) {
- var type = Component.type;
- if (
- "function" === typeof type &&
- !shouldConstruct(type) &&
- void 0 === type.defaultProps &&
- null === Component.compare
- )
- return (
- (workInProgress.tag = 15),
- (workInProgress.type = type),
- updateSimpleMemoComponent(
- current,
- workInProgress,
- type,
- nextProps,
- renderLanes
- )
- );
- current = createFiberFromTypeAndProps(
- Component.type,
- null,
- nextProps,
- workInProgress,
- workInProgress.mode,
- renderLanes
- );
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
- }
- type = current.child;
- if (!checkScheduledUpdateOrContext(current, renderLanes)) {
- var prevProps = type.memoizedProps;
- Component = Component.compare;
- Component = null !== Component ? Component : shallowEqual;
- if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
- }
- workInProgress.flags |= 1;
- current = createWorkInProgress(type, nextProps);
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
-}
-function updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- if (null !== current) {
- var prevProps = current.memoizedProps;
- if (
- shallowEqual(prevProps, nextProps) &&
- current.ref === workInProgress.ref
- )
- if (
- ((didReceiveUpdate = !1),
- (workInProgress.pendingProps = nextProps = prevProps),
- checkScheduledUpdateOrContext(current, renderLanes))
- )
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
- else
- return (
- (workInProgress.lanes = current.lanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- }
- return updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- );
-}
-function updateOffscreenComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- nextChildren = nextProps.children,
- nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2),
- prevState = null !== current ? current.memoizedState : null;
- markRef(current, workInProgress);
- if ("hidden" === nextProps.mode || nextIsDetached) {
- if (0 !== (workInProgress.flags & 128)) {
- nextProps =
- null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
- if (null !== current) {
- nextChildren = workInProgress.child = current.child;
- for (nextIsDetached = 0; null !== nextChildren; )
- (nextIsDetached =
- nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
- (nextChildren = nextChildren.sibling);
- workInProgress.childLanes = nextIsDetached & ~nextProps;
- } else (workInProgress.childLanes = 0), (workInProgress.child = null);
- return deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- }
- if (0 !== (renderLanes & 536870912))
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
- null !== current &&
- pushTransition(
- workInProgress,
- null !== prevState ? prevState.cachePool : null
- ),
- null !== prevState
- ? pushHiddenContext(workInProgress, prevState)
- : reuseHiddenContextOnStack(),
- pushOffscreenSuspenseHandler(workInProgress);
- else
- return (
- (workInProgress.lanes = workInProgress.childLanes = 536870912),
- deferHiddenOffscreenComponent(
- current,
- workInProgress,
- null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
- renderLanes
- )
- );
- } else
- null !== prevState
- ? (pushTransition(workInProgress, prevState.cachePool),
- pushHiddenContext(workInProgress, prevState),
- reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.memoizedState = null))
- : (null !== current && pushTransition(workInProgress, null),
- reuseHiddenContextOnStack(),
- reuseSuspenseHandlerOnStack(workInProgress));
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
-}
-function deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextBaseLanes,
- renderLanes
-) {
- var JSCompiler_inline_result = peekCacheFromPool();
- JSCompiler_inline_result =
- null === JSCompiler_inline_result
- ? null
- : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
- workInProgress.memoizedState = {
- baseLanes: nextBaseLanes,
- cachePool: JSCompiler_inline_result
- };
- null !== current && pushTransition(workInProgress, null);
- reuseHiddenContextOnStack();
- pushOffscreenSuspenseHandler(workInProgress);
- null !== current &&
- propagateParentContextChanges(current, workInProgress, renderLanes, !0);
- return null;
-}
-function markRef(current, workInProgress) {
- var ref = workInProgress.ref;
- if (null === ref)
- null !== current &&
- null !== current.ref &&
- (workInProgress.flags |= 2097664);
- else {
- if ("function" !== typeof ref && "object" !== typeof ref)
- throw Error(formatProdErrorMessage(284));
- if (null === current || current.ref !== ref)
- workInProgress.flags |= 2097664;
- }
-}
-function updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- Component = renderWithHooks(
- current,
- workInProgress,
- Component,
- nextProps,
- void 0,
- renderLanes
- );
- nextProps = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, Component, renderLanes);
- return workInProgress.child;
-}
-function replayFunctionComponent(
- current,
- workInProgress,
- nextProps,
- Component,
- secondArg,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- workInProgress.updateQueue = null;
- nextProps = renderWithHooksAgain(
- workInProgress,
- Component,
- nextProps,
- secondArg
- );
- finishRenderingHooks(current);
- Component = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && Component && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
-}
-function updateClassComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- if (null === workInProgress.stateNode) {
- var context = emptyContextObject,
- contextType = Component.contextType;
- "object" === typeof contextType &&
- null !== contextType &&
- (context = readContext(contextType));
- context = new Component(nextProps, context);
- workInProgress.memoizedState =
- null !== context.state && void 0 !== context.state ? context.state : null;
- context.updater = classComponentUpdater;
- workInProgress.stateNode = context;
- context._reactInternals = workInProgress;
- context = workInProgress.stateNode;
- context.props = nextProps;
- context.state = workInProgress.memoizedState;
- context.refs = {};
- initializeUpdateQueue(workInProgress);
- contextType = Component.contextType;
- context.context =
- "object" === typeof contextType && null !== contextType
- ? readContext(contextType)
- : emptyContextObject;
- context.state = workInProgress.memoizedState;
- contextType = Component.getDerivedStateFromProps;
- "function" === typeof contextType &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- contextType,
- nextProps
- ),
- (context.state = workInProgress.memoizedState));
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof context.getSnapshotBeforeUpdate ||
- ("function" !== typeof context.UNSAFE_componentWillMount &&
- "function" !== typeof context.componentWillMount) ||
- ((contextType = context.state),
- "function" === typeof context.componentWillMount &&
- context.componentWillMount(),
- "function" === typeof context.UNSAFE_componentWillMount &&
- context.UNSAFE_componentWillMount(),
- contextType !== context.state &&
- classComponentUpdater.enqueueReplaceState(context, context.state, null),
- processUpdateQueue(workInProgress, nextProps, context, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction(),
- (context.state = workInProgress.memoizedState));
- "function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308);
- nextProps = !0;
- } else if (null === current) {
- context = workInProgress.stateNode;
- var unresolvedOldProps = workInProgress.memoizedProps,
- oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
- context.props = oldProps;
- var oldContext = context.context,
- contextType$jscomp$0 = Component.contextType;
- contextType = emptyContextObject;
- "object" === typeof contextType$jscomp$0 &&
- null !== contextType$jscomp$0 &&
- (contextType = readContext(contextType$jscomp$0));
- var getDerivedStateFromProps = Component.getDerivedStateFromProps;
- contextType$jscomp$0 =
- "function" === typeof getDerivedStateFromProps ||
- "function" === typeof context.getSnapshotBeforeUpdate;
- unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
- contextType$jscomp$0 ||
- ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof context.componentWillReceiveProps) ||
- ((unresolvedOldProps || oldContext !== contextType) &&
- callComponentWillReceiveProps(
- workInProgress,
- context,
- nextProps,
- contextType
- ));
- hasForceUpdate = !1;
- var oldState = workInProgress.memoizedState;
- context.state = oldState;
- processUpdateQueue(workInProgress, nextProps, context, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- oldContext = workInProgress.memoizedState;
- unresolvedOldProps || oldState !== oldContext || hasForceUpdate
- ? ("function" === typeof getDerivedStateFromProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- getDerivedStateFromProps,
- nextProps
- ),
- (oldContext = workInProgress.memoizedState)),
- (oldProps =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- oldProps,
- nextProps,
- oldState,
- oldContext,
- contextType
- ))
- ? (contextType$jscomp$0 ||
- ("function" !== typeof context.UNSAFE_componentWillMount &&
- "function" !== typeof context.componentWillMount) ||
- ("function" === typeof context.componentWillMount &&
- context.componentWillMount(),
- "function" === typeof context.UNSAFE_componentWillMount &&
- context.UNSAFE_componentWillMount()),
- "function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308))
- : ("function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = oldContext)),
- (context.props = nextProps),
- (context.state = oldContext),
- (context.context = contextType),
- (nextProps = oldProps))
- : ("function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (nextProps = !1));
- } else {
- context = workInProgress.stateNode;
- cloneUpdateQueue(current, workInProgress);
- contextType = workInProgress.memoizedProps;
- contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
- context.props = contextType$jscomp$0;
- getDerivedStateFromProps = workInProgress.pendingProps;
- oldState = context.context;
- oldContext = Component.contextType;
- oldProps = emptyContextObject;
- "object" === typeof oldContext &&
- null !== oldContext &&
- (oldProps = readContext(oldContext));
- unresolvedOldProps = Component.getDerivedStateFromProps;
- (oldContext =
- "function" === typeof unresolvedOldProps ||
- "function" === typeof context.getSnapshotBeforeUpdate) ||
- ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof context.componentWillReceiveProps) ||
- ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&
- callComponentWillReceiveProps(
- workInProgress,
- context,
- nextProps,
- oldProps
- ));
- hasForceUpdate = !1;
- oldState = workInProgress.memoizedState;
- context.state = oldState;
- processUpdateQueue(workInProgress, nextProps, context, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- var newState = workInProgress.memoizedState;
- contextType !== getDerivedStateFromProps ||
- oldState !== newState ||
- hasForceUpdate ||
- (null !== current &&
- null !== current.dependencies &&
- checkIfContextChanged(current.dependencies))
- ? ("function" === typeof unresolvedOldProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- unresolvedOldProps,
- nextProps
- ),
- (newState = workInProgress.memoizedState)),
- (contextType$jscomp$0 =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- contextType$jscomp$0,
- nextProps,
- oldState,
- newState,
- oldProps
- ) ||
- (null !== current &&
- null !== current.dependencies &&
- checkIfContextChanged(current.dependencies)))
- ? (oldContext ||
- ("function" !== typeof context.UNSAFE_componentWillUpdate &&
- "function" !== typeof context.componentWillUpdate) ||
- ("function" === typeof context.componentWillUpdate &&
- context.componentWillUpdate(nextProps, newState, oldProps),
- "function" === typeof context.UNSAFE_componentWillUpdate &&
- context.UNSAFE_componentWillUpdate(
- nextProps,
- newState,
- oldProps
- )),
- "function" === typeof context.componentDidUpdate &&
- (workInProgress.flags |= 4),
- "function" === typeof context.getSnapshotBeforeUpdate &&
- (workInProgress.flags |= 1024))
- : ("function" !== typeof context.componentDidUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof context.getSnapshotBeforeUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 1024),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = newState)),
- (context.props = nextProps),
- (context.state = newState),
- (context.context = oldProps),
- (nextProps = contextType$jscomp$0))
- : ("function" !== typeof context.componentDidUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof context.getSnapshotBeforeUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 1024),
- (nextProps = !1));
- }
- context = nextProps;
- markRef(current, workInProgress);
- nextProps = 0 !== (workInProgress.flags & 128);
- context || nextProps
- ? ((context = workInProgress.stateNode),
- (Component =
- nextProps && "function" !== typeof Component.getDerivedStateFromError
- ? null
- : context.render()),
- (workInProgress.flags |= 1),
- null !== current && nextProps
- ? ((workInProgress.child = reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
- )),
- (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- Component,
- renderLanes
- )))
- : reconcileChildren(current, workInProgress, Component, renderLanes),
- (workInProgress.memoizedState = context.state),
- (current = workInProgress.child))
- : (current = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- ));
- return current;
-}
-function mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextChildren,
- renderLanes
-) {
- resetHydrationState();
- workInProgress.flags |= 256;
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
-}
-var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 };
-function mountSuspenseOffscreenState(renderLanes) {
- return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
-}
-function getRemainingWorkInPrimaryTree(
- current,
- primaryTreeDidDefer,
- renderLanes
-) {
- current = null !== current ? current.childLanes & ~renderLanes : 0;
- primaryTreeDidDefer && (current |= workInProgressDeferredLane);
- return current;
-}
-function updateSuspenseComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- showFallback = !1,
- didSuspend = 0 !== (workInProgress.flags & 128),
- JSCompiler_temp;
- (JSCompiler_temp = didSuspend) ||
- (JSCompiler_temp =
- null !== current && null === current.memoizedState
- ? !1
- : 0 !== (suspenseStackCursor.current & 2));
- JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));
- JSCompiler_temp = 0 !== (workInProgress.flags & 32);
- workInProgress.flags &= -33;
- if (null === current) {
- if (isHydrating) {
- showFallback
- ? pushPrimaryTreeSuspenseHandler(workInProgress)
- : reuseSuspenseHandlerOnStack(workInProgress);
- if (isHydrating) {
- var nextInstance = nextHydratableInstance,
- JSCompiler_temp$jscomp$0;
- if ((JSCompiler_temp$jscomp$0 = nextInstance)) {
- c: {
- JSCompiler_temp$jscomp$0 = nextInstance;
- for (
- nextInstance = rootOrSingletonContext;
- 8 !== JSCompiler_temp$jscomp$0.nodeType;
-
- ) {
- if (!nextInstance) {
- nextInstance = null;
- break c;
- }
- JSCompiler_temp$jscomp$0 = getNextHydratable(
- JSCompiler_temp$jscomp$0.nextSibling
- );
- if (null === JSCompiler_temp$jscomp$0) {
- nextInstance = null;
- break c;
- }
- }
- nextInstance = JSCompiler_temp$jscomp$0;
- }
- null !== nextInstance
- ? ((workInProgress.memoizedState = {
- dehydrated: nextInstance,
- treeContext:
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null,
- retryLane: 536870912
- }),
- (JSCompiler_temp$jscomp$0 = createFiberImplClass(
- 18,
- null,
- null,
- 0
- )),
- (JSCompiler_temp$jscomp$0.stateNode = nextInstance),
- (JSCompiler_temp$jscomp$0.return = workInProgress),
- (workInProgress.child = JSCompiler_temp$jscomp$0),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (JSCompiler_temp$jscomp$0 = !0))
- : (JSCompiler_temp$jscomp$0 = !1);
- }
- JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress);
- }
- nextInstance = workInProgress.memoizedState;
- if (
- null !== nextInstance &&
- ((nextInstance = nextInstance.dehydrated), null !== nextInstance)
- )
- return (
- isSuspenseInstanceFallback(nextInstance)
- ? (workInProgress.lanes = 16)
- : (workInProgress.lanes = 536870912),
- null
- );
- popSuspenseHandler(workInProgress);
- }
- nextInstance = nextProps.children;
- JSCompiler_temp$jscomp$0 = nextProps.fallback;
- if (showFallback)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (nextProps = mountSuspenseFallbackChildren(
- workInProgress,
- nextInstance,
- JSCompiler_temp$jscomp$0,
- renderLanes
- )),
- (showFallback = workInProgress.child),
- (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- nextProps
- );
- if ("number" === typeof nextProps.unstable_expectedLoadTime)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (nextProps = mountSuspenseFallbackChildren(
- workInProgress,
- nextInstance,
- JSCompiler_temp$jscomp$0,
- renderLanes
- )),
- (showFallback = workInProgress.child),
- (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress.lanes = 4194304),
- nextProps
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- return mountSuspensePrimaryChildren(workInProgress, nextInstance);
- }
- JSCompiler_temp$jscomp$0 = current.memoizedState;
- if (
- null !== JSCompiler_temp$jscomp$0 &&
- ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated),
- null !== nextInstance)
- ) {
- if (didSuspend)
- workInProgress.flags & 256
- ? (pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags &= -257),
- (workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- )))
- : null !== workInProgress.memoizedState
- ? (reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.child = current.child),
- (workInProgress.flags |= 128),
- (workInProgress = null))
- : (reuseSuspenseHandlerOnStack(workInProgress),
- (showFallback = nextProps.fallback),
- (nextInstance = workInProgress.mode),
- (nextProps = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: nextProps.children },
- nextInstance
- )),
- (showFallback = createFiberFromFragment(
- showFallback,
- nextInstance,
- renderLanes,
- null
- )),
- (showFallback.flags |= 2),
- (nextProps.return = workInProgress),
- (showFallback.return = workInProgress),
- (nextProps.sibling = showFallback),
- (workInProgress.child = nextProps),
- reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
- ),
- (nextProps = workInProgress.child),
- (nextProps.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (nextProps.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress = showFallback));
- else if (
- (pushPrimaryTreeSuspenseHandler(workInProgress),
- isSuspenseInstanceFallback(nextInstance))
- ) {
- JSCompiler_temp =
- nextInstance.nextSibling && nextInstance.nextSibling.dataset;
- if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
- JSCompiler_temp = digest;
- "POSTPONE" !== JSCompiler_temp &&
- ((nextProps = Error(formatProdErrorMessage(419))),
- (nextProps.stack = ""),
- (nextProps.digest = JSCompiler_temp),
- queueHydrationError({ value: nextProps, source: null, stack: null }));
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- );
- } else if (
- (didReceiveUpdate ||
- propagateParentContextChanges(current, workInProgress, renderLanes, !1),
- (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
- didReceiveUpdate || JSCompiler_temp)
- ) {
- JSCompiler_temp = workInProgressRoot;
- if (null !== JSCompiler_temp) {
- nextProps = renderLanes & -renderLanes;
- if (0 !== (nextProps & 42)) nextProps = 1;
- else
- switch (nextProps) {
- case 2:
- nextProps = 1;
- break;
- case 8:
- nextProps = 4;
- break;
- case 32:
- nextProps = 16;
- break;
- case 128:
- case 256:
- case 512:
- case 1024:
- case 2048:
- case 4096:
- case 8192:
- case 16384:
- case 32768:
- case 65536:
- case 131072:
- case 262144:
- case 524288:
- case 1048576:
- case 2097152:
- case 4194304:
- case 8388608:
- case 16777216:
- case 33554432:
- nextProps = 64;
- break;
- case 268435456:
- nextProps = 134217728;
- break;
- default:
- nextProps = 0;
- }
- nextProps =
- 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
- ? 0
- : nextProps;
- if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane)
- throw (
- ((JSCompiler_temp$jscomp$0.retryLane = nextProps),
- enqueueConcurrentRenderForLane(current, nextProps),
- scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
- SelectiveHydrationException)
- );
- }
- "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- );
- } else
- "$?" === nextInstance.data
- ? ((workInProgress.flags |= 192),
- (workInProgress.child = current.child),
- (workInProgress = null))
- : ((current = JSCompiler_temp$jscomp$0.treeContext),
- (nextHydratableInstance = getNextHydratable(
- nextInstance.nextSibling
- )),
- (hydrationParentFiber = workInProgress),
- (isHydrating = !0),
- (hydrationErrors = null),
- (rootOrSingletonContext = !1),
- null !== current &&
- ((idStack[idStackIndex++] = treeContextId),
- (idStack[idStackIndex++] = treeContextOverflow),
- (idStack[idStackIndex++] = treeContextProvider),
- (treeContextId = current.id),
- (treeContextOverflow = current.overflow),
- (treeContextProvider = workInProgress)),
- (workInProgress = mountSuspensePrimaryChildren(
- workInProgress,
- nextProps.children
- )),
- (workInProgress.flags |= 4096));
- return workInProgress;
- }
- if (showFallback)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (showFallback = nextProps.fallback),
- (nextInstance = workInProgress.mode),
- (JSCompiler_temp$jscomp$0 = current.child),
- (digest = JSCompiler_temp$jscomp$0.sibling),
- (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, {
- mode: "hidden",
- children: nextProps.children
- })),
- (nextProps.subtreeFlags =
- JSCompiler_temp$jscomp$0.subtreeFlags & 31457280),
- null !== digest
- ? (showFallback = createWorkInProgress(digest, showFallback))
- : ((showFallback = createFiberFromFragment(
- showFallback,
- nextInstance,
- renderLanes,
- null
- )),
- (showFallback.flags |= 2)),
- (showFallback.return = workInProgress),
- (nextProps.return = workInProgress),
- (nextProps.sibling = showFallback),
- (workInProgress.child = nextProps),
- (nextProps = showFallback),
- (showFallback = workInProgress.child),
- (nextInstance = current.child.memoizedState),
- null === nextInstance
- ? (nextInstance = mountSuspenseOffscreenState(renderLanes))
- : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool),
- null !== JSCompiler_temp$jscomp$0
- ? ((digest = CacheContext._currentValue),
- (JSCompiler_temp$jscomp$0 =
- JSCompiler_temp$jscomp$0.parent !== digest
- ? { parent: digest, pool: digest }
- : JSCompiler_temp$jscomp$0))
- : (JSCompiler_temp$jscomp$0 = getSuspendedCache()),
- (nextInstance = {
- baseLanes: nextInstance.baseLanes | renderLanes,
- cachePool: JSCompiler_temp$jscomp$0
- })),
- (showFallback.memoizedState = nextInstance),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- nextProps
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- renderLanes = current.child;
- current = renderLanes.sibling;
- renderLanes = createWorkInProgress(renderLanes, {
- mode: "visible",
- children: nextProps.children
- });
- renderLanes.return = workInProgress;
- renderLanes.sibling = null;
- null !== current &&
- ((JSCompiler_temp = workInProgress.deletions),
- null === JSCompiler_temp
- ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
- : JSCompiler_temp.push(current));
- workInProgress.child = renderLanes;
- workInProgress.memoizedState = null;
- return renderLanes;
-}
-function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: primaryChildren },
- workInProgress.mode
- );
- primaryChildren.return = workInProgress;
- return (workInProgress.child = primaryChildren);
-}
-function mountSuspenseFallbackChildren(
- workInProgress,
- primaryChildren,
- fallbackChildren,
- renderLanes
-) {
- var mode = workInProgress.mode;
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "hidden", children: primaryChildren },
- mode
- );
- fallbackChildren = createFiberFromFragment(
- fallbackChildren,
- mode,
- renderLanes,
- null
- );
- primaryChildren.return = workInProgress;
- fallbackChildren.return = workInProgress;
- primaryChildren.sibling = fallbackChildren;
- workInProgress.child = primaryChildren;
- return fallbackChildren;
-}
-function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
- return createFiberFromOffscreen(offscreenProps, mode, 0, null);
-}
-function retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
-) {
- reconcileChildFibers(workInProgress, current.child, null, renderLanes);
- current = mountSuspensePrimaryChildren(
- workInProgress,
- workInProgress.pendingProps.children
- );
- current.flags |= 2;
- workInProgress.memoizedState = null;
- return current;
-}
-function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
- fiber.lanes |= renderLanes;
- var alternate = fiber.alternate;
- null !== alternate && (alternate.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
-}
-function initSuspenseListRenderState(
- workInProgress,
- isBackwards,
- tail,
- lastContentRow,
- tailMode
-) {
- var renderState = workInProgress.memoizedState;
- null === renderState
- ? (workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- renderingStartTime: 0,
- last: lastContentRow,
- tail: tail,
- tailMode: tailMode
- })
- : ((renderState.isBackwards = isBackwards),
- (renderState.rendering = null),
- (renderState.renderingStartTime = 0),
- (renderState.last = lastContentRow),
- (renderState.tail = tail),
- (renderState.tailMode = tailMode));
-}
-function updateSuspenseListComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- revealOrder = nextProps.revealOrder,
- tailMode = nextProps.tail;
- reconcileChildren(current, workInProgress, nextProps.children, renderLanes);
- nextProps = suspenseStackCursor.current;
- if (0 !== (nextProps & 2))
- (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128);
- else {
- if (null !== current && 0 !== (current.flags & 128))
- a: for (current = workInProgress.child; null !== current; ) {
- if (13 === current.tag)
- null !== current.memoizedState &&
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (19 === current.tag)
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (null !== current.child) {
- current.child.return = current;
- current = current.child;
- continue;
- }
- if (current === workInProgress) break a;
- for (; null === current.sibling; ) {
- if (null === current.return || current.return === workInProgress)
- break a;
- current = current.return;
- }
- current.sibling.return = current.return;
- current = current.sibling;
- }
- nextProps &= 1;
- }
- push(suspenseStackCursor, nextProps);
- switch (revealOrder) {
- case "forwards":
- renderLanes = workInProgress.child;
- for (revealOrder = null; null !== renderLanes; )
- (current = renderLanes.alternate),
- null !== current &&
- null === findFirstSuspended(current) &&
- (revealOrder = renderLanes),
- (renderLanes = renderLanes.sibling);
- renderLanes = revealOrder;
- null === renderLanes
- ? ((revealOrder = workInProgress.child), (workInProgress.child = null))
- : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null));
- initSuspenseListRenderState(
- workInProgress,
- !1,
- revealOrder,
- renderLanes,
- tailMode
- );
- break;
- case "backwards":
- renderLanes = null;
- revealOrder = workInProgress.child;
- for (workInProgress.child = null; null !== revealOrder; ) {
- current = revealOrder.alternate;
- if (null !== current && null === findFirstSuspended(current)) {
- workInProgress.child = revealOrder;
- break;
- }
- current = revealOrder.sibling;
- revealOrder.sibling = renderLanes;
- renderLanes = revealOrder;
- revealOrder = current;
- }
- initSuspenseListRenderState(
- workInProgress,
- !0,
- renderLanes,
- null,
- tailMode
- );
- break;
- case "together":
- initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
- break;
- default:
- workInProgress.memoizedState = null;
- }
- return workInProgress.child;
-}
-function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
- null !== current && (workInProgress.dependencies = current.dependencies);
- workInProgressRootSkippedLanes |= workInProgress.lanes;
- if (0 === (renderLanes & workInProgress.childLanes))
- if (null !== current) {
- if (
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- 0 === (renderLanes & workInProgress.childLanes))
- )
- return null;
- } else return null;
- if (null !== current && workInProgress.child !== current.child)
- throw Error(formatProdErrorMessage(153));
- if (null !== workInProgress.child) {
- current = workInProgress.child;
- renderLanes = createWorkInProgress(current, current.pendingProps);
- workInProgress.child = renderLanes;
- for (renderLanes.return = workInProgress; null !== current.sibling; )
- (current = current.sibling),
- (renderLanes = renderLanes.sibling =
- createWorkInProgress(current, current.pendingProps)),
- (renderLanes.return = workInProgress);
- renderLanes.sibling = null;
- }
- return workInProgress.child;
-}
-function checkScheduledUpdateOrContext(current, renderLanes) {
- if (0 !== (current.lanes & renderLanes)) return !0;
- current = current.dependencies;
- return null !== current && checkIfContextChanged(current) ? !0 : !1;
-}
-function attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
-) {
- switch (workInProgress.tag) {
- case 3:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
- resetHydrationState();
- break;
- case 27:
- case 5:
- pushHostContext(workInProgress);
- break;
- case 4:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- break;
- case 10:
- pushProvider(
- workInProgress,
- workInProgress.type,
- workInProgress.memoizedProps.value
- );
- break;
- case 13:
- var state = workInProgress.memoizedState;
- if (null !== state) {
- if (null !== state.dehydrated)
- return (
- pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags |= 128),
- null
- );
- if (0 !== (renderLanes & workInProgress.child.childLanes))
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- current = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- return null !== current ? current.sibling : null;
- }
- pushPrimaryTreeSuspenseHandler(workInProgress);
- break;
- case 19:
- var didSuspendBefore = 0 !== (current.flags & 128);
- state = 0 !== (renderLanes & workInProgress.childLanes);
- state ||
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- (state = 0 !== (renderLanes & workInProgress.childLanes)));
- if (didSuspendBefore) {
- if (state)
- return updateSuspenseListComponent(
- current,
- workInProgress,
- renderLanes
- );
- workInProgress.flags |= 128;
- }
- didSuspendBefore = workInProgress.memoizedState;
- null !== didSuspendBefore &&
- ((didSuspendBefore.rendering = null),
- (didSuspendBefore.tail = null),
- (didSuspendBefore.lastEffect = null));
- push(suspenseStackCursor, suspenseStackCursor.current);
- if (state) break;
- else return null;
- case 22:
- case 23:
- return (
- (workInProgress.lanes = 0),
- updateOffscreenComponent(current, workInProgress, renderLanes)
- );
- case 24:
- pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
-}
-function beginWork(current, workInProgress, renderLanes) {
- if (null !== current)
- if (current.memoizedProps !== workInProgress.pendingProps)
- didReceiveUpdate = !0;
- else {
- if (
- !checkScheduledUpdateOrContext(current, renderLanes) &&
- 0 === (workInProgress.flags & 128)
- )
- return (
- (didReceiveUpdate = !1),
- attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
- )
- );
- didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
- }
- else
- (didReceiveUpdate = !1),
- isHydrating &&
- 0 !== (workInProgress.flags & 1048576) &&
- pushTreeId(workInProgress, treeForkCount, workInProgress.index);
- workInProgress.lanes = 0;
- switch (workInProgress.tag) {
- case 16:
- a: {
- current = workInProgress.pendingProps;
- var lazyComponent = workInProgress.elementType,
- init = lazyComponent._init;
- lazyComponent = init(lazyComponent._payload);
- workInProgress.type = lazyComponent;
- if ("function" === typeof lazyComponent)
- shouldConstruct(lazyComponent)
- ? ((current = resolveClassComponentProps(lazyComponent, current)),
- (workInProgress.tag = 1),
- (workInProgress = updateClassComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- )))
- : ((workInProgress.tag = 0),
- (workInProgress = updateFunctionComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- )));
- else {
- if (void 0 !== lazyComponent && null !== lazyComponent)
- if (
- ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE)
- ) {
- workInProgress.tag = 11;
- workInProgress = updateForwardRef(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- );
- break a;
- } else if (init === REACT_MEMO_TYPE) {
- workInProgress.tag = 14;
- workInProgress = updateMemoComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- );
- break a;
- }
- workInProgress =
- getComponentNameFromType(lazyComponent) || lazyComponent;
- throw Error(formatProdErrorMessage(306, workInProgress, ""));
- }
- }
- return workInProgress;
- case 0:
- return updateFunctionComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 1:
- return (
- (lazyComponent = workInProgress.type),
- (init = resolveClassComponentProps(
- lazyComponent,
- workInProgress.pendingProps
- )),
- updateClassComponent(
- current,
- workInProgress,
- lazyComponent,
- init,
- renderLanes
- )
- );
- case 3:
- a: {
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- if (null === current) throw Error(formatProdErrorMessage(387));
- var nextProps = workInProgress.pendingProps;
- init = workInProgress.memoizedState;
- lazyComponent = init.element;
- cloneUpdateQueue(current, workInProgress);
- processUpdateQueue(workInProgress, nextProps, null, renderLanes);
- var nextState = workInProgress.memoizedState;
- nextProps = nextState.cache;
- pushProvider(workInProgress, CacheContext, nextProps);
- nextProps !== init.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- );
- suspendIfUpdateReadFromEntangledAsyncAction();
- nextProps = nextState.element;
- if (init.isDehydrated)
- if (
- ((init = {
- element: nextProps,
- isDehydrated: !1,
- cache: nextState.cache
- }),
- (workInProgress.updateQueue.baseState = init),
- (workInProgress.memoizedState = init),
- workInProgress.flags & 256)
- ) {
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else if (nextProps !== lazyComponent) {
- lazyComponent = createCapturedValueAtFiber(
- Error(formatProdErrorMessage(424)),
- workInProgress
- );
- queueHydrationError(lazyComponent);
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else
- for (
- nextHydratableInstance = getNextHydratable(
- workInProgress.stateNode.containerInfo.firstChild
- ),
- hydrationParentFiber = workInProgress,
- isHydrating = !0,
- hydrationErrors = null,
- rootOrSingletonContext = !0,
- renderLanes = mountChildFibers(
- workInProgress,
- null,
- nextProps,
- renderLanes
- ),
- workInProgress.child = renderLanes;
- renderLanes;
-
- )
- (renderLanes.flags = (renderLanes.flags & -3) | 4096),
- (renderLanes = renderLanes.sibling);
- else {
- resetHydrationState();
- if (nextProps === lazyComponent) {
- workInProgress = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- break a;
- }
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- }
- workInProgress = workInProgress.child;
- }
- return workInProgress;
- case 26:
- return (
- markRef(current, workInProgress),
- null === current
- ? (renderLanes = getResource(
- workInProgress.type,
- null,
- workInProgress.pendingProps,
- null
- ))
- ? (workInProgress.memoizedState = renderLanes)
- : isHydrating ||
- ((renderLanes = workInProgress.type),
- (current = workInProgress.pendingProps),
- (lazyComponent = getOwnerDocumentFromRootContainer(
- rootInstanceStackCursor.current
- ).createElement(renderLanes)),
- (lazyComponent[internalInstanceKey] = workInProgress),
- (lazyComponent[internalPropsKey] = current),
- setInitialProperties(lazyComponent, renderLanes, current),
- markNodeAsHoistable(lazyComponent),
- (workInProgress.stateNode = lazyComponent))
- : (workInProgress.memoizedState = getResource(
- workInProgress.type,
- current.memoizedProps,
- workInProgress.pendingProps,
- current.memoizedState
- )),
- null
- );
- case 27:
- return (
- pushHostContext(workInProgress),
- null === current &&
- isHydrating &&
- ((lazyComponent = workInProgress.stateNode =
- resolveSingletonInstance(
- workInProgress.type,
- workInProgress.pendingProps,
- rootInstanceStackCursor.current
- )),
- (hydrationParentFiber = workInProgress),
- (rootOrSingletonContext = !0),
- (nextHydratableInstance = getNextHydratable(
- lazyComponent.firstChild
- ))),
- (lazyComponent = workInProgress.pendingProps.children),
- null !== current || isHydrating
- ? reconcileChildren(
- current,
- workInProgress,
- lazyComponent,
- renderLanes
- )
- : (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- lazyComponent,
- renderLanes
+ rootRenderLanes
+ ),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? (suspenseBoundary.updateQueue = new Set([value]))
+ : sourceFiber.add(value),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ case 22:
+ return (
+ (suspenseBoundary.flags |= 65536),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? ((sourceFiber = {
+ transitions: null,
+ markerInstances: null,
+ retryQueue: new Set([value])
+ }),
+ (suspenseBoundary.updateQueue = sourceFiber))
+ : ((returnFiber = sourceFiber.retryQueue),
+ null === returnFiber
+ ? (sourceFiber.retryQueue = new Set([value]))
+ : returnFiber.add(value)),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ }
+ throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
+ }
+ attachPingListener(root, value, rootRenderLanes);
+ renderDidSuspendDelayIfPossible();
+ return !1;
+ }
+ if (isHydrating)
+ return (
+ (suspenseBoundary = suspenseHandlerStackCursor.current),
+ null !== suspenseBoundary
+ ? (0 === (suspenseBoundary.flags & 65536) &&
+ (suspenseBoundary.flags |= 256),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value !== HydrationMismatchException &&
+ ((root = Error(formatProdErrorMessage(422), { cause: value })),
+ queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))
+ : (value !== HydrationMismatchException &&
+ ((returnFiber = Error(formatProdErrorMessage(423), {
+ cause: value
+ })),
+ queueHydrationError(
+ createCapturedValueAtFiber(returnFiber, sourceFiber)
)),
- markRef(current, workInProgress),
- workInProgress.child
- );
- case 5:
- if (null === current && isHydrating) {
- if ((init = lazyComponent = nextHydratableInstance))
- (lazyComponent = canHydrateInstance(
- lazyComponent,
- workInProgress.type,
- workInProgress.pendingProps,
- rootOrSingletonContext
+ (root = root.current.alternate),
+ (root.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (root.lanes |= rootRenderLanes),
+ (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
+ (rootRenderLanes = createRootErrorUpdate(
+ root.stateNode,
+ sourceFiber,
+ rootRenderLanes
)),
- null !== lazyComponent
- ? ((workInProgress.stateNode = lazyComponent),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = getNextHydratable(
- lazyComponent.firstChild
- )),
- (rootOrSingletonContext = !1),
- (init = !0))
- : (init = !1);
- init || throwOnHydrationMismatch(workInProgress);
- }
- pushHostContext(workInProgress);
- init = workInProgress.type;
- nextProps = workInProgress.pendingProps;
- nextState = null !== current ? current.memoizedProps : null;
- lazyComponent = nextProps.children;
- shouldSetTextContent(init, nextProps)
- ? (lazyComponent = null)
- : null !== nextState &&
- shouldSetTextContent(init, nextState) &&
- (workInProgress.flags |= 32);
- null !== workInProgress.memoizedState &&
- ((init = renderWithHooks(
- current,
+ enqueueCapturedUpdate(root, rootRenderLanes),
+ 4 !== workInProgressRootExitStatus &&
+ (workInProgressRootExitStatus = 2)),
+ !1
+ );
+ suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value });
+ queueConcurrentError(
+ createCapturedValueAtFiber(suspenseBoundary, sourceFiber)
+ );
+ 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
+ if (null === returnFiber) return !0;
+ sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
+ do {
+ switch (returnFiber.tag) {
+ case 3:
+ return (
+ (returnFiber.flags |= 65536),
+ (root = rootRenderLanes & -rootRenderLanes),
+ (returnFiber.lanes |= root),
+ (root = createRootErrorUpdate(
+ returnFiber.stateNode,
+ sourceFiber,
+ root
+ )),
+ enqueueCapturedUpdate(returnFiber, root),
+ !1
+ );
+ case 1:
+ if (
+ ((value = returnFiber.type),
+ (suspenseBoundary = returnFiber.stateNode),
+ 0 === (returnFiber.flags & 128) &&
+ ("function" === typeof value.getDerivedStateFromError ||
+ (null !== suspenseBoundary &&
+ "function" === typeof suspenseBoundary.componentDidCatch &&
+ (null === legacyErrorBoundariesThatAlreadyFailed ||
+ !legacyErrorBoundariesThatAlreadyFailed.has(
+ suspenseBoundary
+ )))))
+ )
+ return (
+ (returnFiber.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (returnFiber.lanes |= rootRenderLanes),
+ (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
+ initializeClassErrorUpdate(
+ rootRenderLanes,
+ root,
+ returnFiber,
+ sourceFiber
+ ),
+ enqueueCapturedUpdate(returnFiber, rootRenderLanes),
+ !1
+ );
+ }
+ returnFiber = returnFiber.return;
+ } while (null !== returnFiber);
+ return !1;
+}
+var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
+ didReceiveUpdate = !1;
+function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
+ workInProgress.child =
+ null === current
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
+ : reconcileChildFibers(
workInProgress,
- TransitionAwareHostComponent,
- null,
- null,
+ current.child,
+ nextChildren,
renderLanes
- )),
- (HostTransitionContext._currentValue = init));
- markRef(current, workInProgress);
- reconcileChildren(current, workInProgress, lazyComponent, renderLanes);
- return workInProgress.child;
- case 6:
- if (null === current && isHydrating) {
- if ((current = renderLanes = nextHydratableInstance))
- (renderLanes = canHydrateTextInstance(
- renderLanes,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== renderLanes
- ? ((workInProgress.stateNode = renderLanes),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (current = !0))
- : (current = !1);
- current || throwOnHydrationMismatch(workInProgress);
- }
- return null;
- case 13:
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- case 4:
+ );
+}
+function updateForwardRef(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ Component = Component.render;
+ var ref = workInProgress.ref;
+ if ("ref" in nextProps) {
+ var propsWithoutRef = {};
+ for (var key in nextProps)
+ "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
+ } else propsWithoutRef = nextProps;
+ prepareToReadContext(workInProgress);
+ nextProps = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ propsWithoutRef,
+ ref,
+ renderLanes
+ );
+ key = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && key && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+}
+function updateMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ if (null === current) {
+ var type = Component.type;
+ if (
+ "function" === typeof type &&
+ !shouldConstruct(type) &&
+ void 0 === type.defaultProps &&
+ null === Component.compare
+ )
return (
- pushHostContainer(
+ (workInProgress.tag = 15),
+ (workInProgress.type = type),
+ updateSimpleMemoComponent(
+ current,
workInProgress,
- workInProgress.stateNode.containerInfo
- ),
- (lazyComponent = workInProgress.pendingProps),
- null === current
- ? (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- lazyComponent,
- renderLanes
- ))
- : reconcileChildren(
- current,
- workInProgress,
- lazyComponent,
- renderLanes
- ),
- workInProgress.child
+ type,
+ nextProps,
+ renderLanes
+ )
);
- case 11:
- return updateForwardRef(
+ current = createFiberFromTypeAndProps(
+ Component.type,
+ null,
+ nextProps,
+ workInProgress,
+ workInProgress.mode,
+ renderLanes
+ );
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ type = current.child;
+ if (!checkScheduledUpdateOrContext(current, renderLanes)) {
+ var prevProps = type.memoizedProps;
+ Component = Component.compare;
+ Component = null !== Component ? Component : shallowEqual;
+ if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+ }
+ workInProgress.flags |= 1;
+ current = createWorkInProgress(type, nextProps);
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+}
+function updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ if (null !== current) {
+ var prevProps = current.memoizedProps;
+ if (
+ shallowEqual(prevProps, nextProps) &&
+ current.ref === workInProgress.ref
+ )
+ if (
+ ((didReceiveUpdate = !1),
+ (workInProgress.pendingProps = nextProps = prevProps),
+ checkScheduledUpdateOrContext(current, renderLanes))
+ )
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
+ else
+ return (
+ (workInProgress.lanes = current.lanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ }
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ );
+}
+function updateOffscreenComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ nextChildren = nextProps.children,
+ nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2),
+ prevState = null !== current ? current.memoizedState : null;
+ markRef(current, workInProgress);
+ if ("hidden" === nextProps.mode || nextIsDetached) {
+ if (0 !== (workInProgress.flags & 128)) {
+ nextProps =
+ null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
+ if (null !== current) {
+ nextChildren = workInProgress.child = current.child;
+ for (nextIsDetached = 0; null !== nextChildren; )
+ (nextIsDetached =
+ nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
+ (nextChildren = nextChildren.sibling);
+ workInProgress.childLanes = nextIsDetached & ~nextProps;
+ } else (workInProgress.childLanes = 0), (workInProgress.child = null);
+ return deferHiddenOffscreenComponent(
current,
workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
+ nextProps,
renderLanes
);
- case 7:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps,
- renderLanes
- ),
- workInProgress.child
- );
- case 8:
+ }
+ if (0 !== (renderLanes & 536870912))
+ (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
+ null !== current &&
+ pushTransition(
+ workInProgress,
+ null !== prevState ? prevState.cachePool : null
+ ),
+ null !== prevState
+ ? pushHiddenContext(workInProgress, prevState)
+ : reuseHiddenContextOnStack(),
+ pushOffscreenSuspenseHandler(workInProgress);
+ else
return (
- reconcileChildren(
+ (workInProgress.lanes = workInProgress.childLanes = 536870912),
+ deferHiddenOffscreenComponent(
current,
workInProgress,
- workInProgress.pendingProps.children,
+ null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
renderLanes
- ),
- workInProgress.child
+ )
);
- case 12:
- return (
- reconcileChildren(
- current,
+ } else
+ null !== prevState
+ ? (pushTransition(workInProgress, prevState.cachePool),
+ pushHiddenContext(workInProgress, prevState),
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.memoizedState = null))
+ : (null !== current && pushTransition(workInProgress, null),
+ reuseHiddenContextOnStack(),
+ reuseSuspenseHandlerOnStack(workInProgress));
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+}
+function deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ nextBaseLanes,
+ renderLanes
+) {
+ var JSCompiler_inline_result = peekCacheFromPool();
+ JSCompiler_inline_result =
+ null === JSCompiler_inline_result
+ ? null
+ : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
+ workInProgress.memoizedState = {
+ baseLanes: nextBaseLanes,
+ cachePool: JSCompiler_inline_result
+ };
+ null !== current && pushTransition(workInProgress, null);
+ reuseHiddenContextOnStack();
+ pushOffscreenSuspenseHandler(workInProgress);
+ null !== current &&
+ propagateParentContextChanges(current, workInProgress, renderLanes, !0);
+ return null;
+}
+function markRef(current, workInProgress) {
+ var ref = workInProgress.ref;
+ if (null === ref)
+ null !== current &&
+ null !== current.ref &&
+ (workInProgress.flags |= 2097664);
+ else {
+ if ("function" !== typeof ref && "object" !== typeof ref)
+ throw Error(formatProdErrorMessage(284));
+ if (null === current || current.ref !== ref)
+ workInProgress.flags |= 2097664;
+ }
+}
+function updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ prepareToReadContext(workInProgress);
+ Component = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ void 0,
+ renderLanes
+ );
+ nextProps = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, Component, renderLanes);
+ return workInProgress.child;
+}
+function replayFunctionComponent(
+ current,
+ workInProgress,
+ nextProps,
+ Component,
+ secondArg,
+ renderLanes
+) {
+ prepareToReadContext(workInProgress);
+ workInProgress.updateQueue = null;
+ nextProps = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ nextProps,
+ secondArg
+ );
+ finishRenderingHooks(current);
+ Component = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && Component && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+}
+function updateClassComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ prepareToReadContext(workInProgress);
+ if (null === workInProgress.stateNode) {
+ var context = emptyContextObject,
+ contextType = Component.contextType;
+ "object" === typeof contextType &&
+ null !== contextType &&
+ (context = readContext(contextType));
+ context = new Component(nextProps, context);
+ workInProgress.memoizedState =
+ null !== context.state && void 0 !== context.state ? context.state : null;
+ context.updater = classComponentUpdater;
+ workInProgress.stateNode = context;
+ context._reactInternals = workInProgress;
+ context = workInProgress.stateNode;
+ context.props = nextProps;
+ context.state = workInProgress.memoizedState;
+ context.refs = {};
+ initializeUpdateQueue(workInProgress);
+ contextType = Component.contextType;
+ context.context =
+ "object" === typeof contextType && null !== contextType
+ ? readContext(contextType)
+ : emptyContextObject;
+ context.state = workInProgress.memoizedState;
+ contextType = Component.getDerivedStateFromProps;
+ "function" === typeof contextType &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ contextType,
+ nextProps
+ ),
+ (context.state = workInProgress.memoizedState));
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate ||
+ ("function" !== typeof context.UNSAFE_componentWillMount &&
+ "function" !== typeof context.componentWillMount) ||
+ ((contextType = context.state),
+ "function" === typeof context.componentWillMount &&
+ context.componentWillMount(),
+ "function" === typeof context.UNSAFE_componentWillMount &&
+ context.UNSAFE_componentWillMount(),
+ contextType !== context.state &&
+ classComponentUpdater.enqueueReplaceState(context, context.state, null),
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction(),
+ (context.state = workInProgress.memoizedState));
+ "function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308);
+ nextProps = !0;
+ } else if (null === current) {
+ context = workInProgress.stateNode;
+ var unresolvedOldProps = workInProgress.memoizedProps,
+ oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
+ context.props = oldProps;
+ var oldContext = context.context,
+ contextType$jscomp$0 = Component.contextType;
+ contextType = emptyContextObject;
+ "object" === typeof contextType$jscomp$0 &&
+ null !== contextType$jscomp$0 &&
+ (contextType = readContext(contextType$jscomp$0));
+ var getDerivedStateFromProps = Component.getDerivedStateFromProps;
+ contextType$jscomp$0 =
+ "function" === typeof getDerivedStateFromProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate;
+ unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
+ contextType$jscomp$0 ||
+ ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof context.componentWillReceiveProps) ||
+ ((unresolvedOldProps || oldContext !== contextType) &&
+ callComponentWillReceiveProps(
workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 10:
- return (
- (lazyComponent = workInProgress.pendingProps),
- pushProvider(workInProgress, workInProgress.type, lazyComponent.value),
- reconcileChildren(
- current,
+ context,
+ nextProps,
+ contextType
+ ));
+ hasForceUpdate = !1;
+ var oldState = workInProgress.memoizedState;
+ context.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ oldContext = workInProgress.memoizedState;
+ unresolvedOldProps || oldState !== oldContext || hasForceUpdate
+ ? ("function" === typeof getDerivedStateFromProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ getDerivedStateFromProps,
+ nextProps
+ ),
+ (oldContext = workInProgress.memoizedState)),
+ (oldProps =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ oldProps,
+ nextProps,
+ oldState,
+ oldContext,
+ contextType
+ ))
+ ? (contextType$jscomp$0 ||
+ ("function" !== typeof context.UNSAFE_componentWillMount &&
+ "function" !== typeof context.componentWillMount) ||
+ ("function" === typeof context.componentWillMount &&
+ context.componentWillMount(),
+ "function" === typeof context.UNSAFE_componentWillMount &&
+ context.UNSAFE_componentWillMount()),
+ "function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308))
+ : ("function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = oldContext)),
+ (context.props = nextProps),
+ (context.state = oldContext),
+ (context.context = contextType),
+ (nextProps = oldProps))
+ : ("function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (nextProps = !1));
+ } else {
+ context = workInProgress.stateNode;
+ cloneUpdateQueue(current, workInProgress);
+ contextType = workInProgress.memoizedProps;
+ contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
+ context.props = contextType$jscomp$0;
+ getDerivedStateFromProps = workInProgress.pendingProps;
+ oldState = context.context;
+ oldContext = Component.contextType;
+ oldProps = emptyContextObject;
+ "object" === typeof oldContext &&
+ null !== oldContext &&
+ (oldProps = readContext(oldContext));
+ unresolvedOldProps = Component.getDerivedStateFromProps;
+ (oldContext =
+ "function" === typeof unresolvedOldProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate) ||
+ ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof context.componentWillReceiveProps) ||
+ ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&
+ callComponentWillReceiveProps(
workInProgress,
- lazyComponent.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 9:
- return (
- (init = workInProgress.type._context),
- (lazyComponent = workInProgress.pendingProps.children),
- prepareToReadContext(workInProgress),
- (init = readContext(init)),
- (lazyComponent = lazyComponent(init)),
- (workInProgress.flags |= 1),
- reconcileChildren(current, workInProgress, lazyComponent, renderLanes),
- workInProgress.child
- );
- case 14:
- return updateMemoComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 15:
- return updateSimpleMemoComponent(
+ context,
+ nextProps,
+ oldProps
+ ));
+ hasForceUpdate = !1;
+ oldState = workInProgress.memoizedState;
+ context.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ var newState = workInProgress.memoizedState;
+ contextType !== getDerivedStateFromProps ||
+ oldState !== newState ||
+ hasForceUpdate ||
+ (null !== current &&
+ null !== current.dependencies &&
+ checkIfContextChanged(current.dependencies))
+ ? ("function" === typeof unresolvedOldProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ unresolvedOldProps,
+ nextProps
+ ),
+ (newState = workInProgress.memoizedState)),
+ (contextType$jscomp$0 =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ contextType$jscomp$0,
+ nextProps,
+ oldState,
+ newState,
+ oldProps
+ ) ||
+ (null !== current &&
+ null !== current.dependencies &&
+ checkIfContextChanged(current.dependencies)))
+ ? (oldContext ||
+ ("function" !== typeof context.UNSAFE_componentWillUpdate &&
+ "function" !== typeof context.componentWillUpdate) ||
+ ("function" === typeof context.componentWillUpdate &&
+ context.componentWillUpdate(nextProps, newState, oldProps),
+ "function" === typeof context.UNSAFE_componentWillUpdate &&
+ context.UNSAFE_componentWillUpdate(
+ nextProps,
+ newState,
+ oldProps
+ )),
+ "function" === typeof context.componentDidUpdate &&
+ (workInProgress.flags |= 4),
+ "function" === typeof context.getSnapshotBeforeUpdate &&
+ (workInProgress.flags |= 1024))
+ : ("function" !== typeof context.componentDidUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof context.getSnapshotBeforeUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = newState)),
+ (context.props = nextProps),
+ (context.state = newState),
+ (context.context = oldProps),
+ (nextProps = contextType$jscomp$0))
+ : ("function" !== typeof context.componentDidUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof context.getSnapshotBeforeUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (nextProps = !1));
+ }
+ context = nextProps;
+ markRef(current, workInProgress);
+ nextProps = 0 !== (workInProgress.flags & 128);
+ context || nextProps
+ ? ((context = workInProgress.stateNode),
+ (Component =
+ nextProps && "function" !== typeof Component.getDerivedStateFromError
+ ? null
+ : context.render()),
+ (workInProgress.flags |= 1),
+ null !== current && nextProps
+ ? ((workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ current.child,
+ null,
+ renderLanes
+ )),
+ (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ Component,
+ renderLanes
+ )))
+ : reconcileChildren(current, workInProgress, Component, renderLanes),
+ (workInProgress.memoizedState = context.state),
+ (current = workInProgress.child))
+ : (current = bailoutOnAlreadyFinishedWork(
current,
workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
renderLanes
- );
- case 19:
- return updateSuspenseListComponent(current, workInProgress, renderLanes);
- case 22:
- return updateOffscreenComponent(current, workInProgress, renderLanes);
- case 24:
- return (
- prepareToReadContext(workInProgress),
- (lazyComponent = readContext(CacheContext)),
- null === current
- ? ((init = peekCacheFromPool()),
- null === init &&
- ((init = workInProgressRoot),
- (nextProps = createCache()),
- (init.pooledCache = nextProps),
- nextProps.refCount++,
- null !== nextProps && (init.pooledCacheLanes |= renderLanes),
- (init = nextProps)),
- (workInProgress.memoizedState = {
- parent: lazyComponent,
- cache: init
- }),
- initializeUpdateQueue(workInProgress),
- pushProvider(workInProgress, CacheContext, init))
- : (0 !== (current.lanes & renderLanes) &&
- (cloneUpdateQueue(current, workInProgress),
- processUpdateQueue(workInProgress, null, null, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction()),
- (init = current.memoizedState),
- (nextProps = workInProgress.memoizedState),
- init.parent !== lazyComponent
- ? ((init = { parent: lazyComponent, cache: lazyComponent }),
- (workInProgress.memoizedState = init),
- 0 === workInProgress.lanes &&
- (workInProgress.memoizedState =
- workInProgress.updateQueue.baseState =
- init),
- pushProvider(workInProgress, CacheContext, lazyComponent))
- : ((lazyComponent = nextProps.cache),
- pushProvider(workInProgress, CacheContext, lazyComponent),
- lazyComponent !== init.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- ))),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 29:
- throw workInProgress.pendingProps;
- }
- throw Error(formatProdErrorMessage(156, workInProgress.tag));
-}
-var valueCursor = createCursor(null),
- currentlyRenderingFiber = null,
- lastContextDependency = null;
-function pushProvider(providerFiber, context, nextValue) {
- push(valueCursor, context._currentValue);
- context._currentValue = nextValue;
-}
-function popProvider(context) {
- context._currentValue = valueCursor.current;
- pop(valueCursor);
-}
-function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
- for (; null !== parent; ) {
- var alternate = parent.alternate;
- (parent.childLanes & renderLanes) !== renderLanes
- ? ((parent.childLanes |= renderLanes),
- null !== alternate && (alternate.childLanes |= renderLanes))
- : null !== alternate &&
- (alternate.childLanes & renderLanes) !== renderLanes &&
- (alternate.childLanes |= renderLanes);
- if (parent === propagationRoot) break;
- parent = parent.return;
- }
+ ));
+ return current;
}
-function propagateContextChanges(
+function mountHostRootWithoutHydrating(
+ current,
workInProgress,
- contexts,
- renderLanes,
- forcePropagateEntireTree
+ nextChildren,
+ renderLanes
) {
- var fiber = workInProgress.child;
- null !== fiber && (fiber.return = workInProgress);
- for (; null !== fiber; ) {
- var list = fiber.dependencies;
- if (null !== list) {
- var nextFiber = fiber.child;
- list = list.firstContext;
- a: for (; null !== list; ) {
- var dependency = list;
- list = fiber;
- for (var i = 0; i < contexts.length; i++)
- if (dependency.context === contexts[i]) {
- list.lanes |= renderLanes;
- dependency = list.alternate;
- null !== dependency && (dependency.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- list.return,
- renderLanes,
- workInProgress
- );
- forcePropagateEntireTree || (nextFiber = null);
- break a;
- }
- list = dependency.next;
- }
- } else if (18 === fiber.tag) {
- nextFiber = fiber.return;
- if (null === nextFiber) throw Error(formatProdErrorMessage(341));
- nextFiber.lanes |= renderLanes;
- list = nextFiber.alternate;
- null !== list && (list.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);
- nextFiber = null;
- } else nextFiber = fiber.child;
- if (null !== nextFiber) nextFiber.return = fiber;
- else
- for (nextFiber = fiber; null !== nextFiber; ) {
- if (nextFiber === workInProgress) {
- nextFiber = null;
- break;
- }
- fiber = nextFiber.sibling;
- if (null !== fiber) {
- fiber.return = nextFiber.return;
- nextFiber = fiber;
- break;
- }
- nextFiber = nextFiber.return;
- }
- fiber = nextFiber;
- }
+ resetHydrationState();
+ workInProgress.flags |= 256;
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
}
-function propagateParentContextChanges(
+var SUSPENDED_MARKER = {
+ dehydrated: null,
+ treeContext: null,
+ retryLane: 0,
+ hydrationErrors: null
+};
+function mountSuspenseOffscreenState(renderLanes) {
+ return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
+}
+function getRemainingWorkInPrimaryTree(
current,
- workInProgress,
- renderLanes,
- forcePropagateEntireTree
+ primaryTreeDidDefer,
+ renderLanes
) {
- current = null;
- for (
- var parent = workInProgress, isInsidePropagationBailout = !1;
- null !== parent;
+ current = null !== current ? current.childLanes & ~renderLanes : 0;
+ primaryTreeDidDefer && (current |= workInProgressDeferredLane);
+ return current;
+}
+function updateSuspenseComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ showFallback = !1,
+ didSuspend = 0 !== (workInProgress.flags & 128),
+ JSCompiler_temp;
+ (JSCompiler_temp = didSuspend) ||
+ (JSCompiler_temp =
+ null !== current && null === current.memoizedState
+ ? !1
+ : 0 !== (suspenseStackCursor.current & 2));
+ JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));
+ JSCompiler_temp = 0 !== (workInProgress.flags & 32);
+ workInProgress.flags &= -33;
+ if (null === current) {
+ if (isHydrating) {
+ showFallback
+ ? pushPrimaryTreeSuspenseHandler(workInProgress)
+ : reuseSuspenseHandlerOnStack(workInProgress);
+ if (isHydrating) {
+ var nextInstance = nextHydratableInstance,
+ JSCompiler_temp$jscomp$0;
+ if ((JSCompiler_temp$jscomp$0 = nextInstance)) {
+ c: {
+ JSCompiler_temp$jscomp$0 = nextInstance;
+ for (
+ nextInstance = rootOrSingletonContext;
+ 8 !== JSCompiler_temp$jscomp$0.nodeType;
- ) {
- if (!isInsidePropagationBailout)
- if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
- else if (0 !== (parent.flags & 262144)) break;
- if (10 === parent.tag) {
- var currentParent = parent.alternate;
- if (null === currentParent) throw Error(formatProdErrorMessage(387));
- currentParent = currentParent.memoizedProps;
- if (null !== currentParent) {
- var context = parent.type;
- objectIs(parent.pendingProps.value, currentParent.value) ||
- (null !== current ? current.push(context) : (current = [context]));
+ ) {
+ if (!nextInstance) {
+ nextInstance = null;
+ break c;
+ }
+ JSCompiler_temp$jscomp$0 = getNextHydratable(
+ JSCompiler_temp$jscomp$0.nextSibling
+ );
+ if (null === JSCompiler_temp$jscomp$0) {
+ nextInstance = null;
+ break c;
+ }
+ }
+ nextInstance = JSCompiler_temp$jscomp$0;
+ }
+ null !== nextInstance
+ ? ((workInProgress.memoizedState = {
+ dehydrated: nextInstance,
+ treeContext:
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null,
+ retryLane: 536870912,
+ hydrationErrors: null
+ }),
+ (JSCompiler_temp$jscomp$0 = createFiberImplClass(
+ 18,
+ null,
+ null,
+ 0
+ )),
+ (JSCompiler_temp$jscomp$0.stateNode = nextInstance),
+ (JSCompiler_temp$jscomp$0.return = workInProgress),
+ (workInProgress.child = JSCompiler_temp$jscomp$0),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (JSCompiler_temp$jscomp$0 = !0))
+ : (JSCompiler_temp$jscomp$0 = !1);
+ }
+ JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress);
}
- } else if (parent === hostTransitionProviderCursor.current) {
- currentParent = parent.alternate;
- if (null === currentParent) throw Error(formatProdErrorMessage(387));
- currentParent.memoizedState.memoizedState !==
- parent.memoizedState.memoizedState &&
- (null !== current
- ? current.push(HostTransitionContext)
- : (current = [HostTransitionContext]));
+ nextInstance = workInProgress.memoizedState;
+ if (
+ null !== nextInstance &&
+ ((nextInstance = nextInstance.dehydrated), null !== nextInstance)
+ )
+ return (
+ isSuspenseInstanceFallback(nextInstance)
+ ? (workInProgress.lanes = 32)
+ : (workInProgress.lanes = 536870912),
+ null
+ );
+ popSuspenseHandler(workInProgress);
}
- parent = parent.return;
+ nextInstance = nextProps.children;
+ JSCompiler_temp$jscomp$0 = nextProps.fallback;
+ if (showFallback)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (nextProps = mountSuspenseFallbackChildren(
+ workInProgress,
+ nextInstance,
+ JSCompiler_temp$jscomp$0,
+ renderLanes
+ )),
+ (showFallback = workInProgress.child),
+ (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ nextProps
+ );
+ if ("number" === typeof nextProps.unstable_expectedLoadTime)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (nextProps = mountSuspenseFallbackChildren(
+ workInProgress,
+ nextInstance,
+ JSCompiler_temp$jscomp$0,
+ renderLanes
+ )),
+ (showFallback = workInProgress.child),
+ (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress.lanes = 4194304),
+ nextProps
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ return mountSuspensePrimaryChildren(workInProgress, nextInstance);
}
- null !== current &&
- propagateContextChanges(
- workInProgress,
- current,
- renderLanes,
- forcePropagateEntireTree
- );
- workInProgress.flags |= 262144;
-}
-function checkIfContextChanged(currentDependencies) {
- for (
- currentDependencies = currentDependencies.firstContext;
- null !== currentDependencies;
-
+ JSCompiler_temp$jscomp$0 = current.memoizedState;
+ if (
+ null !== JSCompiler_temp$jscomp$0 &&
+ ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated),
+ null !== nextInstance)
) {
- if (
- !objectIs(
- currentDependencies.context._currentValue,
- currentDependencies.memoizedValue
+ if (didSuspend)
+ workInProgress.flags & 256
+ ? (pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags &= -257),
+ (workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ )))
+ : null !== workInProgress.memoizedState
+ ? (reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.child = current.child),
+ (workInProgress.flags |= 128),
+ (workInProgress = null))
+ : (reuseSuspenseHandlerOnStack(workInProgress),
+ (showFallback = nextProps.fallback),
+ (nextInstance = workInProgress.mode),
+ (nextProps = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: nextProps.children },
+ nextInstance
+ )),
+ (showFallback = createFiberFromFragment(
+ showFallback,
+ nextInstance,
+ renderLanes,
+ null
+ )),
+ (showFallback.flags |= 2),
+ (nextProps.return = workInProgress),
+ (showFallback.return = workInProgress),
+ (nextProps.sibling = showFallback),
+ (workInProgress.child = nextProps),
+ reconcileChildFibers(
+ workInProgress,
+ current.child,
+ null,
+ renderLanes
+ ),
+ (nextProps = workInProgress.child),
+ (nextProps.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (nextProps.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress = showFallback));
+ else if (
+ (pushPrimaryTreeSuspenseHandler(workInProgress),
+ isSuspenseInstanceFallback(nextInstance))
+ ) {
+ JSCompiler_temp =
+ nextInstance.nextSibling && nextInstance.nextSibling.dataset;
+ if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
+ JSCompiler_temp = digest;
+ "POSTPONE" !== JSCompiler_temp &&
+ ((nextProps = Error(formatProdErrorMessage(419))),
+ (nextProps.stack = ""),
+ (nextProps.digest = JSCompiler_temp),
+ queueHydrationError({ value: nextProps, source: null, stack: null }));
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else if (
+ (didReceiveUpdate ||
+ propagateParentContextChanges(current, workInProgress, renderLanes, !1),
+ (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
+ didReceiveUpdate || JSCompiler_temp)
+ ) {
+ JSCompiler_temp = workInProgressRoot;
+ if (
+ null !== JSCompiler_temp &&
+ ((nextProps = renderLanes & -renderLanes),
+ (nextProps =
+ 0 !== (nextProps & 42)
+ ? 1
+ : getBumpedLaneForHydrationByLane(nextProps)),
+ (nextProps =
+ 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
+ ? 0
+ : nextProps),
+ 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane)
)
- )
- return !0;
- currentDependencies = currentDependencies.next;
+ throw (
+ ((JSCompiler_temp$jscomp$0.retryLane = nextProps),
+ enqueueConcurrentRenderForLane(current, nextProps),
+ scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
+ SelectiveHydrationException)
+ );
+ "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else
+ "$?" === nextInstance.data
+ ? ((workInProgress.flags |= 192),
+ (workInProgress.child = current.child),
+ (workInProgress = null))
+ : ((current = JSCompiler_temp$jscomp$0.treeContext),
+ (nextHydratableInstance = getNextHydratable(
+ nextInstance.nextSibling
+ )),
+ (hydrationParentFiber = workInProgress),
+ (isHydrating = !0),
+ (hydrationErrors = null),
+ (rootOrSingletonContext = !1),
+ null !== current &&
+ ((idStack[idStackIndex++] = treeContextId),
+ (idStack[idStackIndex++] = treeContextOverflow),
+ (idStack[idStackIndex++] = treeContextProvider),
+ (treeContextId = current.id),
+ (treeContextOverflow = current.overflow),
+ (treeContextProvider = workInProgress)),
+ (workInProgress = mountSuspensePrimaryChildren(
+ workInProgress,
+ nextProps.children
+ )),
+ (workInProgress.flags |= 4096));
+ return workInProgress;
}
- return !1;
-}
-function prepareToReadContext(workInProgress) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- workInProgress = workInProgress.dependencies;
- null !== workInProgress && (workInProgress.firstContext = null);
-}
-function readContext(context) {
- return readContextForConsumer(currentlyRenderingFiber, context);
+ if (showFallback)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (showFallback = nextProps.fallback),
+ (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),
+ null !== digest
+ ? (showFallback = createWorkInProgress(digest, showFallback))
+ : ((showFallback = createFiberFromFragment(
+ showFallback,
+ nextInstance,
+ renderLanes,
+ null
+ )),
+ (showFallback.flags |= 2)),
+ (showFallback.return = workInProgress),
+ (nextProps.return = workInProgress),
+ (nextProps.sibling = showFallback),
+ (workInProgress.child = nextProps),
+ (nextProps = showFallback),
+ (showFallback = workInProgress.child),
+ (nextInstance = current.child.memoizedState),
+ null === nextInstance
+ ? (nextInstance = mountSuspenseOffscreenState(renderLanes))
+ : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool),
+ null !== JSCompiler_temp$jscomp$0
+ ? ((digest = CacheContext._currentValue),
+ (JSCompiler_temp$jscomp$0 =
+ JSCompiler_temp$jscomp$0.parent !== digest
+ ? { parent: digest, pool: digest }
+ : JSCompiler_temp$jscomp$0))
+ : (JSCompiler_temp$jscomp$0 = getSuspendedCache()),
+ (nextInstance = {
+ baseLanes: nextInstance.baseLanes | renderLanes,
+ cachePool: JSCompiler_temp$jscomp$0
+ })),
+ (showFallback.memoizedState = nextInstance),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ nextProps
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ renderLanes = current.child;
+ current = renderLanes.sibling;
+ renderLanes = createWorkInProgress(renderLanes, {
+ mode: "visible",
+ children: nextProps.children
+ });
+ renderLanes.return = workInProgress;
+ renderLanes.sibling = null;
+ null !== current &&
+ ((JSCompiler_temp = workInProgress.deletions),
+ null === JSCompiler_temp
+ ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
+ : JSCompiler_temp.push(current));
+ workInProgress.child = renderLanes;
+ workInProgress.memoizedState = null;
+ return renderLanes;
}
-function readContextDuringReconciliation(consumer, context) {
- null === currentlyRenderingFiber && prepareToReadContext(consumer);
- return readContextForConsumer(consumer, context);
+function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: primaryChildren },
+ workInProgress.mode
+ );
+ primaryChildren.return = workInProgress;
+ return (workInProgress.child = primaryChildren);
}
-function readContextForConsumer(consumer, context) {
- var value = context._currentValue;
- context = { context: context, memoizedValue: value, next: null };
- if (null === lastContextDependency) {
- if (null === consumer) throw Error(formatProdErrorMessage(308));
- lastContextDependency = context;
- consumer.dependencies = { lanes: 0, firstContext: context };
- consumer.flags |= 524288;
- } else lastContextDependency = lastContextDependency.next = context;
- return value;
+function mountSuspenseFallbackChildren(
+ workInProgress,
+ primaryChildren,
+ fallbackChildren,
+ renderLanes
+) {
+ var mode = workInProgress.mode;
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "hidden", children: primaryChildren },
+ mode
+ );
+ fallbackChildren = createFiberFromFragment(
+ fallbackChildren,
+ mode,
+ renderLanes,
+ null
+ );
+ primaryChildren.return = workInProgress;
+ fallbackChildren.return = workInProgress;
+ primaryChildren.sibling = fallbackChildren;
+ workInProgress.child = primaryChildren;
+ return fallbackChildren;
}
-var hasForceUpdate = !1;
-function initializeUpdateQueue(fiber) {
- fiber.updateQueue = {
- baseState: fiber.memoizedState,
- firstBaseUpdate: null,
- lastBaseUpdate: null,
- shared: { pending: null, lanes: 0, hiddenCallbacks: null },
- callbacks: null
- };
+function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
+ return createFiberFromOffscreen(offscreenProps, mode, 0, null);
}
-function cloneUpdateQueue(current, workInProgress) {
- current = current.updateQueue;
- workInProgress.updateQueue === current &&
- (workInProgress.updateQueue = {
- baseState: current.baseState,
- firstBaseUpdate: current.firstBaseUpdate,
- lastBaseUpdate: current.lastBaseUpdate,
- shared: current.shared,
- callbacks: null
- });
+function retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+) {
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
+ current = mountSuspensePrimaryChildren(
+ workInProgress,
+ workInProgress.pendingProps.children
+ );
+ current.flags |= 2;
+ workInProgress.memoizedState = null;
+ return current;
}
-function createUpdate(lane) {
- return { lane: lane, tag: 0, payload: null, callback: null, next: null };
+function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
+ fiber.lanes |= renderLanes;
+ var alternate = fiber.alternate;
+ null !== alternate && (alternate.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
}
-function enqueueUpdate(fiber, update, lane) {
- var updateQueue = fiber.updateQueue;
- if (null === updateQueue) return null;
- updateQueue = updateQueue.shared;
- if (0 !== (executionContext & 2)) {
- var pending = updateQueue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- updateQueue.pending = update;
- update = getRootForUpdatedFiber(fiber);
- markUpdateLaneFromFiberToRoot(fiber, null, lane);
- return update;
- }
- enqueueUpdate$1(fiber, updateQueue, update, lane);
- return getRootForUpdatedFiber(fiber);
+function initSuspenseListRenderState(
+ workInProgress,
+ isBackwards,
+ tail,
+ lastContentRow,
+ tailMode
+) {
+ var renderState = workInProgress.memoizedState;
+ null === renderState
+ ? (workInProgress.memoizedState = {
+ isBackwards: isBackwards,
+ rendering: null,
+ renderingStartTime: 0,
+ last: lastContentRow,
+ tail: tail,
+ tailMode: tailMode
+ })
+ : ((renderState.isBackwards = isBackwards),
+ (renderState.rendering = null),
+ (renderState.renderingStartTime = 0),
+ (renderState.last = lastContentRow),
+ (renderState.tail = tail),
+ (renderState.tailMode = tailMode));
}
-function entangleTransitions(root, fiber, lane) {
- fiber = fiber.updateQueue;
- if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
- var queueLanes = fiber.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- fiber.lanes = lane;
- markRootEntangled(root, lane);
+function updateSuspenseListComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ revealOrder = nextProps.revealOrder,
+ tailMode = nextProps.tail;
+ reconcileChildren(current, workInProgress, nextProps.children, renderLanes);
+ nextProps = suspenseStackCursor.current;
+ if (0 !== (nextProps & 2))
+ (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128);
+ else {
+ if (null !== current && 0 !== (current.flags & 128))
+ a: for (current = workInProgress.child; null !== current; ) {
+ if (13 === current.tag)
+ null !== current.memoizedState &&
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (19 === current.tag)
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (null !== current.child) {
+ current.child.return = current;
+ current = current.child;
+ continue;
+ }
+ if (current === workInProgress) break a;
+ for (; null === current.sibling; ) {
+ if (null === current.return || current.return === workInProgress)
+ break a;
+ current = current.return;
+ }
+ current.sibling.return = current.return;
+ current = current.sibling;
+ }
+ nextProps &= 1;
}
-}
-function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
- var queue = workInProgress.updateQueue,
- current = workInProgress.alternate;
- if (
- null !== current &&
- ((current = current.updateQueue), queue === current)
- ) {
- var newFirst = null,
- newLast = null;
- queue = queue.firstBaseUpdate;
- if (null !== queue) {
- do {
- var clone = {
- lane: queue.lane,
- tag: queue.tag,
- payload: queue.payload,
- callback: null,
- next: null
- };
- null === newLast
- ? (newFirst = newLast = clone)
- : (newLast = newLast.next = clone);
- queue = queue.next;
- } while (null !== queue);
- null === newLast
- ? (newFirst = newLast = capturedUpdate)
- : (newLast = newLast.next = capturedUpdate);
- } else newFirst = newLast = capturedUpdate;
- queue = {
- baseState: current.baseState,
- firstBaseUpdate: newFirst,
- lastBaseUpdate: newLast,
- shared: current.shared,
- callbacks: current.callbacks
- };
- workInProgress.updateQueue = queue;
- return;
+ 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;
+ 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;
}
- workInProgress = queue.lastBaseUpdate;
- null === workInProgress
- ? (queue.firstBaseUpdate = capturedUpdate)
- : (workInProgress.next = capturedUpdate);
- queue.lastBaseUpdate = capturedUpdate;
+ return workInProgress.child;
}
-var didReadFromEntangledAsyncAction = !1;
-function suspendIfUpdateReadFromEntangledAsyncAction() {
- if (didReadFromEntangledAsyncAction) {
- var entangledActionThenable = currentEntangledActionThenable;
- if (null !== entangledActionThenable) throw entangledActionThenable;
+function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
+ null !== current && (workInProgress.dependencies = current.dependencies);
+ workInProgressRootSkippedLanes |= workInProgress.lanes;
+ if (0 === (renderLanes & workInProgress.childLanes))
+ if (null !== current) {
+ if (
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ 0 === (renderLanes & workInProgress.childLanes))
+ )
+ return null;
+ } else return null;
+ if (null !== current && workInProgress.child !== current.child)
+ throw Error(formatProdErrorMessage(153));
+ if (null !== workInProgress.child) {
+ current = workInProgress.child;
+ renderLanes = createWorkInProgress(current, current.pendingProps);
+ workInProgress.child = renderLanes;
+ for (renderLanes.return = workInProgress; null !== current.sibling; )
+ (current = current.sibling),
+ (renderLanes = renderLanes.sibling =
+ createWorkInProgress(current, current.pendingProps)),
+ (renderLanes.return = workInProgress);
+ renderLanes.sibling = null;
}
+ return workInProgress.child;
}
-function processUpdateQueue(
- workInProgress$jscomp$0,
- props,
- instance$jscomp$0,
+function checkScheduledUpdateOrContext(current, renderLanes) {
+ if (0 !== (current.lanes & renderLanes)) return !0;
+ current = current.dependencies;
+ return null !== current && checkIfContextChanged(current) ? !0 : !1;
+}
+function attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
renderLanes
) {
- didReadFromEntangledAsyncAction = !1;
- var queue = workInProgress$jscomp$0.updateQueue;
- hasForceUpdate = !1;
- var firstBaseUpdate = queue.firstBaseUpdate,
- lastBaseUpdate = queue.lastBaseUpdate,
- pendingQueue = queue.shared.pending;
- if (null !== pendingQueue) {
- queue.shared.pending = null;
- var lastPendingUpdate = pendingQueue,
- firstPendingUpdate = lastPendingUpdate.next;
- lastPendingUpdate.next = null;
- null === lastBaseUpdate
- ? (firstBaseUpdate = firstPendingUpdate)
- : (lastBaseUpdate.next = firstPendingUpdate);
- lastBaseUpdate = lastPendingUpdate;
- var current = workInProgress$jscomp$0.alternate;
- null !== current &&
- ((current = current.updateQueue),
- (pendingQueue = current.lastBaseUpdate),
- pendingQueue !== lastBaseUpdate &&
- (null === pendingQueue
- ? (current.firstBaseUpdate = firstPendingUpdate)
- : (pendingQueue.next = firstPendingUpdate),
- (current.lastBaseUpdate = lastPendingUpdate)));
+ switch (workInProgress.tag) {
+ case 3:
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
+ pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
+ resetHydrationState();
+ break;
+ case 27:
+ case 5:
+ pushHostContext(workInProgress);
+ break;
+ case 4:
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
+ break;
+ case 10:
+ pushProvider(
+ workInProgress,
+ workInProgress.type,
+ workInProgress.memoizedProps.value
+ );
+ break;
+ case 13:
+ var state = workInProgress.memoizedState;
+ if (null !== state) {
+ if (null !== state.dehydrated)
+ return (
+ pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags |= 128),
+ null
+ );
+ if (0 !== (renderLanes & workInProgress.child.childLanes))
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ current = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ return null !== current ? current.sibling : null;
+ }
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ break;
+ case 19:
+ var didSuspendBefore = 0 !== (current.flags & 128);
+ state = 0 !== (renderLanes & workInProgress.childLanes);
+ state ||
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (state = 0 !== (renderLanes & workInProgress.childLanes)));
+ if (didSuspendBefore) {
+ if (state)
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ workInProgress.flags |= 128;
+ }
+ didSuspendBefore = workInProgress.memoizedState;
+ null !== didSuspendBefore &&
+ ((didSuspendBefore.rendering = null),
+ (didSuspendBefore.tail = null),
+ (didSuspendBefore.lastEffect = null));
+ push(suspenseStackCursor, suspenseStackCursor.current);
+ if (state) break;
+ else return null;
+ case 22:
+ case 23:
+ return (
+ (workInProgress.lanes = 0),
+ updateOffscreenComponent(current, workInProgress, renderLanes)
+ );
+ case 24:
+ pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
}
- if (null !== firstBaseUpdate) {
- var newState = queue.baseState;
- lastBaseUpdate = 0;
- current = firstPendingUpdate = lastPendingUpdate = null;
- pendingQueue = firstBaseUpdate;
- do {
- var updateLane = pendingQueue.lane & -536870913,
- isHiddenUpdate = updateLane !== pendingQueue.lane;
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+}
+function beginWork(current, workInProgress, renderLanes) {
+ if (null !== current)
+ if (current.memoizedProps !== workInProgress.pendingProps)
+ didReceiveUpdate = !0;
+ else {
if (
- isHiddenUpdate
- ? (workInProgressRootRenderLanes & updateLane) === updateLane
- : (renderLanes & updateLane) === updateLane
- ) {
- 0 !== updateLane &&
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- null !== current &&
- (current = current.next =
- {
- lane: 0,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: null,
- next: null
- });
- a: {
- var workInProgress = workInProgress$jscomp$0,
- update = pendingQueue;
- updateLane = props;
- var instance = instance$jscomp$0;
- switch (update.tag) {
- case 1:
- workInProgress = update.payload;
- if ("function" === typeof workInProgress) {
- newState = workInProgress.call(instance, newState, updateLane);
- break a;
- }
- newState = workInProgress;
+ !checkScheduledUpdateOrContext(current, renderLanes) &&
+ 0 === (workInProgress.flags & 128)
+ )
+ return (
+ (didReceiveUpdate = !1),
+ attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ )
+ );
+ didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ }
+ else
+ (didReceiveUpdate = !1),
+ isHydrating &&
+ 0 !== (workInProgress.flags & 1048576) &&
+ pushTreeId(workInProgress, treeForkCount, workInProgress.index);
+ workInProgress.lanes = 0;
+ switch (workInProgress.tag) {
+ case 16:
+ a: {
+ current = workInProgress.pendingProps;
+ var lazyComponent = workInProgress.elementType,
+ init = lazyComponent._init;
+ lazyComponent = init(lazyComponent._payload);
+ workInProgress.type = lazyComponent;
+ if ("function" === typeof lazyComponent)
+ shouldConstruct(lazyComponent)
+ ? ((current = resolveClassComponentProps(lazyComponent, current)),
+ (workInProgress.tag = 1),
+ (workInProgress = updateClassComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ )))
+ : ((workInProgress.tag = 0),
+ (workInProgress = updateFunctionComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ )));
+ else {
+ if (void 0 !== lazyComponent && null !== lazyComponent)
+ if (
+ ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE)
+ ) {
+ workInProgress.tag = 11;
+ workInProgress = updateForwardRef(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ );
break a;
- case 3:
- workInProgress.flags = (workInProgress.flags & -65537) | 128;
- case 0:
- workInProgress = update.payload;
- updateLane =
- "function" === typeof workInProgress
- ? workInProgress.call(instance, newState, updateLane)
- : workInProgress;
- if (null === updateLane || void 0 === updateLane) break a;
- newState = assign({}, newState, updateLane);
+ } else if (init === REACT_MEMO_TYPE) {
+ workInProgress.tag = 14;
+ workInProgress = updateMemoComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ );
break a;
- case 2:
- hasForceUpdate = !0;
+ }
+ workInProgress =
+ getComponentNameFromType(lazyComponent) || lazyComponent;
+ throw Error(formatProdErrorMessage(306, workInProgress, ""));
+ }
+ }
+ return workInProgress;
+ case 0:
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 1:
+ return (
+ (lazyComponent = workInProgress.type),
+ (init = resolveClassComponentProps(
+ lazyComponent,
+ workInProgress.pendingProps
+ )),
+ updateClassComponent(
+ current,
+ workInProgress,
+ lazyComponent,
+ init,
+ renderLanes
+ )
+ );
+ case 3:
+ a: {
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ if (null === current) throw Error(formatProdErrorMessage(387));
+ var nextProps = workInProgress.pendingProps;
+ init = workInProgress.memoizedState;
+ lazyComponent = init.element;
+ cloneUpdateQueue(current, workInProgress);
+ processUpdateQueue(workInProgress, nextProps, null, renderLanes);
+ var nextState = workInProgress.memoizedState;
+ nextProps = nextState.cache;
+ pushProvider(workInProgress, CacheContext, nextProps);
+ nextProps !== init.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ );
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ nextProps = nextState.element;
+ if (init.isDehydrated)
+ if (
+ ((init = {
+ element: nextProps,
+ isDehydrated: !1,
+ cache: nextState.cache
+ }),
+ (workInProgress.updateQueue.baseState = init),
+ (workInProgress.memoizedState = init),
+ workInProgress.flags & 256)
+ ) {
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else if (nextProps !== lazyComponent) {
+ lazyComponent = createCapturedValueAtFiber(
+ Error(formatProdErrorMessage(424)),
+ workInProgress
+ );
+ queueHydrationError(lazyComponent);
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else
+ for (
+ nextHydratableInstance = getNextHydratable(
+ workInProgress.stateNode.containerInfo.firstChild
+ ),
+ hydrationParentFiber = workInProgress,
+ isHydrating = !0,
+ hydrationErrors = null,
+ rootOrSingletonContext = !0,
+ renderLanes = mountChildFibers(
+ workInProgress,
+ null,
+ nextProps,
+ renderLanes
+ ),
+ workInProgress.child = renderLanes;
+ renderLanes;
+
+ )
+ (renderLanes.flags = (renderLanes.flags & -3) | 4096),
+ (renderLanes = renderLanes.sibling);
+ else {
+ resetHydrationState();
+ if (nextProps === lazyComponent) {
+ workInProgress = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ break a;
}
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
}
- updateLane = pendingQueue.callback;
- null !== updateLane &&
- ((workInProgress$jscomp$0.flags |= 64),
- isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),
- (isHiddenUpdate = queue.callbacks),
- null === isHiddenUpdate
- ? (queue.callbacks = [updateLane])
- : isHiddenUpdate.push(updateLane));
- } else
- (isHiddenUpdate = {
- lane: updateLane,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: pendingQueue.callback,
- next: null
- }),
- null === current
- ? ((firstPendingUpdate = current = isHiddenUpdate),
- (lastPendingUpdate = newState))
- : (current = current.next = isHiddenUpdate),
- (lastBaseUpdate |= updateLane);
- pendingQueue = pendingQueue.next;
- if (null === pendingQueue)
- if (((pendingQueue = queue.shared.pending), null === pendingQueue))
- break;
- else
- (isHiddenUpdate = pendingQueue),
- (pendingQueue = isHiddenUpdate.next),
- (isHiddenUpdate.next = null),
- (queue.lastBaseUpdate = isHiddenUpdate),
- (queue.shared.pending = null);
- } while (1);
- null === current && (lastPendingUpdate = newState);
- queue.baseState = lastPendingUpdate;
- queue.firstBaseUpdate = firstPendingUpdate;
- queue.lastBaseUpdate = current;
- null === firstBaseUpdate && (queue.shared.lanes = 0);
- workInProgressRootSkippedLanes |= lastBaseUpdate;
- workInProgress$jscomp$0.lanes = lastBaseUpdate;
- workInProgress$jscomp$0.memoizedState = newState;
+ workInProgress = workInProgress.child;
+ }
+ return workInProgress;
+ case 26:
+ return (
+ markRef(current, workInProgress),
+ null === current
+ ? (renderLanes = getResource(
+ workInProgress.type,
+ null,
+ workInProgress.pendingProps,
+ null
+ ))
+ ? (workInProgress.memoizedState = renderLanes)
+ : isHydrating ||
+ ((renderLanes = workInProgress.type),
+ (current = workInProgress.pendingProps),
+ (lazyComponent = getOwnerDocumentFromRootContainer(
+ rootInstanceStackCursor.current
+ ).createElement(renderLanes)),
+ (lazyComponent[internalInstanceKey] = workInProgress),
+ (lazyComponent[internalPropsKey] = current),
+ setInitialProperties(lazyComponent, renderLanes, current),
+ markNodeAsHoistable(lazyComponent),
+ (workInProgress.stateNode = lazyComponent))
+ : (workInProgress.memoizedState = getResource(
+ workInProgress.type,
+ current.memoizedProps,
+ workInProgress.pendingProps,
+ current.memoizedState
+ )),
+ null
+ );
+ case 27:
+ return (
+ pushHostContext(workInProgress),
+ null === current &&
+ isHydrating &&
+ ((lazyComponent = workInProgress.stateNode =
+ resolveSingletonInstance(
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootInstanceStackCursor.current
+ )),
+ (hydrationParentFiber = workInProgress),
+ (rootOrSingletonContext = !0),
+ (nextHydratableInstance = getNextHydratable(
+ lazyComponent.firstChild
+ ))),
+ (lazyComponent = workInProgress.pendingProps.children),
+ null !== current || isHydrating
+ ? reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent,
+ renderLanes
+ )
+ : (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ lazyComponent,
+ renderLanes
+ )),
+ markRef(current, workInProgress),
+ workInProgress.child
+ );
+ case 5:
+ if (null === current && isHydrating) {
+ if ((init = lazyComponent = nextHydratableInstance))
+ (lazyComponent = canHydrateInstance(
+ lazyComponent,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== lazyComponent
+ ? ((workInProgress.stateNode = lazyComponent),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = getNextHydratable(
+ lazyComponent.firstChild
+ )),
+ (rootOrSingletonContext = !1),
+ (init = !0))
+ : (init = !1);
+ init || throwOnHydrationMismatch(workInProgress);
+ }
+ pushHostContext(workInProgress);
+ init = workInProgress.type;
+ nextProps = workInProgress.pendingProps;
+ nextState = null !== current ? current.memoizedProps : null;
+ lazyComponent = nextProps.children;
+ shouldSetTextContent(init, nextProps)
+ ? (lazyComponent = null)
+ : null !== nextState &&
+ shouldSetTextContent(init, nextState) &&
+ (workInProgress.flags |= 32);
+ null !== workInProgress.memoizedState &&
+ ((init = renderWithHooks(
+ current,
+ workInProgress,
+ TransitionAwareHostComponent,
+ null,
+ null,
+ renderLanes
+ )),
+ (HostTransitionContext._currentValue = init));
+ markRef(current, workInProgress);
+ reconcileChildren(current, workInProgress, lazyComponent, renderLanes);
+ return workInProgress.child;
+ case 6:
+ if (null === current && isHydrating) {
+ if ((current = renderLanes = nextHydratableInstance))
+ (renderLanes = canHydrateTextInstance(
+ renderLanes,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== renderLanes
+ ? ((workInProgress.stateNode = renderLanes),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (current = !0))
+ : (current = !1);
+ current || throwOnHydrationMismatch(workInProgress);
+ }
+ return null;
+ case 13:
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ case 4:
+ return (
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ ),
+ (lazyComponent = workInProgress.pendingProps),
+ null === current
+ ? (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ lazyComponent,
+ renderLanes
+ ))
+ : reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 11:
+ return updateForwardRef(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 7:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 8:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 12:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 10:
+ return (
+ (lazyComponent = workInProgress.pendingProps),
+ pushProvider(workInProgress, workInProgress.type, lazyComponent.value),
+ reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 9:
+ return (
+ (init = workInProgress.type._context),
+ (lazyComponent = workInProgress.pendingProps.children),
+ prepareToReadContext(workInProgress),
+ (init = readContext(init)),
+ (lazyComponent = lazyComponent(init)),
+ (workInProgress.flags |= 1),
+ reconcileChildren(current, workInProgress, lazyComponent, renderLanes),
+ workInProgress.child
+ );
+ case 14:
+ return updateMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 15:
+ return updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 19:
+ return updateSuspenseListComponent(current, workInProgress, renderLanes);
+ case 22:
+ return updateOffscreenComponent(current, workInProgress, renderLanes);
+ case 24:
+ return (
+ prepareToReadContext(workInProgress),
+ (lazyComponent = readContext(CacheContext)),
+ null === current
+ ? ((init = peekCacheFromPool()),
+ null === init &&
+ ((init = workInProgressRoot),
+ (nextProps = createCache()),
+ (init.pooledCache = nextProps),
+ nextProps.refCount++,
+ null !== nextProps && (init.pooledCacheLanes |= renderLanes),
+ (init = nextProps)),
+ (workInProgress.memoizedState = {
+ parent: lazyComponent,
+ cache: init
+ }),
+ initializeUpdateQueue(workInProgress),
+ pushProvider(workInProgress, CacheContext, init))
+ : (0 !== (current.lanes & renderLanes) &&
+ (cloneUpdateQueue(current, workInProgress),
+ processUpdateQueue(workInProgress, null, null, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction()),
+ (init = current.memoizedState),
+ (nextProps = workInProgress.memoizedState),
+ init.parent !== lazyComponent
+ ? ((init = { parent: lazyComponent, cache: lazyComponent }),
+ (workInProgress.memoizedState = init),
+ 0 === workInProgress.lanes &&
+ (workInProgress.memoizedState =
+ workInProgress.updateQueue.baseState =
+ init),
+ pushProvider(workInProgress, CacheContext, lazyComponent))
+ : ((lazyComponent = nextProps.cache),
+ pushProvider(workInProgress, CacheContext, lazyComponent),
+ lazyComponent !== init.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ ))),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 29:
+ throw workInProgress.pendingProps;
}
-}
-function callCallback(callback, context) {
- if ("function" !== typeof callback)
- throw Error(formatProdErrorMessage(191, callback));
- callback.call(context);
-}
-function commitCallbacks(updateQueue, context) {
- var callbacks = updateQueue.callbacks;
- if (null !== callbacks)
- for (
- updateQueue.callbacks = null, updateQueue = 0;
- updateQueue < callbacks.length;
- updateQueue++
- )
- callCallback(callbacks[updateQueue], context);
+ throw Error(formatProdErrorMessage(156, workInProgress.tag));
}
function commitHookEffectListMount(flags, finishedWork) {
try {
@@ -9175,6 +9197,14 @@ function commitPassiveMountOnFiber(
committedTransitions
);
break;
+ case 13:
+ recursivelyTraversePassiveMountEffects(
+ finishedRoot,
+ finishedWork,
+ committedLanes,
+ committedTransitions
+ );
+ break;
case 23:
break;
case 22:
@@ -9888,9 +9918,7 @@ function completeWork(current, workInProgress, renderLanes) {
(current.memoizedState.isDehydrated &&
0 === (workInProgress.flags & 256)) ||
((workInProgress.flags |= 1024),
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)));
+ upgradeHydrationErrorsToRecoverable());
bubbleProperties(workInProgress);
return null;
case 26:
@@ -10104,8 +10132,10 @@ function completeWork(current, workInProgress, renderLanes) {
bubbleProperties(workInProgress);
type = !1;
} else
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)),
+ (type = upgradeHydrationErrorsToRecoverable()),
+ null !== current &&
+ null !== current.memoizedState &&
+ (current.memoizedState.hydrationErrors = type),
(type = !0);
if (!type) {
if (workInProgress.flags & 256)
@@ -10126,11 +10156,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(type = newProps.alternate.memoizedState.cachePool.pool);
- var cache$147 = null;
+ var cache$148 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
- (cache$147 = newProps.memoizedState.cachePool.pool);
- cache$147 !== type && (newProps.flags |= 2048);
+ (cache$148 = newProps.memoizedState.cachePool.pool);
+ cache$148 !== type && (newProps.flags |= 2048);
}
renderLanes !== current &&
renderLanes &&
@@ -10155,8 +10185,8 @@ function completeWork(current, workInProgress, renderLanes) {
type = workInProgress.memoizedState;
if (null === type) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
- cache$147 = type.rendering;
- if (null === cache$147)
+ cache$148 = type.rendering;
+ if (null === cache$148)
if (newProps) cutOffTailIfNeeded(type, !1);
else {
if (
@@ -10164,11 +10194,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
- cache$147 = findFirstSuspended(current);
- if (null !== cache$147) {
+ cache$148 = findFirstSuspended(current);
+ if (null !== cache$148) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(type, !1);
- current = cache$147.updateQueue;
+ current = cache$148.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -10193,7 +10223,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
- if (((current = findFirstSuspended(cache$147)), null !== current)) {
+ if (((current = findFirstSuspended(cache$148)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -10203,7 +10233,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(type, !0),
null === type.tail &&
"hidden" === type.tailMode &&
- !cache$147.alternate &&
+ !cache$148.alternate &&
!isHydrating)
)
return bubbleProperties(workInProgress), null;
@@ -10216,13 +10246,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(type, !1),
(workInProgress.lanes = 4194304));
type.isBackwards
- ? ((cache$147.sibling = workInProgress.child),
- (workInProgress.child = cache$147))
+ ? ((cache$148.sibling = workInProgress.child),
+ (workInProgress.child = cache$148))
: ((current = type.last),
null !== current
- ? (current.sibling = cache$147)
- : (workInProgress.child = cache$147),
- (type.last = cache$147));
+ ? (current.sibling = cache$148)
+ : (workInProgress.child = cache$148),
+ (type.last = cache$148));
}
if (null !== type.tail)
return (
@@ -10412,7 +10442,6 @@ var DefaultAsyncDispatcher = {
workInProgressRootRenderTargetTime = Infinity,
workInProgressTransitions = null,
legacyErrorBoundariesThatAlreadyFailed = null,
- rootDoesHavePassiveEffects = !1,
rootWithPendingPassiveEffects = null,
pendingPassiveEffectsLanes = 0,
pendingPassiveEffectsRemainingLanes = 0,
@@ -10532,7 +10561,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
renderWasConcurrent = workInProgressRootRecoverableErrors;
workInProgressRootRecoverableErrors = exitStatus;
null !== renderWasConcurrent &&
- queueRecoverableErrors(renderWasConcurrent);
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = renderWasConcurrent)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ renderWasConcurrent
+ ));
}
exitStatus = JSCompiler_inline_result;
}
@@ -10629,14 +10663,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
} while (1);
ensureRootIsScheduled(root$jscomp$0);
}
-function queueRecoverableErrors(errors) {
- null === workInProgressRootRecoverableErrors
- ? (workInProgressRootRecoverableErrors = errors)
- : workInProgressRootRecoverableErrors.push.apply(
- workInProgressRootRecoverableErrors,
- errors
- );
-}
function commitRootWhenReady(
root,
finishedWork,
@@ -10760,7 +10786,7 @@ function resetWorkInProgressStack() {
var interruptedWork = workInProgress.return;
else
(interruptedWork = workInProgress),
- (lastContextDependency = currentlyRenderingFiber = null),
+ (lastContextDependency = currentlyRenderingFiber$1 = null),
resetHooksOnUnwind(interruptedWork),
(thenableState = null),
(thenableIndexCounter = 0),
@@ -10817,7 +10843,7 @@ function prepareFreshStack(root, lanes) {
return timeoutHandle;
}
function handleThrow(root, thrownValue) {
- currentlyRenderingFiber$1 = null;
+ currentlyRenderingFiber = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
thrownValue === SuspenseException || thrownValue === SuspenseActionException
? ((thrownValue = getSuspendedThenable()),
@@ -10919,12 +10945,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) {
workLoopSync();
exitStatus = workInProgressRootExitStatus;
break;
- } catch (thrownValue$166) {
- handleThrow(root, thrownValue$166);
+ } catch (thrownValue$167) {
+ handleThrow(root, thrownValue$167);
}
while (1);
lanes && root.shellSuspendCounter++;
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
executionContext = prevExecutionContext;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
@@ -11035,11 +11061,11 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
- } catch (thrownValue$168) {
- handleThrow(root, thrownValue$168);
+ } catch (thrownValue$169) {
+ handleThrow(root, thrownValue$169);
}
while (1);
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
executionContext = prevExecutionContext;
@@ -11100,7 +11126,7 @@ function throwAndUnwindWorkLoop(
thrownValue,
suspendedReason
) {
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
resetHooksOnUnwind(unitOfWork);
thenableState = null;
thenableIndexCounter = 0;
@@ -11262,9 +11288,6 @@ function commitRootImpl(
root.finishedWork = null;
root.finishedLanes = 0;
if (finishedWork === root.current) throw Error(formatProdErrorMessage(177));
- root.callbackNode = null;
- root.callbackPriority = 0;
- root.cancelPendingCommit = null;
var remainingLanes = finishedWork.lanes | finishedWork.childLanes;
remainingLanes |= concurrentlyUpdatedLanes;
markRootFinished(
@@ -11278,23 +11301,29 @@ function commitRootImpl(
root === workInProgressRoot &&
((workInProgress = workInProgressRoot = null),
(workInProgressRootRenderLanes = 0));
- (0 === (finishedWork.subtreeFlags & 10256) &&
- 0 === (finishedWork.flags & 10256)) ||
- rootDoesHavePassiveEffects ||
- ((rootDoesHavePassiveEffects = !0),
- (pendingPassiveEffectsRemainingLanes = remainingLanes),
- (pendingPassiveTransitions = transitions),
- scheduleCallback$1(NormalPriority$1, function () {
- flushPassiveEffects(!0);
- return null;
- }));
+ spawnedLane = !1;
+ 0 !== (finishedWork.subtreeFlags & 10256) ||
+ 0 !== (finishedWork.flags & 10256)
+ ? ((spawnedLane = !0),
+ (pendingPassiveEffectsRemainingLanes = remainingLanes),
+ (pendingPassiveTransitions = transitions),
+ (root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null),
+ scheduleCallback$1(NormalPriority$1, function () {
+ flushPassiveEffects(!0);
+ return null;
+ }))
+ : ((root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null));
transitions = 0 !== (finishedWork.flags & 15990);
0 !== (finishedWork.subtreeFlags & 15990) || transitions
? ((transitions = ReactSharedInternals.T),
(ReactSharedInternals.T = null),
- (spawnedLane = ReactDOMSharedInternals.p),
+ (updatedLanes = ReactDOMSharedInternals.p),
(ReactDOMSharedInternals.p = 2),
- (updatedLanes = executionContext),
+ (suspendedRetryLanes = executionContext),
(executionContext |= 4),
commitBeforeMutationEffects(root, finishedWork),
commitMutationEffectsOnFiber(finishedWork, root),
@@ -11304,19 +11333,18 @@ function commitRootImpl(
(root.current = finishedWork),
commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork),
requestPaint(),
- (executionContext = updatedLanes),
- (ReactDOMSharedInternals.p = spawnedLane),
+ (executionContext = suspendedRetryLanes),
+ (ReactDOMSharedInternals.p = updatedLanes),
(ReactSharedInternals.T = transitions))
: (root.current = finishedWork);
- rootDoesHavePassiveEffects
- ? ((rootDoesHavePassiveEffects = !1),
+ spawnedLane
+ ? ((spawnedLane = !1),
(rootWithPendingPassiveEffects = root),
(pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate))
: releaseRootPooledCache(root, remainingLanes);
remainingLanes = root.pendingLanes;
0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
- ensureRootIsScheduled(root);
if (null !== recoverableErrors)
for (
renderPriorityLevel = root.onRecoverableError, finishedWork = 0;
@@ -11328,6 +11356,7 @@ function commitRootImpl(
componentStack: remainingLanes.stack
});
0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects();
+ ensureRootIsScheduled(root);
remainingLanes = root.pendingLanes;
0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42)
? root === rootWithNestedUpdates
@@ -11345,7 +11374,7 @@ function releaseRootPooledCache(root, remainingLanes) {
}
function flushPassiveEffects() {
if (null !== rootWithPendingPassiveEffects) {
- var root$172 = rootWithPendingPassiveEffects,
+ var root$173 = rootWithPendingPassiveEffects,
remainingLanes = pendingPassiveEffectsRemainingLanes;
pendingPassiveEffectsRemainingLanes = 0;
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes),
@@ -11384,7 +11413,7 @@ function flushPassiveEffects() {
} finally {
(ReactDOMSharedInternals.p = previousPriority),
(ReactSharedInternals.T = prevTransition),
- releaseRootPooledCache(root$172, remainingLanes);
+ releaseRootPooledCache(root$173, remainingLanes);
}
}
return !1;
@@ -11527,14 +11556,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
isFlushingWork = !0;
do {
var didPerformSomeWork = !1;
- for (var root$174 = firstScheduledRoot; null !== root$174; ) {
+ for (var root$175 = firstScheduledRoot; null !== root$175; ) {
if (!onlyLegacy)
if (0 !== syncTransitionLanes) {
- var pendingLanes = root$174.pendingLanes;
+ var pendingLanes = root$175.pendingLanes;
if (0 === pendingLanes) var JSCompiler_inline_result = 0;
else {
- var suspendedLanes = root$174.suspendedLanes,
- pingedLanes = root$174.pingedLanes;
+ var suspendedLanes = root$175.suspendedLanes,
+ pingedLanes = root$175.pingedLanes;
JSCompiler_inline_result =
(1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1;
JSCompiler_inline_result &=
@@ -11548,18 +11577,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
}
0 !== JSCompiler_inline_result &&
((didPerformSomeWork = !0),
- performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
+ performSyncWorkOnRoot(root$175, JSCompiler_inline_result));
} else
(JSCompiler_inline_result = workInProgressRootRenderLanes),
(JSCompiler_inline_result = getNextLanes(
- root$174,
- root$174 === workInProgressRoot ? JSCompiler_inline_result : 0
+ root$175,
+ root$175 === workInProgressRoot ? JSCompiler_inline_result : 0
)),
0 === (JSCompiler_inline_result & 3) ||
- checkIfRootIsPrerendering(root$174, JSCompiler_inline_result) ||
+ checkIfRootIsPrerendering(root$175, JSCompiler_inline_result) ||
((didPerformSomeWork = !0),
- performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
- root$174 = root$174.next;
+ performSyncWorkOnRoot(root$175, JSCompiler_inline_result));
+ root$175 = root$175.next;
}
} while (didPerformSomeWork);
isFlushingWork = !1;
@@ -11789,20 +11818,20 @@ function extractEvents$1(
}
}
for (
- var i$jscomp$inline_1429 = 0;
- i$jscomp$inline_1429 < simpleEventPluginEvents.length;
- i$jscomp$inline_1429++
+ var i$jscomp$inline_1425 = 0;
+ i$jscomp$inline_1425 < simpleEventPluginEvents.length;
+ i$jscomp$inline_1425++
) {
- var eventName$jscomp$inline_1430 =
- simpleEventPluginEvents[i$jscomp$inline_1429],
- domEventName$jscomp$inline_1431 =
- eventName$jscomp$inline_1430.toLowerCase(),
- capitalizedEvent$jscomp$inline_1432 =
- eventName$jscomp$inline_1430[0].toUpperCase() +
- eventName$jscomp$inline_1430.slice(1);
+ var eventName$jscomp$inline_1426 =
+ simpleEventPluginEvents[i$jscomp$inline_1425],
+ domEventName$jscomp$inline_1427 =
+ eventName$jscomp$inline_1426.toLowerCase(),
+ capitalizedEvent$jscomp$inline_1428 =
+ eventName$jscomp$inline_1426[0].toUpperCase() +
+ eventName$jscomp$inline_1426.slice(1);
registerSimpleEvent(
- domEventName$jscomp$inline_1431,
- "on" + capitalizedEvent$jscomp$inline_1432
+ domEventName$jscomp$inline_1427,
+ "on" + capitalizedEvent$jscomp$inline_1428
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -12985,34 +13014,34 @@ function setInitialProperties(domElement, tag, props) {
defaultChecked = null;
for (hasSrc in props)
if (props.hasOwnProperty(hasSrc)) {
- var propValue$188 = props[hasSrc];
- if (null != propValue$188)
+ var propValue$189 = props[hasSrc];
+ if (null != propValue$189)
switch (hasSrc) {
case "name":
- hasSrcSet = propValue$188;
+ hasSrcSet = propValue$189;
break;
case "type":
- propValue = propValue$188;
+ propValue = propValue$189;
break;
case "checked":
- checked = propValue$188;
+ checked = propValue$189;
break;
case "defaultChecked":
- defaultChecked = propValue$188;
+ defaultChecked = propValue$189;
break;
case "value":
- propKey = propValue$188;
+ propKey = propValue$189;
break;
case "defaultValue":
- defaultValue = propValue$188;
+ defaultValue = propValue$189;
break;
case "children":
case "dangerouslySetInnerHTML":
- if (null != propValue$188)
+ if (null != propValue$189)
throw Error(formatProdErrorMessage(137, tag));
break;
default:
- setProp(domElement, tag, hasSrc, propValue$188, props, null);
+ setProp(domElement, tag, hasSrc, propValue$189, props, null);
}
}
initInput(
@@ -13149,14 +13178,14 @@ function setInitialProperties(domElement, tag, props) {
return;
default:
if (isCustomElement(tag)) {
- for (propValue$188 in props)
- props.hasOwnProperty(propValue$188) &&
- ((hasSrc = props[propValue$188]),
+ for (propValue$189 in props)
+ props.hasOwnProperty(propValue$189) &&
+ ((hasSrc = props[propValue$189]),
void 0 !== hasSrc &&
setPropOnCustomElement(
domElement,
tag,
- propValue$188,
+ propValue$189,
hasSrc,
props,
void 0
@@ -13204,14 +13233,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(domElement, tag, propKey, null, nextProps, lastProp);
}
}
- for (var propKey$205 in nextProps) {
- var propKey = nextProps[propKey$205];
- lastProp = lastProps[propKey$205];
+ for (var propKey$206 in nextProps) {
+ var propKey = nextProps[propKey$206];
+ lastProp = lastProps[propKey$206];
if (
- nextProps.hasOwnProperty(propKey$205) &&
+ nextProps.hasOwnProperty(propKey$206) &&
(null != propKey || null != lastProp)
)
- switch (propKey$205) {
+ switch (propKey$206) {
case "type":
type = propKey;
break;
@@ -13240,7 +13269,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(
domElement,
tag,
- propKey$205,
+ propKey$206,
propKey,
nextProps,
lastProp
@@ -13259,7 +13288,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
);
return;
case "select":
- propKey = value = defaultValue = propKey$205 = null;
+ propKey = value = defaultValue = propKey$206 = null;
for (type in lastProps)
if (
((lastDefaultValue = lastProps[type]),
@@ -13290,7 +13319,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
)
switch (name) {
case "value":
- propKey$205 = type;
+ propKey$206 = type;
break;
case "defaultValue":
defaultValue = type;
@@ -13311,15 +13340,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
tag = defaultValue;
lastProps = value;
nextProps = propKey;
- null != propKey$205
- ? updateOptions(domElement, !!lastProps, propKey$205, !1)
+ null != propKey$206
+ ? updateOptions(domElement, !!lastProps, propKey$206, !1)
: !!nextProps !== !!lastProps &&
(null != tag
? updateOptions(domElement, !!lastProps, tag, !0)
: updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1));
return;
case "textarea":
- propKey = propKey$205 = null;
+ propKey = propKey$206 = null;
for (defaultValue in lastProps)
if (
((name = lastProps[defaultValue]),
@@ -13343,7 +13372,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
)
switch (value) {
case "value":
- propKey$205 = name;
+ propKey$206 = name;
break;
case "defaultValue":
propKey = name;
@@ -13357,17 +13386,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
name !== type &&
setProp(domElement, tag, value, name, nextProps, type);
}
- updateTextarea(domElement, propKey$205, propKey);
+ updateTextarea(domElement, propKey$206, propKey);
return;
case "option":
- for (var propKey$221 in lastProps)
+ for (var propKey$222 in lastProps)
if (
- ((propKey$205 = lastProps[propKey$221]),
- lastProps.hasOwnProperty(propKey$221) &&
- null != propKey$205 &&
- !nextProps.hasOwnProperty(propKey$221))
+ ((propKey$206 = lastProps[propKey$222]),
+ lastProps.hasOwnProperty(propKey$222) &&
+ null != propKey$206 &&
+ !nextProps.hasOwnProperty(propKey$222))
)
- switch (propKey$221) {
+ switch (propKey$222) {
case "selected":
domElement.selected = !1;
break;
@@ -13375,33 +13404,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(
domElement,
tag,
- propKey$221,
+ propKey$222,
null,
nextProps,
- propKey$205
+ propKey$206
);
}
for (lastDefaultValue in nextProps)
if (
- ((propKey$205 = nextProps[lastDefaultValue]),
+ ((propKey$206 = nextProps[lastDefaultValue]),
(propKey = lastProps[lastDefaultValue]),
nextProps.hasOwnProperty(lastDefaultValue) &&
- propKey$205 !== propKey &&
- (null != propKey$205 || null != propKey))
+ propKey$206 !== propKey &&
+ (null != propKey$206 || null != propKey))
)
switch (lastDefaultValue) {
case "selected":
domElement.selected =
- propKey$205 &&
- "function" !== typeof propKey$205 &&
- "symbol" !== typeof propKey$205;
+ propKey$206 &&
+ "function" !== typeof propKey$206 &&
+ "symbol" !== typeof propKey$206;
break;
default:
setProp(
domElement,
tag,
lastDefaultValue,
- propKey$205,
+ propKey$206,
nextProps,
propKey
);
@@ -13422,24 +13451,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
case "track":
case "wbr":
case "menuitem":
- for (var propKey$226 in lastProps)
- (propKey$205 = lastProps[propKey$226]),
- lastProps.hasOwnProperty(propKey$226) &&
- null != propKey$205 &&
- !nextProps.hasOwnProperty(propKey$226) &&
- setProp(domElement, tag, propKey$226, null, nextProps, propKey$205);
+ for (var propKey$227 in lastProps)
+ (propKey$206 = lastProps[propKey$227]),
+ lastProps.hasOwnProperty(propKey$227) &&
+ null != propKey$206 &&
+ !nextProps.hasOwnProperty(propKey$227) &&
+ setProp(domElement, tag, propKey$227, null, nextProps, propKey$206);
for (checked in nextProps)
if (
- ((propKey$205 = nextProps[checked]),
+ ((propKey$206 = nextProps[checked]),
(propKey = lastProps[checked]),
nextProps.hasOwnProperty(checked) &&
- propKey$205 !== propKey &&
- (null != propKey$205 || null != propKey))
+ propKey$206 !== propKey &&
+ (null != propKey$206 || null != propKey))
)
switch (checked) {
case "children":
case "dangerouslySetInnerHTML":
- if (null != propKey$205)
+ if (null != propKey$206)
throw Error(formatProdErrorMessage(137, tag));
break;
default:
@@ -13447,7 +13476,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
domElement,
tag,
checked,
- propKey$205,
+ propKey$206,
nextProps,
propKey
);
@@ -13455,49 +13484,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
return;
default:
if (isCustomElement(tag)) {
- for (var propKey$231 in lastProps)
- (propKey$205 = lastProps[propKey$231]),
- lastProps.hasOwnProperty(propKey$231) &&
- void 0 !== propKey$205 &&
- !nextProps.hasOwnProperty(propKey$231) &&
+ for (var propKey$232 in lastProps)
+ (propKey$206 = lastProps[propKey$232]),
+ lastProps.hasOwnProperty(propKey$232) &&
+ void 0 !== propKey$206 &&
+ !nextProps.hasOwnProperty(propKey$232) &&
setPropOnCustomElement(
domElement,
tag,
- propKey$231,
+ propKey$232,
void 0,
nextProps,
- propKey$205
+ propKey$206
);
for (defaultChecked in nextProps)
- (propKey$205 = nextProps[defaultChecked]),
+ (propKey$206 = nextProps[defaultChecked]),
(propKey = lastProps[defaultChecked]),
!nextProps.hasOwnProperty(defaultChecked) ||
- propKey$205 === propKey ||
- (void 0 === propKey$205 && void 0 === propKey) ||
+ propKey$206 === propKey ||
+ (void 0 === propKey$206 && void 0 === propKey) ||
setPropOnCustomElement(
domElement,
tag,
defaultChecked,
- propKey$205,
+ propKey$206,
nextProps,
propKey
);
return;
}
}
- for (var propKey$236 in lastProps)
- (propKey$205 = lastProps[propKey$236]),
- lastProps.hasOwnProperty(propKey$236) &&
- null != propKey$205 &&
- !nextProps.hasOwnProperty(propKey$236) &&
- setProp(domElement, tag, propKey$236, null, nextProps, propKey$205);
+ for (var propKey$237 in lastProps)
+ (propKey$206 = lastProps[propKey$237]),
+ lastProps.hasOwnProperty(propKey$237) &&
+ null != propKey$206 &&
+ !nextProps.hasOwnProperty(propKey$237) &&
+ setProp(domElement, tag, propKey$237, null, nextProps, propKey$206);
for (lastProp in nextProps)
- (propKey$205 = nextProps[lastProp]),
+ (propKey$206 = nextProps[lastProp]),
(propKey = lastProps[lastProp]),
!nextProps.hasOwnProperty(lastProp) ||
- propKey$205 === propKey ||
- (null == propKey$205 && null == propKey) ||
- setProp(domElement, tag, lastProp, propKey$205, nextProps, propKey);
+ propKey$206 === propKey ||
+ (null == propKey$206 && null == propKey) ||
+ setProp(domElement, tag, lastProp, propKey$206, nextProps, propKey);
}
var eventsEnabled = null,
selectionInformation = null;
@@ -14061,26 +14090,26 @@ function getResource(type, currentProps, pendingProps, currentResource) {
"string" === typeof pendingProps.precedence
) {
type = getStyleKey(pendingProps.href);
- var styles$244 = getResourcesFromRoot(
+ var styles$245 = getResourcesFromRoot(
JSCompiler_inline_result
).hoistableStyles,
- resource$245 = styles$244.get(type);
- resource$245 ||
+ resource$246 = styles$245.get(type);
+ resource$246 ||
((JSCompiler_inline_result =
JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result),
- (resource$245 = {
+ (resource$246 = {
type: "stylesheet",
instance: null,
count: 0,
state: { loading: 0, preload: null }
}),
- styles$244.set(type, resource$245),
- (styles$244 = JSCompiler_inline_result.querySelector(
+ styles$245.set(type, resource$246),
+ (styles$245 = JSCompiler_inline_result.querySelector(
getStylesheetSelectorFromKey(type)
)) &&
- !styles$244._p &&
- ((resource$245.instance = styles$244),
- (resource$245.state.loading = 5)),
+ !styles$245._p &&
+ ((resource$246.instance = styles$245),
+ (resource$246.state.loading = 5)),
preloadPropsMap.has(type) ||
((pendingProps = {
rel: "preload",
@@ -14093,16 +14122,16 @@ function getResource(type, currentProps, pendingProps, currentResource) {
referrerPolicy: pendingProps.referrerPolicy
}),
preloadPropsMap.set(type, pendingProps),
- styles$244 ||
+ styles$245 ||
preloadStylesheet(
JSCompiler_inline_result,
type,
pendingProps,
- resource$245.state
+ resource$246.state
)));
if (currentProps && null === currentResource)
throw Error(formatProdErrorMessage(528, ""));
- return resource$245;
+ return resource$246;
}
if (currentProps && null !== currentResource)
throw Error(formatProdErrorMessage(529, ""));
@@ -14199,37 +14228,37 @@ function acquireResource(hoistableRoot, resource, props) {
return (resource.instance = instance);
case "stylesheet":
styleProps = getStyleKey(props.href);
- var instance$250 = hoistableRoot.querySelector(
+ var instance$251 = hoistableRoot.querySelector(
getStylesheetSelectorFromKey(styleProps)
);
- if (instance$250)
+ if (instance$251)
return (
(resource.state.loading |= 4),
- (resource.instance = instance$250),
- markNodeAsHoistable(instance$250),
- instance$250
+ (resource.instance = instance$251),
+ markNodeAsHoistable(instance$251),
+ instance$251
);
instance = stylesheetPropsFromRawProps(props);
(styleProps = preloadPropsMap.get(styleProps)) &&
adoptPreloadPropsForStylesheet(instance, styleProps);
- instance$250 = (
+ instance$251 = (
hoistableRoot.ownerDocument || hoistableRoot
).createElement("link");
- markNodeAsHoistable(instance$250);
- var linkInstance = instance$250;
+ markNodeAsHoistable(instance$251);
+ var linkInstance = instance$251;
linkInstance._p = new Promise(function (resolve, reject) {
linkInstance.onload = resolve;
linkInstance.onerror = reject;
});
- setInitialProperties(instance$250, "link", instance);
+ setInitialProperties(instance$251, "link", instance);
resource.state.loading |= 4;
- insertStylesheet(instance$250, props.precedence, hoistableRoot);
- return (resource.instance = instance$250);
+ insertStylesheet(instance$251, props.precedence, hoistableRoot);
+ return (resource.instance = instance$251);
case "script":
- instance$250 = getScriptKey(props.src);
+ instance$251 = getScriptKey(props.src);
if (
(styleProps = hoistableRoot.querySelector(
- getScriptSelectorFromKey(instance$250)
+ getScriptSelectorFromKey(instance$251)
))
)
return (
@@ -14238,7 +14267,7 @@ function acquireResource(hoistableRoot, resource, props) {
styleProps
);
instance = props;
- if ((styleProps = preloadPropsMap.get(instance$250)))
+ if ((styleProps = preloadPropsMap.get(instance$251)))
(instance = assign({}, props)),
adoptPreloadPropsForScript(instance, styleProps);
hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -15059,8 +15088,9 @@ function attemptExplicitHydrationTarget(queuedTarget) {
queuedTarget.blockedOn = targetInst;
runWithPriority(queuedTarget.priority, function () {
if (13 === nearestMounted.tag) {
- var lane = requestUpdateLane(),
- root = enqueueConcurrentRenderForLane(nearestMounted, lane);
+ var lane = requestUpdateLane();
+ lane = getBumpedLaneForHydrationByLane(lane);
+ var root = enqueueConcurrentRenderForLane(nearestMounted, lane);
null !== root &&
scheduleUpdateOnFiber(root, nearestMounted, lane);
markRetryLaneIfNotHydrated(nearestMounted, lane);
@@ -15262,16 +15292,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
0 === i && attemptExplicitHydrationTarget(target);
}
};
-var isomorphicReactPackageVersion$jscomp$inline_1676 = React.version;
+var isomorphicReactPackageVersion$jscomp$inline_1672 = React.version;
if (
- "19.0.0-experimental-372ec00c-20241209" !==
- isomorphicReactPackageVersion$jscomp$inline_1676
+ "19.1.0-experimental-518d06d2-20241219" !==
+ isomorphicReactPackageVersion$jscomp$inline_1672
)
throw Error(
formatProdErrorMessage(
527,
- isomorphicReactPackageVersion$jscomp$inline_1676,
- "19.0.0-experimental-372ec00c-20241209"
+ isomorphicReactPackageVersion$jscomp$inline_1672,
+ "19.1.0-experimental-518d06d2-20241219"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -15291,25 +15321,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
null === componentOrElement ? null : componentOrElement.stateNode;
return componentOrElement;
};
-var internals$jscomp$inline_2146 = {
+var internals$jscomp$inline_2145 = {
bundleType: 0,
- version: "19.0.0-experimental-372ec00c-20241209",
+ version: "19.1.0-experimental-518d06d2-20241219",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
- findFiberByHostInstance: getClosestInstanceFromNode,
- reconcilerVersion: "19.0.0-experimental-372ec00c-20241209"
+ reconcilerVersion: "19.1.0-experimental-518d06d2-20241219"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
- var hook$jscomp$inline_2147 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+ var hook$jscomp$inline_2146 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
- !hook$jscomp$inline_2147.isDisabled &&
- hook$jscomp$inline_2147.supportsFiber
+ !hook$jscomp$inline_2146.isDisabled &&
+ hook$jscomp$inline_2146.supportsFiber
)
try {
- (rendererID = hook$jscomp$inline_2147.inject(
- internals$jscomp$inline_2146
+ (rendererID = hook$jscomp$inline_2146.inject(
+ internals$jscomp$inline_2145
)),
- (injectedHook = hook$jscomp$inline_2147);
+ (injectedHook = hook$jscomp$inline_2146);
} catch (err) {}
}
exports.createRoot = function (container, options) {
@@ -15391,14 +15420,16 @@ exports.hydrateRoot = function (container, initialChildren, options) {
initialChildren.context = getContextForSubtree(null);
options = initialChildren.current;
isStrictMode = requestUpdateLane();
+ isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
identifierPrefix = createUpdate(isStrictMode);
identifierPrefix.callback = null;
enqueueUpdate(options, identifierPrefix, isStrictMode);
- initialChildren.current.lanes = isStrictMode;
- markRootUpdated$1(initialChildren, isStrictMode);
+ options = isStrictMode;
+ initialChildren.current.lanes = options;
+ markRootUpdated$1(initialChildren, options);
ensureRootIsScheduled(initialChildren);
container[internalContainerInstanceKey] = initialChildren.current;
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
-exports.version = "19.0.0-experimental-372ec00c-20241209";
+exports.version = "19.1.0-experimental-518d06d2-20241219";
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js
index 86c95f1bd6ed9..5f19086cf8a1f 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js
@@ -510,13 +510,11 @@
return describeBuiltInComponentFrame("SuspenseList");
case 0:
case 15:
- return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber;
+ return describeNativeComponentFrame(fiber.type, !1);
case 11:
- return (
- (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber
- );
+ return describeNativeComponentFrame(fiber.type.render, !1);
case 1:
- return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber;
+ return describeNativeComponentFrame(fiber.type, !0);
default:
return "";
}
@@ -1225,6 +1223,46 @@
rootEntangledLanes &= ~lane;
}
}
+ function getBumpedLaneForHydrationByLane(lane) {
+ switch (lane) {
+ case 2:
+ lane = 1;
+ break;
+ case 8:
+ lane = 4;
+ break;
+ case 32:
+ lane = 16;
+ break;
+ case 128:
+ case 256:
+ case 512:
+ case 1024:
+ case 2048:
+ case 4096:
+ case 8192:
+ case 16384:
+ case 32768:
+ case 65536:
+ case 131072:
+ case 262144:
+ case 524288:
+ case 1048576:
+ case 2097152:
+ case 4194304:
+ case 8388608:
+ case 16777216:
+ case 33554432:
+ lane = 64;
+ break;
+ case 268435456:
+ lane = 134217728;
+ break;
+ default:
+ lane = 0;
+ }
+ return lane;
+ }
function addFiberToLanesMap(root, fiber, lanes) {
if (isDevToolsPresent)
for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) {
@@ -2335,6 +2373,8 @@
"hr" === tag ||
"option" === tag ||
"optgroup" === tag ||
+ "script" === tag ||
+ "template" === tag ||
"#text" === tag
);
case "optgroup":
@@ -3789,6 +3829,32 @@
? "Idle"
: "Other";
}
+ function logComponentRender(fiber, startTime, endTime, wasHydrated) {
+ var name = getComponentNameFromFiber(fiber);
+ if (null !== name && supportsUserTiming) {
+ var selfTime = fiber.actualDuration;
+ if (null === fiber.alternate || fiber.alternate.child !== fiber.child)
+ for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling)
+ selfTime -= fiber.actualDuration;
+ reusableComponentDevToolDetails.color =
+ 0.5 > selfTime
+ ? wasHydrated
+ ? "tertiary-light"
+ : "primary-light"
+ : 10 > selfTime
+ ? wasHydrated
+ ? "tertiary"
+ : "primary"
+ : 100 > selfTime
+ ? wasHydrated
+ ? "tertiary-dark"
+ : "primary-dark"
+ : "error";
+ reusableComponentOptions.start = startTime;
+ reusableComponentOptions.end = endTime;
+ performance.measure(name, reusableComponentOptions);
+ }
+ }
function logComponentEffect(fiber, startTime, endTime, selfTime) {
fiber = getComponentNameFromFiber(fiber);
null !== fiber &&
@@ -3805,33 +3871,80 @@
(reusableComponentOptions.end = endTime),
performance.measure(fiber, reusableComponentOptions));
}
- function logRenderPhase(startTime, endTime) {
+ function logRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prepared"
+ : (lanes & 201326677) === lanes
+ ? "Hydrated"
+ : "Render",
+ reusableLaneOptions
+ ));
}
- function logSuspendedRenderPhase(startTime, endTime) {
+ function logSuspendedRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Prewarm", reusableLaneOptions));
}
- function logSuspendedWithDelayPhase(startTime, endTime) {
+ function logSuspendedWithDelayPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Suspended", reusableLaneOptions));
}
+ function logRecoveredRenderPhase(
+ startTime,
+ endTime,
+ lanes,
+ recoverableErrors,
+ hydrationFailed
+ ) {
+ if (supportsUserTiming) {
+ lanes = [];
+ for (var i = 0; i < recoverableErrors.length; i++) {
+ var error = recoverableErrors[i].value;
+ lanes.push([
+ "Recoverable Error",
+ "object" === typeof error &&
+ null !== error &&
+ "string" === typeof error.message
+ ? String(error.message)
+ : String(error)
+ ]);
+ }
+ performance.measure("Recovered", {
+ start: startTime,
+ end: endTime,
+ detail: {
+ devtools: {
+ color: "primary-dark",
+ track: reusableLaneDevToolDetails.track,
+ trackGroup: LANES_TRACK_GROUP,
+ tooltipText: hydrationFailed
+ ? "Hydration Failed"
+ : "Recovered after Error",
+ properties: lanes
+ }
+ }
+ });
+ }
+ }
function logErroredRenderPhase(startTime, endTime) {
supportsUserTiming &&
((reusableLaneDevToolDetails.color = "error"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Errored Render", reusableLaneOptions));
+ performance.measure("Errored", reusableLaneOptions));
}
function logSuspenseThrottlePhase(startTime, endTime) {
supportsUserTiming &&
@@ -4169,441 +4282,214 @@
for (var child = fiber.child; child; )
(fiber.actualDuration += child.actualDuration), (child = child.sibling);
}
- function createCapturedValueAtFiber(value, source) {
- if ("object" === typeof value && null !== value) {
- var existing = CapturedStacks.get(value);
- if (void 0 !== existing) return existing;
- source = {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- CapturedStacks.set(value, source);
- return source;
- }
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- }
- function pushTreeFork(workInProgress, totalChildren) {
- warnIfNotHydrating();
- forkStack[forkStackIndex++] = treeForkCount;
- forkStack[forkStackIndex++] = treeForkProvider;
- treeForkProvider = workInProgress;
- treeForkCount = totalChildren;
- }
- function pushTreeId(workInProgress, totalChildren, index) {
- warnIfNotHydrating();
- idStack[idStackIndex++] = treeContextId;
- idStack[idStackIndex++] = treeContextOverflow;
- idStack[idStackIndex++] = treeContextProvider;
- treeContextProvider = workInProgress;
- var baseIdWithLeadingBit = treeContextId;
- workInProgress = treeContextOverflow;
- var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
- baseIdWithLeadingBit &= ~(1 << baseLength);
- index += 1;
- var length = 32 - clz32(totalChildren) + baseLength;
- if (30 < length) {
- var numberOfOverflowBits = baseLength - (baseLength % 5);
- length = (
- baseIdWithLeadingBit &
- ((1 << numberOfOverflowBits) - 1)
- ).toString(32);
- baseIdWithLeadingBit >>= numberOfOverflowBits;
- baseLength -= numberOfOverflowBits;
- treeContextId =
- (1 << (32 - clz32(totalChildren) + baseLength)) |
- (index << baseLength) |
- baseIdWithLeadingBit;
- treeContextOverflow = length + workInProgress;
- } else
- (treeContextId =
- (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
- (treeContextOverflow = workInProgress);
+ function resetContextDependencies() {
+ lastContextDependency = currentlyRenderingFiber$1 = null;
+ isDisallowedContextReadInDEV = !1;
}
- function pushMaterializedTreeId(workInProgress) {
- warnIfNotHydrating();
- null !== workInProgress.return &&
- (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
+ function pushProvider(providerFiber, context, nextValue) {
+ push(valueCursor, context._currentValue, providerFiber);
+ context._currentValue = nextValue;
+ push(rendererCursorDEV, context._currentRenderer, providerFiber);
+ void 0 !== context._currentRenderer &&
+ null !== context._currentRenderer &&
+ context._currentRenderer !== rendererSigil &&
+ console.error(
+ "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
+ );
+ context._currentRenderer = rendererSigil;
}
- function popTreeContext(workInProgress) {
- for (; workInProgress === treeForkProvider; )
- (treeForkProvider = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null),
- (treeForkCount = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null);
- for (; workInProgress === treeContextProvider; )
- (treeContextProvider = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextOverflow = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextId = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null);
+ function popProvider(context, providerFiber) {
+ context._currentValue = valueCursor.current;
+ var currentRenderer = rendererCursorDEV.current;
+ pop(rendererCursorDEV, providerFiber);
+ context._currentRenderer = currentRenderer;
+ pop(valueCursor, providerFiber);
}
- function warnIfNotHydrating() {
- isHydrating ||
+ function scheduleContextWorkOnParentPath(
+ parent,
+ renderLanes,
+ propagationRoot
+ ) {
+ for (; null !== parent; ) {
+ var alternate = parent.alternate;
+ (parent.childLanes & renderLanes) !== renderLanes
+ ? ((parent.childLanes |= renderLanes),
+ null !== alternate && (alternate.childLanes |= renderLanes))
+ : null !== alternate &&
+ (alternate.childLanes & renderLanes) !== renderLanes &&
+ (alternate.childLanes |= renderLanes);
+ if (parent === propagationRoot) break;
+ parent = parent.return;
+ }
+ parent !== propagationRoot &&
console.error(
- "Expected to be hydrating. This is a bug in React. Please file an issue."
+ "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
);
}
- function buildHydrationDiffNode(fiber, distanceFromLeaf) {
- if (null === fiber.return) {
- if (null === hydrationDiffRootDEV)
- hydrationDiffRootDEV = {
- fiber: fiber,
- children: [],
- serverProps: void 0,
- serverTail: [],
- distanceFromLeaf: distanceFromLeaf
- };
- else {
- if (hydrationDiffRootDEV.fiber !== fiber)
+ function propagateContextChanges(
+ workInProgress,
+ contexts,
+ renderLanes,
+ forcePropagateEntireTree
+ ) {
+ var fiber = workInProgress.child;
+ null !== fiber && (fiber.return = workInProgress);
+ for (; null !== fiber; ) {
+ var list = fiber.dependencies;
+ if (null !== list) {
+ var nextFiber = fiber.child;
+ list = list.firstContext;
+ a: for (; null !== list; ) {
+ var dependency = list;
+ list = fiber;
+ for (var i = 0; i < contexts.length; i++)
+ if (dependency.context === contexts[i]) {
+ list.lanes |= renderLanes;
+ dependency = list.alternate;
+ null !== dependency && (dependency.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ list.return,
+ renderLanes,
+ workInProgress
+ );
+ forcePropagateEntireTree || (nextFiber = null);
+ break a;
+ }
+ list = dependency.next;
+ }
+ } else if (18 === fiber.tag) {
+ nextFiber = fiber.return;
+ if (null === nextFiber)
throw Error(
- "Saw multiple hydration diff roots in a pass. This is a bug in React."
+ "We just came from a parent so we must have had a parent. This is a bug in React."
);
- hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf &&
- (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
- }
- return hydrationDiffRootDEV;
+ nextFiber.lanes |= renderLanes;
+ list = nextFiber.alternate;
+ null !== list && (list.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ nextFiber,
+ renderLanes,
+ workInProgress
+ );
+ nextFiber = null;
+ } else nextFiber = fiber.child;
+ if (null !== nextFiber) nextFiber.return = fiber;
+ else
+ for (nextFiber = fiber; null !== nextFiber; ) {
+ if (nextFiber === workInProgress) {
+ nextFiber = null;
+ break;
+ }
+ fiber = nextFiber.sibling;
+ if (null !== fiber) {
+ fiber.return = nextFiber.return;
+ nextFiber = fiber;
+ break;
+ }
+ nextFiber = nextFiber.return;
+ }
+ fiber = nextFiber;
}
- var siblings = buildHydrationDiffNode(
- fiber.return,
- distanceFromLeaf + 1
- ).children;
- if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
- return (
- (siblings = siblings[siblings.length - 1]),
- siblings.distanceFromLeaf > distanceFromLeaf &&
- (siblings.distanceFromLeaf = distanceFromLeaf),
- siblings
- );
- distanceFromLeaf = {
- fiber: fiber,
- children: [],
- serverProps: void 0,
- serverTail: [],
- distanceFromLeaf: distanceFromLeaf
- };
- siblings.push(distanceFromLeaf);
- return distanceFromLeaf;
}
- function warnNonHydratedInstance(fiber, rejectedCandidate) {
- didSuspendOrErrorDEV ||
- ((fiber = buildHydrationDiffNode(fiber, 0)),
- (fiber.serverProps = null),
- null !== rejectedCandidate &&
- ((rejectedCandidate =
- describeHydratableInstanceForDevWarnings(rejectedCandidate)),
- fiber.serverTail.push(rejectedCandidate)));
+ function propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ forcePropagateEntireTree
+ ) {
+ current = null;
+ for (
+ var parent = workInProgress, isInsidePropagationBailout = !1;
+ null !== parent;
+
+ ) {
+ if (!isInsidePropagationBailout)
+ if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
+ else if (0 !== (parent.flags & 262144)) break;
+ if (10 === parent.tag) {
+ var currentParent = parent.alternate;
+ if (null === currentParent)
+ throw Error("Should have a current fiber. This is a bug in React.");
+ currentParent = currentParent.memoizedProps;
+ if (null !== currentParent) {
+ var context = parent.type;
+ objectIs(parent.pendingProps.value, currentParent.value) ||
+ (null !== current
+ ? current.push(context)
+ : (current = [context]));
+ }
+ } else if (parent === hostTransitionProviderCursor.current) {
+ currentParent = parent.alternate;
+ if (null === currentParent)
+ throw Error("Should have a current fiber. This is a bug in React.");
+ currentParent.memoizedState.memoizedState !==
+ parent.memoizedState.memoizedState &&
+ (null !== current
+ ? current.push(HostTransitionContext)
+ : (current = [HostTransitionContext]));
+ }
+ parent = parent.return;
+ }
+ null !== current &&
+ propagateContextChanges(
+ workInProgress,
+ current,
+ renderLanes,
+ forcePropagateEntireTree
+ );
+ workInProgress.flags |= 262144;
}
- function throwOnHydrationMismatch(fiber) {
- var diff = "",
- diffRoot = hydrationDiffRootDEV;
- null !== diffRoot &&
- ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot)));
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" +
- diff
- ),
- fiber
+ function checkIfContextChanged(currentDependencies) {
+ for (
+ currentDependencies = currentDependencies.firstContext;
+ null !== currentDependencies;
+
+ ) {
+ if (
+ !objectIs(
+ currentDependencies.context._currentValue,
+ currentDependencies.memoizedValue
+ )
)
- );
- throw HydrationMismatchException;
- }
- function prepareToHydrateHostInstance(fiber) {
- var didHydrate = fiber.stateNode;
- var type = fiber.type,
- props = fiber.memoizedProps;
- didHydrate[internalInstanceKey] = fiber;
- didHydrate[internalPropsKey] = props;
- validatePropertiesInDevelopment(type, props);
- switch (type) {
- case "dialog":
- listenToNonDelegatedEvent("cancel", didHydrate);
- listenToNonDelegatedEvent("close", didHydrate);
- break;
- case "iframe":
- case "object":
- case "embed":
- listenToNonDelegatedEvent("load", didHydrate);
- break;
- case "video":
- case "audio":
- for (type = 0; type < mediaEventTypes.length; type++)
- listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate);
- break;
- case "source":
- listenToNonDelegatedEvent("error", didHydrate);
- break;
- case "img":
- case "image":
- case "link":
- listenToNonDelegatedEvent("error", didHydrate);
- listenToNonDelegatedEvent("load", didHydrate);
- break;
- case "details":
- listenToNonDelegatedEvent("toggle", didHydrate);
- break;
- case "input":
- checkControlledValueProps("input", props);
- listenToNonDelegatedEvent("invalid", didHydrate);
- validateInputProps(didHydrate, props);
- initInput(
- didHydrate,
- props.value,
- props.defaultValue,
- props.checked,
- props.defaultChecked,
- props.type,
- props.name,
- !0
- );
- track(didHydrate);
- break;
- case "option":
- validateOptionProps(didHydrate, props);
- break;
- case "select":
- checkControlledValueProps("select", props);
- listenToNonDelegatedEvent("invalid", didHydrate);
- validateSelectProps(didHydrate, props);
- break;
- case "textarea":
- checkControlledValueProps("textarea", props),
- listenToNonDelegatedEvent("invalid", didHydrate),
- validateTextareaProps(didHydrate, props),
- initTextarea(
- didHydrate,
- props.value,
- props.defaultValue,
- props.children
- ),
- track(didHydrate);
+ return !0;
+ currentDependencies = currentDependencies.next;
}
- type = props.children;
- ("string" !== typeof type &&
- "number" !== typeof type &&
- "bigint" !== typeof type) ||
- didHydrate.textContent === "" + type ||
- !0 === props.suppressHydrationWarning ||
- checkForUnmatchedText(didHydrate.textContent, type)
- ? (null != props.popover &&
- (listenToNonDelegatedEvent("beforetoggle", didHydrate),
- listenToNonDelegatedEvent("toggle", didHydrate)),
- null != props.onScroll &&
- listenToNonDelegatedEvent("scroll", didHydrate),
- null != props.onScrollEnd &&
- listenToNonDelegatedEvent("scrollend", didHydrate),
- null != props.onClick && (didHydrate.onclick = noop$2),
- (didHydrate = !0))
- : (didHydrate = !1);
- didHydrate || throwOnHydrationMismatch(fiber);
+ return !1;
}
- function popToNextHostParent(fiber) {
- for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
- switch (hydrationParentFiber.tag) {
- case 3:
- case 27:
- rootOrSingletonContext = !0;
- return;
- case 5:
- case 13:
- rootOrSingletonContext = !1;
- return;
- default:
- hydrationParentFiber = hydrationParentFiber.return;
- }
+ function prepareToReadContext(workInProgress) {
+ currentlyRenderingFiber$1 = workInProgress;
+ lastContextDependency = null;
+ workInProgress = workInProgress.dependencies;
+ null !== workInProgress && (workInProgress.firstContext = null);
}
- function popHydrationState(fiber) {
- if (fiber !== hydrationParentFiber) return !1;
- if (!isHydrating)
- return popToNextHostParent(fiber), (isHydrating = !0), !1;
- var shouldClear = !1,
- JSCompiler_temp;
- if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
- if ((JSCompiler_temp = 5 === fiber.tag))
- (JSCompiler_temp = fiber.type),
- (JSCompiler_temp =
- !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
- shouldSetTextContent(fiber.type, fiber.memoizedProps));
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp && (shouldClear = !0);
- if (shouldClear && nextHydratableInstance) {
- for (shouldClear = nextHydratableInstance; shouldClear; ) {
- JSCompiler_temp = buildHydrationDiffNode(fiber, 0);
- var description =
- describeHydratableInstanceForDevWarnings(shouldClear);
- JSCompiler_temp.serverTail.push(description);
- shouldClear =
- "Suspense" === description.type
- ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear)
- : getNextHydratable(shouldClear.nextSibling);
- }
- throwOnHydrationMismatch(fiber);
- }
- popToNextHostParent(fiber);
- if (13 === fiber.tag) {
- fiber = fiber.memoizedState;
- fiber = null !== fiber ? fiber.dehydrated : null;
- if (!fiber)
+ function readContext(context) {
+ isDisallowedContextReadInDEV &&
+ console.error(
+ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
+ );
+ return readContextForConsumer(currentlyRenderingFiber$1, context);
+ }
+ function readContextDuringReconciliation(consumer, context) {
+ null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
+ return readContextForConsumer(consumer, context);
+ }
+ function readContextForConsumer(consumer, context) {
+ var value = context._currentValue;
+ context = { context: context, memoizedValue: value, next: null };
+ if (null === lastContextDependency) {
+ if (null === consumer)
throw Error(
- "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
+ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
);
- nextHydratableInstance =
- getNextHydratableInstanceAfterSuspenseInstance(fiber);
- } else
- nextHydratableInstance = hydrationParentFiber
- ? getNextHydratable(fiber.stateNode.nextSibling)
- : null;
- return !0;
- }
- function resetHydrationState() {
- nextHydratableInstance = hydrationParentFiber = null;
- didSuspendOrErrorDEV = isHydrating = !1;
- }
- function queueHydrationError(error) {
- null === hydrationErrors
- ? (hydrationErrors = [error])
- : hydrationErrors.push(error);
- }
- function emitPendingHydrationWarnings() {
- var diffRoot = hydrationDiffRootDEV;
- null !== diffRoot &&
- ((hydrationDiffRootDEV = null),
- (diffRoot = describeDiff(diffRoot)),
- console.error(
- "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
- "https://react.dev/link/hydration-mismatch",
- diffRoot
- ));
- }
- function createThenableState() {
- return { didWarnAboutUncachedPromise: !1, thenables: [] };
- }
- function isThenableResolved(thenable) {
- thenable = thenable.status;
- return "fulfilled" === thenable || "rejected" === thenable;
- }
- function noop$4() {}
- function trackUsedThenable(thenableState, thenable, index) {
- null !== ReactSharedInternals.actQueue &&
- (ReactSharedInternals.didUsePromise = !0);
- var trackedThenables = thenableState.thenables;
- index = trackedThenables[index];
- void 0 === index
- ? trackedThenables.push(thenable)
- : index !== thenable &&
- (thenableState.didWarnAboutUncachedPromise ||
- ((thenableState.didWarnAboutUncachedPromise = !0),
- console.error(
- "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
- )),
- thenable.then(noop$4, noop$4),
- (thenable = index));
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- default:
- if ("string" === typeof thenable.status)
- thenable.then(noop$4, noop$4);
- else {
- thenableState = workInProgressRoot;
- if (
- null !== thenableState &&
- 100 < thenableState.shellSuspendCounter
- )
- throw Error(
- "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- );
- thenableState = thenable;
- thenableState.status = "pending";
- thenableState.then(
- function (fulfilledValue) {
- if ("pending" === thenable.status) {
- var fulfilledThenable = thenable;
- fulfilledThenable.status = "fulfilled";
- fulfilledThenable.value = fulfilledValue;
- }
- },
- function (error) {
- if ("pending" === thenable.status) {
- var rejectedThenable = thenable;
- rejectedThenable.status = "rejected";
- rejectedThenable.reason = error;
- }
- }
- );
- }
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- }
- suspendedThenable = thenable;
- needsToResetSuspendedThenableDEV = !0;
- throw SuspenseException;
- }
- }
- function getSuspendedThenable() {
- if (null === suspendedThenable)
- throw Error(
- "Expected a suspended thenable. This is a bug in React. Please file an issue."
- );
- var thenable = suspendedThenable;
- suspendedThenable = null;
- needsToResetSuspendedThenableDEV = !1;
- return thenable;
- }
- function checkIfUseWrappedInAsyncCatch(rejectedReason) {
- if (
- rejectedReason === SuspenseException ||
- rejectedReason === SuspenseActionException
- )
- throw Error(
- "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- );
- }
- function createCache() {
- return {
- controller: new AbortControllerLocal(),
- data: new Map(),
- refCount: 0
- };
- }
- function retainCache(cache) {
- cache.controller.signal.aborted &&
- console.warn(
- "A cache instance was retained after it was already freed. This likely indicates a bug in React."
- );
- cache.refCount++;
- }
- function releaseCache(cache) {
- cache.refCount--;
- 0 > cache.refCount &&
- console.warn(
- "A cache instance was released after it was already freed. This likely indicates a bug in React."
- );
- 0 === cache.refCount &&
- scheduleCallback$2(NormalPriority, function () {
- cache.controller.abort();
- });
+ lastContextDependency = context;
+ consumer.dependencies = {
+ lanes: 0,
+ firstContext: context,
+ _debugThenableState: null
+ };
+ consumer.flags |= 524288;
+ } else lastContextDependency = lastContextDependency.next = context;
+ return value;
}
function entangleAsyncAction(transition, thenable) {
if (null === currentEntangledListeners) {
@@ -4662,6378 +4548,6553 @@
);
return thenableWithOverride;
}
- function pushHiddenContext(fiber, context) {
- var prevEntangledRenderLanes = entangledRenderLanes;
- push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber);
- push(currentTreeHiddenStackCursor, context, fiber);
- entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes;
- }
- function reuseHiddenContextOnStack(fiber) {
- push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber);
- push(
- currentTreeHiddenStackCursor,
- currentTreeHiddenStackCursor.current,
- fiber
- );
- }
- function popHiddenContext(fiber) {
- entangledRenderLanes = prevEntangledRenderLanesCursor.current;
- pop(currentTreeHiddenStackCursor, fiber);
- pop(prevEntangledRenderLanesCursor, fiber);
- }
- function peekCacheFromPool() {
- var cacheResumedFromPreviousRender = resumedCache.current;
- return null !== cacheResumedFromPreviousRender
- ? cacheResumedFromPreviousRender
- : workInProgressRoot.pooledCache;
- }
- function pushTransition(offscreenWorkInProgress, prevCachePool) {
- null === prevCachePool
- ? push(resumedCache, resumedCache.current, offscreenWorkInProgress)
- : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress);
+ function initializeUpdateQueue(fiber) {
+ fiber.updateQueue = {
+ baseState: fiber.memoizedState,
+ firstBaseUpdate: null,
+ lastBaseUpdate: null,
+ shared: { pending: null, lanes: 0, hiddenCallbacks: null },
+ callbacks: null
+ };
}
- function getSuspendedCache() {
- var cacheFromPool = peekCacheFromPool();
- return null === cacheFromPool
- ? null
- : { parent: CacheContext._currentValue, pool: cacheFromPool };
+ function cloneUpdateQueue(current, workInProgress) {
+ current = current.updateQueue;
+ workInProgress.updateQueue === current &&
+ (workInProgress.updateQueue = {
+ baseState: current.baseState,
+ firstBaseUpdate: current.firstBaseUpdate,
+ lastBaseUpdate: current.lastBaseUpdate,
+ shared: current.shared,
+ callbacks: null
+ });
}
- function mountHookTypesDev() {
- var hookName = currentHookNameInDev;
- null === hookTypesDev
- ? (hookTypesDev = [hookName])
- : hookTypesDev.push(hookName);
+ function createUpdate(lane) {
+ return {
+ lane: lane,
+ tag: UpdateState,
+ payload: null,
+ callback: null,
+ next: null
+ };
}
- function updateHookTypesDev() {
- var hookName = currentHookNameInDev;
+ function enqueueUpdate(fiber, update, lane) {
+ var updateQueue = fiber.updateQueue;
+ if (null === updateQueue) return null;
+ updateQueue = updateQueue.shared;
if (
- null !== hookTypesDev &&
- (hookTypesUpdateIndexDev++,
- hookTypesDev[hookTypesUpdateIndexDev] !== hookName)
+ currentlyProcessingQueue === updateQueue &&
+ !didWarnUpdateInsideUpdate
) {
- var componentName = getComponentNameFromFiber(
- currentlyRenderingFiber$1
- );
- if (
- !didWarnAboutMismatchedHooksForComponent.has(componentName) &&
- (didWarnAboutMismatchedHooksForComponent.add(componentName),
- null !== hookTypesDev)
- ) {
- for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) {
- var oldHookName = hookTypesDev[i],
- newHookName =
- i === hookTypesUpdateIndexDev ? hookName : oldHookName;
- for (
- oldHookName = i + 1 + ". " + oldHookName;
- 30 > oldHookName.length;
-
- )
- oldHookName += " ";
- oldHookName += newHookName + "\n";
- table += oldHookName;
- }
- console.error(
- "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
- componentName,
- table
- );
- }
- }
- }
- function checkDepsAreArrayDev(deps) {
- void 0 === deps ||
- null === deps ||
- isArrayImpl(deps) ||
+ var componentName = getComponentNameFromFiber(fiber);
console.error(
- "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
- currentHookNameInDev,
- typeof deps
+ "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s",
+ componentName
);
- }
- function warnOnUseFormStateInDev() {
- var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
- didWarnAboutUseFormState.has(componentName) ||
- (didWarnAboutUseFormState.add(componentName),
- console.error(
- "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
- componentName
- ));
- }
- function throwInvalidHookError() {
- throw Error(
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
- );
- }
- function areHookInputsEqual(nextDeps, prevDeps) {
- if (ignorePreviousDependencies) return !1;
- if (null === prevDeps)
+ didWarnUpdateInsideUpdate = !0;
+ }
+ if ((executionContext & RenderContext) !== NoContext)
return (
- console.error(
- "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
- currentHookNameInDev
- ),
- !1
- );
- nextDeps.length !== prevDeps.length &&
- console.error(
- "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",
- currentHookNameInDev,
- "[" + prevDeps.join(", ") + "]",
- "[" + nextDeps.join(", ") + "]"
+ (componentName = updateQueue.pending),
+ null === componentName
+ ? (update.next = update)
+ : ((update.next = componentName.next),
+ (componentName.next = update)),
+ (updateQueue.pending = update),
+ (update = getRootForUpdatedFiber(fiber)),
+ markUpdateLaneFromFiberToRoot(fiber, null, lane),
+ update
);
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
- if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
- return !0;
+ enqueueUpdate$1(fiber, updateQueue, update, lane);
+ return getRootForUpdatedFiber(fiber);
}
- function renderWithHooks(
- current,
- workInProgress,
- Component,
- props,
- secondArg,
- nextRenderLanes
- ) {
- renderLanes = nextRenderLanes;
- currentlyRenderingFiber$1 = workInProgress;
- hookTypesDev = null !== current ? current._debugHookTypes : null;
- hookTypesUpdateIndexDev = -1;
- ignorePreviousDependencies =
- null !== current && current.type !== workInProgress.type;
- if (
- "[object AsyncFunction]" ===
- Object.prototype.toString.call(Component) ||
- "[object AsyncGeneratorFunction]" ===
- Object.prototype.toString.call(Component)
- )
- (nextRenderLanes = getComponentNameFromFiber(
- currentlyRenderingFiber$1
- )),
- didWarnAboutAsyncClientComponent.has(nextRenderLanes) ||
- (didWarnAboutAsyncClientComponent.add(nextRenderLanes),
- console.error(
- "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
- ));
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.lanes = 0;
- ReactSharedInternals.H =
- null !== current && null !== current.memoizedState
- ? HooksDispatcherOnUpdateInDEV
- : null !== hookTypesDev
- ? HooksDispatcherOnMountWithHookTypesInDEV
- : HooksDispatcherOnMountInDEV;
- shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes =
- (workInProgress.mode & StrictLegacyMode) !== NoMode;
- var children = callComponentInDEV(Component, props, secondArg);
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- didScheduleRenderPhaseUpdateDuringThisPass &&
- (children = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- ));
- if (nextRenderLanes) {
- setIsStrictModeForDevtools(!0);
- try {
- children = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- );
- } finally {
- setIsStrictModeForDevtools(!1);
- }
+ function entangleTransitions(root, fiber, lane) {
+ fiber = fiber.updateQueue;
+ if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
+ var queueLanes = fiber.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ fiber.lanes = lane;
+ markRootEntangled(root, lane);
}
- finishRenderingHooks(current, workInProgress);
- return children;
}
- function finishRenderingHooks(current, workInProgress) {
- workInProgress._debugHookTypes = hookTypesDev;
- null === workInProgress.dependencies
- ? null !== thenableState$1 &&
- (workInProgress.dependencies = {
- lanes: 0,
- firstContext: null,
- _debugThenableState: thenableState$1
- })
- : (workInProgress.dependencies._debugThenableState = thenableState$1);
- ReactSharedInternals.H = ContextOnlyDispatcher;
- var didRenderTooFewHooks =
- null !== currentHook && null !== currentHook.next;
- renderLanes = 0;
- hookTypesDev =
- currentHookNameInDev =
- workInProgressHook =
- currentHook =
- currentlyRenderingFiber$1 =
- null;
- hookTypesUpdateIndexDev = -1;
- null !== current &&
- (current.flags & 31457280) !== (workInProgress.flags & 31457280) &&
- console.error(
- "Internal React error: Expected static flag was missing. Please notify the React team."
- );
- didScheduleRenderPhaseUpdate = !1;
- thenableIndexCounter$1 = 0;
- thenableState$1 = null;
- if (didRenderTooFewHooks)
- throw Error(
- "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
- );
- null === current ||
- didReceiveUpdate ||
- ((current = current.dependencies),
+ function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
+ var queue = workInProgress.updateQueue,
+ current = workInProgress.alternate;
+ if (
null !== current &&
- checkIfContextChanged(current) &&
- (didReceiveUpdate = !0));
- needsToResetSuspendedThenableDEV
- ? ((needsToResetSuspendedThenableDEV = !1), (current = !0))
- : (current = !1);
- current &&
- ((workInProgress =
- getComponentNameFromFiber(workInProgress) || "Unknown"),
- didWarnAboutUseWrappedInTryCatch.has(workInProgress) ||
- didWarnAboutAsyncClientComponent.has(workInProgress) ||
- (didWarnAboutUseWrappedInTryCatch.add(workInProgress),
- console.error(
- "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
- )));
- }
- function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
- currentlyRenderingFiber$1 = workInProgress;
- var numberOfReRenders = 0;
- do {
- didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
- thenableIndexCounter$1 = 0;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- if (numberOfReRenders >= RE_RENDER_LIMIT)
- throw Error(
- "Too many re-renders. React limits the number of renders to prevent an infinite loop."
- );
- numberOfReRenders += 1;
- ignorePreviousDependencies = !1;
- workInProgressHook = currentHook = null;
- if (null != workInProgress.updateQueue) {
- var children = workInProgress.updateQueue;
- children.lastEffect = null;
- children.events = null;
- children.stores = null;
- null != children.memoCache && (children.memoCache.index = 0);
- }
- hookTypesUpdateIndexDev = -1;
- ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV;
- children = callComponentInDEV(Component, props, secondArg);
- } while (didScheduleRenderPhaseUpdateDuringThisPass);
- return children;
- }
- function TransitionAwareHostComponent() {
- var dispatcher = ReactSharedInternals.H,
- maybeThenable = dispatcher.useState()[0];
- maybeThenable =
- "function" === typeof maybeThenable.then
- ? useThenable(maybeThenable)
- : maybeThenable;
- dispatcher = dispatcher.useState()[0];
- (null !== currentHook ? currentHook.memoizedState : null) !==
- dispatcher && (currentlyRenderingFiber$1.flags |= 1024);
- return maybeThenable;
+ ((current = current.updateQueue), queue === current)
+ ) {
+ var newFirst = null,
+ newLast = null;
+ queue = queue.firstBaseUpdate;
+ if (null !== queue) {
+ do {
+ var clone = {
+ lane: queue.lane,
+ tag: queue.tag,
+ payload: queue.payload,
+ callback: null,
+ next: null
+ };
+ null === newLast
+ ? (newFirst = newLast = clone)
+ : (newLast = newLast.next = clone);
+ queue = queue.next;
+ } while (null !== queue);
+ null === newLast
+ ? (newFirst = newLast = capturedUpdate)
+ : (newLast = newLast.next = capturedUpdate);
+ } else newFirst = newLast = capturedUpdate;
+ queue = {
+ baseState: current.baseState,
+ firstBaseUpdate: newFirst,
+ lastBaseUpdate: newLast,
+ shared: current.shared,
+ callbacks: current.callbacks
+ };
+ workInProgress.updateQueue = queue;
+ return;
+ }
+ workInProgress = queue.lastBaseUpdate;
+ null === workInProgress
+ ? (queue.firstBaseUpdate = capturedUpdate)
+ : (workInProgress.next = capturedUpdate);
+ queue.lastBaseUpdate = capturedUpdate;
}
- function checkDidRenderIdHook() {
- var didRenderIdHook = 0 !== localIdCounter;
- localIdCounter = 0;
- return didRenderIdHook;
+ function suspendIfUpdateReadFromEntangledAsyncAction() {
+ if (didReadFromEntangledAsyncAction) {
+ var entangledActionThenable = currentEntangledActionThenable;
+ if (null !== entangledActionThenable) throw entangledActionThenable;
+ }
}
- function bailoutHooks(current, workInProgress, lanes) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.flags =
- (workInProgress.mode & StrictEffectsMode) !== NoMode
- ? workInProgress.flags & -201328645
- : workInProgress.flags & -2053;
- current.lanes &= ~lanes;
- }
- function resetHooksOnUnwind(workInProgress) {
- if (didScheduleRenderPhaseUpdate) {
- for (
- workInProgress = workInProgress.memoizedState;
- null !== workInProgress;
-
- ) {
- var queue = workInProgress.queue;
- null !== queue && (queue.pending = null);
- workInProgress = workInProgress.next;
- }
- didScheduleRenderPhaseUpdate = !1;
- }
- renderLanes = 0;
- hookTypesDev =
- workInProgressHook =
- currentHook =
- currentlyRenderingFiber$1 =
- null;
- hookTypesUpdateIndexDev = -1;
- currentHookNameInDev = null;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- thenableIndexCounter$1 = localIdCounter = 0;
- thenableState$1 = null;
- }
- function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- baseQueue: null,
- queue: null,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
- : (workInProgressHook = workInProgressHook.next = hook);
- return workInProgressHook;
- }
- function updateWorkInProgressHook() {
- if (null === currentHook) {
- var nextCurrentHook = currentlyRenderingFiber$1.alternate;
- nextCurrentHook =
- null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
- } else nextCurrentHook = currentHook.next;
- var nextWorkInProgressHook =
- null === workInProgressHook
- ? currentlyRenderingFiber$1.memoizedState
- : workInProgressHook.next;
- if (null !== nextWorkInProgressHook)
- (workInProgressHook = nextWorkInProgressHook),
- (currentHook = nextCurrentHook);
- else {
- if (null === nextCurrentHook) {
- if (null === currentlyRenderingFiber$1.alternate)
- throw Error(
- "Update hook called on initial render. This is likely a bug in React. Please file an issue."
- );
- throw Error("Rendered more hooks than during the previous render.");
- }
- currentHook = nextCurrentHook;
- nextCurrentHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- baseQueue: currentHook.baseQueue,
- queue: currentHook.queue,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook =
- nextCurrentHook)
- : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
- }
- return workInProgressHook;
- }
- function useThenable(thenable) {
- var index = thenableIndexCounter$1;
- thenableIndexCounter$1 += 1;
- null === thenableState$1 && (thenableState$1 = createThenableState());
- thenable = trackUsedThenable(thenableState$1, thenable, index);
- index = currentlyRenderingFiber$1;
- null ===
- (null === workInProgressHook
- ? index.memoizedState
- : workInProgressHook.next) &&
- ((index = index.alternate),
- (ReactSharedInternals.H =
- null !== index && null !== index.memoizedState
- ? HooksDispatcherOnUpdateInDEV
- : HooksDispatcherOnMountInDEV));
- return thenable;
- }
- function use(usable) {
- if (null !== usable && "object" === typeof usable) {
- if ("function" === typeof usable.then) return useThenable(usable);
- if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
- }
- throw Error("An unsupported type was passed to use(): " + String(usable));
- }
- function useMemoCache(size) {
- var memoCache = null,
- updateQueue = currentlyRenderingFiber$1.updateQueue;
- null !== updateQueue && (memoCache = updateQueue.memoCache);
- if (null == memoCache) {
- var current = currentlyRenderingFiber$1.alternate;
+ function processUpdateQueue(
+ workInProgress,
+ props,
+ instance$jscomp$0,
+ renderLanes
+ ) {
+ didReadFromEntangledAsyncAction = !1;
+ var queue = workInProgress.updateQueue;
+ hasForceUpdate = !1;
+ currentlyProcessingQueue = queue.shared;
+ var firstBaseUpdate = queue.firstBaseUpdate,
+ lastBaseUpdate = queue.lastBaseUpdate,
+ pendingQueue = queue.shared.pending;
+ if (null !== pendingQueue) {
+ queue.shared.pending = null;
+ var lastPendingUpdate = pendingQueue,
+ firstPendingUpdate = lastPendingUpdate.next;
+ lastPendingUpdate.next = null;
+ null === lastBaseUpdate
+ ? (firstBaseUpdate = firstPendingUpdate)
+ : (lastBaseUpdate.next = firstPendingUpdate);
+ lastBaseUpdate = lastPendingUpdate;
+ var current = workInProgress.alternate;
null !== current &&
((current = current.updateQueue),
- null !== current &&
- ((current = current.memoCache),
- null != current &&
- (memoCache = {
- data: current.data.map(function (array) {
- return array.slice();
- }),
- index: 0
- })));
- }
- null == memoCache && (memoCache = { data: [], index: 0 });
- null === updateQueue &&
- ((updateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = updateQueue));
- updateQueue.memoCache = memoCache;
- updateQueue = memoCache.data[memoCache.index];
- if (void 0 === updateQueue || ignorePreviousDependencies)
- for (
- updateQueue = memoCache.data[memoCache.index] = Array(size),
- current = 0;
- current < size;
- current++
- )
- updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
- else
- updateQueue.length !== size &&
- console.error(
- "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
- updateQueue.length,
- size
- );
- memoCache.index++;
- return updateQueue;
- }
- function basicStateReducer(state, action) {
- return "function" === typeof action ? action(state) : action;
- }
- function mountReducer(reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- if (void 0 !== init) {
- var initialState = init(initialArg);
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- init(initialArg);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- } else initialState = initialArg;
- hook.memoizedState = hook.baseState = initialState;
- reducer = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- hook.queue = reducer;
- reducer = reducer.dispatch = dispatchReducerAction.bind(
- null,
- currentlyRenderingFiber$1,
- reducer
- );
- return [hook.memoizedState, reducer];
- }
- function updateReducer(reducer) {
- var hook = updateWorkInProgressHook();
- return updateReducerImpl(hook, currentHook, reducer);
- }
- function updateReducerImpl(hook, current, reducer) {
- var queue = hook.queue;
- if (null === queue)
- throw Error(
- "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
- );
- queue.lastRenderedReducer = reducer;
- var baseQueue = hook.baseQueue,
- pendingQueue = queue.pending;
- if (null !== pendingQueue) {
- if (null !== baseQueue) {
- var baseFirst = baseQueue.next;
- baseQueue.next = pendingQueue.next;
- pendingQueue.next = baseFirst;
- }
- current.baseQueue !== baseQueue &&
- console.error(
- "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
- );
- current.baseQueue = baseQueue = pendingQueue;
- queue.pending = null;
+ (pendingQueue = current.lastBaseUpdate),
+ pendingQueue !== lastBaseUpdate &&
+ (null === pendingQueue
+ ? (current.firstBaseUpdate = firstPendingUpdate)
+ : (pendingQueue.next = firstPendingUpdate),
+ (current.lastBaseUpdate = lastPendingUpdate)));
}
- pendingQueue = hook.baseState;
- if (null === baseQueue) hook.memoizedState = pendingQueue;
- else {
- current = baseQueue.next;
- var newBaseQueueFirst = (baseFirst = null),
- newBaseQueueLast = null,
- update = current,
- didReadFromEntangledAsyncAction = !1;
+ if (null !== firstBaseUpdate) {
+ var newState = queue.baseState;
+ lastBaseUpdate = 0;
+ current = firstPendingUpdate = lastPendingUpdate = null;
+ pendingQueue = firstBaseUpdate;
do {
- var updateLane = update.lane & -536870913;
+ var updateLane = pendingQueue.lane & -536870913,
+ isHiddenUpdate = updateLane !== pendingQueue.lane;
if (
- updateLane !== update.lane
+ isHiddenUpdate
? (workInProgressRootRenderLanes & updateLane) === updateLane
: (renderLanes & updateLane) === updateLane
) {
- var revertLane = update.revertLane;
- if (0 === revertLane)
- null !== newBaseQueueLast &&
- (newBaseQueueLast = newBaseQueueLast.next =
- {
- lane: 0,
- revertLane: 0,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- else if ((renderLanes & revertLane) === revertLane) {
- update = update.next;
- revertLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- continue;
- } else
- (updateLane = {
- lane: 0,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
- (currentlyRenderingFiber$1.lanes |= revertLane),
- (workInProgressRootSkippedLanes |= revertLane);
- updateLane = update.action;
- shouldDoubleInvokeUserFnsInHooksDEV &&
- reducer(pendingQueue, updateLane);
- pendingQueue = update.hasEagerState
- ? update.eagerState
- : reducer(pendingQueue, updateLane);
+ 0 !== updateLane &&
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ null !== current &&
+ (current = current.next =
+ {
+ lane: 0,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: null,
+ next: null
+ });
+ a: {
+ updateLane = workInProgress;
+ var partialState = pendingQueue;
+ var nextProps = props,
+ instance = instance$jscomp$0;
+ switch (partialState.tag) {
+ case ReplaceState:
+ partialState = partialState.payload;
+ if ("function" === typeof partialState) {
+ isDisallowedContextReadInDEV = !0;
+ var nextState = partialState.call(
+ instance,
+ newState,
+ nextProps
+ );
+ if (updateLane.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ partialState.call(instance, newState, nextProps);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ isDisallowedContextReadInDEV = !1;
+ newState = nextState;
+ break a;
+ }
+ newState = partialState;
+ break a;
+ case CaptureUpdate:
+ updateLane.flags = (updateLane.flags & -65537) | 128;
+ case UpdateState:
+ nextState = partialState.payload;
+ if ("function" === typeof nextState) {
+ isDisallowedContextReadInDEV = !0;
+ partialState = nextState.call(
+ instance,
+ newState,
+ nextProps
+ );
+ if (updateLane.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextState.call(instance, newState, nextProps);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ isDisallowedContextReadInDEV = !1;
+ } else partialState = nextState;
+ if (null === partialState || void 0 === partialState) break a;
+ newState = assign({}, newState, partialState);
+ break a;
+ case ForceUpdate:
+ hasForceUpdate = !0;
+ }
+ }
+ updateLane = pendingQueue.callback;
+ null !== updateLane &&
+ ((workInProgress.flags |= 64),
+ isHiddenUpdate && (workInProgress.flags |= 8192),
+ (isHiddenUpdate = queue.callbacks),
+ null === isHiddenUpdate
+ ? (queue.callbacks = [updateLane])
+ : isHiddenUpdate.push(updateLane));
} else
- (revertLane = {
+ (isHiddenUpdate = {
lane: updateLane,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: pendingQueue.callback,
next: null
}),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
- (currentlyRenderingFiber$1.lanes |= updateLane),
- (workInProgressRootSkippedLanes |= updateLane);
- update = update.next;
- } while (null !== update && update !== current);
- null === newBaseQueueLast
- ? (baseFirst = pendingQueue)
- : (newBaseQueueLast.next = newBaseQueueFirst);
- if (
- !objectIs(pendingQueue, hook.memoizedState) &&
- ((didReceiveUpdate = !0),
- didReadFromEntangledAsyncAction &&
- ((reducer = currentEntangledActionThenable), null !== reducer))
- )
- throw reducer;
- hook.memoizedState = pendingQueue;
- hook.baseState = baseFirst;
- hook.baseQueue = newBaseQueueLast;
- queue.lastRenderedState = pendingQueue;
+ null === current
+ ? ((firstPendingUpdate = current = isHiddenUpdate),
+ (lastPendingUpdate = newState))
+ : (current = current.next = isHiddenUpdate),
+ (lastBaseUpdate |= updateLane);
+ pendingQueue = pendingQueue.next;
+ if (null === pendingQueue)
+ if (((pendingQueue = queue.shared.pending), null === pendingQueue))
+ break;
+ else
+ (isHiddenUpdate = pendingQueue),
+ (pendingQueue = isHiddenUpdate.next),
+ (isHiddenUpdate.next = null),
+ (queue.lastBaseUpdate = isHiddenUpdate),
+ (queue.shared.pending = null);
+ } while (1);
+ null === current && (lastPendingUpdate = newState);
+ queue.baseState = lastPendingUpdate;
+ queue.firstBaseUpdate = firstPendingUpdate;
+ queue.lastBaseUpdate = current;
+ null === firstBaseUpdate && (queue.shared.lanes = 0);
+ workInProgressRootSkippedLanes |= lastBaseUpdate;
+ workInProgress.lanes = lastBaseUpdate;
+ workInProgress.memoizedState = newState;
}
- null === baseQueue && (queue.lanes = 0);
- return [hook.memoizedState, queue.dispatch];
+ currentlyProcessingQueue = null;
}
- function rerenderReducer(reducer) {
- var hook = updateWorkInProgressHook(),
- queue = hook.queue;
- if (null === queue)
+ function callCallback(callback, context) {
+ if ("function" !== typeof callback)
throw Error(
- "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ "Invalid argument passed as callback. Expected a function. Instead received: " +
+ callback
);
- queue.lastRenderedReducer = reducer;
- var dispatch = queue.dispatch,
- lastRenderPhaseUpdate = queue.pending,
- newState = hook.memoizedState;
- if (null !== lastRenderPhaseUpdate) {
- queue.pending = null;
- var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
- do
- (newState = reducer(newState, update.action)), (update = update.next);
- while (update !== lastRenderPhaseUpdate);
- objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
- hook.memoizedState = newState;
- null === hook.baseQueue && (hook.baseState = newState);
- queue.lastRenderedState = newState;
- }
- return [newState, dispatch];
+ callback.call(context);
}
- function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = mountWorkInProgressHook();
- if (isHydrating) {
- if (void 0 === getServerSnapshot)
- throw Error(
- "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
- );
- var nextSnapshot = getServerSnapshot();
- didWarnUncachedGetSnapshot ||
- nextSnapshot === getServerSnapshot() ||
- (console.error(
- "The result of getServerSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0));
- } else {
- nextSnapshot = getSnapshot();
- didWarnUncachedGetSnapshot ||
- ((getServerSnapshot = getSnapshot()),
- objectIs(nextSnapshot, getServerSnapshot) ||
- (console.error(
- "The result of getSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0)));
- if (null === workInProgressRoot)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- 0 !== (workInProgressRootRenderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
- }
- hook.memoizedState = nextSnapshot;
- getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
- hook.queue = getServerSnapshot;
- mountEffect(
- subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe),
- [subscribe]
- );
- fiber.flags |= 2048;
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- getServerSnapshot,
- nextSnapshot,
- getSnapshot
- ),
- null
- );
- return nextSnapshot;
+ function commitHiddenCallbacks(updateQueue, context) {
+ var hiddenCallbacks = updateQueue.shared.hiddenCallbacks;
+ if (null !== hiddenCallbacks)
+ for (
+ updateQueue.shared.hiddenCallbacks = null, updateQueue = 0;
+ updateQueue < hiddenCallbacks.length;
+ updateQueue++
+ )
+ callCallback(hiddenCallbacks[updateQueue], context);
}
- function updateSyncExternalStore(
- subscribe,
- getSnapshot,
- getServerSnapshot
- ) {
- var fiber = currentlyRenderingFiber$1,
- hook = updateWorkInProgressHook(),
- isHydrating$jscomp$0 = isHydrating;
- if (isHydrating$jscomp$0) {
- if (void 0 === getServerSnapshot)
- throw Error(
- "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
- );
- getServerSnapshot = getServerSnapshot();
- } else if (
- ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot)
- ) {
- var cachedSnapshot = getSnapshot();
- objectIs(getServerSnapshot, cachedSnapshot) ||
- (console.error(
- "The result of getSnapshot should be cached to avoid an infinite loop"
- ),
- (didWarnUncachedGetSnapshot = !0));
- }
- if (
- (cachedSnapshot = !objectIs(
- (currentHook || hook).memoizedState,
- getServerSnapshot
- ))
- )
- (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0);
- hook = hook.queue;
- var create = subscribeToStore.bind(null, fiber, hook, subscribe);
- updateEffectImpl(2048, Passive, create, [subscribe]);
- if (
- hook.getSnapshot !== getSnapshot ||
- cachedSnapshot ||
- (null !== workInProgressHook &&
- workInProgressHook.memoizedState.tag & HasEffect)
- ) {
- fiber.flags |= 2048;
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- hook,
- getServerSnapshot,
- getSnapshot
- ),
- null
- );
- if (null === workInProgressRoot)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- isHydrating$jscomp$0 ||
- 0 !== (renderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- return getServerSnapshot;
+ function commitCallbacks(updateQueue, context) {
+ var callbacks = updateQueue.callbacks;
+ if (null !== callbacks)
+ for (
+ updateQueue.callbacks = null, updateQueue = 0;
+ updateQueue < callbacks.length;
+ updateQueue++
+ )
+ callCallback(callbacks[updateQueue], context);
}
- function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
- fiber.flags |= 16384;
- fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
- getSnapshot = currentlyRenderingFiber$1.updateQueue;
- null === getSnapshot
- ? ((getSnapshot = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = getSnapshot),
- (getSnapshot.stores = [fiber]))
- : ((renderedSnapshot = getSnapshot.stores),
- null === renderedSnapshot
- ? (getSnapshot.stores = [fiber])
- : renderedSnapshot.push(fiber));
+ function createCache() {
+ return {
+ controller: new AbortControllerLocal(),
+ data: new Map(),
+ refCount: 0
+ };
}
- function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
- inst.value = nextSnapshot;
- inst.getSnapshot = getSnapshot;
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ function retainCache(cache) {
+ cache.controller.signal.aborted &&
+ console.warn(
+ "A cache instance was retained after it was already freed. This likely indicates a bug in React."
+ );
+ cache.refCount++;
}
- function subscribeToStore(fiber, inst, subscribe) {
- return subscribe(function () {
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
- });
+ function releaseCache(cache) {
+ cache.refCount--;
+ 0 > cache.refCount &&
+ console.warn(
+ "A cache instance was released after it was already freed. This likely indicates a bug in React."
+ );
+ 0 === cache.refCount &&
+ scheduleCallback$2(NormalPriority, function () {
+ cache.controller.abort();
+ });
}
- function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- inst = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(inst, nextValue);
- } catch (error) {
- return !0;
+ function warnOnInvalidCallback(callback) {
+ if (null !== callback && "function" !== typeof callback) {
+ var key = String(callback);
+ didWarnOnInvalidCallback.has(key) ||
+ (didWarnOnInvalidCallback.add(key),
+ console.error(
+ "Expected the last optional `callback` argument to be a function. Instead received: %s.",
+ callback
+ ));
}
}
- function forceStoreRerender(fiber) {
- var root = enqueueConcurrentRenderForLane(fiber, 2);
- null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+ function applyDerivedStateFromProps(
+ workInProgress,
+ ctor,
+ getDerivedStateFromProps,
+ nextProps
+ ) {
+ var prevState = workInProgress.memoizedState,
+ partialState = getDerivedStateFromProps(nextProps, prevState);
+ if (workInProgress.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ partialState = getDerivedStateFromProps(nextProps, prevState);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ void 0 === partialState &&
+ ((ctor = getComponentNameFromType(ctor) || "Component"),
+ didWarnAboutUndefinedDerivedState.has(ctor) ||
+ (didWarnAboutUndefinedDerivedState.add(ctor),
+ console.error(
+ "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
+ ctor
+ )));
+ prevState =
+ null === partialState || void 0 === partialState
+ ? prevState
+ : assign({}, prevState, partialState);
+ workInProgress.memoizedState = prevState;
+ 0 === workInProgress.lanes &&
+ (workInProgress.updateQueue.baseState = prevState);
}
- function mountStateImpl(initialState) {
- var hook = mountWorkInProgressHook();
- if ("function" === typeof initialState) {
- var initialStateInitializer = initialState;
- initialState = initialStateInitializer();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ function checkShouldComponentUpdate(
+ workInProgress,
+ ctor,
+ oldProps,
+ newProps,
+ oldState,
+ newState,
+ nextContext
+ ) {
+ var instance = workInProgress.stateNode;
+ if ("function" === typeof instance.shouldComponentUpdate) {
+ oldProps = instance.shouldComponentUpdate(
+ newProps,
+ newState,
+ nextContext
+ );
+ if (workInProgress.mode & StrictLegacyMode) {
setIsStrictModeForDevtools(!0);
try {
- initialStateInitializer();
+ oldProps = instance.shouldComponentUpdate(
+ newProps,
+ newState,
+ nextContext
+ );
} finally {
setIsStrictModeForDevtools(!1);
}
}
+ void 0 === oldProps &&
+ console.error(
+ "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
+ getComponentNameFromType(ctor) || "Component"
+ );
+ return oldProps;
}
- hook.memoizedState = hook.baseState = initialState;
- hook.queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- return hook;
+ return ctor.prototype && ctor.prototype.isPureReactComponent
+ ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
+ : !0;
}
- function mountState(initialState) {
- initialState = mountStateImpl(initialState);
- var queue = initialState.queue,
- dispatch = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- queue
- );
- queue.dispatch = dispatch;
- return [initialState.memoizedState, dispatch];
+ function callComponentWillReceiveProps(
+ workInProgress,
+ instance,
+ newProps,
+ nextContext
+ ) {
+ var oldState = instance.state;
+ "function" === typeof instance.componentWillReceiveProps &&
+ instance.componentWillReceiveProps(newProps, nextContext);
+ "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
+ instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
+ instance.state !== oldState &&
+ ((workInProgress =
+ getComponentNameFromFiber(workInProgress) || "Component"),
+ didWarnAboutStateAssignmentForComponent.has(workInProgress) ||
+ (didWarnAboutStateAssignmentForComponent.add(workInProgress),
+ console.error(
+ "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
+ workInProgress
+ )),
+ classComponentUpdater.enqueueReplaceState(
+ instance,
+ instance.state,
+ null
+ ));
}
- function mountOptimistic(passthrough) {
- var hook = mountWorkInProgressHook();
- hook.memoizedState = hook.baseState = passthrough;
- var queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: null,
- lastRenderedState: null
- };
- hook.queue = queue;
- hook = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !0,
- queue
- );
- queue.dispatch = hook;
- return [passthrough, hook];
+ function resolveClassComponentProps(Component, baseProps) {
+ var newProps = baseProps;
+ if ("ref" in baseProps) {
+ newProps = {};
+ for (var propName in baseProps)
+ "ref" !== propName && (newProps[propName] = baseProps[propName]);
+ }
+ if ((Component = Component.defaultProps)) {
+ newProps === baseProps && (newProps = assign({}, newProps));
+ for (var _propName in Component)
+ void 0 === newProps[_propName] &&
+ (newProps[_propName] = Component[_propName]);
+ }
+ return newProps;
}
- function updateOptimistic(passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- }
- function updateOptimisticImpl(hook, current, passthrough, reducer) {
- hook.baseState = passthrough;
- return updateReducerImpl(
- hook,
- currentHook,
- "function" === typeof reducer ? reducer : basicStateReducer
- );
- }
- function rerenderOptimistic(passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- if (null !== currentHook)
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- hook.baseState = passthrough;
- return [passthrough, hook.queue.dispatch];
- }
- function dispatchActionState(
- fiber,
- actionQueue,
- setPendingState,
- setState,
- payload
- ) {
- if (isRenderPhaseUpdate(fiber))
- throw Error("Cannot update form state while rendering.");
- fiber = actionQueue.action;
- if (null !== fiber) {
- var actionNode = {
- payload: payload,
- action: fiber,
- next: null,
- isTransition: !0,
- status: "pending",
- value: null,
- reason: null,
- listeners: [],
- then: function (listener) {
- actionNode.listeners.push(listener);
- }
+ function createCapturedValueAtFiber(value, source) {
+ if ("object" === typeof value && null !== value) {
+ var existing = CapturedStacks.get(value);
+ if (void 0 !== existing) return existing;
+ source = {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
};
- null !== ReactSharedInternals.T
- ? setPendingState(!0)
- : (actionNode.isTransition = !1);
- setState(actionNode);
- setPendingState = actionQueue.pending;
- null === setPendingState
- ? ((actionNode.next = actionQueue.pending = actionNode),
- runActionStateAction(actionQueue, actionNode))
- : ((actionNode.next = setPendingState.next),
- (actionQueue.pending = setPendingState.next = actionNode));
+ CapturedStacks.set(value, source);
+ return source;
}
+ return {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
+ };
}
- function runActionStateAction(actionQueue, node) {
- var action = node.action,
- payload = node.payload,
- prevState = actionQueue.state;
- if (node.isTransition) {
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- ReactSharedInternals.T._updatedFibers = new Set();
- try {
- var returnValue = action(prevState, payload),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- handleActionReturnValue(actionQueue, node, returnValue);
- } catch (error) {
- onActionError(actionQueue, node, error);
- } finally {
- (ReactSharedInternals.T = prevTransition),
- null === prevTransition &&
- currentTransition._updatedFibers &&
- ((actionQueue = currentTransition._updatedFibers.size),
- currentTransition._updatedFibers.clear(),
- 10 < actionQueue &&
- console.warn(
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
- ));
- }
+ function pushTreeFork(workInProgress, totalChildren) {
+ warnIfNotHydrating();
+ forkStack[forkStackIndex++] = treeForkCount;
+ forkStack[forkStackIndex++] = treeForkProvider;
+ treeForkProvider = workInProgress;
+ treeForkCount = totalChildren;
+ }
+ function pushTreeId(workInProgress, totalChildren, index) {
+ warnIfNotHydrating();
+ idStack[idStackIndex++] = treeContextId;
+ idStack[idStackIndex++] = treeContextOverflow;
+ idStack[idStackIndex++] = treeContextProvider;
+ treeContextProvider = workInProgress;
+ var baseIdWithLeadingBit = treeContextId;
+ workInProgress = treeContextOverflow;
+ var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
+ baseIdWithLeadingBit &= ~(1 << baseLength);
+ index += 1;
+ var length = 32 - clz32(totalChildren) + baseLength;
+ if (30 < length) {
+ var numberOfOverflowBits = baseLength - (baseLength % 5);
+ length = (
+ baseIdWithLeadingBit &
+ ((1 << numberOfOverflowBits) - 1)
+ ).toString(32);
+ baseIdWithLeadingBit >>= numberOfOverflowBits;
+ baseLength -= numberOfOverflowBits;
+ treeContextId =
+ (1 << (32 - clz32(totalChildren) + baseLength)) |
+ (index << baseLength) |
+ baseIdWithLeadingBit;
+ treeContextOverflow = length + workInProgress;
} else
- try {
- (currentTransition = action(prevState, payload)),
- handleActionReturnValue(actionQueue, node, currentTransition);
- } catch (error$3) {
- onActionError(actionQueue, node, error$3);
- }
+ (treeContextId =
+ (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
+ (treeContextOverflow = workInProgress);
}
- function handleActionReturnValue(actionQueue, node, returnValue) {
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
- ? (returnValue.then(
- function (nextState) {
- onActionSuccess(actionQueue, node, nextState);
- },
- function (error) {
- return onActionError(actionQueue, node, error);
- }
- ),
- node.isTransition ||
- console.error(
- "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
- ))
- : onActionSuccess(actionQueue, node, returnValue);
+ function pushMaterializedTreeId(workInProgress) {
+ warnIfNotHydrating();
+ null !== workInProgress.return &&
+ (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
}
- function onActionSuccess(actionQueue, actionNode, nextState) {
- actionNode.status = "fulfilled";
- actionNode.value = nextState;
- notifyActionListeners(actionNode);
- actionQueue.state = nextState;
- actionNode = actionQueue.pending;
- null !== actionNode &&
- ((nextState = actionNode.next),
- nextState === actionNode
- ? (actionQueue.pending = null)
- : ((nextState = nextState.next),
- (actionNode.next = nextState),
- runActionStateAction(actionQueue, nextState)));
+ function popTreeContext(workInProgress) {
+ for (; workInProgress === treeForkProvider; )
+ (treeForkProvider = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null),
+ (treeForkCount = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null);
+ for (; workInProgress === treeContextProvider; )
+ (treeContextProvider = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextOverflow = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextId = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null);
}
- function onActionError(actionQueue, actionNode, error) {
- var last = actionQueue.pending;
- actionQueue.pending = null;
- if (null !== last) {
- last = last.next;
- do
- (actionNode.status = "rejected"),
- (actionNode.reason = error),
- notifyActionListeners(actionNode),
- (actionNode = actionNode.next);
- while (actionNode !== last);
- }
- actionQueue.action = null;
+ function warnIfNotHydrating() {
+ isHydrating ||
+ console.error(
+ "Expected to be hydrating. This is a bug in React. Please file an issue."
+ );
}
- function notifyActionListeners(actionNode) {
- actionNode = actionNode.listeners;
- for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+ function buildHydrationDiffNode(fiber, distanceFromLeaf) {
+ if (null === fiber.return) {
+ if (null === hydrationDiffRootDEV)
+ hydrationDiffRootDEV = {
+ fiber: fiber,
+ children: [],
+ serverProps: void 0,
+ serverTail: [],
+ distanceFromLeaf: distanceFromLeaf
+ };
+ else {
+ if (hydrationDiffRootDEV.fiber !== fiber)
+ throw Error(
+ "Saw multiple hydration diff roots in a pass. This is a bug in React."
+ );
+ hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf &&
+ (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf);
+ }
+ return hydrationDiffRootDEV;
+ }
+ var siblings = buildHydrationDiffNode(
+ fiber.return,
+ distanceFromLeaf + 1
+ ).children;
+ if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber)
+ return (
+ (siblings = siblings[siblings.length - 1]),
+ siblings.distanceFromLeaf > distanceFromLeaf &&
+ (siblings.distanceFromLeaf = distanceFromLeaf),
+ siblings
+ );
+ distanceFromLeaf = {
+ fiber: fiber,
+ children: [],
+ serverProps: void 0,
+ serverTail: [],
+ distanceFromLeaf: distanceFromLeaf
+ };
+ siblings.push(distanceFromLeaf);
+ return distanceFromLeaf;
}
- function actionStateReducer(oldState, newState) {
- return newState;
+ function warnNonHydratedInstance(fiber, rejectedCandidate) {
+ didSuspendOrErrorDEV ||
+ ((fiber = buildHydrationDiffNode(fiber, 0)),
+ (fiber.serverProps = null),
+ null !== rejectedCandidate &&
+ ((rejectedCandidate =
+ describeHydratableInstanceForDevWarnings(rejectedCandidate)),
+ fiber.serverTail.push(rejectedCandidate)));
}
- function mountActionState(action, initialStateProp) {
- if (isHydrating) {
- var ssrFormState = workInProgressRoot.formState;
- if (null !== ssrFormState) {
- a: {
- var isMatching = currentlyRenderingFiber$1;
- if (isHydrating) {
- if (nextHydratableInstance) {
- b: {
- var markerInstance = nextHydratableInstance;
- for (
- var inRootOrSingleton = rootOrSingletonContext;
- 8 !== markerInstance.nodeType;
-
- ) {
- if (!inRootOrSingleton) {
- markerInstance = null;
- break b;
- }
- markerInstance = getNextHydratable(
- markerInstance.nextSibling
- );
- if (null === markerInstance) {
- markerInstance = null;
- break b;
- }
- }
- inRootOrSingleton = markerInstance.data;
- markerInstance =
- inRootOrSingleton === FORM_STATE_IS_MATCHING ||
- inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING
- ? markerInstance
- : null;
- }
- if (markerInstance) {
- nextHydratableInstance = getNextHydratable(
- markerInstance.nextSibling
- );
- isMatching = markerInstance.data === FORM_STATE_IS_MATCHING;
- break a;
- }
- }
- throwOnHydrationMismatch(isMatching);
- }
- isMatching = !1;
- }
- isMatching && (initialStateProp = ssrFormState[0]);
- }
- }
- ssrFormState = mountWorkInProgressHook();
- ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
- isMatching = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: actionStateReducer,
- lastRenderedState: initialStateProp
- };
- ssrFormState.queue = isMatching;
- ssrFormState = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- isMatching
- );
- isMatching.dispatch = ssrFormState;
- isMatching = mountStateImpl(!1);
- inRootOrSingleton = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !1,
- isMatching.queue
- );
- isMatching = mountWorkInProgressHook();
- markerInstance = {
- state: initialStateProp,
- dispatch: null,
- action: action,
- pending: null
- };
- isMatching.queue = markerInstance;
- ssrFormState = dispatchActionState.bind(
- null,
- currentlyRenderingFiber$1,
- markerInstance,
- inRootOrSingleton,
- ssrFormState
+ function throwOnHydrationMismatch(fiber) {
+ var diff = "",
+ diffRoot = hydrationDiffRootDEV;
+ null !== diffRoot &&
+ ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot)));
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" +
+ diff
+ ),
+ fiber
+ )
);
- markerInstance.dispatch = ssrFormState;
- isMatching.memoizedState = action;
- return [initialStateProp, ssrFormState, !1];
+ throw HydrationMismatchException;
}
- function updateActionState(action) {
- var stateHook = updateWorkInProgressHook();
- return updateActionStateImpl(stateHook, currentHook, action);
+ function prepareToHydrateHostInstance(fiber) {
+ var didHydrate = fiber.stateNode;
+ var type = fiber.type,
+ props = fiber.memoizedProps;
+ didHydrate[internalInstanceKey] = fiber;
+ didHydrate[internalPropsKey] = props;
+ validatePropertiesInDevelopment(type, props);
+ switch (type) {
+ case "dialog":
+ listenToNonDelegatedEvent("cancel", didHydrate);
+ listenToNonDelegatedEvent("close", didHydrate);
+ break;
+ case "iframe":
+ case "object":
+ case "embed":
+ listenToNonDelegatedEvent("load", didHydrate);
+ break;
+ case "video":
+ case "audio":
+ for (type = 0; type < mediaEventTypes.length; type++)
+ listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate);
+ break;
+ case "source":
+ listenToNonDelegatedEvent("error", didHydrate);
+ break;
+ case "img":
+ case "image":
+ case "link":
+ listenToNonDelegatedEvent("error", didHydrate);
+ listenToNonDelegatedEvent("load", didHydrate);
+ break;
+ case "details":
+ listenToNonDelegatedEvent("toggle", didHydrate);
+ break;
+ case "input":
+ checkControlledValueProps("input", props);
+ listenToNonDelegatedEvent("invalid", didHydrate);
+ validateInputProps(didHydrate, props);
+ initInput(
+ didHydrate,
+ props.value,
+ props.defaultValue,
+ props.checked,
+ props.defaultChecked,
+ props.type,
+ props.name,
+ !0
+ );
+ track(didHydrate);
+ break;
+ case "option":
+ validateOptionProps(didHydrate, props);
+ break;
+ case "select":
+ checkControlledValueProps("select", props);
+ listenToNonDelegatedEvent("invalid", didHydrate);
+ validateSelectProps(didHydrate, props);
+ break;
+ case "textarea":
+ checkControlledValueProps("textarea", props),
+ listenToNonDelegatedEvent("invalid", didHydrate),
+ validateTextareaProps(didHydrate, props),
+ initTextarea(
+ didHydrate,
+ props.value,
+ props.defaultValue,
+ props.children
+ ),
+ track(didHydrate);
+ }
+ type = props.children;
+ ("string" !== typeof type &&
+ "number" !== typeof type &&
+ "bigint" !== typeof type) ||
+ didHydrate.textContent === "" + type ||
+ !0 === props.suppressHydrationWarning ||
+ checkForUnmatchedText(didHydrate.textContent, type)
+ ? (null != props.popover &&
+ (listenToNonDelegatedEvent("beforetoggle", didHydrate),
+ listenToNonDelegatedEvent("toggle", didHydrate)),
+ null != props.onScroll &&
+ listenToNonDelegatedEvent("scroll", didHydrate),
+ null != props.onScrollEnd &&
+ listenToNonDelegatedEvent("scrollend", didHydrate),
+ null != props.onClick && (didHydrate.onclick = noop$2),
+ (didHydrate = !0))
+ : (didHydrate = !1);
+ didHydrate || throwOnHydrationMismatch(fiber);
}
- function updateActionStateImpl(stateHook, currentStateHook, action) {
- currentStateHook = updateReducerImpl(
- stateHook,
- currentStateHook,
- actionStateReducer
- )[0];
- stateHook = updateReducer(basicStateReducer)[0];
- if (
- "object" === typeof currentStateHook &&
- null !== currentStateHook &&
- "function" === typeof currentStateHook.then
- )
- try {
- var state = useThenable(currentStateHook);
- } catch (x) {
- if (x === SuspenseException) throw SuspenseActionException;
- throw x;
+ function popToNextHostParent(fiber) {
+ for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
+ switch (hydrationParentFiber.tag) {
+ case 3:
+ case 27:
+ rootOrSingletonContext = !0;
+ return;
+ case 5:
+ case 13:
+ rootOrSingletonContext = !1;
+ return;
+ default:
+ hydrationParentFiber = hydrationParentFiber.return;
}
- else state = currentStateHook;
- currentStateHook = updateWorkInProgressHook();
- var actionQueue = currentStateHook.queue,
- dispatch = actionQueue.dispatch;
- action !== currentStateHook.memoizedState &&
- ((currentlyRenderingFiber$1.flags |= 2048),
- pushSimpleEffect(
- HasEffect | Passive,
- createEffectInstance(),
- actionStateActionEffect.bind(null, actionQueue, action),
- null
- ));
- return [state, dispatch, stateHook];
- }
- function actionStateActionEffect(actionQueue, action) {
- actionQueue.action = action;
- }
- function rerenderActionState(action) {
- var stateHook = updateWorkInProgressHook(),
- currentStateHook = currentHook;
- if (null !== currentStateHook)
- return updateActionStateImpl(stateHook, currentStateHook, action);
- updateWorkInProgressHook();
- stateHook = stateHook.memoizedState;
- currentStateHook = updateWorkInProgressHook();
- var dispatch = currentStateHook.queue.dispatch;
- currentStateHook.memoizedState = action;
- return [stateHook, dispatch, !1];
- }
- function pushSimpleEffect(tag, inst, create, deps) {
- tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
- inst = currentlyRenderingFiber$1.updateQueue;
- null === inst &&
- ((inst = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = inst));
- create = inst.lastEffect;
- null === create
- ? (inst.lastEffect = tag.next = tag)
- : ((deps = create.next),
- (create.next = tag),
- (tag.next = deps),
- (inst.lastEffect = tag));
- return tag;
}
- function createEffectInstance() {
- return { destroy: void 0, resource: void 0 };
- }
- function mountRef(initialValue) {
- var hook = mountWorkInProgressHook();
- initialValue = { current: initialValue };
- return (hook.memoizedState = initialValue);
- }
- function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- currentlyRenderingFiber$1.flags |= fiberFlags;
- hook.memoizedState = pushSimpleEffect(
- HasEffect | hookFlags,
- createEffectInstance(),
- create,
- deps
- );
+ function popHydrationState(fiber) {
+ if (fiber !== hydrationParentFiber) return !1;
+ if (!isHydrating)
+ return popToNextHostParent(fiber), (isHydrating = !0), !1;
+ var shouldClear = !1,
+ JSCompiler_temp;
+ if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
+ if ((JSCompiler_temp = 5 === fiber.tag))
+ (JSCompiler_temp = fiber.type),
+ (JSCompiler_temp =
+ !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
+ shouldSetTextContent(fiber.type, fiber.memoizedProps));
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp && (shouldClear = !0);
+ if (shouldClear && nextHydratableInstance) {
+ for (shouldClear = nextHydratableInstance; shouldClear; ) {
+ JSCompiler_temp = buildHydrationDiffNode(fiber, 0);
+ var description =
+ describeHydratableInstanceForDevWarnings(shouldClear);
+ JSCompiler_temp.serverTail.push(description);
+ shouldClear =
+ "Suspense" === description.type
+ ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear)
+ : getNextHydratable(shouldClear.nextSibling);
+ }
+ throwOnHydrationMismatch(fiber);
+ }
+ popToNextHostParent(fiber);
+ if (13 === fiber.tag) {
+ fiber = fiber.memoizedState;
+ fiber = null !== fiber ? fiber.dehydrated : null;
+ if (!fiber)
+ throw Error(
+ "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."
+ );
+ nextHydratableInstance =
+ getNextHydratableInstanceAfterSuspenseInstance(fiber);
+ } else
+ nextHydratableInstance = hydrationParentFiber
+ ? getNextHydratable(fiber.stateNode.nextSibling)
+ : null;
+ return !0;
}
- function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var inst = hook.memoizedState.inst;
- null !== currentHook &&
- null !== deps &&
- areHookInputsEqual(deps, currentHook.memoizedState.deps)
- ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
- : ((currentlyRenderingFiber$1.flags |= fiberFlags),
- (hook.memoizedState = pushSimpleEffect(
- HasEffect | hookFlags,
- inst,
- create,
- deps
- )));
+ function resetHydrationState() {
+ nextHydratableInstance = hydrationParentFiber = null;
+ didSuspendOrErrorDEV = isHydrating = !1;
}
- function mountEffect(create, deps) {
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode
- ? mountEffectImpl(142608384, Passive, create, deps)
- : mountEffectImpl(8390656, Passive, create, deps);
+ function upgradeHydrationErrorsToRecoverable() {
+ var queuedErrors = hydrationErrors;
+ null !== queuedErrors &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = queuedErrors)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ queuedErrors
+ ),
+ (hydrationErrors = null));
+ return queuedErrors;
}
- function useEffectEventImpl(payload) {
- currentlyRenderingFiber$1.flags |= 4;
- var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
- if (null === componentUpdateQueue)
- (componentUpdateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue),
- (componentUpdateQueue.events = [payload]);
- else {
- var events = componentUpdateQueue.events;
- null === events
- ? (componentUpdateQueue.events = [payload])
- : events.push(payload);
- }
+ function queueHydrationError(error) {
+ null === hydrationErrors
+ ? (hydrationErrors = [error])
+ : hydrationErrors.push(error);
}
- function mountEvent(callback) {
- var hook = mountWorkInProgressHook(),
- ref = { impl: callback };
- hook.memoizedState = ref;
- return function () {
- if ((executionContext & RenderContext) !== NoContext)
- throw Error(
- "A function wrapped in useEffectEvent can't be called during rendering."
- );
- return ref.impl.apply(void 0, arguments);
- };
+ function emitPendingHydrationWarnings() {
+ var diffRoot = hydrationDiffRootDEV;
+ null !== diffRoot &&
+ ((hydrationDiffRootDEV = null),
+ (diffRoot = describeDiff(diffRoot)),
+ console.error(
+ "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s",
+ "https://react.dev/link/hydration-mismatch",
+ diffRoot
+ ));
}
- function updateEvent(callback) {
- var ref = updateWorkInProgressHook().memoizedState;
- useEffectEventImpl({ ref: ref, nextImpl: callback });
- return function () {
- if ((executionContext & RenderContext) !== NoContext)
- throw Error(
- "A function wrapped in useEffectEvent can't be called during rendering."
- );
- return ref.impl.apply(void 0, arguments);
- };
+ function createThenableState() {
+ return { didWarnAboutUncachedPromise: !1, thenables: [] };
}
- function mountLayoutEffect(create, deps) {
- var fiberFlags = 4194308;
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (fiberFlags |= 67108864);
- return mountEffectImpl(fiberFlags, Layout, create, deps);
+ function isThenableResolved(thenable) {
+ thenable = thenable.status;
+ return "fulfilled" === thenable || "rejected" === thenable;
}
- function imperativeHandleEffect(create, ref) {
- if ("function" === typeof ref) {
- create = create();
- var refCleanup = ref(create);
- return function () {
- "function" === typeof refCleanup ? refCleanup() : ref(null);
- };
- }
- if (null !== ref && void 0 !== ref)
- return (
- ref.hasOwnProperty("current") ||
+ function noop$4() {}
+ function trackUsedThenable(thenableState, thenable, index) {
+ null !== ReactSharedInternals.actQueue &&
+ (ReactSharedInternals.didUsePromise = !0);
+ var trackedThenables = thenableState.thenables;
+ index = trackedThenables[index];
+ void 0 === index
+ ? trackedThenables.push(thenable)
+ : index !== thenable &&
+ (thenableState.didWarnAboutUncachedPromise ||
+ ((thenableState.didWarnAboutUncachedPromise = !0),
console.error(
- "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
- "an object with keys {" + Object.keys(ref).join(", ") + "}"
- ),
- (create = create()),
- (ref.current = create),
- function () {
- ref.current = null;
+ "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
+ )),
+ thenable.then(noop$4, noop$4),
+ (thenable = index));
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ default:
+ if ("string" === typeof thenable.status)
+ thenable.then(noop$4, noop$4);
+ else {
+ thenableState = workInProgressRoot;
+ if (
+ null !== thenableState &&
+ 100 < thenableState.shellSuspendCounter
+ )
+ throw Error(
+ "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
+ );
+ thenableState = thenable;
+ thenableState.status = "pending";
+ thenableState.then(
+ function (fulfilledValue) {
+ if ("pending" === thenable.status) {
+ var fulfilledThenable = thenable;
+ fulfilledThenable.status = "fulfilled";
+ fulfilledThenable.value = fulfilledValue;
+ }
+ },
+ function (error) {
+ if ("pending" === thenable.status) {
+ var rejectedThenable = thenable;
+ rejectedThenable.status = "rejected";
+ rejectedThenable.reason = error;
+ }
+ }
+ );
}
- );
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ }
+ suspendedThenable = thenable;
+ needsToResetSuspendedThenableDEV = !0;
+ throw SuspenseException;
+ }
}
- function mountImperativeHandle(ref, create, deps) {
- "function" !== typeof create &&
- console.error(
- "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
- null !== create ? typeof create : "null"
+ function getSuspendedThenable() {
+ if (null === suspendedThenable)
+ throw Error(
+ "Expected a suspended thenable. This is a bug in React. Please file an issue."
);
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- var fiberFlags = 4194308;
- (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode &&
- (fiberFlags |= 67108864);
- mountEffectImpl(
- fiberFlags,
- Layout,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
+ var thenable = suspendedThenable;
+ suspendedThenable = null;
+ needsToResetSuspendedThenableDEV = !1;
+ return thenable;
}
- function updateImperativeHandle(ref, create, deps) {
- "function" !== typeof create &&
- console.error(
- "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
- null !== create ? typeof create : "null"
+ function checkIfUseWrappedInAsyncCatch(rejectedReason) {
+ if (
+ rejectedReason === SuspenseException ||
+ rejectedReason === SuspenseActionException
+ )
+ throw Error(
+ "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
);
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- updateEffectImpl(
- 4,
- Layout,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
- }
- function mountCallback(callback, deps) {
- mountWorkInProgressHook().memoizedState = [
- callback,
- void 0 === deps ? null : deps
- ];
- return callback;
- }
- function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- hook.memoizedState = [callback, deps];
- return callback;
}
- function mountMemo(nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var nextValue = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- hook.memoizedState = [nextValue, deps];
- return nextValue;
+ function pushHiddenContext(fiber, context) {
+ var prevEntangledRenderLanes = entangledRenderLanes;
+ push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber);
+ push(currentTreeHiddenStackCursor, context, fiber);
+ entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes;
}
- function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- prevState = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- hook.memoizedState = [prevState, deps];
- return prevState;
+ function reuseHiddenContextOnStack(fiber) {
+ push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber);
+ push(
+ currentTreeHiddenStackCursor,
+ currentTreeHiddenStackCursor.current,
+ fiber
+ );
}
- function mountDeferredValue(value, initialValue) {
- var hook = mountWorkInProgressHook();
- return mountDeferredValueImpl(hook, value, initialValue);
+ function popHiddenContext(fiber) {
+ entangledRenderLanes = prevEntangledRenderLanesCursor.current;
+ pop(currentTreeHiddenStackCursor, fiber);
+ pop(prevEntangledRenderLanesCursor, fiber);
}
- function updateDeferredValue(value, initialValue) {
- var hook = updateWorkInProgressHook();
- return updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
+ function peekCacheFromPool() {
+ var cacheResumedFromPreviousRender = resumedCache.current;
+ return null !== cacheResumedFromPreviousRender
+ ? cacheResumedFromPreviousRender
+ : workInProgressRoot.pooledCache;
}
- function rerenderDeferredValue(value, initialValue) {
- var hook = updateWorkInProgressHook();
- return null === currentHook
- ? mountDeferredValueImpl(hook, value, initialValue)
- : updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
+ function pushTransition(offscreenWorkInProgress, prevCachePool) {
+ null === prevCachePool
+ ? push(resumedCache, resumedCache.current, offscreenWorkInProgress)
+ : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress);
}
- function mountDeferredValueImpl(hook, value, initialValue) {
- if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
- return (hook.memoizedState = value);
- hook.memoizedState = initialValue;
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return initialValue;
+ function getSuspendedCache() {
+ var cacheFromPool = peekCacheFromPool();
+ return null === cacheFromPool
+ ? null
+ : { parent: CacheContext._currentValue, pool: cacheFromPool };
}
- function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
- if (objectIs(value, prevValue)) return value;
- if (null !== currentTreeHiddenStackCursor.current)
- return (
- (hook = mountDeferredValueImpl(hook, value, initialValue)),
- objectIs(hook, prevValue) || (didReceiveUpdate = !0),
- hook
- );
- if (0 === (renderLanes & 42))
- return (didReceiveUpdate = !0), (hook.memoizedState = value);
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return prevValue;
+ function mountHookTypesDev() {
+ var hookName = currentHookNameInDev;
+ null === hookTypesDev
+ ? (hookTypesDev = [hookName])
+ : hookTypesDev.push(hookName);
}
- function startTransition(
- fiber,
- queue,
- pendingState,
- finishedState,
- callback
- ) {
- var previousPriority = ReactDOMSharedInternals.p;
- ReactDOMSharedInternals.p =
- 0 !== previousPriority && previousPriority < ContinuousEventPriority
- ? previousPriority
- : ContinuousEventPriority;
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- dispatchOptimisticSetState(fiber, !1, queue, pendingState);
- currentTransition._updatedFibers = new Set();
- try {
- var returnValue = callback(),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
+ function updateHookTypesDev() {
+ var hookName = currentHookNameInDev;
+ if (
+ null !== hookTypesDev &&
+ (hookTypesUpdateIndexDev++,
+ hookTypesDev[hookTypesUpdateIndexDev] !== hookName)
+ ) {
+ var componentName = getComponentNameFromFiber(currentlyRenderingFiber);
if (
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
+ !didWarnAboutMismatchedHooksForComponent.has(componentName) &&
+ (didWarnAboutMismatchedHooksForComponent.add(componentName),
+ null !== hookTypesDev)
) {
- var thenableForFinishedState = chainThenableValue(
- returnValue,
- finishedState
- );
- dispatchSetStateInternal(
- fiber,
- queue,
- thenableForFinishedState,
- requestUpdateLane(fiber)
- );
- } else
- dispatchSetStateInternal(
- fiber,
- queue,
- finishedState,
- requestUpdateLane(fiber)
+ for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) {
+ var oldHookName = hookTypesDev[i],
+ newHookName =
+ i === hookTypesUpdateIndexDev ? hookName : oldHookName;
+ for (
+ oldHookName = i + 1 + ". " + oldHookName;
+ 30 > oldHookName.length;
+
+ )
+ oldHookName += " ";
+ oldHookName += newHookName + "\n";
+ table += oldHookName;
+ }
+ console.error(
+ "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
+ componentName,
+ table
);
- } catch (error) {
- dispatchSetStateInternal(
- fiber,
- queue,
- { then: function () {}, status: "rejected", reason: error },
- requestUpdateLane(fiber)
- );
- } finally {
- (ReactDOMSharedInternals.p = previousPriority),
- (ReactSharedInternals.T = prevTransition),
- null === prevTransition &&
- currentTransition._updatedFibers &&
- ((fiber = currentTransition._updatedFibers.size),
- currentTransition._updatedFibers.clear(),
- 10 < fiber &&
- console.warn(
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
- ));
+ }
}
}
- function startHostTransition(formFiber, pendingState, action, formData) {
- if (5 !== formFiber.tag)
- throw Error(
- "Expected the form instance to be a HostComponent. This is a bug in React."
+ function checkDepsAreArrayDev(deps) {
+ void 0 === deps ||
+ null === deps ||
+ isArrayImpl(deps) ||
+ console.error(
+ "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
+ currentHookNameInDev,
+ typeof deps
);
- var queue = ensureFormComponentIsStateful(formFiber).queue;
- startTransition(
- formFiber,
- queue,
- pendingState,
- NotPendingTransition,
- null === action
- ? noop$3
- : function () {
- requestFormReset$2(formFiber);
- return action(formData);
- }
+ }
+ function warnOnUseFormStateInDev() {
+ var componentName = getComponentNameFromFiber(currentlyRenderingFiber);
+ didWarnAboutUseFormState.has(componentName) ||
+ (didWarnAboutUseFormState.add(componentName),
+ console.error(
+ "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",
+ componentName
+ ));
+ }
+ function throwInvalidHookError() {
+ throw Error(
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
);
}
- function ensureFormComponentIsStateful(formFiber) {
- var existingStateHook = formFiber.memoizedState;
- if (null !== existingStateHook) return existingStateHook;
- existingStateHook = {
- memoizedState: NotPendingTransition,
- baseState: NotPendingTransition,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: NotPendingTransition
- },
- next: null
- };
- var initialResetState = {};
- existingStateHook.next = {
- memoizedState: initialResetState,
- baseState: initialResetState,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialResetState
- },
- next: null
- };
- formFiber.memoizedState = existingStateHook;
- formFiber = formFiber.alternate;
- null !== formFiber && (formFiber.memoizedState = existingStateHook);
- return existingStateHook;
- }
- function requestFormReset$2(formFiber) {
- null === ReactSharedInternals.T &&
+ function areHookInputsEqual(nextDeps, prevDeps) {
+ if (ignorePreviousDependencies) return !1;
+ if (null === prevDeps)
+ return (
+ console.error(
+ "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
+ currentHookNameInDev
+ ),
+ !1
+ );
+ nextDeps.length !== prevDeps.length &&
console.error(
- "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
+ "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s",
+ currentHookNameInDev,
+ "[" + prevDeps.join(", ") + "]",
+ "[" + nextDeps.join(", ") + "]"
);
- var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
- dispatchSetStateInternal(
- formFiber,
- resetStateQueue,
- {},
- requestUpdateLane(formFiber)
- );
- }
- function mountTransition() {
- var stateHook = mountStateImpl(!1);
- stateHook = startTransition.bind(
- null,
- currentlyRenderingFiber$1,
- stateHook.queue,
- !0,
- !1
- );
- mountWorkInProgressHook().memoizedState = stateHook;
- return [!1, stateHook];
- }
- function updateTransition() {
- var booleanOrThenable = updateReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- }
- function rerenderTransition() {
- var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- }
- function useHostTransitionStatus() {
- return readContext(HostTransitionContext);
- }
- function mountId() {
- var hook = mountWorkInProgressHook(),
- identifierPrefix = workInProgressRoot.identifierPrefix;
- if (isHydrating) {
- var treeId = treeContextOverflow;
- var idWithLeadingBit = treeContextId;
- treeId =
- (
- idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
- ).toString(32) + treeId;
- identifierPrefix = ":" + identifierPrefix + "R" + treeId;
- treeId = localIdCounter++;
- 0 < treeId && (identifierPrefix += "H" + treeId.toString(32));
- identifierPrefix += ":";
- } else
- (treeId = globalClientIdCounter++),
- (identifierPrefix =
- ":" + identifierPrefix + "r" + treeId.toString(32) + ":");
- return (hook.memoizedState = identifierPrefix);
- }
- function mountRefresh() {
- return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
- null,
- currentlyRenderingFiber$1
- ));
+ for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
+ if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
+ return !0;
}
- function refreshCache(fiber, seedKey, seedValue) {
- for (var provider = fiber.return; null !== provider; ) {
- switch (provider.tag) {
- case 24:
- case 3:
- var lane = requestUpdateLane(provider);
- fiber = createUpdate(lane);
- var root = enqueueUpdate(provider, fiber, lane);
- null !== root &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(root, provider, lane),
- entangleTransitions(root, provider, lane));
- provider = createCache();
- null !== seedKey &&
- void 0 !== seedKey &&
- null !== root &&
- provider.data.set(seedKey, seedValue);
- fiber.payload = { cache: provider };
- return;
+ function renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ props,
+ secondArg,
+ nextRenderLanes
+ ) {
+ renderLanes = nextRenderLanes;
+ currentlyRenderingFiber = workInProgress;
+ hookTypesDev = null !== current ? current._debugHookTypes : null;
+ hookTypesUpdateIndexDev = -1;
+ ignorePreviousDependencies =
+ null !== current && current.type !== workInProgress.type;
+ if (
+ "[object AsyncFunction]" ===
+ Object.prototype.toString.call(Component) ||
+ "[object AsyncGeneratorFunction]" ===
+ Object.prototype.toString.call(Component)
+ )
+ (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)),
+ didWarnAboutAsyncClientComponent.has(nextRenderLanes) ||
+ (didWarnAboutAsyncClientComponent.add(nextRenderLanes),
+ console.error(
+ "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."
+ ));
+ workInProgress.memoizedState = null;
+ workInProgress.updateQueue = null;
+ workInProgress.lanes = 0;
+ ReactSharedInternals.H =
+ null !== current && null !== current.memoizedState
+ ? HooksDispatcherOnUpdateInDEV
+ : null !== hookTypesDev
+ ? HooksDispatcherOnMountWithHookTypesInDEV
+ : HooksDispatcherOnMountInDEV;
+ shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes =
+ (workInProgress.mode & StrictLegacyMode) !== NoMode;
+ var children = callComponentInDEV(Component, props, secondArg);
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ didScheduleRenderPhaseUpdateDuringThisPass &&
+ (children = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ ));
+ if (nextRenderLanes) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ children = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ );
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- provider = provider.return;
}
+ finishRenderingHooks(current, workInProgress);
+ return children;
}
- function dispatchReducerAction(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p0
- ) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 &&
+ function finishRenderingHooks(current, workInProgress) {
+ workInProgress._debugHookTypes = hookTypesDev;
+ null === workInProgress.dependencies
+ ? null !== thenableState$1 &&
+ (workInProgress.dependencies = {
+ lanes: 0,
+ firstContext: null,
+ _debugThenableState: thenableState$1
+ })
+ : (workInProgress.dependencies._debugThenableState = thenableState$1);
+ ReactSharedInternals.H = ContextOnlyDispatcher;
+ var didRenderTooFewHooks =
+ null !== currentHook && null !== currentHook.next;
+ renderLanes = 0;
+ hookTypesDev =
+ currentHookNameInDev =
+ workInProgressHook =
+ currentHook =
+ currentlyRenderingFiber =
+ null;
+ hookTypesUpdateIndexDev = -1;
+ null !== current &&
+ (current.flags & 31457280) !== (workInProgress.flags & 31457280) &&
console.error(
- "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ "Internal React error: Expected static flag was missing. Please notify the React team."
);
- JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber);
- action = {
- lane: JSCompiler_OptimizeArgumentsArray_p0,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- isRenderPhaseUpdate(fiber)
- ? enqueueRenderPhaseUpdate(queue, action)
- : ((action = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p0
- )),
- null !== action &&
- (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0),
- scheduleUpdateOnFiber(
- action,
- fiber,
- JSCompiler_OptimizeArgumentsArray_p0
- ),
- entangleTransitionUpdate(
- action,
- queue,
- JSCompiler_OptimizeArgumentsArray_p0
- )));
- }
- function dispatchSetState(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p1
- ) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 &&
- console.error(
- "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ didScheduleRenderPhaseUpdate = !1;
+ thenableIndexCounter$1 = 0;
+ thenableState$1 = null;
+ if (didRenderTooFewHooks)
+ throw Error(
+ "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
);
- JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber);
- dispatchSetStateInternal(
- fiber,
- queue,
- action,
- JSCompiler_OptimizeArgumentsArray_p1
- ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1);
- }
- function dispatchSetStateInternal(fiber, queue, action, lane) {
- var update = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
- else {
- var alternate = fiber.alternate;
- if (
- 0 === fiber.lanes &&
- (null === alternate || 0 === alternate.lanes) &&
- ((alternate = queue.lastRenderedReducer), null !== alternate)
- ) {
- var prevDispatcher = ReactSharedInternals.H;
- ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- var currentState = queue.lastRenderedState,
- eagerState = alternate(currentState, action);
- update.hasEagerState = !0;
- update.eagerState = eagerState;
- if (objectIs(eagerState, currentState))
- return (
- enqueueUpdate$1(fiber, queue, update, 0),
- null === workInProgressRoot &&
- finishQueueingConcurrentUpdates(),
- !1
- );
- } catch (error) {
- } finally {
- ReactSharedInternals.H = prevDispatcher;
- }
- }
- action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
- if (null !== action)
- return (
- scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane),
- !0
+ null === current ||
+ didReceiveUpdate ||
+ ((current = current.dependencies),
+ null !== current &&
+ checkIfContextChanged(current) &&
+ (didReceiveUpdate = !0));
+ needsToResetSuspendedThenableDEV
+ ? ((needsToResetSuspendedThenableDEV = !1), (current = !0))
+ : (current = !1);
+ current &&
+ ((workInProgress =
+ getComponentNameFromFiber(workInProgress) || "Unknown"),
+ didWarnAboutUseWrappedInTryCatch.has(workInProgress) ||
+ didWarnAboutAsyncClientComponent.has(workInProgress) ||
+ (didWarnAboutUseWrappedInTryCatch.add(workInProgress),
+ console.error(
+ "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary."
+ )));
+ }
+ function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
+ currentlyRenderingFiber = workInProgress;
+ var numberOfReRenders = 0;
+ do {
+ didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
+ thenableIndexCounter$1 = 0;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ if (numberOfReRenders >= RE_RENDER_LIMIT)
+ throw Error(
+ "Too many re-renders. React limits the number of renders to prevent an infinite loop."
);
- }
- return !1;
+ numberOfReRenders += 1;
+ ignorePreviousDependencies = !1;
+ workInProgressHook = currentHook = null;
+ if (null != workInProgress.updateQueue) {
+ var children = workInProgress.updateQueue;
+ children.lastEffect = null;
+ children.events = null;
+ children.stores = null;
+ null != children.memoCache && (children.memoCache.index = 0);
+ }
+ hookTypesUpdateIndexDev = -1;
+ ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV;
+ children = callComponentInDEV(Component, props, secondArg);
+ } while (didScheduleRenderPhaseUpdateDuringThisPass);
+ return children;
}
- function dispatchOptimisticSetState(
- fiber,
- throwIfDuringRender,
- queue,
- action
- ) {
- null === ReactSharedInternals.T &&
- 0 === currentEntangledLane &&
- console.error(
- "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
- );
- action = {
- lane: 2,
- revertLane: requestTransitionLane(),
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) {
- if (throwIfDuringRender)
- throw Error("Cannot update optimistic state while rendering.");
- console.error("Cannot call startTransition while rendering.");
- } else
- (throwIfDuringRender = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- 2
- )),
- null !== throwIfDuringRender &&
- (startUpdateTimerByLane(2),
- scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
+ function TransitionAwareHostComponent() {
+ var dispatcher = ReactSharedInternals.H,
+ maybeThenable = dispatcher.useState()[0];
+ maybeThenable =
+ "function" === typeof maybeThenable.then
+ ? useThenable(maybeThenable)
+ : maybeThenable;
+ dispatcher = dispatcher.useState()[0];
+ (null !== currentHook ? currentHook.memoizedState : null) !==
+ dispatcher && (currentlyRenderingFiber.flags |= 1024);
+ return maybeThenable;
}
- function isRenderPhaseUpdate(fiber) {
- var alternate = fiber.alternate;
- return (
- fiber === currentlyRenderingFiber$1 ||
- (null !== alternate && alternate === currentlyRenderingFiber$1)
- );
+ function checkDidRenderIdHook() {
+ var didRenderIdHook = 0 !== localIdCounter;
+ localIdCounter = 0;
+ return didRenderIdHook;
}
- function enqueueRenderPhaseUpdate(queue, update) {
- didScheduleRenderPhaseUpdateDuringThisPass =
- didScheduleRenderPhaseUpdate = !0;
- var pending = queue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- queue.pending = update;
+ function bailoutHooks(current, workInProgress, lanes) {
+ workInProgress.updateQueue = current.updateQueue;
+ workInProgress.flags =
+ (workInProgress.mode & StrictEffectsMode) !== NoMode
+ ? workInProgress.flags & -201328645
+ : workInProgress.flags & -2053;
+ current.lanes &= ~lanes;
}
- function entangleTransitionUpdate(root, queue, lane) {
- if (0 !== (lane & 4194176)) {
- var queueLanes = queue.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- queue.lanes = lane;
- markRootEntangled(root, lane);
+ function resetHooksOnUnwind(workInProgress) {
+ if (didScheduleRenderPhaseUpdate) {
+ for (
+ workInProgress = workInProgress.memoizedState;
+ null !== workInProgress;
+
+ ) {
+ var queue = workInProgress.queue;
+ null !== queue && (queue.pending = null);
+ workInProgress = workInProgress.next;
+ }
+ didScheduleRenderPhaseUpdate = !1;
}
+ renderLanes = 0;
+ hookTypesDev =
+ workInProgressHook =
+ currentHook =
+ currentlyRenderingFiber =
+ null;
+ hookTypesUpdateIndexDev = -1;
+ currentHookNameInDev = null;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ thenableIndexCounter$1 = localIdCounter = 0;
+ thenableState$1 = null;
}
- function pushDebugInfo(debugInfo) {
- var previousDebugInfo = currentDebugInfo;
- null != debugInfo &&
- (currentDebugInfo =
- null === previousDebugInfo
- ? debugInfo
- : previousDebugInfo.concat(debugInfo));
- return previousDebugInfo;
+ function mountWorkInProgressHook() {
+ var hook = {
+ memoizedState: null,
+ baseState: null,
+ baseQueue: null,
+ queue: null,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)
+ : (workInProgressHook = workInProgressHook.next = hook);
+ return workInProgressHook;
}
- function validateFragmentProps(element, fiber, returnFiber) {
- for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) {
- var key = keys[i];
- if ("children" !== key && "key" !== key) {
- null === fiber &&
- ((fiber = createFiberFromElement(element, returnFiber.mode, 0)),
- (fiber._debugInfo = currentDebugInfo),
- (fiber.return = returnFiber));
- runWithFiberInDEV(
- fiber,
- function (erroredKey) {
- console.error(
- "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
- erroredKey
- );
- },
- key
- );
- break;
+ function updateWorkInProgressHook() {
+ if (null === currentHook) {
+ var nextCurrentHook = currentlyRenderingFiber.alternate;
+ nextCurrentHook =
+ null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
+ } else nextCurrentHook = currentHook.next;
+ var nextWorkInProgressHook =
+ null === workInProgressHook
+ ? currentlyRenderingFiber.memoizedState
+ : workInProgressHook.next;
+ if (null !== nextWorkInProgressHook)
+ (workInProgressHook = nextWorkInProgressHook),
+ (currentHook = nextCurrentHook);
+ else {
+ if (null === nextCurrentHook) {
+ if (null === currentlyRenderingFiber.alternate)
+ throw Error(
+ "Update hook called on initial render. This is likely a bug in React. Please file an issue."
+ );
+ throw Error("Rendered more hooks than during the previous render.");
}
+ currentHook = nextCurrentHook;
+ nextCurrentHook = {
+ memoizedState: currentHook.memoizedState,
+ baseState: currentHook.baseState,
+ baseQueue: currentHook.baseQueue,
+ queue: currentHook.queue,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook =
+ nextCurrentHook)
+ : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
}
+ return workInProgressHook;
}
- function unwrapThenable(thenable) {
- var index = thenableIndexCounter;
- thenableIndexCounter += 1;
- null === thenableState && (thenableState = createThenableState());
- return trackUsedThenable(thenableState, thenable, index);
- }
- function coerceRef(workInProgress, element) {
- element = element.props.ref;
- workInProgress.ref = void 0 !== element ? element : null;
+ function createFunctionComponentUpdateQueue() {
+ return { lastEffect: null, events: null, stores: null, memoCache: null };
}
- function throwOnInvalidObjectType(returnFiber, newChild) {
- if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
- throw Error(
- 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
- );
- returnFiber = Object.prototype.toString.call(newChild);
- throw Error(
- "Objects are not valid as a React child (found: " +
- ("[object Object]" === returnFiber
- ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
- : returnFiber) +
- "). If you meant to render a collection of children, use an array instead."
- );
- }
- function warnOnFunctionType(returnFiber, invalidChild) {
- var parentName = getComponentNameFromFiber(returnFiber) || "Component";
- ownerHasFunctionTypeWarning[parentName] ||
- ((ownerHasFunctionTypeWarning[parentName] = !0),
- (invalidChild =
- invalidChild.displayName || invalidChild.name || "Component"),
- 3 === returnFiber.tag
- ? console.error(
- "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)",
- invalidChild,
- invalidChild,
- invalidChild
- )
- : console.error(
- "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}%s>",
- invalidChild,
- invalidChild,
- parentName,
- invalidChild,
- parentName
- ));
- }
- function warnOnSymbolType(returnFiber, invalidChild) {
- var parentName = getComponentNameFromFiber(returnFiber) || "Component";
- ownerHasSymbolTypeWarning[parentName] ||
- ((ownerHasSymbolTypeWarning[parentName] = !0),
- (invalidChild = String(invalidChild)),
- 3 === returnFiber.tag
- ? console.error(
- "Symbols are not valid as a React child.\n root.render(%s)",
- invalidChild
- )
- : console.error(
- "Symbols are not valid as a React child.\n <%s>%s%s>",
- parentName,
- invalidChild,
- parentName
- ));
+ function useThenable(thenable) {
+ var index = thenableIndexCounter$1;
+ thenableIndexCounter$1 += 1;
+ null === thenableState$1 && (thenableState$1 = createThenableState());
+ thenable = trackUsedThenable(thenableState$1, thenable, index);
+ index = currentlyRenderingFiber;
+ null ===
+ (null === workInProgressHook
+ ? index.memoizedState
+ : workInProgressHook.next) &&
+ ((index = index.alternate),
+ (ReactSharedInternals.H =
+ null !== index && null !== index.memoizedState
+ ? HooksDispatcherOnUpdateInDEV
+ : HooksDispatcherOnMountInDEV));
+ return thenable;
}
- function createChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (shouldTrackSideEffects) {
- var deletions = returnFiber.deletions;
- null === deletions
- ? ((returnFiber.deletions = [childToDelete]),
- (returnFiber.flags |= 16))
- : deletions.push(childToDelete);
- }
- }
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) return null;
- for (; null !== currentFirstChild; )
- deleteChild(returnFiber, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return null;
- }
- function mapRemainingChildren(currentFirstChild) {
- for (var existingChildren = new Map(); null !== currentFirstChild; )
- null !== currentFirstChild.key
- ? existingChildren.set(currentFirstChild.key, currentFirstChild)
- : existingChildren.set(currentFirstChild.index, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return existingChildren;
- }
- function useFiber(fiber, pendingProps) {
- fiber = createWorkInProgress(fiber, pendingProps);
- fiber.index = 0;
- fiber.sibling = null;
- return fiber;
- }
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
- if (!shouldTrackSideEffects)
- return (newFiber.flags |= 1048576), lastPlacedIndex;
- newIndex = newFiber.alternate;
- if (null !== newIndex)
- return (
- (newIndex = newIndex.index),
- newIndex < lastPlacedIndex
- ? ((newFiber.flags |= 33554434), lastPlacedIndex)
- : newIndex
- );
- newFiber.flags |= 33554434;
- return lastPlacedIndex;
- }
- function placeSingleChild(newFiber) {
- shouldTrackSideEffects &&
- null === newFiber.alternate &&
- (newFiber.flags |= 33554434);
- return newFiber;
- }
- function updateTextNode(returnFiber, current, textContent, lanes) {
- if (null === current || 6 !== current.tag)
- return (
- (current = createFiberFromText(
- textContent,
- returnFiber.mode,
- lanes
- )),
- (current.return = returnFiber),
- (current._debugOwner = returnFiber),
- (current._debugTask = returnFiber._debugTask),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = useFiber(current, textContent);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
+ function use(usable) {
+ if (null !== usable && "object" === typeof usable) {
+ if ("function" === typeof usable.then) return useThenable(usable);
+ if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
}
- function updateElement(returnFiber, current, element, lanes) {
- var elementType = element.type;
- if (elementType === REACT_FRAGMENT_TYPE)
- return (
- (current = updateFragment(
- returnFiber,
- current,
- element.props.children,
- lanes,
- element.key
- )),
- validateFragmentProps(element, current, returnFiber),
- current
- );
- if (
+ throw Error("An unsupported type was passed to use(): " + String(usable));
+ }
+ function useMemoCache(size) {
+ var memoCache = null,
+ updateQueue = currentlyRenderingFiber.updateQueue;
+ null !== updateQueue && (memoCache = updateQueue.memoCache);
+ if (null == memoCache) {
+ var current = currentlyRenderingFiber.alternate;
+ null !== current &&
+ ((current = current.updateQueue),
null !== current &&
- (current.elementType === elementType ||
- isCompatibleFamilyForHotReloading(current, element) ||
- ("object" === typeof elementType &&
- null !== elementType &&
- elementType.$$typeof === REACT_LAZY_TYPE &&
- callLazyInitInDEV(elementType) === current.type))
- )
- return (
- (current = useFiber(current, element.props)),
- coerceRef(current, element),
- (current.return = returnFiber),
- (current._debugOwner = element._owner),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = createFiberFromElement(element, returnFiber.mode, lanes);
- coerceRef(current, element);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
+ ((current = current.memoCache),
+ null != current &&
+ (memoCache = {
+ data: current.data.map(function (array) {
+ return array.slice();
+ }),
+ index: 0
+ })));
}
- function updatePortal(returnFiber, current, portal, lanes) {
- if (
- null === current ||
- 4 !== current.tag ||
- current.stateNode.containerInfo !== portal.containerInfo ||
- current.stateNode.implementation !== portal.implementation
+ null == memoCache && (memoCache = { data: [], index: 0 });
+ null === updateQueue &&
+ ((updateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = updateQueue));
+ updateQueue.memoCache = memoCache;
+ updateQueue = memoCache.data[memoCache.index];
+ if (void 0 === updateQueue || ignorePreviousDependencies)
+ for (
+ updateQueue = memoCache.data[memoCache.index] = Array(size),
+ current = 0;
+ current < size;
+ current++
)
- return (
- (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- (current._debugInfo = currentDebugInfo),
- current
- );
- current = useFiber(current, portal.children || []);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
- }
- function updateFragment(returnFiber, current, fragment, lanes, key) {
- if (null === current || 7 !== current.tag)
- return (
- (current = createFiberFromFragment(
- fragment,
- returnFiber.mode,
- lanes,
- key
- )),
- (current.return = returnFiber),
- (current._debugOwner = returnFiber),
- (current._debugTask = returnFiber._debugTask),
- (current._debugInfo = currentDebugInfo),
- current
+ updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
+ else
+ updateQueue.length !== size &&
+ console.error(
+ "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
+ updateQueue.length,
+ size
);
- current = useFiber(current, fragment);
- current.return = returnFiber;
- current._debugInfo = currentDebugInfo;
- return current;
- }
- function createChild(returnFiber, newChild, lanes) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (newChild = createFiberFromText(
- "" + newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- (newChild._debugOwner = returnFiber),
- (newChild._debugTask = returnFiber._debugTask),
- (newChild._debugInfo = currentDebugInfo),
- newChild
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (lanes = createFiberFromElement(
- newChild,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (returnFiber = pushDebugInfo(newChild._debugInfo)),
- (lanes._debugInfo = currentDebugInfo),
- (currentDebugInfo = returnFiber),
- lanes
- );
- case REACT_PORTAL_TYPE:
- return (
- (newChild = createFiberFromPortal(
- newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- (newChild._debugInfo = currentDebugInfo),
- newChild
- );
- case REACT_LAZY_TYPE:
- var _prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- newChild = callLazyInitInDEV(newChild);
- returnFiber = createChild(returnFiber, newChild, lanes);
- currentDebugInfo = _prevDebugInfo;
- return returnFiber;
+ memoCache.index++;
+ return updateQueue;
+ }
+ function basicStateReducer(state, action) {
+ return "function" === typeof action ? action(state) : action;
+ }
+ function mountReducer(reducer, initialArg, init) {
+ var hook = mountWorkInProgressHook();
+ if (void 0 !== init) {
+ var initialState = init(initialArg);
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ init(initialArg);
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (lanes = createFiberFromFragment(
- newChild,
- returnFiber.mode,
- lanes,
- null
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (returnFiber = pushDebugInfo(newChild._debugInfo)),
- (lanes._debugInfo = currentDebugInfo),
- (currentDebugInfo = returnFiber),
- lanes
- );
- if ("function" === typeof newChild.then)
- return (
- (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = createChild(
- returnFiber,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = _prevDebugInfo),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return createChild(
- returnFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
}
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
+ } else initialState = initialArg;
+ hook.memoizedState = hook.baseState = initialState;
+ reducer = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: reducer,
+ lastRenderedState: initialState
+ };
+ hook.queue = reducer;
+ reducer = reducer.dispatch = dispatchReducerAction.bind(
+ null,
+ currentlyRenderingFiber,
+ reducer
+ );
+ return [hook.memoizedState, reducer];
+ }
+ function updateReducer(reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateReducerImpl(hook, currentHook, reducer);
+ }
+ function updateReducerImpl(hook, current, reducer) {
+ var queue = hook.queue;
+ if (null === queue)
+ throw Error(
+ "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ );
+ queue.lastRenderedReducer = reducer;
+ var baseQueue = hook.baseQueue,
+ pendingQueue = queue.pending;
+ if (null !== pendingQueue) {
+ if (null !== baseQueue) {
+ var baseFirst = baseQueue.next;
+ baseQueue.next = pendingQueue.next;
+ pendingQueue.next = baseFirst;
+ }
+ current.baseQueue !== baseQueue &&
+ console.error(
+ "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."
+ );
+ current.baseQueue = baseQueue = pendingQueue;
+ queue.pending = null;
}
- function updateSlot(returnFiber, oldFiber, newChild, lanes) {
- var key = null !== oldFiber ? oldFiber.key : null;
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return null !== key
- ? null
- : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return newChild.key === key
- ? ((key = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateElement(
- returnFiber,
- oldFiber,
- newChild,
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber)
- : null;
- case REACT_PORTAL_TYPE:
- return newChild.key === key
- ? updatePortal(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_LAZY_TYPE:
- return (
- (key = pushDebugInfo(newChild._debugInfo)),
- (newChild = callLazyInitInDEV(newChild)),
- (returnFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChild,
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber
- );
- }
+ pendingQueue = hook.baseState;
+ if (null === baseQueue) hook.memoizedState = pendingQueue;
+ else {
+ current = baseQueue.next;
+ var newBaseQueueFirst = (baseFirst = null),
+ newBaseQueueLast = null,
+ update = current,
+ didReadFromEntangledAsyncAction = !1;
+ do {
+ var updateLane = update.lane & -536870913;
if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
+ updateLane !== update.lane
+ ? (workInProgressRootRenderLanes & updateLane) === updateLane
+ : (renderLanes & updateLane) === updateLane
) {
- if (null !== key) return null;
- key = pushDebugInfo(newChild._debugInfo);
- returnFiber = updateFragment(
- returnFiber,
- oldFiber,
- newChild,
- lanes,
- null
- );
- currentDebugInfo = key;
- return returnFiber;
- }
- if ("function" === typeof newChild.then)
- return (
- (key = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateSlot(
- returnFiber,
- oldFiber,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = key),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateSlot(
- returnFiber,
- oldFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
- }
- function updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- ) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (newIdx =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- (existingChildren = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateElement(
- returnFiber,
- newIdx,
- newChild,
- lanes
- )),
- (currentDebugInfo = existingChildren),
- returnFiber
- );
- case REACT_PORTAL_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updatePortal(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_LAZY_TYPE:
- var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo);
- newChild = callLazyInitInDEV(newChild);
- returnFiber = updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- );
- currentDebugInfo = _prevDebugInfo7;
- return returnFiber;
- }
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (newIdx = existingChildren.get(newIdx) || null),
- (existingChildren = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateFragment(
- returnFiber,
- newIdx,
- newChild,
- lanes,
- null
- )),
- (currentDebugInfo = existingChildren),
- returnFiber
- );
- if ("function" === typeof newChild.then)
- return (
- (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = _prevDebugInfo7),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return null;
+ var revertLane = update.revertLane;
+ if (0 === revertLane)
+ null !== newBaseQueueLast &&
+ (newBaseQueueLast = newBaseQueueLast.next =
+ {
+ lane: 0,
+ revertLane: 0,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ else if ((renderLanes & revertLane) === revertLane) {
+ update = update.next;
+ revertLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ continue;
+ } else
+ (updateLane = {
+ lane: 0,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
+ (currentlyRenderingFiber.lanes |= revertLane),
+ (workInProgressRootSkippedLanes |= revertLane);
+ updateLane = update.action;
+ shouldDoubleInvokeUserFnsInHooksDEV &&
+ reducer(pendingQueue, updateLane);
+ pendingQueue = update.hasEagerState
+ ? update.eagerState
+ : reducer(pendingQueue, updateLane);
+ } else
+ (revertLane = {
+ lane: updateLane,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
+ (currentlyRenderingFiber.lanes |= updateLane),
+ (workInProgressRootSkippedLanes |= updateLane);
+ update = update.next;
+ } while (null !== update && update !== current);
+ null === newBaseQueueLast
+ ? (baseFirst = pendingQueue)
+ : (newBaseQueueLast.next = newBaseQueueFirst);
+ if (
+ !objectIs(pendingQueue, hook.memoizedState) &&
+ ((didReceiveUpdate = !0),
+ didReadFromEntangledAsyncAction &&
+ ((reducer = currentEntangledActionThenable), null !== reducer))
+ )
+ throw reducer;
+ hook.memoizedState = pendingQueue;
+ hook.baseState = baseFirst;
+ hook.baseQueue = newBaseQueueLast;
+ queue.lastRenderedState = pendingQueue;
}
- function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) {
- if ("object" !== typeof child || null === child) return knownKeys;
- switch (child.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_PORTAL_TYPE:
- warnForMissingKey(returnFiber, workInProgress, child);
- var key = child.key;
- if ("string" !== typeof key) break;
- if (null === knownKeys) {
- knownKeys = new Set();
- knownKeys.add(key);
- break;
- }
- if (!knownKeys.has(key)) {
- knownKeys.add(key);
- break;
- }
- runWithFiberInDEV(workInProgress, function () {
- console.error(
- "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.",
- key
- );
- });
- break;
- case REACT_LAZY_TYPE:
- (child = callLazyInitInDEV(child)),
- warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys);
- }
- return knownKeys;
+ null === baseQueue && (queue.lanes = 0);
+ return [hook.memoizedState, queue.dispatch];
+ }
+ function rerenderReducer(reducer) {
+ var hook = updateWorkInProgressHook(),
+ queue = hook.queue;
+ if (null === queue)
+ throw Error(
+ "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)"
+ );
+ queue.lastRenderedReducer = reducer;
+ var dispatch = queue.dispatch,
+ lastRenderPhaseUpdate = queue.pending,
+ newState = hook.memoizedState;
+ if (null !== lastRenderPhaseUpdate) {
+ queue.pending = null;
+ var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
+ do
+ (newState = reducer(newState, update.action)), (update = update.next);
+ while (update !== lastRenderPhaseUpdate);
+ objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
+ hook.memoizedState = newState;
+ null === hook.baseQueue && (hook.baseState = newState);
+ queue.lastRenderedState = newState;
}
- function reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- for (
- var knownKeys = null,
- resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null;
- null !== oldFiber && newIdx < newChildren.length;
- newIdx++
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- lanes
- );
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- knownKeys = warnOnInvalidKey(
- returnFiber,
- newFiber,
- newChildren[newIdx],
- knownKeys
+ return [newState, dispatch];
+ }
+ function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = mountWorkInProgressHook();
+ if (isHydrating) {
+ if (void 0 === getServerSnapshot)
+ throw Error(
+ "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
);
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (newIdx === newChildren.length)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ var nextSnapshot = getServerSnapshot();
+ didWarnUncachedGetSnapshot ||
+ nextSnapshot === getServerSnapshot() ||
+ (console.error(
+ "The result of getServerSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0));
+ } else {
+ nextSnapshot = getSnapshot();
+ didWarnUncachedGetSnapshot ||
+ ((getServerSnapshot = getSnapshot()),
+ objectIs(nextSnapshot, getServerSnapshot) ||
+ (console.error(
+ "The result of getSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0)));
+ if (null === workInProgressRoot)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
- if (null === oldFiber) {
- for (; newIdx < newChildren.length; newIdx++)
- (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
- null !== oldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- knownKeys
- )),
- (currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- newIdx < newChildren.length;
- newIdx++
- )
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- newChildren[newIdx],
- lanes
- )),
- null !== nextOldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- nextOldFiber,
- newChildren[newIdx],
- knownKeys
- )),
- shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ 0 !== (workInProgressRootRenderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
}
- function reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChildrenIterable,
- lanes
+ hook.memoizedState = nextSnapshot;
+ getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
+ hook.queue = getServerSnapshot;
+ mountEffect(
+ subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe),
+ [subscribe]
+ );
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ getServerSnapshot,
+ nextSnapshot,
+ getSnapshot
+ ),
+ null
+ );
+ return nextSnapshot;
+ }
+ function updateSyncExternalStore(
+ subscribe,
+ getSnapshot,
+ getServerSnapshot
+ ) {
+ var fiber = currentlyRenderingFiber,
+ hook = updateWorkInProgressHook(),
+ isHydrating$jscomp$0 = isHydrating;
+ if (isHydrating$jscomp$0) {
+ if (void 0 === getServerSnapshot)
+ throw Error(
+ "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
+ );
+ getServerSnapshot = getServerSnapshot();
+ } else if (
+ ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot)
) {
- var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
- newChildren !== newChildrenIterable ||
- (0 === returnFiber.tag &&
- "[object AsyncGeneratorFunction]" ===
- Object.prototype.toString.call(returnFiber.type) &&
- "[object AsyncGenerator]" ===
- Object.prototype.toString.call(newChildren)) ||
- (didWarnAboutGenerators ||
- console.error(
- "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items."
- ),
- (didWarnAboutGenerators = !0));
- if (null == newChildren)
- throw Error("An iterable object provided no iterator.");
- return reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- {
- next: function () {
- return unwrapThenable(newChildren.next());
- }
- },
- lanes
- );
+ var cachedSnapshot = getSnapshot();
+ objectIs(getServerSnapshot, cachedSnapshot) ||
+ (console.error(
+ "The result of getSnapshot should be cached to avoid an infinite loop"
+ ),
+ (didWarnUncachedGetSnapshot = !0));
}
- function reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
+ if (
+ (cachedSnapshot = !objectIs(
+ (currentHook || hook).memoizedState,
+ getServerSnapshot
+ ))
+ )
+ (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0);
+ hook = hook.queue;
+ var create = subscribeToStore.bind(null, fiber, hook, subscribe);
+ updateEffectImpl(2048, Passive, create, [subscribe]);
+ if (
+ hook.getSnapshot !== getSnapshot ||
+ cachedSnapshot ||
+ (null !== workInProgressHook &&
+ workInProgressHook.memoizedState.tag & HasEffect)
) {
- if (null == newChildren)
- throw Error("An iterable object provided no iterator.");
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null,
- knownKeys = null,
- step = newChildren.next();
- null !== oldFiber && !step.done;
- newIdx++, step = newChildren.next()
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- knownKeys = warnOnInvalidKey(
- returnFiber,
- newFiber,
- step.value,
- knownKeys
- );
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (step.done)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ hook,
+ getServerSnapshot,
+ getSnapshot
+ ),
+ null
+ );
+ if (null === workInProgressRoot)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
- if (null === oldFiber) {
- for (; !step.done; newIdx++, step = newChildren.next())
- (oldFiber = createChild(returnFiber, step.value, lanes)),
- null !== oldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- oldFiber,
- step.value,
- knownKeys
- )),
- (currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- !step.done;
- newIdx++, step = newChildren.next()
- )
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- step.value,
- lanes
- )),
- null !== nextOldFiber &&
- ((knownKeys = warnOnInvalidKey(
- returnFiber,
- nextOldFiber,
- step.value,
- knownKeys
- )),
- shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ isHydrating$jscomp$0 ||
+ 0 !== (renderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
}
- function reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- ) {
- "object" === typeof newChild &&
- null !== newChild &&
- newChild.type === REACT_FRAGMENT_TYPE &&
- null === newChild.key &&
- (validateFragmentProps(newChild, null, returnFiber),
- (newChild = newChild.props.children));
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- var prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- a: {
- for (var key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key) {
- key = newChild.type;
- if (key === REACT_FRAGMENT_TYPE) {
- if (7 === currentFirstChild.tag) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- newChild.props.children
- );
- lanes.return = returnFiber;
- lanes._debugOwner = newChild._owner;
- lanes._debugInfo = currentDebugInfo;
- validateFragmentProps(newChild, lanes, returnFiber);
- returnFiber = lanes;
- break a;
- }
- } else if (
- currentFirstChild.elementType === key ||
- isCompatibleFamilyForHotReloading(
- currentFirstChild,
- newChild
- ) ||
- ("object" === typeof key &&
- null !== key &&
- key.$$typeof === REACT_LAZY_TYPE &&
- callLazyInitInDEV(key) === currentFirstChild.type)
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.props);
- coerceRef(lanes, newChild);
- lanes.return = returnFiber;
- lanes._debugOwner = newChild._owner;
- lanes._debugInfo = currentDebugInfo;
- returnFiber = lanes;
- break a;
- }
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- } else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- newChild.type === REACT_FRAGMENT_TYPE
- ? ((lanes = createFiberFromFragment(
- newChild.props.children,
- returnFiber.mode,
- lanes,
- newChild.key
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (lanes._debugInfo = currentDebugInfo),
- validateFragmentProps(newChild, lanes, returnFiber),
- (returnFiber = lanes))
- : ((lanes = createFiberFromElement(
- newChild,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (lanes._debugInfo = currentDebugInfo),
- (returnFiber = lanes));
- }
- returnFiber = placeSingleChild(returnFiber);
- currentDebugInfo = prevDebugInfo;
- return returnFiber;
- case REACT_PORTAL_TYPE:
- a: {
- prevDebugInfo = newChild;
- for (
- newChild = prevDebugInfo.key;
- null !== currentFirstChild;
-
- ) {
- if (currentFirstChild.key === newChild)
- if (
- 4 === currentFirstChild.tag &&
- currentFirstChild.stateNode.containerInfo ===
- prevDebugInfo.containerInfo &&
- currentFirstChild.stateNode.implementation ===
- prevDebugInfo.implementation
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- prevDebugInfo.children || []
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- } else {
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- }
- else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- lanes = createFiberFromPortal(
- prevDebugInfo,
- returnFiber.mode,
- lanes
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- }
- return placeSingleChild(returnFiber);
- case REACT_LAZY_TYPE:
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (newChild = callLazyInitInDEV(newChild)),
- (returnFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
+ return getServerSnapshot;
+ }
+ function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
+ fiber.flags |= 16384;
+ fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
+ getSnapshot = currentlyRenderingFiber.updateQueue;
+ null === getSnapshot
+ ? ((getSnapshot = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = getSnapshot),
+ (getSnapshot.stores = [fiber]))
+ : ((renderedSnapshot = getSnapshot.stores),
+ null === renderedSnapshot
+ ? (getSnapshot.stores = [fiber])
+ : renderedSnapshot.push(fiber));
+ }
+ function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
+ inst.value = nextSnapshot;
+ inst.getSnapshot = getSnapshot;
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ }
+ function subscribeToStore(fiber, inst, subscribe) {
+ return subscribe(function () {
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ });
+ }
+ function checkIfSnapshotChanged(inst) {
+ var latestGetSnapshot = inst.getSnapshot;
+ inst = inst.value;
+ try {
+ var nextValue = latestGetSnapshot();
+ return !objectIs(inst, nextValue);
+ } catch (error) {
+ return !0;
+ }
+ }
+ function forceStoreRerender(fiber) {
+ var root = enqueueConcurrentRenderForLane(fiber, 2);
+ null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+ }
+ function mountStateImpl(initialState) {
+ var hook = mountWorkInProgressHook();
+ if ("function" === typeof initialState) {
+ var initialStateInitializer = initialState;
+ initialState = initialStateInitializer();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ initialStateInitializer();
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- if (isArrayImpl(newChild))
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if (getIteratorFn(newChild)) {
- prevDebugInfo = pushDebugInfo(newChild._debugInfo);
- key = getIteratorFn(newChild);
- if ("function" !== typeof key)
- throw Error(
- "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
- );
- var newChildren = key.call(newChild);
- if (newChildren === newChild) {
- if (
- 0 !== returnFiber.tag ||
- "[object GeneratorFunction]" !==
- Object.prototype.toString.call(returnFiber.type) ||
- "[object Generator]" !==
- Object.prototype.toString.call(newChildren)
- )
- didWarnAboutGenerators ||
- console.error(
- "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
- ),
- (didWarnAboutGenerators = !0);
- } else
- newChild.entries !== key ||
- didWarnAboutMaps ||
- (console.error(
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
- ),
- (didWarnAboutMaps = !0));
- returnFiber = reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- );
- currentDebugInfo = prevDebugInfo;
- return returnFiber;
- }
- if ("function" === typeof newChild[ASYNC_ITERATOR])
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if ("function" === typeof newChild.then)
- return (
- (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
- (returnFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- unwrapThenable(newChild),
- lanes
- )),
- (currentDebugInfo = prevDebugInfo),
- returnFiber
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
}
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (prevDebugInfo = "" + newChild),
- null !== currentFirstChild && 6 === currentFirstChild.tag
- ? (deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- ),
- (lanes = useFiber(currentFirstChild, prevDebugInfo)),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : (deleteRemainingChildren(returnFiber, currentFirstChild),
- (lanes = createFiberFromText(
- prevDebugInfo,
- returnFiber.mode,
- lanes
- )),
- (lanes.return = returnFiber),
- (lanes._debugOwner = returnFiber),
- (lanes._debugTask = returnFiber._debugTask),
- (lanes._debugInfo = currentDebugInfo),
- (returnFiber = lanes)),
- placeSingleChild(returnFiber)
- );
- "function" === typeof newChild &&
- warnOnFunctionType(returnFiber, newChild);
- "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
- return deleteRemainingChildren(returnFiber, currentFirstChild);
}
- return function (returnFiber, currentFirstChild, newChild, lanes) {
- var prevDebugInfo = currentDebugInfo;
- currentDebugInfo = null;
- try {
- thenableIndexCounter = 0;
- var firstChildFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- );
- thenableState = null;
- return firstChildFiber;
- } catch (x) {
- if (x === SuspenseException || x === SuspenseActionException) throw x;
- var fiber = createFiber(29, x, null, returnFiber.mode);
- fiber.lanes = lanes;
- fiber.return = returnFiber;
- var debugInfo = (fiber._debugInfo = currentDebugInfo);
- fiber._debugOwner = returnFiber._debugOwner;
- fiber._debugTask = returnFiber._debugTask;
- if (null != debugInfo)
- for (var i = debugInfo.length - 1; 0 <= i; i--)
- if ("string" === typeof debugInfo[i].stack) {
- fiber._debugOwner = debugInfo[i];
- fiber._debugTask = debugInfo[i].debugTask;
- break;
- }
- return fiber;
- } finally {
- currentDebugInfo = prevDebugInfo;
- }
+ hook.memoizedState = hook.baseState = initialState;
+ hook.queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialState
};
+ return hook;
}
- function pushPrimaryTreeSuspenseHandler(handler) {
- var current = handler.alternate;
- push(
- suspenseStackCursor,
- suspenseStackCursor.current & SubtreeSuspenseContextMask,
- handler
- );
- push(suspenseHandlerStackCursor, handler, handler);
- null === shellBoundary &&
- (null === current || null !== currentTreeHiddenStackCursor.current
- ? (shellBoundary = handler)
- : null !== current.memoizedState && (shellBoundary = handler));
- }
- function pushOffscreenSuspenseHandler(fiber) {
- if (22 === fiber.tag) {
- if (
- (push(suspenseStackCursor, suspenseStackCursor.current, fiber),
- push(suspenseHandlerStackCursor, fiber, fiber),
- null === shellBoundary)
- ) {
- var current = fiber.alternate;
- null !== current &&
- null !== current.memoizedState &&
- (shellBoundary = fiber);
- }
- } else reuseSuspenseHandlerOnStack(fiber);
+ function mountState(initialState) {
+ initialState = mountStateImpl(initialState);
+ var queue = initialState.queue,
+ dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
+ queue.dispatch = dispatch;
+ return [initialState.memoizedState, dispatch];
}
- function reuseSuspenseHandlerOnStack(fiber) {
- push(suspenseStackCursor, suspenseStackCursor.current, fiber);
- push(
- suspenseHandlerStackCursor,
- suspenseHandlerStackCursor.current,
- fiber
+ function mountOptimistic(passthrough) {
+ var hook = mountWorkInProgressHook();
+ hook.memoizedState = hook.baseState = passthrough;
+ var queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: null,
+ lastRenderedState: null
+ };
+ hook.queue = queue;
+ hook = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !0,
+ queue
);
+ queue.dispatch = hook;
+ return [passthrough, hook];
}
- function popSuspenseHandler(fiber) {
- pop(suspenseHandlerStackCursor, fiber);
- shellBoundary === fiber && (shellBoundary = null);
- pop(suspenseStackCursor, fiber);
+ function updateOptimistic(passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
}
- function findFirstSuspended(row) {
- for (var node = row; null !== node; ) {
- if (13 === node.tag) {
- var state = node.memoizedState;
- if (
- null !== state &&
- ((state = state.dehydrated),
- null === state ||
- state.data === SUSPENSE_PENDING_START_DATA ||
- isSuspenseInstanceFallback(state))
- )
- return node;
- } else if (
- 19 === node.tag &&
- void 0 !== node.memoizedProps.revealOrder
- ) {
- if (0 !== (node.flags & 128)) return node;
- } else if (null !== node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === row) break;
- for (; null === node.sibling; ) {
- if (null === node.return || node.return === row) return null;
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- return null;
+ function updateOptimisticImpl(hook, current, passthrough, reducer) {
+ hook.baseState = passthrough;
+ return updateReducerImpl(
+ hook,
+ currentHook,
+ "function" === typeof reducer ? reducer : basicStateReducer
+ );
}
- function warnOnInvalidCallback(callback) {
- if (null !== callback && "function" !== typeof callback) {
- var key = String(callback);
- didWarnOnInvalidCallback.has(key) ||
- (didWarnOnInvalidCallback.add(key),
- console.error(
- "Expected the last optional `callback` argument to be a function. Instead received: %s.",
- callback
- ));
- }
+ function rerenderOptimistic(passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ if (null !== currentHook)
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ hook.baseState = passthrough;
+ return [passthrough, hook.queue.dispatch];
}
- function applyDerivedStateFromProps(
- workInProgress,
- ctor,
- getDerivedStateFromProps,
- nextProps
+ function dispatchActionState(
+ fiber,
+ actionQueue,
+ setPendingState,
+ setState,
+ payload
) {
- var prevState = workInProgress.memoizedState,
- partialState = getDerivedStateFromProps(nextProps, prevState);
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
+ if (isRenderPhaseUpdate(fiber))
+ throw Error("Cannot update form state while rendering.");
+ fiber = actionQueue.action;
+ if (null !== fiber) {
+ var actionNode = {
+ payload: payload,
+ action: fiber,
+ next: null,
+ isTransition: !0,
+ status: "pending",
+ value: null,
+ reason: null,
+ listeners: [],
+ then: function (listener) {
+ actionNode.listeners.push(listener);
+ }
+ };
+ null !== ReactSharedInternals.T
+ ? setPendingState(!0)
+ : (actionNode.isTransition = !1);
+ setState(actionNode);
+ setPendingState = actionQueue.pending;
+ null === setPendingState
+ ? ((actionNode.next = actionQueue.pending = actionNode),
+ runActionStateAction(actionQueue, actionNode))
+ : ((actionNode.next = setPendingState.next),
+ (actionQueue.pending = setPendingState.next = actionNode));
+ }
+ }
+ function runActionStateAction(actionQueue, node) {
+ var action = node.action,
+ payload = node.payload,
+ prevState = actionQueue.state;
+ if (node.isTransition) {
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ ReactSharedInternals.T._updatedFibers = new Set();
try {
- partialState = getDerivedStateFromProps(nextProps, prevState);
+ var returnValue = action(prevState, payload),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ handleActionReturnValue(actionQueue, node, returnValue);
+ } catch (error) {
+ onActionError(actionQueue, node, error);
} finally {
- setIsStrictModeForDevtools(!1);
+ (ReactSharedInternals.T = prevTransition),
+ null === prevTransition &&
+ currentTransition._updatedFibers &&
+ ((actionQueue = currentTransition._updatedFibers.size),
+ currentTransition._updatedFibers.clear(),
+ 10 < actionQueue &&
+ console.warn(
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
+ ));
}
- }
- void 0 === partialState &&
- ((ctor = getComponentNameFromType(ctor) || "Component"),
- didWarnAboutUndefinedDerivedState.has(ctor) ||
- (didWarnAboutUndefinedDerivedState.add(ctor),
- console.error(
- "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",
- ctor
- )));
- prevState =
- null === partialState || void 0 === partialState
- ? prevState
- : assign({}, prevState, partialState);
- workInProgress.memoizedState = prevState;
- 0 === workInProgress.lanes &&
- (workInProgress.updateQueue.baseState = prevState);
- }
- function checkShouldComponentUpdate(
- workInProgress,
- ctor,
- oldProps,
- newProps,
- oldState,
- newState,
- nextContext
- ) {
- var instance = workInProgress.stateNode;
- if ("function" === typeof instance.shouldComponentUpdate) {
- oldProps = instance.shouldComponentUpdate(
- newProps,
- newState,
- nextContext
- );
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- oldProps = instance.shouldComponentUpdate(
- newProps,
- newState,
- nextContext
- );
- } finally {
- setIsStrictModeForDevtools(!1);
- }
+ } else
+ try {
+ (currentTransition = action(prevState, payload)),
+ handleActionReturnValue(actionQueue, node, currentTransition);
+ } catch (error$3) {
+ onActionError(actionQueue, node, error$3);
}
- void 0 === oldProps &&
- console.error(
- "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",
- getComponentNameFromType(ctor) || "Component"
- );
- return oldProps;
- }
- return ctor.prototype && ctor.prototype.isPureReactComponent
- ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
- : !0;
}
- function callComponentWillReceiveProps(
- workInProgress,
- instance,
- newProps,
- nextContext
- ) {
- var oldState = instance.state;
- "function" === typeof instance.componentWillReceiveProps &&
- instance.componentWillReceiveProps(newProps, nextContext);
- "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- instance.state !== oldState &&
- ((workInProgress =
- getComponentNameFromFiber(workInProgress) || "Component"),
- didWarnAboutStateAssignmentForComponent.has(workInProgress) ||
- (didWarnAboutStateAssignmentForComponent.add(workInProgress),
- console.error(
- "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
- workInProgress
- )),
- classComponentUpdater.enqueueReplaceState(
- instance,
- instance.state,
- null
- ));
+ function handleActionReturnValue(actionQueue, node, returnValue) {
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ? (returnValue.then(
+ function (nextState) {
+ onActionSuccess(actionQueue, node, nextState);
+ },
+ function (error) {
+ return onActionError(actionQueue, node, error);
+ }
+ ),
+ node.isTransition ||
+ console.error(
+ "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`"
+ ))
+ : onActionSuccess(actionQueue, node, returnValue);
}
- function resolveClassComponentProps(Component, baseProps) {
- var newProps = baseProps;
- if ("ref" in baseProps) {
- newProps = {};
- for (var propName in baseProps)
- "ref" !== propName && (newProps[propName] = baseProps[propName]);
- }
- if ((Component = Component.defaultProps)) {
- newProps === baseProps && (newProps = assign({}, newProps));
- for (var _propName in Component)
- void 0 === newProps[_propName] &&
- (newProps[_propName] = Component[_propName]);
+ function onActionSuccess(actionQueue, actionNode, nextState) {
+ actionNode.status = "fulfilled";
+ actionNode.value = nextState;
+ notifyActionListeners(actionNode);
+ actionQueue.state = nextState;
+ actionNode = actionQueue.pending;
+ null !== actionNode &&
+ ((nextState = actionNode.next),
+ nextState === actionNode
+ ? (actionQueue.pending = null)
+ : ((nextState = nextState.next),
+ (actionNode.next = nextState),
+ runActionStateAction(actionQueue, nextState)));
+ }
+ function onActionError(actionQueue, actionNode, error) {
+ var last = actionQueue.pending;
+ actionQueue.pending = null;
+ if (null !== last) {
+ last = last.next;
+ do
+ (actionNode.status = "rejected"),
+ (actionNode.reason = error),
+ notifyActionListeners(actionNode),
+ (actionNode = actionNode.next);
+ while (actionNode !== last);
}
- return newProps;
+ actionQueue.action = null;
}
- function defaultOnUncaughtError(error) {
- reportGlobalError(error);
- console.warn(
- "%s\n\n%s\n",
- componentName
- ? "An error occurred in the <" + componentName + "> component."
- : "An error occurred in one of your React components.",
- "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
- );
+ function notifyActionListeners(actionNode) {
+ actionNode = actionNode.listeners;
+ for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
}
- function defaultOnCaughtError(error) {
- var componentNameMessage = componentName
- ? "The above error occurred in the <" + componentName + "> component."
- : "The above error occurred in one of your React components.",
- recreateMessage =
- "React will try to recreate this component tree from scratch using the error boundary you provided, " +
- ((errorBoundaryName || "Anonymous") + ".");
- if (
- "object" === typeof error &&
- null !== error &&
- "string" === typeof error.environmentName
- ) {
- var JSCompiler_inline_result = error.environmentName;
- error = [
- "%o\n\n%s\n\n%s\n",
- error,
- componentNameMessage,
- recreateMessage
- ].slice(0);
- "string" === typeof error[0]
- ? error.splice(
- 0,
- 1,
- badgeFormat + error[0],
- badgeStyle,
- pad + JSCompiler_inline_result + pad,
- resetStyle
- )
- : error.splice(
- 0,
- 0,
- badgeFormat,
- badgeStyle,
- pad + JSCompiler_inline_result + pad,
- resetStyle
- );
- error.unshift(console);
- JSCompiler_inline_result = bind.apply(console.error, error);
- JSCompiler_inline_result();
- } else
- console.error(
- "%o\n\n%s\n\n%s\n",
- error,
- componentNameMessage,
- recreateMessage
- );
- }
- function defaultOnRecoverableError(error) {
- reportGlobalError(error);
+ function actionStateReducer(oldState, newState) {
+ return newState;
}
- function logUncaughtError(root, errorInfo) {
- try {
- componentName = errorInfo.source
- ? getComponentNameFromFiber(errorInfo.source)
- : null;
- errorBoundaryName = null;
- var error = errorInfo.value;
- if (null !== ReactSharedInternals.actQueue)
- ReactSharedInternals.thrownErrors.push(error);
- else {
- var onUncaughtError = root.onUncaughtError;
- onUncaughtError(error, { componentStack: errorInfo.stack });
+ function mountActionState(action, initialStateProp) {
+ if (isHydrating) {
+ var ssrFormState = workInProgressRoot.formState;
+ if (null !== ssrFormState) {
+ a: {
+ var isMatching = currentlyRenderingFiber;
+ if (isHydrating) {
+ if (nextHydratableInstance) {
+ b: {
+ var markerInstance = nextHydratableInstance;
+ for (
+ var inRootOrSingleton = rootOrSingletonContext;
+ 8 !== markerInstance.nodeType;
+
+ ) {
+ if (!inRootOrSingleton) {
+ markerInstance = null;
+ break b;
+ }
+ markerInstance = getNextHydratable(
+ markerInstance.nextSibling
+ );
+ if (null === markerInstance) {
+ markerInstance = null;
+ break b;
+ }
+ }
+ inRootOrSingleton = markerInstance.data;
+ markerInstance =
+ inRootOrSingleton === FORM_STATE_IS_MATCHING ||
+ inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING
+ ? markerInstance
+ : null;
+ }
+ if (markerInstance) {
+ nextHydratableInstance = getNextHydratable(
+ markerInstance.nextSibling
+ );
+ isMatching = markerInstance.data === FORM_STATE_IS_MATCHING;
+ break a;
+ }
+ }
+ throwOnHydrationMismatch(isMatching);
+ }
+ isMatching = !1;
+ }
+ isMatching && (initialStateProp = ssrFormState[0]);
}
- } catch (e$4) {
- setTimeout(function () {
- throw e$4;
- });
- }
- }
- function logCaughtError(root, boundary, errorInfo) {
- try {
- componentName = errorInfo.source
- ? getComponentNameFromFiber(errorInfo.source)
- : null;
- errorBoundaryName = getComponentNameFromFiber(boundary);
- var onCaughtError = root.onCaughtError;
- onCaughtError(errorInfo.value, {
- componentStack: errorInfo.stack,
- errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
- });
- } catch (e$5) {
- setTimeout(function () {
- throw e$5;
- });
}
- }
- function createRootErrorUpdate(root, errorInfo, lane) {
- lane = createUpdate(lane);
- lane.tag = CaptureUpdate;
- lane.payload = { element: null };
- lane.callback = function () {
- runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo);
+ ssrFormState = mountWorkInProgressHook();
+ ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
+ isMatching = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: actionStateReducer,
+ lastRenderedState: initialStateProp
};
- return lane;
+ ssrFormState.queue = isMatching;
+ ssrFormState = dispatchSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ isMatching
+ );
+ isMatching.dispatch = ssrFormState;
+ isMatching = mountStateImpl(!1);
+ inRootOrSingleton = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !1,
+ isMatching.queue
+ );
+ isMatching = mountWorkInProgressHook();
+ markerInstance = {
+ state: initialStateProp,
+ dispatch: null,
+ action: action,
+ pending: null
+ };
+ isMatching.queue = markerInstance;
+ ssrFormState = dispatchActionState.bind(
+ null,
+ currentlyRenderingFiber,
+ markerInstance,
+ inRootOrSingleton,
+ ssrFormState
+ );
+ markerInstance.dispatch = ssrFormState;
+ isMatching.memoizedState = action;
+ return [initialStateProp, ssrFormState, !1];
}
- function createClassErrorUpdate(lane) {
- lane = createUpdate(lane);
- lane.tag = CaptureUpdate;
- return lane;
+ function updateActionState(action) {
+ var stateHook = updateWorkInProgressHook();
+ return updateActionStateImpl(stateHook, currentHook, action);
}
- function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
- var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
- if ("function" === typeof getDerivedStateFromError) {
- var error = errorInfo.value;
- update.payload = function () {
- return getDerivedStateFromError(error);
- };
- update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- runWithFiberInDEV(
- errorInfo.source,
- logCaughtError,
- root,
- fiber,
- errorInfo
- );
- };
- }
- var inst = fiber.stateNode;
- null !== inst &&
- "function" === typeof inst.componentDidCatch &&
- (update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- runWithFiberInDEV(
- errorInfo.source,
- logCaughtError,
- root,
- fiber,
- errorInfo
- );
- "function" !== typeof getDerivedStateFromError &&
- (null === legacyErrorBoundariesThatAlreadyFailed
- ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
- : legacyErrorBoundariesThatAlreadyFailed.add(this));
- callComponentDidCatchInDEV(this, errorInfo);
- "function" === typeof getDerivedStateFromError ||
- (0 === (fiber.lanes & 2) &&
- console.error(
- "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
- getComponentNameFromFiber(fiber) || "Unknown"
- ));
- });
+ function updateActionStateImpl(stateHook, currentStateHook, action) {
+ currentStateHook = updateReducerImpl(
+ stateHook,
+ currentStateHook,
+ actionStateReducer
+ )[0];
+ stateHook = updateReducer(basicStateReducer)[0];
+ if (
+ "object" === typeof currentStateHook &&
+ null !== currentStateHook &&
+ "function" === typeof currentStateHook.then
+ )
+ try {
+ var state = useThenable(currentStateHook);
+ } catch (x) {
+ if (x === SuspenseException) throw SuspenseActionException;
+ throw x;
+ }
+ else state = currentStateHook;
+ currentStateHook = updateWorkInProgressHook();
+ var actionQueue = currentStateHook.queue,
+ dispatch = actionQueue.dispatch;
+ action !== currentStateHook.memoizedState &&
+ ((currentlyRenderingFiber.flags |= 2048),
+ pushSimpleEffect(
+ HasEffect | Passive,
+ createEffectInstance(),
+ actionStateActionEffect.bind(null, actionQueue, action),
+ null
+ ));
+ return [state, dispatch, stateHook];
}
- function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
- var currentSourceFiber = sourceFiber.alternate;
- null !== currentSourceFiber &&
- propagateParentContextChanges(
- currentSourceFiber,
- sourceFiber,
- rootRenderLanes,
- !0
- );
+ function actionStateActionEffect(actionQueue, action) {
+ actionQueue.action = action;
}
- function markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ) {
- suspenseBoundary.flags |= 65536;
- suspenseBoundary.lanes = rootRenderLanes;
- return suspenseBoundary;
+ function rerenderActionState(action) {
+ var stateHook = updateWorkInProgressHook(),
+ currentStateHook = currentHook;
+ if (null !== currentStateHook)
+ return updateActionStateImpl(stateHook, currentStateHook, action);
+ updateWorkInProgressHook();
+ stateHook = stateHook.memoizedState;
+ currentStateHook = updateWorkInProgressHook();
+ var dispatch = currentStateHook.queue.dispatch;
+ currentStateHook.memoizedState = action;
+ return [stateHook, dispatch, !1];
}
- function throwException(
- root,
- returnFiber,
- sourceFiber,
- value,
- rootRenderLanes
- ) {
- sourceFiber.flags |= 32768;
- isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
- if (
- null !== value &&
- "object" === typeof value &&
- (value.$$typeof === REACT_POSTPONE_TYPE &&
- (value = { then: function () {} }),
- "function" === typeof value.then)
- ) {
- resetSuspendedComponent(sourceFiber, rootRenderLanes);
- isHydrating && (didSuspendOrErrorDEV = !0);
- var suspenseBoundary = suspenseHandlerStackCursor.current;
- if (null !== suspenseBoundary) {
- switch (suspenseBoundary.tag) {
- case 13:
- return (
- null === shellBoundary
- ? renderDidSuspendDelayIfPossible()
- : null === suspenseBoundary.alternate &&
- workInProgressRootExitStatus === RootInProgress &&
- (workInProgressRootExitStatus = RootSuspended),
- (suspenseBoundary.flags &= -257),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? (suspenseBoundary.updateQueue = new Set([value]))
- : sourceFiber.add(value),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- case 22:
- return (
- (suspenseBoundary.flags |= 65536),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? ((sourceFiber = {
- transitions: null,
- markerInstances: null,
- retryQueue: new Set([value])
- }),
- (suspenseBoundary.updateQueue = sourceFiber))
- : ((returnFiber = sourceFiber.retryQueue),
- null === returnFiber
- ? (sourceFiber.retryQueue = new Set([value]))
- : returnFiber.add(value)),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- }
+ function pushSimpleEffect(tag, inst, create, deps) {
+ tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
+ inst = currentlyRenderingFiber.updateQueue;
+ null === inst &&
+ ((inst = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = inst));
+ create = inst.lastEffect;
+ null === create
+ ? (inst.lastEffect = tag.next = tag)
+ : ((deps = create.next),
+ (create.next = tag),
+ (tag.next = deps),
+ (inst.lastEffect = tag));
+ return tag;
+ }
+ function createEffectInstance() {
+ return { destroy: void 0, resource: void 0 };
+ }
+ function mountRef(initialValue) {
+ var hook = mountWorkInProgressHook();
+ initialValue = { current: initialValue };
+ return (hook.memoizedState = initialValue);
+ }
+ function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ currentlyRenderingFiber.flags |= fiberFlags;
+ hook.memoizedState = pushSimpleEffect(
+ HasEffect | hookFlags,
+ createEffectInstance(),
+ create,
+ deps
+ );
+ }
+ function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var inst = hook.memoizedState.inst;
+ null !== currentHook &&
+ null !== deps &&
+ areHookInputsEqual(deps, currentHook.memoizedState.deps)
+ ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
+ : ((currentlyRenderingFiber.flags |= fiberFlags),
+ (hook.memoizedState = pushSimpleEffect(
+ HasEffect | hookFlags,
+ inst,
+ create,
+ deps
+ )));
+ }
+ function mountEffect(create, deps) {
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode
+ ? mountEffectImpl(142608384, Passive, create, deps)
+ : mountEffectImpl(8390656, Passive, create, deps);
+ }
+ function useEffectEventImpl(payload) {
+ currentlyRenderingFiber.flags |= 4;
+ var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
+ if (null === componentUpdateQueue)
+ (componentUpdateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = componentUpdateQueue),
+ (componentUpdateQueue.events = [payload]);
+ else {
+ var events = componentUpdateQueue.events;
+ null === events
+ ? (componentUpdateQueue.events = [payload])
+ : events.push(payload);
+ }
+ }
+ function mountEvent(callback) {
+ var hook = mountWorkInProgressHook(),
+ ref = { impl: callback };
+ hook.memoizedState = ref;
+ return function () {
+ if ((executionContext & RenderContext) !== NoContext)
throw Error(
- "Unexpected Suspense handler tag (" +
- suspenseBoundary.tag +
- "). This is a bug in React."
+ "A function wrapped in useEffectEvent can't be called during rendering."
);
- }
- attachPingListener(root, value, rootRenderLanes);
- renderDidSuspendDelayIfPossible();
- return !1;
+ return ref.impl.apply(void 0, arguments);
+ };
+ }
+ function updateEvent(callback) {
+ var ref = updateWorkInProgressHook().memoizedState;
+ useEffectEventImpl({ ref: ref, nextImpl: callback });
+ return function () {
+ if ((executionContext & RenderContext) !== NoContext)
+ throw Error(
+ "A function wrapped in useEffectEvent can't be called during rendering."
+ );
+ return ref.impl.apply(void 0, arguments);
+ };
+ }
+ function mountLayoutEffect(create, deps) {
+ var fiberFlags = 4194308;
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (fiberFlags |= 67108864);
+ return mountEffectImpl(fiberFlags, Layout, create, deps);
+ }
+ function imperativeHandleEffect(create, ref) {
+ if ("function" === typeof ref) {
+ create = create();
+ var refCleanup = ref(create);
+ return function () {
+ "function" === typeof refCleanup ? refCleanup() : ref(null);
+ };
}
- if (isHydrating)
+ if (null !== ref && void 0 !== ref)
return (
- (didSuspendOrErrorDEV = !0),
- (suspenseBoundary = suspenseHandlerStackCursor.current),
- null !== suspenseBoundary
- ? (0 === (suspenseBoundary.flags & 65536) &&
- (suspenseBoundary.flags |= 256),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value !== HydrationMismatchException &&
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
- { cause: value }
- ),
- sourceFiber
- )
- ))
- : (value !== HydrationMismatchException &&
- queueHydrationError(
- createCapturedValueAtFiber(
- Error(
- "There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
- { cause: value }
- ),
- sourceFiber
- )
- ),
- (root = root.current.alternate),
- (root.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (root.lanes |= rootRenderLanes),
- (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
- (rootRenderLanes = createRootErrorUpdate(
- root.stateNode,
- sourceFiber,
- rootRenderLanes
- )),
- enqueueCapturedUpdate(root, rootRenderLanes),
- workInProgressRootExitStatus !== RootSuspendedWithDelay &&
- (workInProgressRootExitStatus = RootErrored)),
- !1
+ ref.hasOwnProperty("current") ||
+ console.error(
+ "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.",
+ "an object with keys {" + Object.keys(ref).join(", ") + "}"
+ ),
+ (create = create()),
+ (ref.current = create),
+ function () {
+ ref.current = null;
+ }
);
- queueConcurrentError(
- createCapturedValueAtFiber(
- Error(
- "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
- { cause: value }
- ),
- sourceFiber
- )
+ }
+ function mountImperativeHandle(ref, create, deps) {
+ "function" !== typeof create &&
+ console.error(
+ "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
+ null !== create ? typeof create : "null"
+ );
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ var fiberFlags = 4194308;
+ (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode &&
+ (fiberFlags |= 67108864);
+ mountEffectImpl(
+ fiberFlags,
+ Layout,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
);
- workInProgressRootExitStatus !== RootSuspendedWithDelay &&
- (workInProgressRootExitStatus = RootErrored);
- if (null === returnFiber) return !0;
- sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
- value = returnFiber;
- do {
- switch (value.tag) {
- case 3:
- return (
- (value.flags |= 65536),
- (root = rootRenderLanes & -rootRenderLanes),
- (value.lanes |= root),
- (root = createRootErrorUpdate(
- value.stateNode,
- sourceFiber,
- root
- )),
- enqueueCapturedUpdate(value, root),
- !1
- );
- case 1:
- if (
- ((returnFiber = value.type),
- (suspenseBoundary = value.stateNode),
- 0 === (value.flags & 128) &&
- ("function" === typeof returnFiber.getDerivedStateFromError ||
- (null !== suspenseBoundary &&
- "function" === typeof suspenseBoundary.componentDidCatch &&
- (null === legacyErrorBoundariesThatAlreadyFailed ||
- !legacyErrorBoundariesThatAlreadyFailed.has(
- suspenseBoundary
- )))))
- )
- return (
- (value.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (value.lanes |= rootRenderLanes),
- (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
- initializeClassErrorUpdate(
- rootRenderLanes,
- root,
- value,
- sourceFiber
- ),
- enqueueCapturedUpdate(value, rootRenderLanes),
- !1
- );
+ }
+ function updateImperativeHandle(ref, create, deps) {
+ "function" !== typeof create &&
+ console.error(
+ "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",
+ null !== create ? typeof create : "null"
+ );
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ updateEffectImpl(
+ 4,
+ Layout,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
+ );
+ }
+ function mountCallback(callback, deps) {
+ mountWorkInProgressHook().memoizedState = [
+ callback,
+ void 0 === deps ? null : deps
+ ];
+ return callback;
+ }
+ function updateCallback(callback, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ hook.memoizedState = [callback, deps];
+ return callback;
+ }
+ function mountMemo(nextCreate, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var nextValue = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- value = value.return;
- } while (null !== value);
- return !1;
+ }
+ hook.memoizedState = [nextValue, deps];
+ return nextValue;
}
- function reconcileChildren(
- current,
- workInProgress,
- nextChildren,
- renderLanes
- ) {
- workInProgress.child =
- null === current
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
- : reconcileChildFibers(
- workInProgress,
- current.child,
- nextChildren,
- renderLanes
- );
+ function updateMemo(nextCreate, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ prevState = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ hook.memoizedState = [prevState, deps];
+ return prevState;
}
- function updateForwardRef(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- Component = Component.render;
- var ref = workInProgress.ref;
- if ("ref" in nextProps) {
- var propsWithoutRef = {};
- for (var key in nextProps)
- "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
- } else propsWithoutRef = nextProps;
- prepareToReadContext(workInProgress);
- nextProps = renderWithHooks(
- current,
- workInProgress,
- Component,
- propsWithoutRef,
- ref,
- renderLanes
+ function mountDeferredValue(value, initialValue) {
+ var hook = mountWorkInProgressHook();
+ return mountDeferredValueImpl(hook, value, initialValue);
+ }
+ function updateDeferredValue(value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
);
- key = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
+ }
+ function rerenderDeferredValue(value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return null === currentHook
+ ? mountDeferredValueImpl(hook, value, initialValue)
+ : updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
+ );
+ }
+ function mountDeferredValueImpl(hook, value, initialValue) {
+ if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
+ return (hook.memoizedState = value);
+ hook.memoizedState = initialValue;
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return initialValue;
+ }
+ function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
+ if (objectIs(value, prevValue)) return value;
+ if (null !== currentTreeHiddenStackCursor.current)
return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ (hook = mountDeferredValueImpl(hook, value, initialValue)),
+ objectIs(hook, prevValue) || (didReceiveUpdate = !0),
+ hook
);
- isHydrating && key && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
+ if (0 === (renderLanes & 42))
+ return (didReceiveUpdate = !0), (hook.memoizedState = value);
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return prevValue;
}
- function updateMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
+ function startTransition(
+ fiber,
+ queue,
+ pendingState,
+ finishedState,
+ callback
) {
- if (null === current) {
- var type = Component.type;
+ var previousPriority = ReactDOMSharedInternals.p;
+ ReactDOMSharedInternals.p =
+ 0 !== previousPriority && previousPriority < ContinuousEventPriority
+ ? previousPriority
+ : ContinuousEventPriority;
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ dispatchOptimisticSetState(fiber, !1, queue, pendingState);
+ currentTransition._updatedFibers = new Set();
+ try {
+ var returnValue = callback(),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
if (
- "function" === typeof type &&
- !shouldConstruct(type) &&
- void 0 === type.defaultProps &&
- null === Component.compare
- )
- return (
- (Component = resolveFunctionForHotReloading(type)),
- (workInProgress.tag = 15),
- (workInProgress.type = Component),
- validateFunctionComponentInDev(workInProgress, type),
- updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- )
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ) {
+ var thenableForFinishedState = chainThenableValue(
+ returnValue,
+ finishedState
);
- current = createFiberFromTypeAndProps(
- Component.type,
- null,
- nextProps,
- workInProgress,
- workInProgress.mode,
- renderLanes
- );
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
- }
- type = current.child;
- if (!checkScheduledUpdateOrContext(current, renderLanes)) {
- var prevProps = type.memoizedProps;
- Component = Component.compare;
- Component = null !== Component ? Component : shallowEqual;
- if (
- Component(prevProps, nextProps) &&
- current.ref === workInProgress.ref
- )
- return bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ thenableForFinishedState,
+ requestUpdateLane(fiber)
+ );
+ } else
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ finishedState,
+ requestUpdateLane(fiber)
);
+ } catch (error) {
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ { then: function () {}, status: "rejected", reason: error },
+ requestUpdateLane(fiber)
+ );
+ } finally {
+ (ReactDOMSharedInternals.p = previousPriority),
+ (ReactSharedInternals.T = prevTransition),
+ null === prevTransition &&
+ currentTransition._updatedFibers &&
+ ((fiber = currentTransition._updatedFibers.size),
+ currentTransition._updatedFibers.clear(),
+ 10 < fiber &&
+ console.warn(
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
+ ));
}
- workInProgress.flags |= 1;
- current = createWorkInProgress(type, nextProps);
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
}
- function updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- if (null !== current) {
- var prevProps = current.memoizedProps;
- if (
- shallowEqual(prevProps, nextProps) &&
- current.ref === workInProgress.ref &&
- workInProgress.type === current.type
- )
- if (
- ((didReceiveUpdate = !1),
- (workInProgress.pendingProps = nextProps = prevProps),
- checkScheduledUpdateOrContext(current, renderLanes))
- )
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
- else
- return (
- (workInProgress.lanes = current.lanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- }
- return updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
+ function startHostTransition(formFiber, pendingState, action, formData) {
+ if (5 !== formFiber.tag)
+ throw Error(
+ "Expected the form instance to be a HostComponent. This is a bug in React."
+ );
+ var queue = ensureFormComponentIsStateful(formFiber).queue;
+ startTransition(
+ formFiber,
+ queue,
+ pendingState,
+ NotPendingTransition,
+ null === action
+ ? noop$3
+ : function () {
+ requestFormReset$2(formFiber);
+ return action(formData);
+ }
);
}
- function updateOffscreenComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- nextChildren = nextProps.children,
- nextIsDetached =
- 0 !==
- (workInProgress.stateNode._pendingVisibility & OffscreenDetached),
- prevState = null !== current ? current.memoizedState : null;
- markRef(current, workInProgress);
- if ("hidden" === nextProps.mode || nextIsDetached) {
- if (0 !== (workInProgress.flags & 128)) {
- nextProps =
- null !== prevState
- ? prevState.baseLanes | renderLanes
- : renderLanes;
- if (null !== current) {
- nextChildren = workInProgress.child = current.child;
- for (nextIsDetached = 0; null !== nextChildren; )
- (nextIsDetached =
- nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
- (nextChildren = nextChildren.sibling);
- workInProgress.childLanes = nextIsDetached & ~nextProps;
- } else (workInProgress.childLanes = 0), (workInProgress.child = null);
- return deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- }
- if (0 !== (renderLanes & 536870912))
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
- null !== current &&
- pushTransition(
- workInProgress,
- null !== prevState ? prevState.cachePool : null
- ),
- null !== prevState
- ? pushHiddenContext(workInProgress, prevState)
- : reuseHiddenContextOnStack(workInProgress),
- pushOffscreenSuspenseHandler(workInProgress);
- else
- return (
- (workInProgress.lanes = workInProgress.childLanes = 536870912),
- deferHiddenOffscreenComponent(
- current,
- workInProgress,
- null !== prevState
- ? prevState.baseLanes | renderLanes
- : renderLanes,
- renderLanes
- )
- );
- } else
- null !== prevState
- ? (pushTransition(workInProgress, prevState.cachePool),
- pushHiddenContext(workInProgress, prevState),
- reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.memoizedState = null))
- : (null !== current && pushTransition(workInProgress, null),
- reuseHiddenContextOnStack(workInProgress),
- reuseSuspenseHandlerOnStack(workInProgress));
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
- }
- function deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextBaseLanes,
- renderLanes
- ) {
- var JSCompiler_inline_result = peekCacheFromPool();
- JSCompiler_inline_result =
- null === JSCompiler_inline_result
- ? null
- : {
- parent: CacheContext._currentValue,
- pool: JSCompiler_inline_result
- };
- workInProgress.memoizedState = {
- baseLanes: nextBaseLanes,
- cachePool: JSCompiler_inline_result
+ function ensureFormComponentIsStateful(formFiber) {
+ var existingStateHook = formFiber.memoizedState;
+ if (null !== existingStateHook) return existingStateHook;
+ existingStateHook = {
+ memoizedState: NotPendingTransition,
+ baseState: NotPendingTransition,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: NotPendingTransition
+ },
+ next: null
};
- null !== current && pushTransition(workInProgress, null);
- reuseHiddenContextOnStack(workInProgress);
- pushOffscreenSuspenseHandler(workInProgress);
- null !== current &&
- propagateParentContextChanges(current, workInProgress, renderLanes, !0);
- return null;
- }
- function markRef(current, workInProgress) {
- var ref = workInProgress.ref;
- if (null === ref)
- null !== current &&
- null !== current.ref &&
- (workInProgress.flags |= 2097664);
- else {
- if ("function" !== typeof ref && "object" !== typeof ref)
- throw Error(
- "Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
- );
- if (null === current || current.ref !== ref)
- workInProgress.flags |= 2097664;
- }
+ var initialResetState = {};
+ existingStateHook.next = {
+ memoizedState: initialResetState,
+ baseState: initialResetState,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialResetState
+ },
+ next: null
+ };
+ formFiber.memoizedState = existingStateHook;
+ formFiber = formFiber.alternate;
+ null !== formFiber && (formFiber.memoizedState = existingStateHook);
+ return existingStateHook;
}
- function updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- if (
- Component.prototype &&
- "function" === typeof Component.prototype.render
- ) {
- var componentName = getComponentNameFromType(Component) || "Unknown";
- didWarnAboutBadClass[componentName] ||
- (console.error(
- "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
- componentName,
- componentName
- ),
- (didWarnAboutBadClass[componentName] = !0));
- }
- workInProgress.mode & StrictLegacyMode &&
- ReactStrictModeWarnings.recordLegacyContextWarning(
- workInProgress,
- null
+ function requestFormReset$2(formFiber) {
+ null === ReactSharedInternals.T &&
+ console.error(
+ "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition."
);
- null === current &&
- (validateFunctionComponentInDev(workInProgress, workInProgress.type),
- Component.contextTypes &&
- ((componentName = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutContextTypes[componentName] ||
- ((didWarnAboutContextTypes[componentName] = !0),
- console.error(
- "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
- componentName
- ))));
- prepareToReadContext(workInProgress);
- Component = renderWithHooks(
- current,
- workInProgress,
- Component,
- nextProps,
- void 0,
- renderLanes
+ var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
+ dispatchSetStateInternal(
+ formFiber,
+ resetStateQueue,
+ {},
+ requestUpdateLane(formFiber)
);
- nextProps = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, Component, renderLanes);
- return workInProgress.child;
}
- function replayFunctionComponent(
- current,
- workInProgress,
- nextProps,
- Component,
- secondArg,
- renderLanes
- ) {
- prepareToReadContext(workInProgress);
- hookTypesUpdateIndexDev = -1;
- ignorePreviousDependencies =
- null !== current && current.type !== workInProgress.type;
- workInProgress.updateQueue = null;
- nextProps = renderWithHooksAgain(
- workInProgress,
- Component,
- nextProps,
- secondArg
+ function mountTransition() {
+ var stateHook = mountStateImpl(!1);
+ stateHook = startTransition.bind(
+ null,
+ currentlyRenderingFiber,
+ stateHook.queue,
+ !0,
+ !1
);
- finishRenderingHooks(current, workInProgress);
- Component = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && Component && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
+ mountWorkInProgressHook().memoizedState = stateHook;
+ return [!1, stateHook];
}
- function updateClassComponent(
- current$jscomp$0,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- ) {
- switch (shouldErrorImpl(workInProgress)) {
- case !1:
- var _instance = workInProgress.stateNode,
- state = new workInProgress.type(
- workInProgress.memoizedProps,
- _instance.context
- ).state;
- _instance.updater.enqueueSetState(_instance, state, null);
- break;
- case !0:
- workInProgress.flags |= 128;
- workInProgress.flags |= 65536;
- _instance = Error("Simulated error coming from DevTools");
- var lane = renderLanes & -renderLanes;
- workInProgress.lanes |= lane;
- state = workInProgressRoot;
- if (null === state)
- throw Error(
- "Expected a work-in-progress root. This is a bug in React. Please file an issue."
- );
- lane = createClassErrorUpdate(lane);
- initializeClassErrorUpdate(
- lane,
- state,
- workInProgress,
- createCapturedValueAtFiber(_instance, workInProgress)
- );
- enqueueCapturedUpdate(workInProgress, lane);
+ function updateTransition() {
+ var booleanOrThenable = updateReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ }
+ function rerenderTransition() {
+ var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ }
+ function useHostTransitionStatus() {
+ return readContext(HostTransitionContext);
+ }
+ function mountId() {
+ var hook = mountWorkInProgressHook(),
+ identifierPrefix = workInProgressRoot.identifierPrefix;
+ if (isHydrating) {
+ var treeId = treeContextOverflow;
+ var idWithLeadingBit = treeContextId;
+ treeId =
+ (
+ idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
+ ).toString(32) + treeId;
+ identifierPrefix = ":" + identifierPrefix + "R" + treeId;
+ treeId = localIdCounter++;
+ 0 < treeId && (identifierPrefix += "H" + treeId.toString(32));
+ identifierPrefix += ":";
+ } else
+ (treeId = globalClientIdCounter++),
+ (identifierPrefix =
+ ":" + identifierPrefix + "r" + treeId.toString(32) + ":");
+ return (hook.memoizedState = identifierPrefix);
+ }
+ function mountRefresh() {
+ return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
+ null,
+ currentlyRenderingFiber
+ ));
+ }
+ function refreshCache(fiber, seedKey, seedValue) {
+ for (var provider = fiber.return; null !== provider; ) {
+ switch (provider.tag) {
+ case 24:
+ case 3:
+ var lane = requestUpdateLane(provider);
+ fiber = createUpdate(lane);
+ var root = enqueueUpdate(provider, fiber, lane);
+ null !== root &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(root, provider, lane),
+ entangleTransitions(root, provider, lane));
+ provider = createCache();
+ null !== seedKey &&
+ void 0 !== seedKey &&
+ null !== root &&
+ provider.data.set(seedKey, seedValue);
+ fiber.payload = { cache: provider };
+ return;
+ }
+ provider = provider.return;
}
- prepareToReadContext(workInProgress);
- if (null === workInProgress.stateNode) {
- state = emptyContextObject;
- _instance = Component.contextType;
- "contextType" in Component &&
- null !== _instance &&
- (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) &&
- !didWarnAboutInvalidateContextType.has(Component) &&
- (didWarnAboutInvalidateContextType.add(Component),
- (lane =
- void 0 === _instance
- ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."
- : "object" !== typeof _instance
- ? " However, it is set to a " + typeof _instance + "."
- : _instance.$$typeof === REACT_CONSUMER_TYPE
- ? " Did you accidentally pass the Context.Consumer instead?"
- : " However, it is set to an object with keys {" +
- Object.keys(_instance).join(", ") +
- "}."),
- console.error(
- "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
- getComponentNameFromType(Component) || "Component",
- lane
- ));
- "object" === typeof _instance &&
- null !== _instance &&
- (state = readContext(_instance));
- _instance = new Component(nextProps, state);
- if (workInProgress.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
+ }
+ function dispatchReducerAction(fiber, queue, action) {
+ var args = arguments;
+ "function" === typeof args[3] &&
+ console.error(
+ "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ );
+ args = requestUpdateLane(fiber);
+ var update = {
+ lane: args,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ isRenderPhaseUpdate(fiber)
+ ? enqueueRenderPhaseUpdate(queue, update)
+ : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)),
+ null !== update &&
+ (startUpdateTimerByLane(args),
+ scheduleUpdateOnFiber(update, fiber, args),
+ entangleTransitionUpdate(update, queue, args)));
+ }
+ function dispatchSetState(fiber, queue, action) {
+ var args = arguments;
+ "function" === typeof args[3] &&
+ console.error(
+ "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
+ );
+ args = requestUpdateLane(fiber);
+ dispatchSetStateInternal(fiber, queue, action, args) &&
+ startUpdateTimerByLane(args);
+ }
+ function dispatchSetStateInternal(fiber, queue, action, lane) {
+ var update = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
+ else {
+ var alternate = fiber.alternate;
+ if (
+ 0 === fiber.lanes &&
+ (null === alternate || 0 === alternate.lanes) &&
+ ((alternate = queue.lastRenderedReducer), null !== alternate)
+ ) {
+ var prevDispatcher = ReactSharedInternals.H;
+ ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV;
try {
- _instance = new Component(nextProps, state);
+ var currentState = queue.lastRenderedState,
+ eagerState = alternate(currentState, action);
+ update.hasEagerState = !0;
+ update.eagerState = eagerState;
+ if (objectIs(eagerState, currentState))
+ return (
+ enqueueUpdate$1(fiber, queue, update, 0),
+ null === workInProgressRoot &&
+ finishQueueingConcurrentUpdates(),
+ !1
+ );
+ } catch (error) {
} finally {
- setIsStrictModeForDevtools(!1);
+ ReactSharedInternals.H = prevDispatcher;
}
}
- state = workInProgress.memoizedState =
- null !== _instance.state && void 0 !== _instance.state
- ? _instance.state
- : null;
- _instance.updater = classComponentUpdater;
- workInProgress.stateNode = _instance;
- _instance._reactInternals = workInProgress;
- _instance._reactInternalInstance = fakeInternalInstance;
- "function" === typeof Component.getDerivedStateFromProps &&
- null === state &&
- ((state = getComponentNameFromType(Component) || "Component"),
- didWarnAboutUninitializedState.has(state) ||
- (didWarnAboutUninitializedState.add(state),
- console.error(
- "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
- state,
- null === _instance.state ? "null" : "undefined",
- state
- )));
- if (
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate
- ) {
- var foundWillUpdateName = (lane = state = null);
- "function" === typeof _instance.componentWillMount &&
- !0 !== _instance.componentWillMount.__suppressDeprecationWarning
- ? (state = "componentWillMount")
- : "function" === typeof _instance.UNSAFE_componentWillMount &&
- (state = "UNSAFE_componentWillMount");
- "function" === typeof _instance.componentWillReceiveProps &&
- !0 !==
- _instance.componentWillReceiveProps.__suppressDeprecationWarning
- ? (lane = "componentWillReceiveProps")
- : "function" ===
- typeof _instance.UNSAFE_componentWillReceiveProps &&
- (lane = "UNSAFE_componentWillReceiveProps");
- "function" === typeof _instance.componentWillUpdate &&
- !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning
- ? (foundWillUpdateName = "componentWillUpdate")
- : "function" === typeof _instance.UNSAFE_componentWillUpdate &&
- (foundWillUpdateName = "UNSAFE_componentWillUpdate");
- if (null !== state || null !== lane || null !== foundWillUpdateName) {
- _instance = getComponentNameFromType(Component) || "Component";
- var newApiName =
- "function" === typeof Component.getDerivedStateFromProps
- ? "getDerivedStateFromProps()"
- : "getSnapshotBeforeUpdate()";
- didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) ||
- (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance),
- console.error(
- "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
- _instance,
- newApiName,
- null !== state ? "\n " + state : "",
- null !== lane ? "\n " + lane : "",
- null !== foundWillUpdateName ? "\n " + foundWillUpdateName : ""
- ));
- }
- }
- _instance = workInProgress.stateNode;
- state = getComponentNameFromType(Component) || "Component";
- _instance.render ||
- (Component.prototype &&
- "function" === typeof Component.prototype.render
- ? console.error(
- "No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
- state
- )
- : console.error(
- "No `render` method found on the %s instance: you may have forgotten to define `render`.",
- state
- ));
- !_instance.getInitialState ||
- _instance.getInitialState.isReactClassApproved ||
- _instance.state ||
- console.error(
- "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
- state
- );
- _instance.getDefaultProps &&
- !_instance.getDefaultProps.isReactClassApproved &&
- console.error(
- "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
- state
- );
- _instance.contextType &&
- console.error(
- "contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
- state
- );
- Component.childContextTypes &&
- !didWarnAboutChildContextTypes.has(Component) &&
- (didWarnAboutChildContextTypes.add(Component),
- console.error(
- "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
- state
- ));
- Component.contextTypes &&
- !didWarnAboutContextTypes$1.has(Component) &&
- (didWarnAboutContextTypes$1.add(Component),
- console.error(
- "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
- state
- ));
- "function" === typeof _instance.componentShouldUpdate &&
- console.error(
- "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
- state
- );
- Component.prototype &&
- Component.prototype.isPureReactComponent &&
- "undefined" !== typeof _instance.shouldComponentUpdate &&
- console.error(
- "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
- getComponentNameFromType(Component) || "A pure component"
- );
- "function" === typeof _instance.componentDidUnmount &&
- console.error(
- "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
- state
- );
- "function" === typeof _instance.componentDidReceiveProps &&
- console.error(
- "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
- state
- );
- "function" === typeof _instance.componentWillRecieveProps &&
- console.error(
- "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
- state
- );
- "function" === typeof _instance.UNSAFE_componentWillRecieveProps &&
- console.error(
- "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
- state
- );
- lane = _instance.props !== nextProps;
- void 0 !== _instance.props &&
- lane &&
- console.error(
- "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
- state
- );
- _instance.defaultProps &&
- console.error(
- "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
- state,
- state
- );
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- "function" === typeof _instance.componentDidUpdate ||
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) ||
- (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component),
- console.error(
- "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
- getComponentNameFromType(Component)
- ));
- "function" === typeof _instance.getDerivedStateFromProps &&
- console.error(
- "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
- state
- );
- "function" === typeof _instance.getDerivedStateFromError &&
- console.error(
- "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
- state
- );
- "function" === typeof Component.getSnapshotBeforeUpdate &&
- console.error(
- "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
- state
- );
- (lane = _instance.state) &&
- ("object" !== typeof lane || isArrayImpl(lane)) &&
- console.error("%s.state: must be set to an object or null", state);
- "function" === typeof _instance.getChildContext &&
- "object" !== typeof Component.childContextTypes &&
- console.error(
- "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
- state
- );
- _instance = workInProgress.stateNode;
- _instance.props = nextProps;
- _instance.state = workInProgress.memoizedState;
- _instance.refs = {};
- initializeUpdateQueue(workInProgress);
- state = Component.contextType;
- _instance.context =
- "object" === typeof state && null !== state
- ? readContext(state)
- : emptyContextObject;
- _instance.state === nextProps &&
- ((state = getComponentNameFromType(Component) || "Component"),
- didWarnAboutDirectlyAssigningPropsToState.has(state) ||
- (didWarnAboutDirectlyAssigningPropsToState.add(state),
- console.error(
- "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
- state
- )));
- workInProgress.mode & StrictLegacyMode &&
- ReactStrictModeWarnings.recordLegacyContextWarning(
- workInProgress,
- _instance
+ action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
+ if (null !== action)
+ return (
+ scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane),
+ !0
);
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
- workInProgress,
- _instance
+ }
+ return !1;
+ }
+ function dispatchOptimisticSetState(
+ fiber,
+ throwIfDuringRender,
+ queue,
+ action
+ ) {
+ null === ReactSharedInternals.T &&
+ 0 === currentEntangledLane &&
+ console.error(
+ "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."
);
- _instance.state = workInProgress.memoizedState;
- state = Component.getDerivedStateFromProps;
- "function" === typeof state &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- state,
- nextProps
- ),
- (_instance.state = workInProgress.memoizedState));
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate ||
- ("function" !== typeof _instance.UNSAFE_componentWillMount &&
- "function" !== typeof _instance.componentWillMount) ||
- ((state = _instance.state),
- "function" === typeof _instance.componentWillMount &&
- _instance.componentWillMount(),
- "function" === typeof _instance.UNSAFE_componentWillMount &&
- _instance.UNSAFE_componentWillMount(),
- state !== _instance.state &&
- (console.error(
- "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
- getComponentNameFromFiber(workInProgress) || "Component"
- ),
- classComponentUpdater.enqueueReplaceState(
- _instance,
- _instance.state,
- null
- )),
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction(),
- (_instance.state = workInProgress.memoizedState));
- "function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308);
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864);
- _instance = !0;
- } else if (null === current$jscomp$0) {
- _instance = workInProgress.stateNode;
- var unresolvedOldProps = workInProgress.memoizedProps;
- lane = resolveClassComponentProps(Component, unresolvedOldProps);
- _instance.props = lane;
- var oldContext = _instance.context;
- foundWillUpdateName = Component.contextType;
- state = emptyContextObject;
- "object" === typeof foundWillUpdateName &&
- null !== foundWillUpdateName &&
- (state = readContext(foundWillUpdateName));
- newApiName = Component.getDerivedStateFromProps;
- foundWillUpdateName =
- "function" === typeof newApiName ||
- "function" === typeof _instance.getSnapshotBeforeUpdate;
- unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
- foundWillUpdateName ||
- ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof _instance.componentWillReceiveProps) ||
- ((unresolvedOldProps || oldContext !== state) &&
- callComponentWillReceiveProps(
- workInProgress,
- _instance,
- nextProps,
- state
+ action = {
+ lane: 2,
+ revertLane: requestTransitionLane(),
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) {
+ if (throwIfDuringRender)
+ throw Error("Cannot update optimistic state while rendering.");
+ console.error("Cannot call startTransition while rendering.");
+ } else
+ (throwIfDuringRender = enqueueConcurrentHookUpdate(
+ fiber,
+ queue,
+ action,
+ 2
+ )),
+ null !== throwIfDuringRender &&
+ (startUpdateTimerByLane(2),
+ scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
+ }
+ function isRenderPhaseUpdate(fiber) {
+ var alternate = fiber.alternate;
+ return (
+ fiber === currentlyRenderingFiber ||
+ (null !== alternate && alternate === currentlyRenderingFiber)
+ );
+ }
+ function enqueueRenderPhaseUpdate(queue, update) {
+ didScheduleRenderPhaseUpdateDuringThisPass =
+ didScheduleRenderPhaseUpdate = !0;
+ var pending = queue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ queue.pending = update;
+ }
+ function entangleTransitionUpdate(root, queue, lane) {
+ if (0 !== (lane & 4194176)) {
+ var queueLanes = queue.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ queue.lanes = lane;
+ markRootEntangled(root, lane);
+ }
+ }
+ function pushDebugInfo(debugInfo) {
+ var previousDebugInfo = currentDebugInfo;
+ null != debugInfo &&
+ (currentDebugInfo =
+ null === previousDebugInfo
+ ? debugInfo
+ : previousDebugInfo.concat(debugInfo));
+ return previousDebugInfo;
+ }
+ function validateFragmentProps(element, fiber, returnFiber) {
+ for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if ("children" !== key && "key" !== key) {
+ null === fiber &&
+ ((fiber = createFiberFromElement(element, returnFiber.mode, 0)),
+ (fiber._debugInfo = currentDebugInfo),
+ (fiber.return = returnFiber));
+ runWithFiberInDEV(
+ fiber,
+ function (erroredKey) {
+ console.error(
+ "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
+ erroredKey
+ );
+ },
+ key
+ );
+ break;
+ }
+ }
+ }
+ function unwrapThenable(thenable) {
+ var index = thenableIndexCounter;
+ thenableIndexCounter += 1;
+ null === thenableState && (thenableState = createThenableState());
+ return trackUsedThenable(thenableState, thenable, index);
+ }
+ function coerceRef(workInProgress, element) {
+ element = element.props.ref;
+ workInProgress.ref = void 0 !== element ? element : null;
+ }
+ function throwOnInvalidObjectType(returnFiber, newChild) {
+ if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
+ throw Error(
+ 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
+ );
+ returnFiber = Object.prototype.toString.call(newChild);
+ throw Error(
+ "Objects are not valid as a React child (found: " +
+ ("[object Object]" === returnFiber
+ ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
+ : returnFiber) +
+ "). If you meant to render a collection of children, use an array instead."
+ );
+ }
+ function warnOnFunctionType(returnFiber, invalidChild) {
+ var parentName = getComponentNameFromFiber(returnFiber) || "Component";
+ ownerHasFunctionTypeWarning[parentName] ||
+ ((ownerHasFunctionTypeWarning[parentName] = !0),
+ (invalidChild =
+ invalidChild.displayName || invalidChild.name || "Component"),
+ 3 === returnFiber.tag
+ ? console.error(
+ "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)",
+ invalidChild,
+ invalidChild,
+ invalidChild
+ )
+ : console.error(
+ "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}%s>",
+ invalidChild,
+ invalidChild,
+ parentName,
+ invalidChild,
+ parentName
));
- hasForceUpdate = !1;
- var oldState = workInProgress.memoizedState;
- _instance.state = oldState;
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- oldContext = workInProgress.memoizedState;
- unresolvedOldProps || oldState !== oldContext || hasForceUpdate
- ? ("function" === typeof newApiName &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- newApiName,
- nextProps
- ),
- (oldContext = workInProgress.memoizedState)),
- (lane =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- lane,
- nextProps,
- oldState,
- oldContext,
- state
- ))
- ? (foundWillUpdateName ||
- ("function" !== typeof _instance.UNSAFE_componentWillMount &&
- "function" !== typeof _instance.componentWillMount) ||
- ("function" === typeof _instance.componentWillMount &&
- _instance.componentWillMount(),
- "function" === typeof _instance.UNSAFE_componentWillMount &&
- _instance.UNSAFE_componentWillMount()),
- "function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864))
- : ("function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = oldContext)),
- (_instance.props = nextProps),
- (_instance.state = oldContext),
- (_instance.context = state),
- (_instance = lane))
- : ("function" === typeof _instance.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.mode & StrictEffectsMode) !== NoMode &&
- (workInProgress.flags |= 67108864),
- (_instance = !1));
- } else {
- _instance = workInProgress.stateNode;
- cloneUpdateQueue(current$jscomp$0, workInProgress);
- state = workInProgress.memoizedProps;
- foundWillUpdateName = resolveClassComponentProps(Component, state);
- _instance.props = foundWillUpdateName;
- newApiName = workInProgress.pendingProps;
- oldState = _instance.context;
- oldContext = Component.contextType;
- lane = emptyContextObject;
- "object" === typeof oldContext &&
- null !== oldContext &&
- (lane = readContext(oldContext));
- unresolvedOldProps = Component.getDerivedStateFromProps;
- (oldContext =
- "function" === typeof unresolvedOldProps ||
- "function" === typeof _instance.getSnapshotBeforeUpdate) ||
- ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof _instance.componentWillReceiveProps) ||
- ((state !== newApiName || oldState !== lane) &&
- callComponentWillReceiveProps(
- workInProgress,
- _instance,
- nextProps,
- lane
+ }
+ function warnOnSymbolType(returnFiber, invalidChild) {
+ var parentName = getComponentNameFromFiber(returnFiber) || "Component";
+ ownerHasSymbolTypeWarning[parentName] ||
+ ((ownerHasSymbolTypeWarning[parentName] = !0),
+ (invalidChild = String(invalidChild)),
+ 3 === returnFiber.tag
+ ? console.error(
+ "Symbols are not valid as a React child.\n root.render(%s)",
+ invalidChild
+ )
+ : console.error(
+ "Symbols are not valid as a React child.\n <%s>%s%s>",
+ parentName,
+ invalidChild,
+ parentName
));
- hasForceUpdate = !1;
- oldState = workInProgress.memoizedState;
- _instance.state = oldState;
- processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- var newState = workInProgress.memoizedState;
- state !== newApiName ||
- oldState !== newState ||
- hasForceUpdate ||
- (null !== current$jscomp$0 &&
- null !== current$jscomp$0.dependencies &&
- checkIfContextChanged(current$jscomp$0.dependencies))
- ? ("function" === typeof unresolvedOldProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- unresolvedOldProps,
- nextProps
- ),
- (newState = workInProgress.memoizedState)),
- (foundWillUpdateName =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- foundWillUpdateName,
- nextProps,
- oldState,
- newState,
- lane
- ) ||
- (null !== current$jscomp$0 &&
- null !== current$jscomp$0.dependencies &&
- checkIfContextChanged(current$jscomp$0.dependencies)))
- ? (oldContext ||
- ("function" !== typeof _instance.UNSAFE_componentWillUpdate &&
- "function" !== typeof _instance.componentWillUpdate) ||
- ("function" === typeof _instance.componentWillUpdate &&
- _instance.componentWillUpdate(nextProps, newState, lane),
- "function" === typeof _instance.UNSAFE_componentWillUpdate &&
- _instance.UNSAFE_componentWillUpdate(
- nextProps,
- newState,
- lane
- )),
- "function" === typeof _instance.componentDidUpdate &&
- (workInProgress.flags |= 4),
- "function" === typeof _instance.getSnapshotBeforeUpdate &&
- (workInProgress.flags |= 1024))
- : ("function" !== typeof _instance.componentDidUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 1024),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = newState)),
- (_instance.props = nextProps),
- (_instance.state = newState),
- (_instance.context = lane),
- (_instance = foundWillUpdateName))
- : ("function" !== typeof _instance.componentDidUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof _instance.getSnapshotBeforeUpdate ||
- (state === current$jscomp$0.memoizedProps &&
- oldState === current$jscomp$0.memoizedState) ||
- (workInProgress.flags |= 1024),
- (_instance = !1));
- }
- lane = _instance;
- markRef(current$jscomp$0, workInProgress);
- state = 0 !== (workInProgress.flags & 128);
- if (lane || state) {
- lane = workInProgress.stateNode;
- ReactSharedInternals.getCurrentStack =
- null === workInProgress ? null : getCurrentFiberStackInDev;
- isRendering = !1;
- current = workInProgress;
- if (state && "function" !== typeof Component.getDerivedStateFromError)
- (Component = null), (profilerStartTime = -1);
- else if (
- ((Component = callRenderInDEV(lane)),
- workInProgress.mode & StrictLegacyMode)
- ) {
- setIsStrictModeForDevtools(!0);
- try {
- callRenderInDEV(lane);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- workInProgress.flags |= 1;
- null !== current$jscomp$0 && state
- ? ((workInProgress.child = reconcileChildFibers(
- workInProgress,
- current$jscomp$0.child,
- null,
- renderLanes
- )),
- (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- Component,
- renderLanes
- )))
- : reconcileChildren(
- current$jscomp$0,
- workInProgress,
- Component,
- renderLanes
- );
- workInProgress.memoizedState = lane.state;
- current$jscomp$0 = workInProgress.child;
- } else
- current$jscomp$0 = bailoutOnAlreadyFinishedWork(
- current$jscomp$0,
- workInProgress,
- renderLanes
- );
- renderLanes = workInProgress.stateNode;
- _instance &&
- renderLanes.props !== nextProps &&
- (didWarnAboutReassigningProps ||
- console.error(
- "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
- getComponentNameFromFiber(workInProgress) || "a component"
- ),
- (didWarnAboutReassigningProps = !0));
- return current$jscomp$0;
- }
- function mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextChildren,
- renderLanes
- ) {
- resetHydrationState();
- workInProgress.flags |= 256;
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
- }
- function validateFunctionComponentInDev(workInProgress, Component) {
- Component &&
- Component.childContextTypes &&
- console.error(
- "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...",
- Component.displayName || Component.name || "Component"
- );
- "function" === typeof Component.getDerivedStateFromProps &&
- ((workInProgress = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] ||
- (console.error(
- "%s: Function components do not support getDerivedStateFromProps.",
- workInProgress
- ),
- (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] =
- !0)));
- "object" === typeof Component.contextType &&
- null !== Component.contextType &&
- ((Component = getComponentNameFromType(Component) || "Unknown"),
- didWarnAboutContextTypeOnFunctionComponent[Component] ||
- (console.error(
- "%s: Function components do not support contextType.",
- Component
- ),
- (didWarnAboutContextTypeOnFunctionComponent[Component] = !0)));
- }
- function mountSuspenseOffscreenState(renderLanes) {
- return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
- }
- function getRemainingWorkInPrimaryTree(
- current,
- primaryTreeDidDefer,
- renderLanes
- ) {
- current = null !== current ? current.childLanes & ~renderLanes : 0;
- primaryTreeDidDefer && (current |= workInProgressDeferredLane);
- return current;
}
- function updateSuspenseComponent(current, workInProgress, renderLanes) {
- var JSCompiler_object_inline_componentStack_2335;
- var JSCompiler_object_inline_stack_2334 = workInProgress.pendingProps;
- shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128);
- var JSCompiler_object_inline_message_2332 = !1;
- var didSuspend = 0 !== (workInProgress.flags & 128);
- (JSCompiler_object_inline_componentStack_2335 = didSuspend) ||
- (JSCompiler_object_inline_componentStack_2335 =
- null !== current && null === current.memoizedState
- ? !1
- : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback));
- JSCompiler_object_inline_componentStack_2335 &&
- ((JSCompiler_object_inline_message_2332 = !0),
- (workInProgress.flags &= -129));
- JSCompiler_object_inline_componentStack_2335 =
- 0 !== (workInProgress.flags & 32);
- workInProgress.flags &= -33;
- if (null === current) {
- if (isHydrating) {
- JSCompiler_object_inline_message_2332
- ? pushPrimaryTreeSuspenseHandler(workInProgress)
- : reuseSuspenseHandlerOnStack(workInProgress);
- if (isHydrating) {
- var JSCompiler_object_inline_digest_2333 = nextHydratableInstance;
- var JSCompiler_temp;
- if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2333)) {
- c: {
- var instance = JSCompiler_object_inline_digest_2333;
- for (
- JSCompiler_temp = rootOrSingletonContext;
- 8 !== instance.nodeType;
-
- ) {
- if (!JSCompiler_temp) {
- JSCompiler_temp = null;
- break c;
- }
- instance = getNextHydratable(instance.nextSibling);
- if (null === instance) {
- JSCompiler_temp = null;
- break c;
- }
- }
- JSCompiler_temp = instance;
- }
- null !== JSCompiler_temp
- ? (warnIfNotHydrating(),
- (workInProgress.memoizedState = {
- dehydrated: JSCompiler_temp,
- treeContext:
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null,
- retryLane: 536870912
- }),
- (instance = createFiber(18, null, null, NoMode)),
- (instance.stateNode = JSCompiler_temp),
- (instance.return = workInProgress),
- (workInProgress.child = instance),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (JSCompiler_temp = !0))
- : (JSCompiler_temp = !1);
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp &&
- (warnNonHydratedInstance(
- workInProgress,
- JSCompiler_object_inline_digest_2333
- ),
- throwOnHydrationMismatch(workInProgress));
- }
- JSCompiler_object_inline_digest_2333 = workInProgress.memoizedState;
- if (
- null !== JSCompiler_object_inline_digest_2333 &&
- ((JSCompiler_object_inline_digest_2333 =
- JSCompiler_object_inline_digest_2333.dehydrated),
- null !== JSCompiler_object_inline_digest_2333)
- )
- return (
- isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333)
- ? (workInProgress.lanes = 16)
- : (workInProgress.lanes = 536870912),
- null
- );
- popSuspenseHandler(workInProgress);
+ function createChildReconciler(shouldTrackSideEffects) {
+ function deleteChild(returnFiber, childToDelete) {
+ if (shouldTrackSideEffects) {
+ var deletions = returnFiber.deletions;
+ null === deletions
+ ? ((returnFiber.deletions = [childToDelete]),
+ (returnFiber.flags |= 16))
+ : deletions.push(childToDelete);
}
- JSCompiler_object_inline_digest_2333 =
- JSCompiler_object_inline_stack_2334.children;
- JSCompiler_temp = JSCompiler_object_inline_stack_2334.fallback;
- if (JSCompiler_object_inline_message_2332)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_stack_2334 =
- mountSuspenseFallbackChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2333,
- JSCompiler_temp,
- renderLanes
- )),
- (JSCompiler_object_inline_message_2332 = workInProgress.child),
- (JSCompiler_object_inline_message_2332.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_message_2332.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2335,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- JSCompiler_object_inline_stack_2334
- );
- if (
- "number" ===
- typeof JSCompiler_object_inline_stack_2334.unstable_expectedLoadTime
- )
+ }
+ function deleteRemainingChildren(returnFiber, currentFirstChild) {
+ if (!shouldTrackSideEffects) return null;
+ for (; null !== currentFirstChild; )
+ deleteChild(returnFiber, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return null;
+ }
+ function mapRemainingChildren(currentFirstChild) {
+ for (var existingChildren = new Map(); null !== currentFirstChild; )
+ null !== currentFirstChild.key
+ ? existingChildren.set(currentFirstChild.key, currentFirstChild)
+ : existingChildren.set(currentFirstChild.index, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return existingChildren;
+ }
+ function useFiber(fiber, pendingProps) {
+ fiber = createWorkInProgress(fiber, pendingProps);
+ fiber.index = 0;
+ fiber.sibling = null;
+ return fiber;
+ }
+ function placeChild(newFiber, lastPlacedIndex, newIndex) {
+ newFiber.index = newIndex;
+ if (!shouldTrackSideEffects)
+ return (newFiber.flags |= 1048576), lastPlacedIndex;
+ newIndex = newFiber.alternate;
+ if (null !== newIndex)
return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_stack_2334 =
- mountSuspenseFallbackChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2333,
- JSCompiler_temp,
- renderLanes
- )),
- (JSCompiler_object_inline_message_2332 = workInProgress.child),
- (JSCompiler_object_inline_message_2332.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_message_2332.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2335,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress.lanes = 4194304),
- JSCompiler_object_inline_stack_2334
+ (newIndex = newIndex.index),
+ newIndex < lastPlacedIndex
+ ? ((newFiber.flags |= 33554434), lastPlacedIndex)
+ : newIndex
);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- return mountSuspensePrimaryChildren(
- workInProgress,
- JSCompiler_object_inline_digest_2333
- );
+ newFiber.flags |= 33554434;
+ return lastPlacedIndex;
}
- var prevState = current.memoizedState;
- if (
- null !== prevState &&
- ((JSCompiler_object_inline_digest_2333 = prevState.dehydrated),
- null !== JSCompiler_object_inline_digest_2333)
- ) {
- if (didSuspend)
- workInProgress.flags & 256
- ? (pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags &= -257),
- (workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- )))
- : null !== workInProgress.memoizedState
- ? (reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.child = current.child),
- (workInProgress.flags |= 128),
- (workInProgress = null))
- : (reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_message_2332 =
- JSCompiler_object_inline_stack_2334.fallback),
- (JSCompiler_object_inline_digest_2333 = workInProgress.mode),
- (JSCompiler_object_inline_stack_2334 =
- mountWorkInProgressOffscreenFiber(
- {
- mode: "visible",
- children: JSCompiler_object_inline_stack_2334.children
- },
- JSCompiler_object_inline_digest_2333
- )),
- (JSCompiler_object_inline_message_2332 =
- createFiberFromFragment(
- JSCompiler_object_inline_message_2332,
- JSCompiler_object_inline_digest_2333,
- renderLanes,
- null
- )),
- (JSCompiler_object_inline_message_2332.flags |= 2),
- (JSCompiler_object_inline_stack_2334.return = workInProgress),
- (JSCompiler_object_inline_message_2332.return = workInProgress),
- (JSCompiler_object_inline_stack_2334.sibling =
- JSCompiler_object_inline_message_2332),
- (workInProgress.child = JSCompiler_object_inline_stack_2334),
- reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
- ),
- (JSCompiler_object_inline_stack_2334 = workInProgress.child),
- (JSCompiler_object_inline_stack_2334.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (JSCompiler_object_inline_stack_2334.childLanes =
- getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_object_inline_componentStack_2335,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress = JSCompiler_object_inline_message_2332));
- else if (
- (pushPrimaryTreeSuspenseHandler(workInProgress),
- isHydrating &&
- console.error(
- "We should not be hydrating here. This is a bug in React. Please file a bug."
- ),
- isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333))
- ) {
- JSCompiler_object_inline_componentStack_2335 =
- JSCompiler_object_inline_digest_2333.nextSibling &&
- JSCompiler_object_inline_digest_2333.nextSibling.dataset;
- if (JSCompiler_object_inline_componentStack_2335) {
- JSCompiler_temp = JSCompiler_object_inline_componentStack_2335.dgst;
- var message = JSCompiler_object_inline_componentStack_2335.msg;
- instance = JSCompiler_object_inline_componentStack_2335.stck;
- var componentStack =
- JSCompiler_object_inline_componentStack_2335.cstck;
- }
- JSCompiler_object_inline_message_2332 = message;
- JSCompiler_object_inline_digest_2333 = JSCompiler_temp;
- JSCompiler_object_inline_stack_2334 = instance;
- JSCompiler_temp = JSCompiler_object_inline_componentStack_2335 =
- componentStack;
- "POSTPONE" !== JSCompiler_object_inline_digest_2333 &&
- ((JSCompiler_object_inline_componentStack_2335 =
- JSCompiler_object_inline_message_2332
- ? Error(JSCompiler_object_inline_message_2332)
- : Error(
- "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
- )),
- (JSCompiler_object_inline_componentStack_2335.stack =
- JSCompiler_object_inline_stack_2334 || ""),
- (JSCompiler_object_inline_componentStack_2335.digest =
- JSCompiler_object_inline_digest_2333),
- (JSCompiler_object_inline_stack_2334 =
- void 0 === JSCompiler_temp ? null : JSCompiler_temp),
- (JSCompiler_object_inline_message_2332 = {
- value: JSCompiler_object_inline_componentStack_2335,
- source: null,
- stack: JSCompiler_object_inline_stack_2334
- }),
- "string" === typeof JSCompiler_object_inline_stack_2334 &&
- CapturedStacks.set(
- JSCompiler_object_inline_componentStack_2335,
- JSCompiler_object_inline_message_2332
- ),
- queueHydrationError(JSCompiler_object_inline_message_2332));
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- );
- } else if (
- (didReceiveUpdate ||
- propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- (JSCompiler_object_inline_componentStack_2335 =
- 0 !== (renderLanes & current.childLanes)),
- didReceiveUpdate || JSCompiler_object_inline_componentStack_2335)
- ) {
- JSCompiler_object_inline_componentStack_2335 = workInProgressRoot;
- if (null !== JSCompiler_object_inline_componentStack_2335) {
- JSCompiler_object_inline_stack_2334 = renderLanes & -renderLanes;
- if (0 !== (JSCompiler_object_inline_stack_2334 & 42))
- JSCompiler_object_inline_stack_2334 = 1;
- else
- switch (JSCompiler_object_inline_stack_2334) {
- case 2:
- JSCompiler_object_inline_stack_2334 = 1;
- break;
- case 8:
- JSCompiler_object_inline_stack_2334 = 4;
- break;
- case 32:
- JSCompiler_object_inline_stack_2334 = 16;
- break;
- case 128:
- case 256:
- case 512:
- case 1024:
- case 2048:
- case 4096:
- case 8192:
- case 16384:
- case 32768:
- case 65536:
- case 131072:
- case 262144:
- case 524288:
- case 1048576:
- case 2097152:
- case 4194304:
- case 8388608:
- case 16777216:
- case 33554432:
- JSCompiler_object_inline_stack_2334 = 64;
- break;
- case 268435456:
- JSCompiler_object_inline_stack_2334 = 134217728;
- break;
- default:
- JSCompiler_object_inline_stack_2334 = 0;
- }
- JSCompiler_object_inline_stack_2334 =
- 0 !==
- (JSCompiler_object_inline_stack_2334 &
- (JSCompiler_object_inline_componentStack_2335.suspendedLanes |
- renderLanes))
- ? 0
- : JSCompiler_object_inline_stack_2334;
- if (
- 0 !== JSCompiler_object_inline_stack_2334 &&
- JSCompiler_object_inline_stack_2334 !== prevState.retryLane
- )
- throw (
- ((prevState.retryLane = JSCompiler_object_inline_stack_2334),
- enqueueConcurrentRenderForLane(
- current,
- JSCompiler_object_inline_stack_2334
- ),
- scheduleUpdateOnFiber(
- JSCompiler_object_inline_componentStack_2335,
- current,
- JSCompiler_object_inline_stack_2334
- ),
- SelectiveHydrationException)
- );
- }
- JSCompiler_object_inline_digest_2333.data ===
- SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible();
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
+ function placeSingleChild(newFiber) {
+ shouldTrackSideEffects &&
+ null === newFiber.alternate &&
+ (newFiber.flags |= 33554434);
+ return newFiber;
+ }
+ function updateTextNode(returnFiber, current, textContent, lanes) {
+ if (null === current || 6 !== current.tag)
+ return (
+ (current = createFiberFromText(
+ textContent,
+ returnFiber.mode,
+ lanes
+ )),
+ (current.return = returnFiber),
+ (current._debugOwner = returnFiber),
+ (current._debugTask = returnFiber._debugTask),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- } else
- JSCompiler_object_inline_digest_2333.data ===
- SUSPENSE_PENDING_START_DATA
- ? ((workInProgress.flags |= 192),
- (workInProgress.child = current.child),
- (workInProgress = null))
- : ((current = prevState.treeContext),
- (nextHydratableInstance = getNextHydratable(
- JSCompiler_object_inline_digest_2333.nextSibling
- )),
- (hydrationParentFiber = workInProgress),
- (isHydrating = !0),
- (hydrationErrors = null),
- (didSuspendOrErrorDEV = !1),
- (hydrationDiffRootDEV = null),
- (rootOrSingletonContext = !1),
- null !== current &&
- (warnIfNotHydrating(),
- (idStack[idStackIndex++] = treeContextId),
- (idStack[idStackIndex++] = treeContextOverflow),
- (idStack[idStackIndex++] = treeContextProvider),
- (treeContextId = current.id),
- (treeContextOverflow = current.overflow),
- (treeContextProvider = workInProgress)),
- (workInProgress = mountSuspensePrimaryChildren(
- workInProgress,
- JSCompiler_object_inline_stack_2334.children
- )),
- (workInProgress.flags |= 4096));
- return workInProgress;
+ current = useFiber(current, textContent);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- if (JSCompiler_object_inline_message_2332)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (JSCompiler_object_inline_message_2332 =
- JSCompiler_object_inline_stack_2334.fallback),
- (JSCompiler_object_inline_digest_2333 = workInProgress.mode),
- (JSCompiler_temp = current.child),
- (instance = JSCompiler_temp.sibling),
- (JSCompiler_object_inline_stack_2334 = createWorkInProgress(
- JSCompiler_temp,
- {
- mode: "hidden",
- children: JSCompiler_object_inline_stack_2334.children
- }
- )),
- (JSCompiler_object_inline_stack_2334.subtreeFlags =
- JSCompiler_temp.subtreeFlags & 31457280),
- null !== instance
- ? (JSCompiler_object_inline_message_2332 = createWorkInProgress(
- instance,
- JSCompiler_object_inline_message_2332
- ))
- : ((JSCompiler_object_inline_message_2332 = createFiberFromFragment(
- JSCompiler_object_inline_message_2332,
- JSCompiler_object_inline_digest_2333,
- renderLanes,
- null
- )),
- (JSCompiler_object_inline_message_2332.flags |= 2)),
- (JSCompiler_object_inline_message_2332.return = workInProgress),
- (JSCompiler_object_inline_stack_2334.return = workInProgress),
- (JSCompiler_object_inline_stack_2334.sibling =
- JSCompiler_object_inline_message_2332),
- (workInProgress.child = JSCompiler_object_inline_stack_2334),
- (JSCompiler_object_inline_stack_2334 =
- JSCompiler_object_inline_message_2332),
- (JSCompiler_object_inline_message_2332 = workInProgress.child),
- (JSCompiler_object_inline_digest_2333 = current.child.memoizedState),
- null === JSCompiler_object_inline_digest_2333
- ? (JSCompiler_object_inline_digest_2333 =
- mountSuspenseOffscreenState(renderLanes))
- : ((JSCompiler_temp =
- JSCompiler_object_inline_digest_2333.cachePool),
- null !== JSCompiler_temp
- ? ((instance = CacheContext._currentValue),
- (JSCompiler_temp =
- JSCompiler_temp.parent !== instance
- ? { parent: instance, pool: instance }
- : JSCompiler_temp))
- : (JSCompiler_temp = getSuspendedCache()),
- (JSCompiler_object_inline_digest_2333 = {
- baseLanes:
- JSCompiler_object_inline_digest_2333.baseLanes | renderLanes,
- cachePool: JSCompiler_temp
- })),
- (JSCompiler_object_inline_message_2332.memoizedState =
- JSCompiler_object_inline_digest_2333),
- (JSCompiler_object_inline_message_2332.childLanes =
- getRemainingWorkInPrimaryTree(
+ function updateElement(returnFiber, current, element, lanes) {
+ var elementType = element.type;
+ if (elementType === REACT_FRAGMENT_TYPE)
+ return (
+ (current = updateFragment(
+ returnFiber,
current,
- JSCompiler_object_inline_componentStack_2335,
- renderLanes
+ element.props.children,
+ lanes,
+ element.key
)),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- JSCompiler_object_inline_stack_2334
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- renderLanes = current.child;
- current = renderLanes.sibling;
- renderLanes = createWorkInProgress(renderLanes, {
- mode: "visible",
- children: JSCompiler_object_inline_stack_2334.children
- });
- renderLanes.return = workInProgress;
- renderLanes.sibling = null;
- null !== current &&
- ((JSCompiler_object_inline_componentStack_2335 =
- workInProgress.deletions),
- null === JSCompiler_object_inline_componentStack_2335
- ? ((workInProgress.deletions = [current]),
- (workInProgress.flags |= 16))
- : JSCompiler_object_inline_componentStack_2335.push(current));
- workInProgress.child = renderLanes;
- workInProgress.memoizedState = null;
- return renderLanes;
- }
- function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: primaryChildren },
- workInProgress.mode
- );
- primaryChildren.return = workInProgress;
- return (workInProgress.child = primaryChildren);
- }
- function mountSuspenseFallbackChildren(
- workInProgress,
- primaryChildren,
- fallbackChildren,
- renderLanes
- ) {
- var mode = workInProgress.mode;
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "hidden", children: primaryChildren },
- mode
- );
- fallbackChildren = createFiberFromFragment(
- fallbackChildren,
- mode,
- renderLanes,
- null
- );
- primaryChildren.return = workInProgress;
- fallbackChildren.return = workInProgress;
- primaryChildren.sibling = fallbackChildren;
- workInProgress.child = primaryChildren;
- return fallbackChildren;
- }
- function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
- return createFiberFromOffscreen(offscreenProps, mode, 0, null);
- }
- function retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- ) {
- reconcileChildFibers(workInProgress, current.child, null, renderLanes);
- current = mountSuspensePrimaryChildren(
- workInProgress,
- workInProgress.pendingProps.children
- );
- current.flags |= 2;
- workInProgress.memoizedState = null;
- return current;
- }
- function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
- fiber.lanes |= renderLanes;
- var alternate = fiber.alternate;
- null !== alternate && (alternate.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- fiber.return,
- renderLanes,
- propagationRoot
- );
- }
- function validateSuspenseListNestedChild(childSlot, index) {
- var isAnArray = isArrayImpl(childSlot);
- childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot);
- return isAnArray || childSlot
- ? ((isAnArray = isAnArray ? "array" : "iterable"),
- console.error(
- "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ",
- isAnArray,
- index,
- isAnArray
- ),
- !1)
- : !0;
- }
- function initSuspenseListRenderState(
- workInProgress,
- isBackwards,
- tail,
- lastContentRow,
- tailMode
- ) {
- var renderState = workInProgress.memoizedState;
- null === renderState
- ? (workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- renderingStartTime: 0,
- last: lastContentRow,
- tail: tail,
- tailMode: tailMode
- })
- : ((renderState.isBackwards = isBackwards),
- (renderState.rendering = null),
- (renderState.renderingStartTime = 0),
- (renderState.last = lastContentRow),
- (renderState.tail = tail),
- (renderState.tailMode = tailMode));
- }
- function updateSuspenseListComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- revealOrder = nextProps.revealOrder,
- tailMode = nextProps.tail;
- nextProps = nextProps.children;
- if (
- void 0 !== revealOrder &&
- "forwards" !== revealOrder &&
- "backwards" !== revealOrder &&
- "together" !== revealOrder &&
- !didWarnAboutRevealOrder[revealOrder]
- )
+ validateFragmentProps(element, current, returnFiber),
+ current
+ );
if (
- ((didWarnAboutRevealOrder[revealOrder] = !0),
- "string" === typeof revealOrder)
+ null !== current &&
+ (current.elementType === elementType ||
+ isCompatibleFamilyForHotReloading(current, element) ||
+ ("object" === typeof elementType &&
+ null !== elementType &&
+ elementType.$$typeof === REACT_LAZY_TYPE &&
+ callLazyInitInDEV(elementType) === current.type))
)
- switch (revealOrder.toLowerCase()) {
- case "together":
- case "forwards":
- case "backwards":
- console.error(
- '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.',
- revealOrder,
- revealOrder.toLowerCase()
- );
- break;
- case "forward":
- case "backward":
- console.error(
- '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.',
- revealOrder,
- revealOrder.toLowerCase()
- );
- break;
- default:
- console.error(
- '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?',
- revealOrder
- );
- }
- else
- console.error(
- '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?',
- revealOrder
+ return (
+ (current = useFiber(current, element.props)),
+ coerceRef(current, element),
+ (current.return = returnFiber),
+ (current._debugOwner = element._owner),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- void 0 === tailMode ||
- didWarnAboutTailOptions[tailMode] ||
- ("collapsed" !== tailMode && "hidden" !== tailMode
- ? ((didWarnAboutTailOptions[tailMode] = !0),
- console.error(
- '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?',
- tailMode
- ))
- : "forwards" !== revealOrder &&
- "backwards" !== revealOrder &&
- ((didWarnAboutTailOptions[tailMode] = !0),
- console.error(
- ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
- tailMode
- )));
- a: if (
- ("forwards" === revealOrder || "backwards" === revealOrder) &&
- void 0 !== nextProps &&
- null !== nextProps &&
- !1 !== nextProps
- )
- if (isArrayImpl(nextProps))
- for (var i = 0; i < nextProps.length; i++) {
- if (!validateSuspenseListNestedChild(nextProps[i], i)) break a;
- }
- else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) {
- if ((i = i.call(nextProps)))
- for (var step = i.next(), _i = 0; !step.done; step = i.next()) {
- if (!validateSuspenseListNestedChild(step.value, _i)) break a;
- _i++;
- }
- } else
- console.error(
- 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
- revealOrder
+ current = createFiberFromElement(element, returnFiber.mode, lanes);
+ coerceRef(current, element);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
+ }
+ function updatePortal(returnFiber, current, portal, lanes) {
+ if (
+ null === current ||
+ 4 !== current.tag ||
+ current.stateNode.containerInfo !== portal.containerInfo ||
+ current.stateNode.implementation !== portal.implementation
+ )
+ return (
+ (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- nextProps = suspenseStackCursor.current;
- if (0 !== (nextProps & ForceSuspenseFallback))
- (nextProps =
- (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback),
- (workInProgress.flags |= 128);
- else {
- if (null !== current && 0 !== (current.flags & 128))
- a: for (current = workInProgress.child; null !== current; ) {
- if (13 === current.tag)
- null !== current.memoizedState &&
- scheduleSuspenseWorkOnFiber(
- current,
- renderLanes,
- workInProgress
- );
- else if (19 === current.tag)
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (null !== current.child) {
- current.child.return = current;
- current = current.child;
- continue;
- }
- if (current === workInProgress) break a;
- for (; null === current.sibling; ) {
- if (null === current.return || current.return === workInProgress)
- break a;
- current = current.return;
- }
- current.sibling.return = current.return;
- current = current.sibling;
- }
- nextProps &= SubtreeSuspenseContextMask;
+ current = useFiber(current, portal.children || []);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- 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;
- renderLanes = revealOrder;
- revealOrder = current;
- }
- initSuspenseListRenderState(
- workInProgress,
- !0,
- renderLanes,
- null,
- tailMode
+ function updateFragment(returnFiber, current, fragment, lanes, key) {
+ if (null === current || 7 !== current.tag)
+ return (
+ (current = createFiberFromFragment(
+ fragment,
+ returnFiber.mode,
+ lanes,
+ key
+ )),
+ (current.return = returnFiber),
+ (current._debugOwner = returnFiber),
+ (current._debugTask = returnFiber._debugTask),
+ (current._debugInfo = currentDebugInfo),
+ current
);
- break;
- case "together":
- initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
- break;
- default:
- workInProgress.memoizedState = null;
- }
- return workInProgress.child;
- }
- function bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- ) {
- null !== current && (workInProgress.dependencies = current.dependencies);
- profilerStartTime = -1;
- workInProgressRootSkippedLanes |= workInProgress.lanes;
- if (0 === (renderLanes & workInProgress.childLanes))
- if (null !== current) {
- if (
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- 0 === (renderLanes & workInProgress.childLanes))
- )
- return null;
- } else return null;
- if (null !== current && workInProgress.child !== current.child)
- throw Error("Resuming work not yet implemented.");
- if (null !== workInProgress.child) {
- current = workInProgress.child;
- renderLanes = createWorkInProgress(current, current.pendingProps);
- workInProgress.child = renderLanes;
- for (renderLanes.return = workInProgress; null !== current.sibling; )
- (current = current.sibling),
- (renderLanes = renderLanes.sibling =
- createWorkInProgress(current, current.pendingProps)),
- (renderLanes.return = workInProgress);
- renderLanes.sibling = null;
+ current = useFiber(current, fragment);
+ current.return = returnFiber;
+ current._debugInfo = currentDebugInfo;
+ return current;
}
- return workInProgress.child;
- }
- function checkScheduledUpdateOrContext(current, renderLanes) {
- if (0 !== (current.lanes & renderLanes)) return !0;
- current = current.dependencies;
- return null !== current && checkIfContextChanged(current) ? !0 : !1;
- }
- function attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
- ) {
- switch (workInProgress.tag) {
- case 3:
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- pushProvider(
- workInProgress,
- CacheContext,
- current.memoizedState.cache
- );
- resetHydrationState();
- break;
- case 27:
- case 5:
- pushHostContext(workInProgress);
- break;
- case 4:
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- break;
- case 10:
- pushProvider(
- workInProgress,
- workInProgress.type,
- workInProgress.memoizedProps.value
+ function createChild(returnFiber, newChild, lanes) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (newChild = createFiberFromText(
+ "" + newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ (newChild._debugOwner = returnFiber),
+ (newChild._debugTask = returnFiber._debugTask),
+ (newChild._debugInfo = currentDebugInfo),
+ newChild
);
- break;
- case 12:
- 0 !== (renderLanes & workInProgress.childLanes) &&
- (workInProgress.flags |= 4);
- workInProgress.flags |= 2048;
- var stateNode = workInProgress.stateNode;
- stateNode.effectDuration = -0;
- stateNode.passiveEffectDuration = -0;
- break;
- case 13:
- stateNode = workInProgress.memoizedState;
- if (null !== stateNode) {
- if (null !== stateNode.dehydrated)
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
return (
- pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags |= 128),
- null
- );
- if (0 !== (renderLanes & workInProgress.child.childLanes))
- return updateSuspenseComponent(
- current,
- workInProgress,
- renderLanes
+ (lanes = createFiberFromElement(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (returnFiber = pushDebugInfo(newChild._debugInfo)),
+ (lanes._debugInfo = currentDebugInfo),
+ (currentDebugInfo = returnFiber),
+ lanes
);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- current = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- return null !== current ? current.sibling : null;
- }
- pushPrimaryTreeSuspenseHandler(workInProgress);
- break;
- case 19:
- var didSuspendBefore = 0 !== (current.flags & 128);
- stateNode = 0 !== (renderLanes & workInProgress.childLanes);
- stateNode ||
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
- if (didSuspendBefore) {
- if (stateNode)
- return updateSuspenseListComponent(
- current,
- workInProgress,
- renderLanes
+ case REACT_PORTAL_TYPE:
+ return (
+ (newChild = createFiberFromPortal(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ (newChild._debugInfo = currentDebugInfo),
+ newChild
);
- workInProgress.flags |= 128;
+ case REACT_LAZY_TYPE:
+ var _prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ newChild = callLazyInitInDEV(newChild);
+ returnFiber = createChild(returnFiber, newChild, lanes);
+ currentDebugInfo = _prevDebugInfo;
+ return returnFiber;
}
- didSuspendBefore = workInProgress.memoizedState;
- null !== didSuspendBefore &&
- ((didSuspendBefore.rendering = null),
- (didSuspendBefore.tail = null),
- (didSuspendBefore.lastEffect = null));
- push(
- suspenseStackCursor,
- suspenseStackCursor.current,
- workInProgress
- );
- if (stateNode) break;
- else return null;
- case 22:
- case 23:
- return (
- (workInProgress.lanes = 0),
- updateOffscreenComponent(current, workInProgress, renderLanes)
- );
- case 24:
- pushProvider(
- workInProgress,
- CacheContext,
- current.memoizedState.cache
- );
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
- }
- function beginWork(current, workInProgress, renderLanes) {
- if (workInProgress._debugNeedsRemount && null !== current) {
- renderLanes = createFiberFromTypeAndProps(
- workInProgress.type,
- workInProgress.key,
- workInProgress.pendingProps,
- workInProgress._debugOwner || null,
- workInProgress.mode,
- workInProgress.lanes
- );
- renderLanes._debugStack = workInProgress._debugStack;
- renderLanes._debugTask = workInProgress._debugTask;
- var returnFiber = workInProgress.return;
- if (null === returnFiber) throw Error("Cannot swap the root fiber.");
- current.alternate = null;
- workInProgress.alternate = null;
- renderLanes.index = workInProgress.index;
- renderLanes.sibling = workInProgress.sibling;
- renderLanes.return = workInProgress.return;
- renderLanes.ref = workInProgress.ref;
- renderLanes._debugInfo = workInProgress._debugInfo;
- if (workInProgress === returnFiber.child)
- returnFiber.child = renderLanes;
- else {
- var prevSibling = returnFiber.child;
- if (null === prevSibling)
- throw Error("Expected parent to have a child.");
- for (; prevSibling.sibling !== workInProgress; )
- if (((prevSibling = prevSibling.sibling), null === prevSibling))
- throw Error("Expected to find the previous sibling.");
- prevSibling.sibling = renderLanes;
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (lanes = createFiberFromFragment(
+ newChild,
+ returnFiber.mode,
+ lanes,
+ null
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (returnFiber = pushDebugInfo(newChild._debugInfo)),
+ (lanes._debugInfo = currentDebugInfo),
+ (currentDebugInfo = returnFiber),
+ lanes
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = createChild(
+ returnFiber,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = _prevDebugInfo),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return createChild(
+ returnFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
}
- workInProgress = returnFiber.deletions;
- null === workInProgress
- ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16))
- : workInProgress.push(current);
- renderLanes.flags |= 2;
- return renderLanes;
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
}
- if (null !== current)
+ function updateSlot(returnFiber, oldFiber, newChild, lanes) {
+ var key = null !== oldFiber ? oldFiber.key : null;
if (
- current.memoizedProps !== workInProgress.pendingProps ||
- workInProgress.type !== current.type
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
)
- didReceiveUpdate = !0;
- else {
+ return null !== key
+ ? null
+ : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return newChild.key === key
+ ? ((key = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateElement(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber)
+ : null;
+ case REACT_PORTAL_TYPE:
+ return newChild.key === key
+ ? updatePortal(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_LAZY_TYPE:
+ return (
+ (key = pushDebugInfo(newChild._debugInfo)),
+ (newChild = callLazyInitInDEV(newChild)),
+ (returnFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber
+ );
+ }
if (
- !checkScheduledUpdateOrContext(current, renderLanes) &&
- 0 === (workInProgress.flags & 128)
- )
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ ) {
+ if (null !== key) return null;
+ key = pushDebugInfo(newChild._debugInfo);
+ returnFiber = updateFragment(
+ returnFiber,
+ oldFiber,
+ newChild,
+ lanes,
+ null
+ );
+ currentDebugInfo = key;
+ return returnFiber;
+ }
+ if ("function" === typeof newChild.then)
return (
- (didReceiveUpdate = !1),
- attemptEarlyBailoutIfNoScheduledUpdate(
- current,
- workInProgress,
- renderLanes
- )
+ (key = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = key),
+ returnFiber
);
- didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateSlot(
+ returnFiber,
+ oldFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
}
- else {
- didReceiveUpdate = !1;
- if ((returnFiber = isHydrating))
- warnIfNotHydrating(),
- (returnFiber = 0 !== (workInProgress.flags & 1048576));
- returnFiber &&
- ((returnFiber = workInProgress.index),
- warnIfNotHydrating(),
- pushTreeId(workInProgress, treeForkCount, returnFiber));
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
}
- 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
- )),
- (workInProgress.tag = 1),
- (workInProgress.type = current =
- resolveFunctionForHotReloading(current)),
- (workInProgress = updateClassComponent(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- )))
- : ((workInProgress.tag = 0),
- validateFunctionComponentInDev(workInProgress, current),
- (workInProgress.type = current =
- resolveFunctionForHotReloading(current)),
- (workInProgress = updateFunctionComponent(
- null,
- workInProgress,
- current,
+ function updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ ) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return (
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
+ );
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return (
+ (newIdx =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ (existingChildren = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateElement(
returnFiber,
- renderLanes
- )));
- else {
- if (void 0 !== current && null !== current)
- if (
- ((prevSibling = current.$$typeof),
- prevSibling === REACT_FORWARD_REF_TYPE)
- ) {
- workInProgress.tag = 11;
- workInProgress.type = current =
- resolveForwardRefForHotReloading(current);
- workInProgress = updateForwardRef(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- );
- break a;
- } else if (prevSibling === REACT_MEMO_TYPE) {
- workInProgress.tag = 14;
- workInProgress = updateMemoComponent(
- null,
- workInProgress,
- current,
- returnFiber,
- renderLanes
- );
- break a;
- }
- workInProgress = "";
- null !== current &&
- "object" === typeof current &&
- current.$$typeof === REACT_LAZY_TYPE &&
- (workInProgress =
- " Did you wrap a component in React.lazy() more than once?");
- current = getComponentNameFromType(current) || current;
- throw Error(
- "Element type is invalid. Received a promise that resolves to: " +
- current +
- ". Lazy element type must resolve to a class or function." +
- workInProgress
+ newIdx,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = existingChildren),
+ returnFiber
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updatePortal(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_LAZY_TYPE:
+ var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo);
+ newChild = callLazyInitInDEV(newChild);
+ returnFiber = updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ );
+ currentDebugInfo = _prevDebugInfo7;
+ return returnFiber;
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (newIdx = existingChildren.get(newIdx) || null),
+ (existingChildren = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateFragment(
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes,
+ null
+ )),
+ (currentDebugInfo = existingChildren),
+ returnFiber
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = _prevDebugInfo7),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
);
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return null;
+ }
+ function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) {
+ if ("object" !== typeof child || null === child) return knownKeys;
+ switch (child.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ case REACT_PORTAL_TYPE:
+ warnForMissingKey(returnFiber, workInProgress, child);
+ var key = child.key;
+ if ("string" !== typeof key) break;
+ if (null === knownKeys) {
+ knownKeys = new Set();
+ knownKeys.add(key);
+ break;
+ }
+ if (!knownKeys.has(key)) {
+ knownKeys.add(key);
+ break;
+ }
+ runWithFiberInDEV(workInProgress, function () {
+ console.error(
+ "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.",
+ key
+ );
+ });
+ break;
+ case REACT_LAZY_TYPE:
+ (child = callLazyInitInDEV(child)),
+ warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys);
+ }
+ return knownKeys;
+ }
+ function reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ for (
+ var knownKeys = null,
+ resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null;
+ null !== oldFiber && newIdx < newChildren.length;
+ newIdx++
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ newChildren[newIdx],
+ lanes
+ );
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
}
- return workInProgress;
- case 0:
- return updateFunctionComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
+ knownKeys = warnOnInvalidKey(
+ returnFiber,
+ newFiber,
+ newChildren[newIdx],
+ knownKeys
);
- case 1:
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (newIdx === newChildren.length)
return (
- (returnFiber = workInProgress.type),
- (prevSibling = resolveClassComponentProps(
- returnFiber,
- workInProgress.pendingProps
- )),
- updateClassComponent(
- current,
- workInProgress,
- returnFiber,
- prevSibling,
- renderLanes
- )
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
);
- case 3:
- a: {
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- if (null === current)
- throw Error(
- "Should have a current fiber. This is a bug in React."
- );
- var nextProps = workInProgress.pendingProps;
- prevSibling = workInProgress.memoizedState;
- returnFiber = prevSibling.element;
- cloneUpdateQueue(current, workInProgress);
- processUpdateQueue(workInProgress, nextProps, null, renderLanes);
- var nextState = workInProgress.memoizedState;
- nextProps = nextState.cache;
- pushProvider(workInProgress, CacheContext, nextProps);
- nextProps !== prevSibling.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- );
- suspendIfUpdateReadFromEntangledAsyncAction();
- nextProps = nextState.element;
- if (prevSibling.isDehydrated)
- if (
- ((prevSibling = {
- element: nextProps,
- isDehydrated: !1,
- cache: nextState.cache
- }),
- (workInProgress.updateQueue.baseState = prevSibling),
- (workInProgress.memoizedState = prevSibling),
- workInProgress.flags & 256)
- ) {
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else if (nextProps !== returnFiber) {
- returnFiber = createCapturedValueAtFiber(
- Error(
- "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
- ),
- workInProgress
- );
- queueHydrationError(returnFiber);
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else
- for (
- nextHydratableInstance = getNextHydratable(
- workInProgress.stateNode.containerInfo.firstChild
- ),
- hydrationParentFiber = workInProgress,
- isHydrating = !0,
- hydrationErrors = null,
- didSuspendOrErrorDEV = !1,
- hydrationDiffRootDEV = null,
- rootOrSingletonContext = !0,
- current = mountChildFibers(
- workInProgress,
- null,
- nextProps,
- renderLanes
- ),
- workInProgress.child = current;
- current;
-
- )
- (current.flags = (current.flags & -3) | 4096),
- (current = current.sibling);
- else {
- resetHydrationState();
- if (nextProps === returnFiber) {
- workInProgress = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- break a;
- }
- reconcileChildren(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
+ if (null === oldFiber) {
+ for (; newIdx < newChildren.length; newIdx++)
+ (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
+ null !== oldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ oldFiber,
+ newChildren[newIdx],
+ knownKeys
+ )),
+ (currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ newIdx < newChildren.length;
+ newIdx++
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ newChildren[newIdx],
+ lanes
+ )),
+ null !== nextOldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ nextOldFiber,
+ newChildren[newIdx],
+ knownKeys
+ )),
+ shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
+ ),
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ function reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChildrenIterable,
+ lanes
+ ) {
+ var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
+ newChildren !== newChildrenIterable ||
+ (0 === returnFiber.tag &&
+ "[object AsyncGeneratorFunction]" ===
+ Object.prototype.toString.call(returnFiber.type) &&
+ "[object AsyncGenerator]" ===
+ Object.prototype.toString.call(newChildren)) ||
+ (didWarnAboutGenerators ||
+ console.error(
+ "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items."
+ ),
+ (didWarnAboutGenerators = !0));
+ if (null == newChildren)
+ throw Error("An iterable object provided no iterator.");
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ {
+ next: function () {
+ return unwrapThenable(newChildren.next());
}
- workInProgress = workInProgress.child;
+ },
+ lanes
+ );
+ }
+ function reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ if (null == newChildren)
+ throw Error("An iterable object provided no iterator.");
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null,
+ knownKeys = null,
+ step = newChildren.next();
+ null !== oldFiber && !step.done;
+ newIdx++, step = newChildren.next()
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
}
- return workInProgress;
- case 26:
- return (
- markRef(current, workInProgress),
- null === current
- ? (current = getResource(
- workInProgress.type,
- null,
- workInProgress.pendingProps,
- null
- ))
- ? (workInProgress.memoizedState = current)
- : isHydrating ||
- ((current = workInProgress.type),
- (renderLanes = workInProgress.pendingProps),
- (returnFiber = requiredContext(
- rootInstanceStackCursor.current
- )),
- (returnFiber =
- getOwnerDocumentFromRootContainer(
- returnFiber
- ).createElement(current)),
- (returnFiber[internalInstanceKey] = workInProgress),
- (returnFiber[internalPropsKey] = renderLanes),
- setInitialProperties(returnFiber, current, renderLanes),
- markNodeAsHoistable(returnFiber),
- (workInProgress.stateNode = returnFiber))
- : (workInProgress.memoizedState = getResource(
- workInProgress.type,
- current.memoizedProps,
- workInProgress.pendingProps,
- current.memoizedState
- )),
- null
+ knownKeys = warnOnInvalidKey(
+ returnFiber,
+ newFiber,
+ step.value,
+ knownKeys
);
- case 27:
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (step.done)
return (
- pushHostContext(workInProgress),
- null === current &&
- isHydrating &&
- ((prevSibling = requiredContext(rootInstanceStackCursor.current)),
- (returnFiber = getHostContext()),
- (prevSibling = workInProgress.stateNode =
- resolveSingletonInstance(
- workInProgress.type,
- workInProgress.pendingProps,
- prevSibling,
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; !step.done; newIdx++, step = newChildren.next())
+ (oldFiber = createChild(returnFiber, step.value, lanes)),
+ null !== oldFiber &&
+ ((knownKeys = warnOnInvalidKey(
returnFiber,
- !1
+ oldFiber,
+ step.value,
+ knownKeys
)),
- didSuspendOrErrorDEV ||
- ((returnFiber = diffHydratedProperties(
- prevSibling,
- workInProgress.type,
- workInProgress.pendingProps,
- returnFiber
+ (currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
)),
- null !== returnFiber &&
- (buildHydrationDiffNode(workInProgress, 0).serverProps =
- returnFiber)),
- (hydrationParentFiber = workInProgress),
- (rootOrSingletonContext = !0),
- (nextHydratableInstance = getNextHydratable(
- prevSibling.firstChild
- ))),
- (returnFiber = workInProgress.pendingProps.children),
- null !== current || isHydrating
- ? reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- )
- : (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- returnFiber,
- renderLanes
- )),
- markRef(current, workInProgress),
- workInProgress.child
- );
- case 5:
- return (
- null === current &&
- isHydrating &&
- ((nextProps = getHostContext()),
- (returnFiber = validateDOMNesting(
- workInProgress.type,
- nextProps.ancestorInfo
- )),
- (prevSibling = nextHydratableInstance),
- (nextState = !prevSibling) ||
- ((nextState = canHydrateInstance(
- prevSibling,
- workInProgress.type,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== nextState
- ? ((workInProgress.stateNode = nextState),
- didSuspendOrErrorDEV ||
- ((nextProps = diffHydratedProperties(
- nextState,
- workInProgress.type,
- workInProgress.pendingProps,
- nextProps
- )),
- null !== nextProps &&
- (buildHydrationDiffNode(workInProgress, 0).serverProps =
- nextProps)),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = getNextHydratable(
- nextState.firstChild
- )),
- (rootOrSingletonContext = !1),
- (nextProps = !0))
- : (nextProps = !1),
- (nextState = !nextProps)),
- nextState &&
- (returnFiber &&
- warnNonHydratedInstance(workInProgress, prevSibling),
- throwOnHydrationMismatch(workInProgress))),
- pushHostContext(workInProgress),
- (prevSibling = workInProgress.type),
- (nextProps = workInProgress.pendingProps),
- (nextState = null !== current ? current.memoizedProps : null),
- (returnFiber = nextProps.children),
- shouldSetTextContent(prevSibling, nextProps)
- ? (returnFiber = null)
- : null !== nextState &&
- shouldSetTextContent(prevSibling, nextState) &&
- (workInProgress.flags |= 32),
- null !== workInProgress.memoizedState &&
- ((prevSibling = renderWithHooks(
- current,
- workInProgress,
- TransitionAwareHostComponent,
- null,
- null,
- renderLanes
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ !step.done;
+ newIdx++, step = newChildren.next()
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ step.value,
+ lanes
+ )),
+ null !== nextOldFiber &&
+ ((knownKeys = warnOnInvalidKey(
+ returnFiber,
+ nextOldFiber,
+ step.value,
+ knownKeys
)),
- (HostTransitionContext._currentValue = prevSibling)),
- markRef(current, workInProgress),
- reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- ),
- workInProgress.child
- );
- case 6:
- return (
- null === current &&
- isHydrating &&
- ((current = workInProgress.pendingProps),
- (renderLanes = getHostContext().ancestorInfo.current),
- (current =
- null != renderLanes
- ? validateTextNesting(current, renderLanes.tag)
- : !0),
- (renderLanes = nextHydratableInstance),
- (returnFiber = !renderLanes) ||
- ((returnFiber = canHydrateTextInstance(
- renderLanes,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== returnFiber
- ? ((workInProgress.stateNode = returnFiber),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (returnFiber = !0))
- : (returnFiber = !1),
- (returnFiber = !returnFiber)),
- returnFiber &&
- (current &&
- warnNonHydratedInstance(workInProgress, renderLanes),
- throwOnHydrationMismatch(workInProgress))),
- null
- );
- case 13:
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- case 4:
- return (
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- ),
- (returnFiber = workInProgress.pendingProps),
- null === current
- ? (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- returnFiber,
- renderLanes
- ))
- : reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
+ shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
),
- workInProgress.child
- );
- case 11:
- return updateForwardRef(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 7:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps,
- renderLanes
- ),
- workInProgress.child
- );
- case 8:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 12:
- return (
- (workInProgress.flags |= 4),
- (workInProgress.flags |= 2048),
- (returnFiber = workInProgress.stateNode),
- (returnFiber.effectDuration = -0),
- (returnFiber.passiveEffectDuration = -0),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 10:
- return (
- (returnFiber = workInProgress.type),
- (prevSibling = workInProgress.pendingProps),
- (nextProps = prevSibling.value),
- "value" in prevSibling ||
- hasWarnedAboutUsingNoValuePropOnContextProvider ||
- ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0),
- console.error(
- "The `value` prop is required for the ``. Did you misspell it or forget to pass it?"
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
)),
- pushProvider(workInProgress, returnFiber, nextProps),
- reconcileChildren(
- current,
- workInProgress,
- prevSibling.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 9:
- return (
- (prevSibling = workInProgress.type._context),
- (returnFiber = workInProgress.pendingProps.children),
- "function" !== typeof returnFiber &&
- console.error(
- "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
- ),
- prepareToReadContext(workInProgress),
- (prevSibling = readContext(prevSibling)),
- (returnFiber = callComponentInDEV(
- returnFiber,
- prevSibling,
- void 0
- )),
- (workInProgress.flags |= 1),
- reconcileChildren(
- current,
- workInProgress,
- returnFiber,
- renderLanes
- ),
- workInProgress.child
- );
- case 14:
- return updateMemoComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 15:
- return updateSimpleMemoComponent(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 19:
- return updateSuspenseListComponent(
- current,
- workInProgress,
- renderLanes
- );
- case 22:
- return updateOffscreenComponent(current, workInProgress, renderLanes);
- case 24:
- return (
- prepareToReadContext(workInProgress),
- (returnFiber = readContext(CacheContext)),
- null === current
- ? ((prevSibling = peekCacheFromPool()),
- null === prevSibling &&
- ((prevSibling = workInProgressRoot),
- (nextProps = createCache()),
- (prevSibling.pooledCache = nextProps),
- retainCache(nextProps),
- null !== nextProps &&
- (prevSibling.pooledCacheLanes |= renderLanes),
- (prevSibling = nextProps)),
- (workInProgress.memoizedState = {
- parent: returnFiber,
- cache: prevSibling
- }),
- initializeUpdateQueue(workInProgress),
- pushProvider(workInProgress, CacheContext, prevSibling))
- : (0 !== (current.lanes & renderLanes) &&
- (cloneUpdateQueue(current, workInProgress),
- processUpdateQueue(workInProgress, null, null, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction()),
- (prevSibling = current.memoizedState),
- (nextProps = workInProgress.memoizedState),
- prevSibling.parent !== returnFiber
- ? ((prevSibling = {
- parent: returnFiber,
- cache: returnFiber
- }),
- (workInProgress.memoizedState = prevSibling),
- 0 === workInProgress.lanes &&
- (workInProgress.memoizedState =
- workInProgress.updateQueue.baseState =
- prevSibling),
- pushProvider(workInProgress, CacheContext, returnFiber))
- : ((returnFiber = nextProps.cache),
- pushProvider(workInProgress, CacheContext, returnFiber),
- returnFiber !== prevSibling.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- ))),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 29:
- throw workInProgress.pendingProps;
- }
- throw Error(
- "Unknown unit of work tag (" +
- workInProgress.tag +
- "). This error is likely caused by a bug in React. Please file an issue."
- );
- }
- function resetContextDependencies() {
- lastContextDependency = currentlyRenderingFiber = null;
- isDisallowedContextReadInDEV = !1;
- }
- function pushProvider(providerFiber, context, nextValue) {
- push(valueCursor, context._currentValue, providerFiber);
- context._currentValue = nextValue;
- push(rendererCursorDEV, context._currentRenderer, providerFiber);
- void 0 !== context._currentRenderer &&
- null !== context._currentRenderer &&
- context._currentRenderer !== rendererSigil &&
- console.error(
- "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."
- );
- context._currentRenderer = rendererSigil;
- }
- function popProvider(context, providerFiber) {
- context._currentValue = valueCursor.current;
- var currentRenderer = rendererCursorDEV.current;
- pop(rendererCursorDEV, providerFiber);
- context._currentRenderer = currentRenderer;
- pop(valueCursor, providerFiber);
- }
- function scheduleContextWorkOnParentPath(
- parent,
- renderLanes,
- propagationRoot
- ) {
- for (; null !== parent; ) {
- var alternate = parent.alternate;
- (parent.childLanes & renderLanes) !== renderLanes
- ? ((parent.childLanes |= renderLanes),
- null !== alternate && (alternate.childLanes |= renderLanes))
- : null !== alternate &&
- (alternate.childLanes & renderLanes) !== renderLanes &&
- (alternate.childLanes |= renderLanes);
- if (parent === propagationRoot) break;
- parent = parent.return;
- }
- parent !== propagationRoot &&
- console.error(
- "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."
- );
- }
- function propagateContextChanges(
- workInProgress,
- contexts,
- renderLanes,
- forcePropagateEntireTree
- ) {
- var fiber = workInProgress.child;
- null !== fiber && (fiber.return = workInProgress);
- for (; null !== fiber; ) {
- var list = fiber.dependencies;
- if (null !== list) {
- var nextFiber = fiber.child;
- list = list.firstContext;
- a: for (; null !== list; ) {
- var dependency = list;
- list = fiber;
- for (var i = 0; i < contexts.length; i++)
- if (dependency.context === contexts[i]) {
- list.lanes |= renderLanes;
- dependency = list.alternate;
- null !== dependency && (dependency.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- list.return,
- renderLanes,
- workInProgress
- );
- forcePropagateEntireTree || (nextFiber = null);
- break a;
- }
- list = dependency.next;
- }
- } else if (18 === fiber.tag) {
- nextFiber = fiber.return;
- if (null === nextFiber)
- throw Error(
- "We just came from a parent so we must have had a parent. This is a bug in React."
- );
- nextFiber.lanes |= renderLanes;
- list = nextFiber.alternate;
- null !== list && (list.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- nextFiber,
- renderLanes,
- workInProgress
- );
- nextFiber = null;
- } else nextFiber = fiber.child;
- if (null !== nextFiber) nextFiber.return = fiber;
- else
- for (nextFiber = fiber; null !== nextFiber; ) {
- if (nextFiber === workInProgress) {
- nextFiber = null;
- break;
- }
- fiber = nextFiber.sibling;
- if (null !== fiber) {
- fiber.return = nextFiber.return;
- nextFiber = fiber;
- break;
- }
- nextFiber = nextFiber.return;
- }
- fiber = nextFiber;
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
}
- }
- function propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- forcePropagateEntireTree
- ) {
- current = null;
- for (
- var parent = workInProgress, isInsidePropagationBailout = !1;
- null !== parent;
-
+ function reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
) {
- if (!isInsidePropagationBailout)
- if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
- else if (0 !== (parent.flags & 262144)) break;
- if (10 === parent.tag) {
- var currentParent = parent.alternate;
- if (null === currentParent)
- throw Error("Should have a current fiber. This is a bug in React.");
- currentParent = currentParent.memoizedProps;
- if (null !== currentParent) {
- var context = parent.type;
- objectIs(parent.pendingProps.value, currentParent.value) ||
- (null !== current
- ? current.push(context)
- : (current = [context]));
- }
- } else if (parent === hostTransitionProviderCursor.current) {
- currentParent = parent.alternate;
- if (null === currentParent)
- throw Error("Should have a current fiber. This is a bug in React.");
- currentParent.memoizedState.memoizedState !==
- parent.memoizedState.memoizedState &&
- (null !== current
- ? current.push(HostTransitionContext)
- : (current = [HostTransitionContext]));
- }
- parent = parent.return;
- }
- null !== current &&
- propagateContextChanges(
- workInProgress,
- current,
- renderLanes,
- forcePropagateEntireTree
- );
- workInProgress.flags |= 262144;
- }
- function checkIfContextChanged(currentDependencies) {
- for (
- currentDependencies = currentDependencies.firstContext;
- null !== currentDependencies;
+ "object" === typeof newChild &&
+ null !== newChild &&
+ newChild.type === REACT_FRAGMENT_TYPE &&
+ null === newChild.key &&
+ (validateFragmentProps(newChild, null, returnFiber),
+ (newChild = newChild.props.children));
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ var prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ a: {
+ for (var key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key) {
+ key = newChild.type;
+ if (key === REACT_FRAGMENT_TYPE) {
+ if (7 === currentFirstChild.tag) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ newChild.props.children
+ );
+ lanes.return = returnFiber;
+ lanes._debugOwner = newChild._owner;
+ lanes._debugInfo = currentDebugInfo;
+ validateFragmentProps(newChild, lanes, returnFiber);
+ returnFiber = lanes;
+ break a;
+ }
+ } else if (
+ currentFirstChild.elementType === key ||
+ isCompatibleFamilyForHotReloading(
+ currentFirstChild,
+ newChild
+ ) ||
+ ("object" === typeof key &&
+ null !== key &&
+ key.$$typeof === REACT_LAZY_TYPE &&
+ callLazyInitInDEV(key) === currentFirstChild.type)
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.props);
+ coerceRef(lanes, newChild);
+ lanes.return = returnFiber;
+ lanes._debugOwner = newChild._owner;
+ lanes._debugInfo = currentDebugInfo;
+ returnFiber = lanes;
+ break a;
+ }
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ } else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ newChild.type === REACT_FRAGMENT_TYPE
+ ? ((lanes = createFiberFromFragment(
+ newChild.props.children,
+ returnFiber.mode,
+ lanes,
+ newChild.key
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (lanes._debugInfo = currentDebugInfo),
+ validateFragmentProps(newChild, lanes, returnFiber),
+ (returnFiber = lanes))
+ : ((lanes = createFiberFromElement(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (lanes._debugInfo = currentDebugInfo),
+ (returnFiber = lanes));
+ }
+ returnFiber = placeSingleChild(returnFiber);
+ currentDebugInfo = prevDebugInfo;
+ return returnFiber;
+ case REACT_PORTAL_TYPE:
+ a: {
+ prevDebugInfo = newChild;
+ for (
+ newChild = prevDebugInfo.key;
+ null !== currentFirstChild;
- ) {
+ ) {
+ if (currentFirstChild.key === newChild)
+ if (
+ 4 === currentFirstChild.tag &&
+ currentFirstChild.stateNode.containerInfo ===
+ prevDebugInfo.containerInfo &&
+ currentFirstChild.stateNode.implementation ===
+ prevDebugInfo.implementation
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ prevDebugInfo.children || []
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ } else {
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ }
+ else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ lanes = createFiberFromPortal(
+ prevDebugInfo,
+ returnFiber.mode,
+ lanes
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_LAZY_TYPE:
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (newChild = callLazyInitInDEV(newChild)),
+ (returnFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ }
+ if (isArrayImpl(newChild))
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if (getIteratorFn(newChild)) {
+ prevDebugInfo = pushDebugInfo(newChild._debugInfo);
+ key = getIteratorFn(newChild);
+ if ("function" !== typeof key)
+ throw Error(
+ "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
+ );
+ var newChildren = key.call(newChild);
+ if (newChildren === newChild) {
+ if (
+ 0 !== returnFiber.tag ||
+ "[object GeneratorFunction]" !==
+ Object.prototype.toString.call(returnFiber.type) ||
+ "[object Generator]" !==
+ Object.prototype.toString.call(newChildren)
+ )
+ didWarnAboutGenerators ||
+ console.error(
+ "Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."
+ ),
+ (didWarnAboutGenerators = !0);
+ } else
+ newChild.entries !== key ||
+ didWarnAboutMaps ||
+ (console.error(
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
+ ),
+ (didWarnAboutMaps = !0));
+ returnFiber = reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ );
+ currentDebugInfo = prevDebugInfo;
+ return returnFiber;
+ }
+ if ("function" === typeof newChild[ASYNC_ITERATOR])
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if ("function" === typeof newChild.then)
+ return (
+ (prevDebugInfo = pushDebugInfo(newChild._debugInfo)),
+ (returnFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ unwrapThenable(newChild),
+ lanes
+ )),
+ (currentDebugInfo = prevDebugInfo),
+ returnFiber
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
if (
- !objectIs(
- currentDependencies.context._currentValue,
- currentDependencies.memoizedValue
- )
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
)
- return !0;
- currentDependencies = currentDependencies.next;
- }
- return !1;
- }
- function prepareToReadContext(workInProgress) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- workInProgress = workInProgress.dependencies;
- null !== workInProgress && (workInProgress.firstContext = null);
- }
- function readContext(context) {
- isDisallowedContextReadInDEV &&
- console.error(
- "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
- );
- return readContextForConsumer(currentlyRenderingFiber, context);
- }
- function readContextDuringReconciliation(consumer, context) {
- null === currentlyRenderingFiber && prepareToReadContext(consumer);
- return readContextForConsumer(consumer, context);
- }
- function readContextForConsumer(consumer, context) {
- var value = context._currentValue;
- context = { context: context, memoizedValue: value, next: null };
- if (null === lastContextDependency) {
- if (null === consumer)
- throw Error(
- "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
+ return (
+ (prevDebugInfo = "" + newChild),
+ null !== currentFirstChild && 6 === currentFirstChild.tag
+ ? (deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ ),
+ (lanes = useFiber(currentFirstChild, prevDebugInfo)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : (deleteRemainingChildren(returnFiber, currentFirstChild),
+ (lanes = createFiberFromText(
+ prevDebugInfo,
+ returnFiber.mode,
+ lanes
+ )),
+ (lanes.return = returnFiber),
+ (lanes._debugOwner = returnFiber),
+ (lanes._debugTask = returnFiber._debugTask),
+ (lanes._debugInfo = currentDebugInfo),
+ (returnFiber = lanes)),
+ placeSingleChild(returnFiber)
);
- lastContextDependency = context;
- consumer.dependencies = {
- lanes: 0,
- firstContext: context,
- _debugThenableState: null
- };
- consumer.flags |= 524288;
- } else lastContextDependency = lastContextDependency.next = context;
- return value;
- }
- function initializeUpdateQueue(fiber) {
- fiber.updateQueue = {
- baseState: fiber.memoizedState,
- firstBaseUpdate: null,
- lastBaseUpdate: null,
- shared: { pending: null, lanes: 0, hiddenCallbacks: null },
- callbacks: null
+ "function" === typeof newChild &&
+ warnOnFunctionType(returnFiber, newChild);
+ "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild);
+ return deleteRemainingChildren(returnFiber, currentFirstChild);
+ }
+ return function (returnFiber, currentFirstChild, newChild, lanes) {
+ var prevDebugInfo = currentDebugInfo;
+ currentDebugInfo = null;
+ try {
+ thenableIndexCounter = 0;
+ var firstChildFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ thenableState = null;
+ return firstChildFiber;
+ } catch (x) {
+ if (x === SuspenseException || x === SuspenseActionException) throw x;
+ var fiber = createFiber(29, x, null, returnFiber.mode);
+ fiber.lanes = lanes;
+ fiber.return = returnFiber;
+ var debugInfo = (fiber._debugInfo = currentDebugInfo);
+ fiber._debugOwner = returnFiber._debugOwner;
+ fiber._debugTask = returnFiber._debugTask;
+ if (null != debugInfo)
+ for (var i = debugInfo.length - 1; 0 <= i; i--)
+ if ("string" === typeof debugInfo[i].stack) {
+ fiber._debugOwner = debugInfo[i];
+ fiber._debugTask = debugInfo[i].debugTask;
+ break;
+ }
+ return fiber;
+ } finally {
+ currentDebugInfo = prevDebugInfo;
+ }
};
}
- function cloneUpdateQueue(current, workInProgress) {
- current = current.updateQueue;
- workInProgress.updateQueue === current &&
- (workInProgress.updateQueue = {
- baseState: current.baseState,
- firstBaseUpdate: current.firstBaseUpdate,
- lastBaseUpdate: current.lastBaseUpdate,
- shared: current.shared,
- callbacks: null
- });
+ function pushPrimaryTreeSuspenseHandler(handler) {
+ var current = handler.alternate;
+ push(
+ suspenseStackCursor,
+ suspenseStackCursor.current & SubtreeSuspenseContextMask,
+ handler
+ );
+ push(suspenseHandlerStackCursor, handler, handler);
+ null === shellBoundary &&
+ (null === current || null !== currentTreeHiddenStackCursor.current
+ ? (shellBoundary = handler)
+ : null !== current.memoizedState && (shellBoundary = handler));
}
- function createUpdate(lane) {
- return {
- lane: lane,
- tag: UpdateState,
- payload: null,
- callback: null,
- next: null
- };
+ function pushOffscreenSuspenseHandler(fiber) {
+ if (22 === fiber.tag) {
+ if (
+ (push(suspenseStackCursor, suspenseStackCursor.current, fiber),
+ push(suspenseHandlerStackCursor, fiber, fiber),
+ null === shellBoundary)
+ ) {
+ var current = fiber.alternate;
+ null !== current &&
+ null !== current.memoizedState &&
+ (shellBoundary = fiber);
+ }
+ } else reuseSuspenseHandlerOnStack(fiber);
}
- function enqueueUpdate(fiber, update, lane) {
- var updateQueue = fiber.updateQueue;
- if (null === updateQueue) return null;
- updateQueue = updateQueue.shared;
- if (
- currentlyProcessingQueue === updateQueue &&
- !didWarnUpdateInsideUpdate
- ) {
- var componentName = getComponentNameFromFiber(fiber);
- console.error(
- "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.\n\nPlease update the following component: %s",
- componentName
- );
- didWarnUpdateInsideUpdate = !0;
- }
- if ((executionContext & RenderContext) !== NoContext)
- return (
- (componentName = updateQueue.pending),
- null === componentName
- ? (update.next = update)
- : ((update.next = componentName.next),
- (componentName.next = update)),
- (updateQueue.pending = update),
- (update = getRootForUpdatedFiber(fiber)),
- markUpdateLaneFromFiberToRoot(fiber, null, lane),
- update
- );
- enqueueUpdate$1(fiber, updateQueue, update, lane);
- return getRootForUpdatedFiber(fiber);
+ function reuseSuspenseHandlerOnStack(fiber) {
+ push(suspenseStackCursor, suspenseStackCursor.current, fiber);
+ push(
+ suspenseHandlerStackCursor,
+ suspenseHandlerStackCursor.current,
+ fiber
+ );
}
- function entangleTransitions(root, fiber, lane) {
- fiber = fiber.updateQueue;
- if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
- var queueLanes = fiber.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- fiber.lanes = lane;
- markRootEntangled(root, lane);
+ function popSuspenseHandler(fiber) {
+ pop(suspenseHandlerStackCursor, fiber);
+ shellBoundary === fiber && (shellBoundary = null);
+ pop(suspenseStackCursor, fiber);
+ }
+ function findFirstSuspended(row) {
+ for (var node = row; null !== node; ) {
+ if (13 === node.tag) {
+ var state = node.memoizedState;
+ if (
+ null !== state &&
+ ((state = state.dehydrated),
+ null === state ||
+ state.data === SUSPENSE_PENDING_START_DATA ||
+ isSuspenseInstanceFallback(state))
+ )
+ return node;
+ } else if (
+ 19 === node.tag &&
+ void 0 !== node.memoizedProps.revealOrder
+ ) {
+ if (0 !== (node.flags & 128)) return node;
+ } else if (null !== node.child) {
+ node.child.return = node;
+ node = node.child;
+ continue;
+ }
+ if (node === row) break;
+ for (; null === node.sibling; ) {
+ if (null === node.return || node.return === row) return null;
+ node = node.return;
+ }
+ node.sibling.return = node.return;
+ node = node.sibling;
}
+ return null;
}
- function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
- var queue = workInProgress.updateQueue,
- current = workInProgress.alternate;
+ function defaultOnUncaughtError(error) {
+ reportGlobalError(error);
+ console.warn(
+ "%s\n\n%s\n",
+ componentName
+ ? "An error occurred in the <" + componentName + "> component."
+ : "An error occurred in one of your React components.",
+ "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries."
+ );
+ }
+ function defaultOnCaughtError(error) {
+ var componentNameMessage = componentName
+ ? "The above error occurred in the <" + componentName + "> component."
+ : "The above error occurred in one of your React components.",
+ recreateMessage =
+ "React will try to recreate this component tree from scratch using the error boundary you provided, " +
+ ((errorBoundaryName || "Anonymous") + ".");
if (
- null !== current &&
- ((current = current.updateQueue), queue === current)
+ "object" === typeof error &&
+ null !== error &&
+ "string" === typeof error.environmentName
) {
- var newFirst = null,
- newLast = null;
- queue = queue.firstBaseUpdate;
- if (null !== queue) {
- do {
- var clone = {
- lane: queue.lane,
- tag: queue.tag,
- payload: queue.payload,
- callback: null,
- next: null
- };
- null === newLast
- ? (newFirst = newLast = clone)
- : (newLast = newLast.next = clone);
- queue = queue.next;
- } while (null !== queue);
- null === newLast
- ? (newFirst = newLast = capturedUpdate)
- : (newLast = newLast.next = capturedUpdate);
- } else newFirst = newLast = capturedUpdate;
- queue = {
- baseState: current.baseState,
- firstBaseUpdate: newFirst,
- lastBaseUpdate: newLast,
- shared: current.shared,
- callbacks: current.callbacks
- };
- workInProgress.updateQueue = queue;
- return;
+ var JSCompiler_inline_result = error.environmentName;
+ error = [
+ "%o\n\n%s\n\n%s\n",
+ error,
+ componentNameMessage,
+ recreateMessage
+ ].slice(0);
+ "string" === typeof error[0]
+ ? error.splice(
+ 0,
+ 1,
+ badgeFormat + error[0],
+ badgeStyle,
+ pad + JSCompiler_inline_result + pad,
+ resetStyle
+ )
+ : error.splice(
+ 0,
+ 0,
+ badgeFormat,
+ badgeStyle,
+ pad + JSCompiler_inline_result + pad,
+ resetStyle
+ );
+ error.unshift(console);
+ JSCompiler_inline_result = bind.apply(console.error, error);
+ JSCompiler_inline_result();
+ } else
+ console.error(
+ "%o\n\n%s\n\n%s\n",
+ error,
+ componentNameMessage,
+ recreateMessage
+ );
+ }
+ function defaultOnRecoverableError(error) {
+ reportGlobalError(error);
+ }
+ function logUncaughtError(root, errorInfo) {
+ try {
+ componentName = errorInfo.source
+ ? getComponentNameFromFiber(errorInfo.source)
+ : null;
+ errorBoundaryName = null;
+ var error = errorInfo.value;
+ if (null !== ReactSharedInternals.actQueue)
+ ReactSharedInternals.thrownErrors.push(error);
+ else {
+ var onUncaughtError = root.onUncaughtError;
+ onUncaughtError(error, { componentStack: errorInfo.stack });
+ }
+ } catch (e$4) {
+ setTimeout(function () {
+ throw e$4;
+ });
}
- workInProgress = queue.lastBaseUpdate;
- null === workInProgress
- ? (queue.firstBaseUpdate = capturedUpdate)
- : (workInProgress.next = capturedUpdate);
- queue.lastBaseUpdate = capturedUpdate;
}
- function suspendIfUpdateReadFromEntangledAsyncAction() {
- if (didReadFromEntangledAsyncAction) {
- var entangledActionThenable = currentEntangledActionThenable;
- if (null !== entangledActionThenable) throw entangledActionThenable;
+ function logCaughtError(root, boundary, errorInfo) {
+ try {
+ componentName = errorInfo.source
+ ? getComponentNameFromFiber(errorInfo.source)
+ : null;
+ errorBoundaryName = getComponentNameFromFiber(boundary);
+ var onCaughtError = root.onCaughtError;
+ onCaughtError(errorInfo.value, {
+ componentStack: errorInfo.stack,
+ errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
+ });
+ } catch (e$5) {
+ setTimeout(function () {
+ throw e$5;
+ });
}
}
- function processUpdateQueue(
- workInProgress,
- props,
- instance$jscomp$0,
- renderLanes
- ) {
- didReadFromEntangledAsyncAction = !1;
- var queue = workInProgress.updateQueue;
- hasForceUpdate = !1;
- currentlyProcessingQueue = queue.shared;
- var firstBaseUpdate = queue.firstBaseUpdate,
- lastBaseUpdate = queue.lastBaseUpdate,
- pendingQueue = queue.shared.pending;
- if (null !== pendingQueue) {
- queue.shared.pending = null;
- var lastPendingUpdate = pendingQueue,
- firstPendingUpdate = lastPendingUpdate.next;
- lastPendingUpdate.next = null;
- null === lastBaseUpdate
- ? (firstBaseUpdate = firstPendingUpdate)
- : (lastBaseUpdate.next = firstPendingUpdate);
- lastBaseUpdate = lastPendingUpdate;
- var current = workInProgress.alternate;
- null !== current &&
- ((current = current.updateQueue),
- (pendingQueue = current.lastBaseUpdate),
- pendingQueue !== lastBaseUpdate &&
- (null === pendingQueue
- ? (current.firstBaseUpdate = firstPendingUpdate)
- : (pendingQueue.next = firstPendingUpdate),
- (current.lastBaseUpdate = lastPendingUpdate)));
+ function createRootErrorUpdate(root, errorInfo, lane) {
+ lane = createUpdate(lane);
+ lane.tag = CaptureUpdate;
+ lane.payload = { element: null };
+ lane.callback = function () {
+ runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo);
+ };
+ return lane;
+ }
+ function createClassErrorUpdate(lane) {
+ lane = createUpdate(lane);
+ lane.tag = CaptureUpdate;
+ return lane;
+ }
+ function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
+ var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
+ if ("function" === typeof getDerivedStateFromError) {
+ var error = errorInfo.value;
+ update.payload = function () {
+ return getDerivedStateFromError(error);
+ };
+ update.callback = function () {
+ markFailedErrorBoundaryForHotReloading(fiber);
+ runWithFiberInDEV(
+ errorInfo.source,
+ logCaughtError,
+ root,
+ fiber,
+ errorInfo
+ );
+ };
}
- if (null !== firstBaseUpdate) {
- var newState = queue.baseState;
- lastBaseUpdate = 0;
- current = firstPendingUpdate = lastPendingUpdate = null;
- pendingQueue = firstBaseUpdate;
- do {
- var updateLane = pendingQueue.lane & -536870913,
- isHiddenUpdate = updateLane !== pendingQueue.lane;
- if (
- isHiddenUpdate
- ? (workInProgressRootRenderLanes & updateLane) === updateLane
- : (renderLanes & updateLane) === updateLane
- ) {
- 0 !== updateLane &&
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- null !== current &&
- (current = current.next =
- {
- lane: 0,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: null,
- next: null
- });
- a: {
- updateLane = workInProgress;
- var partialState = pendingQueue;
- var nextProps = props,
- instance = instance$jscomp$0;
- switch (partialState.tag) {
- case ReplaceState:
- partialState = partialState.payload;
- if ("function" === typeof partialState) {
- isDisallowedContextReadInDEV = !0;
- var nextState = partialState.call(
- instance,
- newState,
- nextProps
- );
- if (updateLane.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- partialState.call(instance, newState, nextProps);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- isDisallowedContextReadInDEV = !1;
- newState = nextState;
- break a;
- }
- newState = partialState;
- break a;
- case CaptureUpdate:
- updateLane.flags = (updateLane.flags & -65537) | 128;
- case UpdateState:
- nextState = partialState.payload;
- if ("function" === typeof nextState) {
- isDisallowedContextReadInDEV = !0;
- partialState = nextState.call(
- instance,
- newState,
- nextProps
- );
- if (updateLane.mode & StrictLegacyMode) {
- setIsStrictModeForDevtools(!0);
- try {
- nextState.call(instance, newState, nextProps);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- isDisallowedContextReadInDEV = !1;
- } else partialState = nextState;
- if (null === partialState || void 0 === partialState) break a;
- newState = assign({}, newState, partialState);
- break a;
- case ForceUpdate:
- hasForceUpdate = !0;
- }
- }
- updateLane = pendingQueue.callback;
- null !== updateLane &&
- ((workInProgress.flags |= 64),
- isHiddenUpdate && (workInProgress.flags |= 8192),
- (isHiddenUpdate = queue.callbacks),
- null === isHiddenUpdate
- ? (queue.callbacks = [updateLane])
- : isHiddenUpdate.push(updateLane));
- } else
- (isHiddenUpdate = {
- lane: updateLane,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: pendingQueue.callback,
- next: null
- }),
- null === current
- ? ((firstPendingUpdate = current = isHiddenUpdate),
- (lastPendingUpdate = newState))
- : (current = current.next = isHiddenUpdate),
- (lastBaseUpdate |= updateLane);
- pendingQueue = pendingQueue.next;
- if (null === pendingQueue)
- if (((pendingQueue = queue.shared.pending), null === pendingQueue))
- break;
- else
- (isHiddenUpdate = pendingQueue),
- (pendingQueue = isHiddenUpdate.next),
- (isHiddenUpdate.next = null),
- (queue.lastBaseUpdate = isHiddenUpdate),
- (queue.shared.pending = null);
- } while (1);
- null === current && (lastPendingUpdate = newState);
- queue.baseState = lastPendingUpdate;
- queue.firstBaseUpdate = firstPendingUpdate;
- queue.lastBaseUpdate = current;
- null === firstBaseUpdate && (queue.shared.lanes = 0);
- workInProgressRootSkippedLanes |= lastBaseUpdate;
- workInProgress.lanes = lastBaseUpdate;
- workInProgress.memoizedState = newState;
+ var inst = fiber.stateNode;
+ null !== inst &&
+ "function" === typeof inst.componentDidCatch &&
+ (update.callback = function () {
+ markFailedErrorBoundaryForHotReloading(fiber);
+ runWithFiberInDEV(
+ errorInfo.source,
+ logCaughtError,
+ root,
+ fiber,
+ errorInfo
+ );
+ "function" !== typeof getDerivedStateFromError &&
+ (null === legacyErrorBoundariesThatAlreadyFailed
+ ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
+ : legacyErrorBoundariesThatAlreadyFailed.add(this));
+ callComponentDidCatchInDEV(this, errorInfo);
+ "function" === typeof getDerivedStateFromError ||
+ (0 === (fiber.lanes & 2) &&
+ console.error(
+ "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",
+ getComponentNameFromFiber(fiber) || "Unknown"
+ ));
+ });
+ }
+ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
+ var currentSourceFiber = sourceFiber.alternate;
+ null !== currentSourceFiber &&
+ propagateParentContextChanges(
+ currentSourceFiber,
+ sourceFiber,
+ rootRenderLanes,
+ !0
+ );
+ }
+ function markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ) {
+ suspenseBoundary.flags |= 65536;
+ suspenseBoundary.lanes = rootRenderLanes;
+ return suspenseBoundary;
+ }
+ function throwException(
+ root,
+ returnFiber,
+ sourceFiber,
+ value,
+ rootRenderLanes
+ ) {
+ sourceFiber.flags |= 32768;
+ isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
+ if (
+ null !== value &&
+ "object" === typeof value &&
+ (value.$$typeof === REACT_POSTPONE_TYPE &&
+ (value = { then: function () {} }),
+ "function" === typeof value.then)
+ ) {
+ resetSuspendedComponent(sourceFiber, rootRenderLanes);
+ isHydrating && (didSuspendOrErrorDEV = !0);
+ var suspenseBoundary = suspenseHandlerStackCursor.current;
+ if (null !== suspenseBoundary) {
+ switch (suspenseBoundary.tag) {
+ case 13:
+ return (
+ null === shellBoundary
+ ? renderDidSuspendDelayIfPossible()
+ : null === suspenseBoundary.alternate &&
+ workInProgressRootExitStatus === RootInProgress &&
+ (workInProgressRootExitStatus = RootSuspended),
+ (suspenseBoundary.flags &= -257),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? (suspenseBoundary.updateQueue = new Set([value]))
+ : sourceFiber.add(value),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ case 22:
+ return (
+ (suspenseBoundary.flags |= 65536),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? ((sourceFiber = {
+ transitions: null,
+ markerInstances: null,
+ retryQueue: new Set([value])
+ }),
+ (suspenseBoundary.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 (" +
+ suspenseBoundary.tag +
+ "). This is a bug in React."
+ );
+ }
+ attachPingListener(root, value, rootRenderLanes);
+ renderDidSuspendDelayIfPossible();
+ return !1;
+ }
+ if (isHydrating)
+ return (
+ (didSuspendOrErrorDEV = !0),
+ (suspenseBoundary = suspenseHandlerStackCursor.current),
+ null !== suspenseBoundary
+ ? (0 === (suspenseBoundary.flags & 65536) &&
+ (suspenseBoundary.flags |= 256),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value !== HydrationMismatchException &&
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ ))
+ : (value !== HydrationMismatchException &&
+ queueHydrationError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error while hydrating but React was able to recover by instead client rendering the entire root.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ ),
+ (root = root.current.alternate),
+ (root.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (root.lanes |= rootRenderLanes),
+ (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
+ (rootRenderLanes = createRootErrorUpdate(
+ root.stateNode,
+ sourceFiber,
+ rootRenderLanes
+ )),
+ enqueueCapturedUpdate(root, rootRenderLanes),
+ workInProgressRootExitStatus !== RootSuspendedWithDelay &&
+ (workInProgressRootExitStatus = RootErrored)),
+ !1
+ );
+ queueConcurrentError(
+ createCapturedValueAtFiber(
+ Error(
+ "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",
+ { cause: value }
+ ),
+ sourceFiber
+ )
+ );
+ workInProgressRootExitStatus !== RootSuspendedWithDelay &&
+ (workInProgressRootExitStatus = RootErrored);
+ if (null === returnFiber) return !0;
+ sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
+ value = returnFiber;
+ do {
+ switch (value.tag) {
+ case 3:
+ return (
+ (value.flags |= 65536),
+ (root = rootRenderLanes & -rootRenderLanes),
+ (value.lanes |= root),
+ (root = createRootErrorUpdate(
+ value.stateNode,
+ sourceFiber,
+ root
+ )),
+ enqueueCapturedUpdate(value, root),
+ !1
+ );
+ case 1:
+ if (
+ ((returnFiber = value.type),
+ (suspenseBoundary = value.stateNode),
+ 0 === (value.flags & 128) &&
+ ("function" === typeof returnFiber.getDerivedStateFromError ||
+ (null !== suspenseBoundary &&
+ "function" === typeof suspenseBoundary.componentDidCatch &&
+ (null === legacyErrorBoundariesThatAlreadyFailed ||
+ !legacyErrorBoundariesThatAlreadyFailed.has(
+ suspenseBoundary
+ )))))
+ )
+ return (
+ (value.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (value.lanes |= rootRenderLanes),
+ (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
+ initializeClassErrorUpdate(
+ rootRenderLanes,
+ root,
+ value,
+ sourceFiber
+ ),
+ enqueueCapturedUpdate(value, rootRenderLanes),
+ !1
+ );
+ }
+ value = value.return;
+ } while (null !== value);
+ return !1;
+ }
+ function reconcileChildren(
+ current,
+ workInProgress,
+ nextChildren,
+ renderLanes
+ ) {
+ workInProgress.child =
+ null === current
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
+ : reconcileChildFibers(
+ workInProgress,
+ current.child,
+ nextChildren,
+ renderLanes
+ );
+ }
+ function updateForwardRef(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ Component = Component.render;
+ var ref = workInProgress.ref;
+ if ("ref" in nextProps) {
+ var propsWithoutRef = {};
+ for (var key in nextProps)
+ "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
+ } else propsWithoutRef = nextProps;
+ prepareToReadContext(workInProgress);
+ nextProps = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ propsWithoutRef,
+ ref,
+ renderLanes
+ );
+ key = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && key && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+ }
+ function updateMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (null === current) {
+ var type = Component.type;
+ if (
+ "function" === typeof type &&
+ !shouldConstruct(type) &&
+ void 0 === type.defaultProps &&
+ null === Component.compare
+ )
+ return (
+ (Component = resolveFunctionForHotReloading(type)),
+ (workInProgress.tag = 15),
+ (workInProgress.type = Component),
+ validateFunctionComponentInDev(workInProgress, type),
+ updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ )
+ );
+ current = createFiberFromTypeAndProps(
+ Component.type,
+ null,
+ nextProps,
+ workInProgress,
+ workInProgress.mode,
+ renderLanes
+ );
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ type = current.child;
+ if (!checkScheduledUpdateOrContext(current, renderLanes)) {
+ var prevProps = type.memoizedProps;
+ Component = Component.compare;
+ Component = null !== Component ? Component : shallowEqual;
+ if (
+ Component(prevProps, nextProps) &&
+ current.ref === workInProgress.ref
+ )
+ return bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ }
+ workInProgress.flags |= 1;
+ current = createWorkInProgress(type, nextProps);
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ function updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (null !== current) {
+ var prevProps = current.memoizedProps;
+ if (
+ shallowEqual(prevProps, nextProps) &&
+ current.ref === workInProgress.ref &&
+ workInProgress.type === current.type
+ )
+ if (
+ ((didReceiveUpdate = !1),
+ (workInProgress.pendingProps = nextProps = prevProps),
+ checkScheduledUpdateOrContext(current, renderLanes))
+ )
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
+ else
+ return (
+ (workInProgress.lanes = current.lanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ }
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ );
+ }
+ function updateOffscreenComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ nextChildren = nextProps.children,
+ nextIsDetached =
+ 0 !==
+ (workInProgress.stateNode._pendingVisibility & OffscreenDetached),
+ prevState = null !== current ? current.memoizedState : null;
+ markRef(current, workInProgress);
+ if ("hidden" === nextProps.mode || nextIsDetached) {
+ if (0 !== (workInProgress.flags & 128)) {
+ nextProps =
+ null !== prevState
+ ? prevState.baseLanes | renderLanes
+ : renderLanes;
+ if (null !== current) {
+ nextChildren = workInProgress.child = current.child;
+ for (nextIsDetached = 0; null !== nextChildren; )
+ (nextIsDetached =
+ nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
+ (nextChildren = nextChildren.sibling);
+ workInProgress.childLanes = nextIsDetached & ~nextProps;
+ } else (workInProgress.childLanes = 0), (workInProgress.child = null);
+ return deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ }
+ if (0 !== (renderLanes & 536870912))
+ (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
+ null !== current &&
+ pushTransition(
+ workInProgress,
+ null !== prevState ? prevState.cachePool : null
+ ),
+ null !== prevState
+ ? pushHiddenContext(workInProgress, prevState)
+ : reuseHiddenContextOnStack(workInProgress),
+ pushOffscreenSuspenseHandler(workInProgress);
+ else
+ return (
+ (workInProgress.lanes = workInProgress.childLanes = 536870912),
+ deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ null !== prevState
+ ? prevState.baseLanes | renderLanes
+ : renderLanes,
+ renderLanes
+ )
+ );
+ } else
+ null !== prevState
+ ? (pushTransition(workInProgress, prevState.cachePool),
+ pushHiddenContext(workInProgress, prevState),
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.memoizedState = null))
+ : (null !== current && pushTransition(workInProgress, null),
+ reuseHiddenContextOnStack(workInProgress),
+ reuseSuspenseHandlerOnStack(workInProgress));
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+ }
+ function deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ nextBaseLanes,
+ renderLanes
+ ) {
+ var JSCompiler_inline_result = peekCacheFromPool();
+ JSCompiler_inline_result =
+ null === JSCompiler_inline_result
+ ? null
+ : {
+ parent: CacheContext._currentValue,
+ pool: JSCompiler_inline_result
+ };
+ workInProgress.memoizedState = {
+ baseLanes: nextBaseLanes,
+ cachePool: JSCompiler_inline_result
+ };
+ null !== current && pushTransition(workInProgress, null);
+ reuseHiddenContextOnStack(workInProgress);
+ pushOffscreenSuspenseHandler(workInProgress);
+ null !== current &&
+ propagateParentContextChanges(current, workInProgress, renderLanes, !0);
+ return null;
+ }
+ function markRef(current, workInProgress) {
+ var ref = workInProgress.ref;
+ if (null === ref)
+ null !== current &&
+ null !== current.ref &&
+ (workInProgress.flags |= 2097664);
+ else {
+ if ("function" !== typeof ref && "object" !== typeof ref)
+ throw Error(
+ "Expected ref to be a function, an object returned by React.createRef(), or undefined/null."
+ );
+ if (null === current || current.ref !== ref)
+ workInProgress.flags |= 2097664;
+ }
+ }
+ function updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ if (
+ Component.prototype &&
+ "function" === typeof Component.prototype.render
+ ) {
+ var componentName = getComponentNameFromType(Component) || "Unknown";
+ didWarnAboutBadClass[componentName] ||
+ (console.error(
+ "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",
+ componentName,
+ componentName
+ ),
+ (didWarnAboutBadClass[componentName] = !0));
+ }
+ workInProgress.mode & StrictLegacyMode &&
+ ReactStrictModeWarnings.recordLegacyContextWarning(
+ workInProgress,
+ null
+ );
+ null === current &&
+ (validateFunctionComponentInDev(workInProgress, workInProgress.type),
+ Component.contextTypes &&
+ ((componentName = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutContextTypes[componentName] ||
+ ((didWarnAboutContextTypes[componentName] = !0),
+ console.error(
+ "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",
+ componentName
+ ))));
+ prepareToReadContext(workInProgress);
+ Component = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ void 0,
+ renderLanes
+ );
+ nextProps = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, Component, renderLanes);
+ return workInProgress.child;
+ }
+ function replayFunctionComponent(
+ current,
+ workInProgress,
+ nextProps,
+ Component,
+ secondArg,
+ renderLanes
+ ) {
+ prepareToReadContext(workInProgress);
+ hookTypesUpdateIndexDev = -1;
+ ignorePreviousDependencies =
+ null !== current && current.type !== workInProgress.type;
+ workInProgress.updateQueue = null;
+ nextProps = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ nextProps,
+ secondArg
+ );
+ finishRenderingHooks(current, workInProgress);
+ Component = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && Component && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ return workInProgress.child;
+ }
+ function updateClassComponent(
+ current$jscomp$0,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ ) {
+ switch (shouldErrorImpl(workInProgress)) {
+ case !1:
+ var _instance = workInProgress.stateNode,
+ state = new workInProgress.type(
+ workInProgress.memoizedProps,
+ _instance.context
+ ).state;
+ _instance.updater.enqueueSetState(_instance, state, null);
+ break;
+ case !0:
+ workInProgress.flags |= 128;
+ workInProgress.flags |= 65536;
+ _instance = Error("Simulated error coming from DevTools");
+ var lane = renderLanes & -renderLanes;
+ workInProgress.lanes |= lane;
+ state = workInProgressRoot;
+ if (null === state)
+ throw Error(
+ "Expected a work-in-progress root. This is a bug in React. Please file an issue."
+ );
+ lane = createClassErrorUpdate(lane);
+ initializeClassErrorUpdate(
+ lane,
+ state,
+ workInProgress,
+ createCapturedValueAtFiber(_instance, workInProgress)
+ );
+ enqueueCapturedUpdate(workInProgress, lane);
+ }
+ prepareToReadContext(workInProgress);
+ if (null === workInProgress.stateNode) {
+ state = emptyContextObject;
+ _instance = Component.contextType;
+ "contextType" in Component &&
+ null !== _instance &&
+ (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) &&
+ !didWarnAboutInvalidateContextType.has(Component) &&
+ (didWarnAboutInvalidateContextType.add(Component),
+ (lane =
+ void 0 === _instance
+ ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."
+ : "object" !== typeof _instance
+ ? " However, it is set to a " + typeof _instance + "."
+ : _instance.$$typeof === REACT_CONSUMER_TYPE
+ ? " Did you accidentally pass the Context.Consumer instead?"
+ : " However, it is set to an object with keys {" +
+ Object.keys(_instance).join(", ") +
+ "}."),
+ console.error(
+ "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",
+ getComponentNameFromType(Component) || "Component",
+ lane
+ ));
+ "object" === typeof _instance &&
+ null !== _instance &&
+ (state = readContext(_instance));
+ _instance = new Component(nextProps, state);
+ if (workInProgress.mode & StrictLegacyMode) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ _instance = new Component(nextProps, state);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ state = workInProgress.memoizedState =
+ null !== _instance.state && void 0 !== _instance.state
+ ? _instance.state
+ : null;
+ _instance.updater = classComponentUpdater;
+ workInProgress.stateNode = _instance;
+ _instance._reactInternals = workInProgress;
+ _instance._reactInternalInstance = fakeInternalInstance;
+ "function" === typeof Component.getDerivedStateFromProps &&
+ null === state &&
+ ((state = getComponentNameFromType(Component) || "Component"),
+ didWarnAboutUninitializedState.has(state) ||
+ (didWarnAboutUninitializedState.add(state),
+ console.error(
+ "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",
+ state,
+ null === _instance.state ? "null" : "undefined",
+ state
+ )));
+ if (
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate
+ ) {
+ var foundWillUpdateName = (lane = state = null);
+ "function" === typeof _instance.componentWillMount &&
+ !0 !== _instance.componentWillMount.__suppressDeprecationWarning
+ ? (state = "componentWillMount")
+ : "function" === typeof _instance.UNSAFE_componentWillMount &&
+ (state = "UNSAFE_componentWillMount");
+ "function" === typeof _instance.componentWillReceiveProps &&
+ !0 !==
+ _instance.componentWillReceiveProps.__suppressDeprecationWarning
+ ? (lane = "componentWillReceiveProps")
+ : "function" ===
+ typeof _instance.UNSAFE_componentWillReceiveProps &&
+ (lane = "UNSAFE_componentWillReceiveProps");
+ "function" === typeof _instance.componentWillUpdate &&
+ !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning
+ ? (foundWillUpdateName = "componentWillUpdate")
+ : "function" === typeof _instance.UNSAFE_componentWillUpdate &&
+ (foundWillUpdateName = "UNSAFE_componentWillUpdate");
+ if (null !== state || null !== lane || null !== foundWillUpdateName) {
+ _instance = getComponentNameFromType(Component) || "Component";
+ var newApiName =
+ "function" === typeof Component.getDerivedStateFromProps
+ ? "getDerivedStateFromProps()"
+ : "getSnapshotBeforeUpdate()";
+ didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) ||
+ (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance),
+ console.error(
+ "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
+ _instance,
+ newApiName,
+ null !== state ? "\n " + state : "",
+ null !== lane ? "\n " + lane : "",
+ null !== foundWillUpdateName ? "\n " + foundWillUpdateName : ""
+ ));
+ }
+ }
+ _instance = workInProgress.stateNode;
+ state = getComponentNameFromType(Component) || "Component";
+ _instance.render ||
+ (Component.prototype &&
+ "function" === typeof Component.prototype.render
+ ? console.error(
+ "No `render` method found on the %s instance: did you accidentally return an object from the constructor?",
+ state
+ )
+ : console.error(
+ "No `render` method found on the %s instance: you may have forgotten to define `render`.",
+ state
+ ));
+ !_instance.getInitialState ||
+ _instance.getInitialState.isReactClassApproved ||
+ _instance.state ||
+ console.error(
+ "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",
+ state
+ );
+ _instance.getDefaultProps &&
+ !_instance.getDefaultProps.isReactClassApproved &&
+ console.error(
+ "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",
+ state
+ );
+ _instance.contextType &&
+ console.error(
+ "contextType was defined as an instance property on %s. Use a static property to define contextType instead.",
+ state
+ );
+ Component.childContextTypes &&
+ !didWarnAboutChildContextTypes.has(Component) &&
+ (didWarnAboutChildContextTypes.add(Component),
+ console.error(
+ "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
+ state
+ ));
+ Component.contextTypes &&
+ !didWarnAboutContextTypes$1.has(Component) &&
+ (didWarnAboutContextTypes$1.add(Component),
+ console.error(
+ "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",
+ state
+ ));
+ "function" === typeof _instance.componentShouldUpdate &&
+ console.error(
+ "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",
+ state
+ );
+ Component.prototype &&
+ Component.prototype.isPureReactComponent &&
+ "undefined" !== typeof _instance.shouldComponentUpdate &&
+ console.error(
+ "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",
+ getComponentNameFromType(Component) || "A pure component"
+ );
+ "function" === typeof _instance.componentDidUnmount &&
+ console.error(
+ "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",
+ state
+ );
+ "function" === typeof _instance.componentDidReceiveProps &&
+ console.error(
+ "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",
+ state
+ );
+ "function" === typeof _instance.componentWillRecieveProps &&
+ console.error(
+ "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",
+ state
+ );
+ "function" === typeof _instance.UNSAFE_componentWillRecieveProps &&
+ console.error(
+ "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",
+ state
+ );
+ lane = _instance.props !== nextProps;
+ void 0 !== _instance.props &&
+ lane &&
+ console.error(
+ "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",
+ state
+ );
+ _instance.defaultProps &&
+ console.error(
+ "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",
+ state,
+ state
+ );
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ "function" === typeof _instance.componentDidUpdate ||
+ didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) ||
+ (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component),
+ console.error(
+ "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",
+ getComponentNameFromType(Component)
+ ));
+ "function" === typeof _instance.getDerivedStateFromProps &&
+ console.error(
+ "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
+ state
+ );
+ "function" === typeof _instance.getDerivedStateFromError &&
+ console.error(
+ "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",
+ state
+ );
+ "function" === typeof Component.getSnapshotBeforeUpdate &&
+ console.error(
+ "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",
+ state
+ );
+ (lane = _instance.state) &&
+ ("object" !== typeof lane || isArrayImpl(lane)) &&
+ console.error("%s.state: must be set to an object or null", state);
+ "function" === typeof _instance.getChildContext &&
+ "object" !== typeof Component.childContextTypes &&
+ console.error(
+ "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",
+ state
+ );
+ _instance = workInProgress.stateNode;
+ _instance.props = nextProps;
+ _instance.state = workInProgress.memoizedState;
+ _instance.refs = {};
+ initializeUpdateQueue(workInProgress);
+ state = Component.contextType;
+ _instance.context =
+ "object" === typeof state && null !== state
+ ? readContext(state)
+ : emptyContextObject;
+ _instance.state === nextProps &&
+ ((state = getComponentNameFromType(Component) || "Component"),
+ didWarnAboutDirectlyAssigningPropsToState.has(state) ||
+ (didWarnAboutDirectlyAssigningPropsToState.add(state),
+ console.error(
+ "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",
+ state
+ )));
+ workInProgress.mode & StrictLegacyMode &&
+ ReactStrictModeWarnings.recordLegacyContextWarning(
+ workInProgress,
+ _instance
+ );
+ ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
+ workInProgress,
+ _instance
+ );
+ _instance.state = workInProgress.memoizedState;
+ state = Component.getDerivedStateFromProps;
+ "function" === typeof state &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ state,
+ nextProps
+ ),
+ (_instance.state = workInProgress.memoizedState));
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate ||
+ ("function" !== typeof _instance.UNSAFE_componentWillMount &&
+ "function" !== typeof _instance.componentWillMount) ||
+ ((state = _instance.state),
+ "function" === typeof _instance.componentWillMount &&
+ _instance.componentWillMount(),
+ "function" === typeof _instance.UNSAFE_componentWillMount &&
+ _instance.UNSAFE_componentWillMount(),
+ state !== _instance.state &&
+ (console.error(
+ "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",
+ getComponentNameFromFiber(workInProgress) || "Component"
+ ),
+ classComponentUpdater.enqueueReplaceState(
+ _instance,
+ _instance.state,
+ null
+ )),
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction(),
+ (_instance.state = workInProgress.memoizedState));
+ "function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308);
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864);
+ _instance = !0;
+ } else if (null === current$jscomp$0) {
+ _instance = workInProgress.stateNode;
+ var unresolvedOldProps = workInProgress.memoizedProps;
+ lane = resolveClassComponentProps(Component, unresolvedOldProps);
+ _instance.props = lane;
+ var oldContext = _instance.context;
+ foundWillUpdateName = Component.contextType;
+ state = emptyContextObject;
+ "object" === typeof foundWillUpdateName &&
+ null !== foundWillUpdateName &&
+ (state = readContext(foundWillUpdateName));
+ newApiName = Component.getDerivedStateFromProps;
+ foundWillUpdateName =
+ "function" === typeof newApiName ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate;
+ unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
+ foundWillUpdateName ||
+ ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof _instance.componentWillReceiveProps) ||
+ ((unresolvedOldProps || oldContext !== state) &&
+ callComponentWillReceiveProps(
+ workInProgress,
+ _instance,
+ nextProps,
+ state
+ ));
+ hasForceUpdate = !1;
+ var oldState = workInProgress.memoizedState;
+ _instance.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ oldContext = workInProgress.memoizedState;
+ unresolvedOldProps || oldState !== oldContext || hasForceUpdate
+ ? ("function" === typeof newApiName &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ newApiName,
+ nextProps
+ ),
+ (oldContext = workInProgress.memoizedState)),
+ (lane =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ lane,
+ nextProps,
+ oldState,
+ oldContext,
+ state
+ ))
+ ? (foundWillUpdateName ||
+ ("function" !== typeof _instance.UNSAFE_componentWillMount &&
+ "function" !== typeof _instance.componentWillMount) ||
+ ("function" === typeof _instance.componentWillMount &&
+ _instance.componentWillMount(),
+ "function" === typeof _instance.UNSAFE_componentWillMount &&
+ _instance.UNSAFE_componentWillMount()),
+ "function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864))
+ : ("function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = oldContext)),
+ (_instance.props = nextProps),
+ (_instance.state = oldContext),
+ (_instance.context = state),
+ (_instance = lane))
+ : ("function" === typeof _instance.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.mode & StrictEffectsMode) !== NoMode &&
+ (workInProgress.flags |= 67108864),
+ (_instance = !1));
+ } else {
+ _instance = workInProgress.stateNode;
+ cloneUpdateQueue(current$jscomp$0, workInProgress);
+ state = workInProgress.memoizedProps;
+ foundWillUpdateName = resolveClassComponentProps(Component, state);
+ _instance.props = foundWillUpdateName;
+ newApiName = workInProgress.pendingProps;
+ oldState = _instance.context;
+ oldContext = Component.contextType;
+ lane = emptyContextObject;
+ "object" === typeof oldContext &&
+ null !== oldContext &&
+ (lane = readContext(oldContext));
+ unresolvedOldProps = Component.getDerivedStateFromProps;
+ (oldContext =
+ "function" === typeof unresolvedOldProps ||
+ "function" === typeof _instance.getSnapshotBeforeUpdate) ||
+ ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof _instance.componentWillReceiveProps) ||
+ ((state !== newApiName || oldState !== lane) &&
+ callComponentWillReceiveProps(
+ workInProgress,
+ _instance,
+ nextProps,
+ lane
+ ));
+ hasForceUpdate = !1;
+ oldState = workInProgress.memoizedState;
+ _instance.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, _instance, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ var newState = workInProgress.memoizedState;
+ state !== newApiName ||
+ oldState !== newState ||
+ hasForceUpdate ||
+ (null !== current$jscomp$0 &&
+ null !== current$jscomp$0.dependencies &&
+ checkIfContextChanged(current$jscomp$0.dependencies))
+ ? ("function" === typeof unresolvedOldProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ unresolvedOldProps,
+ nextProps
+ ),
+ (newState = workInProgress.memoizedState)),
+ (foundWillUpdateName =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ foundWillUpdateName,
+ nextProps,
+ oldState,
+ newState,
+ lane
+ ) ||
+ (null !== current$jscomp$0 &&
+ null !== current$jscomp$0.dependencies &&
+ checkIfContextChanged(current$jscomp$0.dependencies)))
+ ? (oldContext ||
+ ("function" !== typeof _instance.UNSAFE_componentWillUpdate &&
+ "function" !== typeof _instance.componentWillUpdate) ||
+ ("function" === typeof _instance.componentWillUpdate &&
+ _instance.componentWillUpdate(nextProps, newState, lane),
+ "function" === typeof _instance.UNSAFE_componentWillUpdate &&
+ _instance.UNSAFE_componentWillUpdate(
+ nextProps,
+ newState,
+ lane
+ )),
+ "function" === typeof _instance.componentDidUpdate &&
+ (workInProgress.flags |= 4),
+ "function" === typeof _instance.getSnapshotBeforeUpdate &&
+ (workInProgress.flags |= 1024))
+ : ("function" !== typeof _instance.componentDidUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = newState)),
+ (_instance.props = nextProps),
+ (_instance.state = newState),
+ (_instance.context = lane),
+ (_instance = foundWillUpdateName))
+ : ("function" !== typeof _instance.componentDidUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof _instance.getSnapshotBeforeUpdate ||
+ (state === current$jscomp$0.memoizedProps &&
+ oldState === current$jscomp$0.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (_instance = !1));
+ }
+ lane = _instance;
+ markRef(current$jscomp$0, workInProgress);
+ state = 0 !== (workInProgress.flags & 128);
+ if (lane || state) {
+ lane = workInProgress.stateNode;
+ ReactSharedInternals.getCurrentStack =
+ null === workInProgress ? null : getCurrentFiberStackInDev;
+ isRendering = !1;
+ current = workInProgress;
+ if (state && "function" !== typeof Component.getDerivedStateFromError)
+ (Component = null), (profilerStartTime = -1);
+ else if (
+ ((Component = callRenderInDEV(lane)),
+ workInProgress.mode & StrictLegacyMode)
+ ) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ callRenderInDEV(lane);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ workInProgress.flags |= 1;
+ null !== current$jscomp$0 && state
+ ? ((workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ current$jscomp$0.child,
+ null,
+ renderLanes
+ )),
+ (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ Component,
+ renderLanes
+ )))
+ : reconcileChildren(
+ current$jscomp$0,
+ workInProgress,
+ Component,
+ renderLanes
+ );
+ workInProgress.memoizedState = lane.state;
+ current$jscomp$0 = workInProgress.child;
+ } else
+ current$jscomp$0 = bailoutOnAlreadyFinishedWork(
+ current$jscomp$0,
+ workInProgress,
+ renderLanes
+ );
+ renderLanes = workInProgress.stateNode;
+ _instance &&
+ renderLanes.props !== nextProps &&
+ (didWarnAboutReassigningProps ||
+ console.error(
+ "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",
+ getComponentNameFromFiber(workInProgress) || "a component"
+ ),
+ (didWarnAboutReassigningProps = !0));
+ return current$jscomp$0;
+ }
+ function mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextChildren,
+ renderLanes
+ ) {
+ resetHydrationState();
+ workInProgress.flags |= 256;
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+ }
+ function validateFunctionComponentInDev(workInProgress, Component) {
+ Component &&
+ Component.childContextTypes &&
+ console.error(
+ "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...",
+ Component.displayName || Component.name || "Component"
+ );
+ "function" === typeof Component.getDerivedStateFromProps &&
+ ((workInProgress = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] ||
+ (console.error(
+ "%s: Function components do not support getDerivedStateFromProps.",
+ workInProgress
+ ),
+ (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] =
+ !0)));
+ "object" === typeof Component.contextType &&
+ null !== Component.contextType &&
+ ((Component = getComponentNameFromType(Component) || "Unknown"),
+ didWarnAboutContextTypeOnFunctionComponent[Component] ||
+ (console.error(
+ "%s: Function components do not support contextType.",
+ Component
+ ),
+ (didWarnAboutContextTypeOnFunctionComponent[Component] = !0)));
+ }
+ function mountSuspenseOffscreenState(renderLanes) {
+ return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
+ }
+ function getRemainingWorkInPrimaryTree(
+ current,
+ primaryTreeDidDefer,
+ renderLanes
+ ) {
+ current = null !== current ? current.childLanes & ~renderLanes : 0;
+ primaryTreeDidDefer && (current |= workInProgressDeferredLane);
+ return current;
+ }
+ function updateSuspenseComponent(current, workInProgress, renderLanes) {
+ var JSCompiler_object_inline_componentStack_2338;
+ var JSCompiler_object_inline_stack_2337 = workInProgress.pendingProps;
+ shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128);
+ var JSCompiler_object_inline_message_2335 = !1;
+ var didSuspend = 0 !== (workInProgress.flags & 128);
+ (JSCompiler_object_inline_componentStack_2338 = didSuspend) ||
+ (JSCompiler_object_inline_componentStack_2338 =
+ null !== current && null === current.memoizedState
+ ? !1
+ : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback));
+ JSCompiler_object_inline_componentStack_2338 &&
+ ((JSCompiler_object_inline_message_2335 = !0),
+ (workInProgress.flags &= -129));
+ JSCompiler_object_inline_componentStack_2338 =
+ 0 !== (workInProgress.flags & 32);
+ workInProgress.flags &= -33;
+ if (null === current) {
+ if (isHydrating) {
+ JSCompiler_object_inline_message_2335
+ ? pushPrimaryTreeSuspenseHandler(workInProgress)
+ : reuseSuspenseHandlerOnStack(workInProgress);
+ if (isHydrating) {
+ var JSCompiler_object_inline_digest_2336 = nextHydratableInstance;
+ var JSCompiler_temp;
+ if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2336)) {
+ c: {
+ var instance = JSCompiler_object_inline_digest_2336;
+ for (
+ JSCompiler_temp = rootOrSingletonContext;
+ 8 !== instance.nodeType;
+
+ ) {
+ if (!JSCompiler_temp) {
+ JSCompiler_temp = null;
+ break c;
+ }
+ instance = getNextHydratable(instance.nextSibling);
+ if (null === instance) {
+ JSCompiler_temp = null;
+ break c;
+ }
+ }
+ JSCompiler_temp = instance;
+ }
+ null !== JSCompiler_temp
+ ? (warnIfNotHydrating(),
+ (workInProgress.memoizedState = {
+ dehydrated: JSCompiler_temp,
+ treeContext:
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null,
+ retryLane: 536870912,
+ hydrationErrors: null
+ }),
+ (instance = createFiber(18, null, null, NoMode)),
+ (instance.stateNode = JSCompiler_temp),
+ (instance.return = workInProgress),
+ (workInProgress.child = instance),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (JSCompiler_temp = !0))
+ : (JSCompiler_temp = !1);
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp &&
+ (warnNonHydratedInstance(
+ workInProgress,
+ JSCompiler_object_inline_digest_2336
+ ),
+ throwOnHydrationMismatch(workInProgress));
+ }
+ JSCompiler_object_inline_digest_2336 = workInProgress.memoizedState;
+ if (
+ null !== JSCompiler_object_inline_digest_2336 &&
+ ((JSCompiler_object_inline_digest_2336 =
+ JSCompiler_object_inline_digest_2336.dehydrated),
+ null !== JSCompiler_object_inline_digest_2336)
+ )
+ return (
+ isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2336)
+ ? (workInProgress.lanes = 32)
+ : (workInProgress.lanes = 536870912),
+ null
+ );
+ popSuspenseHandler(workInProgress);
+ }
+ JSCompiler_object_inline_digest_2336 =
+ JSCompiler_object_inline_stack_2337.children;
+ JSCompiler_temp = JSCompiler_object_inline_stack_2337.fallback;
+ if (JSCompiler_object_inline_message_2335)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_stack_2337 =
+ mountSuspenseFallbackChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2336,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (JSCompiler_object_inline_message_2335 = workInProgress.child),
+ (JSCompiler_object_inline_message_2335.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_message_2335.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2338,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ JSCompiler_object_inline_stack_2337
+ );
+ if (
+ "number" ===
+ typeof JSCompiler_object_inline_stack_2337.unstable_expectedLoadTime
+ )
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_stack_2337 =
+ mountSuspenseFallbackChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2336,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (JSCompiler_object_inline_message_2335 = workInProgress.child),
+ (JSCompiler_object_inline_message_2335.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_message_2335.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2338,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress.lanes = 4194304),
+ JSCompiler_object_inline_stack_2337
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ return mountSuspensePrimaryChildren(
+ workInProgress,
+ JSCompiler_object_inline_digest_2336
+ );
+ }
+ var prevState = current.memoizedState;
+ if (
+ null !== prevState &&
+ ((JSCompiler_object_inline_digest_2336 = prevState.dehydrated),
+ null !== JSCompiler_object_inline_digest_2336)
+ ) {
+ if (didSuspend)
+ workInProgress.flags & 256
+ ? (pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags &= -257),
+ (workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ )))
+ : null !== workInProgress.memoizedState
+ ? (reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.child = current.child),
+ (workInProgress.flags |= 128),
+ (workInProgress = null))
+ : (reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_message_2335 =
+ JSCompiler_object_inline_stack_2337.fallback),
+ (JSCompiler_object_inline_digest_2336 = workInProgress.mode),
+ (JSCompiler_object_inline_stack_2337 =
+ mountWorkInProgressOffscreenFiber(
+ {
+ mode: "visible",
+ children: JSCompiler_object_inline_stack_2337.children
+ },
+ JSCompiler_object_inline_digest_2336
+ )),
+ (JSCompiler_object_inline_message_2335 =
+ createFiberFromFragment(
+ JSCompiler_object_inline_message_2335,
+ JSCompiler_object_inline_digest_2336,
+ renderLanes,
+ null
+ )),
+ (JSCompiler_object_inline_message_2335.flags |= 2),
+ (JSCompiler_object_inline_stack_2337.return = workInProgress),
+ (JSCompiler_object_inline_message_2335.return = workInProgress),
+ (JSCompiler_object_inline_stack_2337.sibling =
+ JSCompiler_object_inline_message_2335),
+ (workInProgress.child = JSCompiler_object_inline_stack_2337),
+ reconcileChildFibers(
+ workInProgress,
+ current.child,
+ null,
+ renderLanes
+ ),
+ (JSCompiler_object_inline_stack_2337 = workInProgress.child),
+ (JSCompiler_object_inline_stack_2337.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (JSCompiler_object_inline_stack_2337.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2338,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress = JSCompiler_object_inline_message_2335));
+ else if (
+ (pushPrimaryTreeSuspenseHandler(workInProgress),
+ isHydrating &&
+ console.error(
+ "We should not be hydrating here. This is a bug in React. Please file a bug."
+ ),
+ isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2336))
+ ) {
+ JSCompiler_object_inline_componentStack_2338 =
+ JSCompiler_object_inline_digest_2336.nextSibling &&
+ JSCompiler_object_inline_digest_2336.nextSibling.dataset;
+ if (JSCompiler_object_inline_componentStack_2338) {
+ JSCompiler_temp = JSCompiler_object_inline_componentStack_2338.dgst;
+ var message = JSCompiler_object_inline_componentStack_2338.msg;
+ instance = JSCompiler_object_inline_componentStack_2338.stck;
+ var componentStack =
+ JSCompiler_object_inline_componentStack_2338.cstck;
+ }
+ JSCompiler_object_inline_message_2335 = message;
+ JSCompiler_object_inline_digest_2336 = JSCompiler_temp;
+ JSCompiler_object_inline_stack_2337 = instance;
+ JSCompiler_temp = JSCompiler_object_inline_componentStack_2338 =
+ componentStack;
+ "POSTPONE" !== JSCompiler_object_inline_digest_2336 &&
+ ((JSCompiler_object_inline_componentStack_2338 =
+ JSCompiler_object_inline_message_2335
+ ? Error(JSCompiler_object_inline_message_2335)
+ : Error(
+ "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."
+ )),
+ (JSCompiler_object_inline_componentStack_2338.stack =
+ JSCompiler_object_inline_stack_2337 || ""),
+ (JSCompiler_object_inline_componentStack_2338.digest =
+ JSCompiler_object_inline_digest_2336),
+ (JSCompiler_object_inline_stack_2337 =
+ void 0 === JSCompiler_temp ? null : JSCompiler_temp),
+ (JSCompiler_object_inline_message_2335 = {
+ value: JSCompiler_object_inline_componentStack_2338,
+ source: null,
+ stack: JSCompiler_object_inline_stack_2337
+ }),
+ "string" === typeof JSCompiler_object_inline_stack_2337 &&
+ CapturedStacks.set(
+ JSCompiler_object_inline_componentStack_2338,
+ JSCompiler_object_inline_message_2335
+ ),
+ queueHydrationError(JSCompiler_object_inline_message_2335));
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else if (
+ (didReceiveUpdate ||
+ propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (JSCompiler_object_inline_componentStack_2338 =
+ 0 !== (renderLanes & current.childLanes)),
+ didReceiveUpdate || JSCompiler_object_inline_componentStack_2338)
+ ) {
+ JSCompiler_object_inline_componentStack_2338 = workInProgressRoot;
+ if (
+ null !== JSCompiler_object_inline_componentStack_2338 &&
+ ((JSCompiler_object_inline_stack_2337 = renderLanes & -renderLanes),
+ (JSCompiler_object_inline_stack_2337 =
+ 0 !== (JSCompiler_object_inline_stack_2337 & 42)
+ ? 1
+ : getBumpedLaneForHydrationByLane(
+ JSCompiler_object_inline_stack_2337
+ )),
+ (JSCompiler_object_inline_stack_2337 =
+ 0 !==
+ (JSCompiler_object_inline_stack_2337 &
+ (JSCompiler_object_inline_componentStack_2338.suspendedLanes |
+ renderLanes))
+ ? 0
+ : JSCompiler_object_inline_stack_2337),
+ 0 !== JSCompiler_object_inline_stack_2337 &&
+ JSCompiler_object_inline_stack_2337 !== prevState.retryLane)
+ )
+ throw (
+ ((prevState.retryLane = JSCompiler_object_inline_stack_2337),
+ enqueueConcurrentRenderForLane(
+ current,
+ JSCompiler_object_inline_stack_2337
+ ),
+ scheduleUpdateOnFiber(
+ JSCompiler_object_inline_componentStack_2338,
+ current,
+ JSCompiler_object_inline_stack_2337
+ ),
+ SelectiveHydrationException)
+ );
+ JSCompiler_object_inline_digest_2336.data ===
+ SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible();
+ workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ } else
+ JSCompiler_object_inline_digest_2336.data ===
+ SUSPENSE_PENDING_START_DATA
+ ? ((workInProgress.flags |= 192),
+ (workInProgress.child = current.child),
+ (workInProgress = null))
+ : ((current = prevState.treeContext),
+ (nextHydratableInstance = getNextHydratable(
+ JSCompiler_object_inline_digest_2336.nextSibling
+ )),
+ (hydrationParentFiber = workInProgress),
+ (isHydrating = !0),
+ (hydrationErrors = null),
+ (didSuspendOrErrorDEV = !1),
+ (hydrationDiffRootDEV = null),
+ (rootOrSingletonContext = !1),
+ null !== current &&
+ (warnIfNotHydrating(),
+ (idStack[idStackIndex++] = treeContextId),
+ (idStack[idStackIndex++] = treeContextOverflow),
+ (idStack[idStackIndex++] = treeContextProvider),
+ (treeContextId = current.id),
+ (treeContextOverflow = current.overflow),
+ (treeContextProvider = workInProgress)),
+ (workInProgress = mountSuspensePrimaryChildren(
+ workInProgress,
+ JSCompiler_object_inline_stack_2337.children
+ )),
+ (workInProgress.flags |= 4096));
+ return workInProgress;
+ }
+ if (JSCompiler_object_inline_message_2335)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (JSCompiler_object_inline_message_2335 =
+ JSCompiler_object_inline_stack_2337.fallback),
+ (JSCompiler_object_inline_digest_2336 = workInProgress.mode),
+ (JSCompiler_temp = current.child),
+ (instance = JSCompiler_temp.sibling),
+ (JSCompiler_object_inline_stack_2337 = createWorkInProgress(
+ JSCompiler_temp,
+ {
+ mode: "hidden",
+ children: JSCompiler_object_inline_stack_2337.children
+ }
+ )),
+ (JSCompiler_object_inline_stack_2337.subtreeFlags =
+ JSCompiler_temp.subtreeFlags & 31457280),
+ null !== instance
+ ? (JSCompiler_object_inline_message_2335 = createWorkInProgress(
+ instance,
+ JSCompiler_object_inline_message_2335
+ ))
+ : ((JSCompiler_object_inline_message_2335 = createFiberFromFragment(
+ JSCompiler_object_inline_message_2335,
+ JSCompiler_object_inline_digest_2336,
+ renderLanes,
+ null
+ )),
+ (JSCompiler_object_inline_message_2335.flags |= 2)),
+ (JSCompiler_object_inline_message_2335.return = workInProgress),
+ (JSCompiler_object_inline_stack_2337.return = workInProgress),
+ (JSCompiler_object_inline_stack_2337.sibling =
+ JSCompiler_object_inline_message_2335),
+ (workInProgress.child = JSCompiler_object_inline_stack_2337),
+ (JSCompiler_object_inline_stack_2337 =
+ JSCompiler_object_inline_message_2335),
+ (JSCompiler_object_inline_message_2335 = workInProgress.child),
+ (JSCompiler_object_inline_digest_2336 = current.child.memoizedState),
+ null === JSCompiler_object_inline_digest_2336
+ ? (JSCompiler_object_inline_digest_2336 =
+ mountSuspenseOffscreenState(renderLanes))
+ : ((JSCompiler_temp =
+ JSCompiler_object_inline_digest_2336.cachePool),
+ null !== JSCompiler_temp
+ ? ((instance = CacheContext._currentValue),
+ (JSCompiler_temp =
+ JSCompiler_temp.parent !== instance
+ ? { parent: instance, pool: instance }
+ : JSCompiler_temp))
+ : (JSCompiler_temp = getSuspendedCache()),
+ (JSCompiler_object_inline_digest_2336 = {
+ baseLanes:
+ JSCompiler_object_inline_digest_2336.baseLanes | renderLanes,
+ cachePool: JSCompiler_temp
+ })),
+ (JSCompiler_object_inline_message_2335.memoizedState =
+ JSCompiler_object_inline_digest_2336),
+ (JSCompiler_object_inline_message_2335.childLanes =
+ getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_object_inline_componentStack_2338,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ JSCompiler_object_inline_stack_2337
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ renderLanes = current.child;
+ current = renderLanes.sibling;
+ renderLanes = createWorkInProgress(renderLanes, {
+ mode: "visible",
+ children: JSCompiler_object_inline_stack_2337.children
+ });
+ renderLanes.return = workInProgress;
+ renderLanes.sibling = null;
+ null !== current &&
+ ((JSCompiler_object_inline_componentStack_2338 =
+ workInProgress.deletions),
+ null === JSCompiler_object_inline_componentStack_2338
+ ? ((workInProgress.deletions = [current]),
+ (workInProgress.flags |= 16))
+ : JSCompiler_object_inline_componentStack_2338.push(current));
+ workInProgress.child = renderLanes;
+ workInProgress.memoizedState = null;
+ return renderLanes;
+ }
+ function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: primaryChildren },
+ workInProgress.mode
+ );
+ primaryChildren.return = workInProgress;
+ return (workInProgress.child = primaryChildren);
+ }
+ function mountSuspenseFallbackChildren(
+ workInProgress,
+ primaryChildren,
+ fallbackChildren,
+ renderLanes
+ ) {
+ var mode = workInProgress.mode;
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "hidden", children: primaryChildren },
+ mode
+ );
+ fallbackChildren = createFiberFromFragment(
+ fallbackChildren,
+ mode,
+ renderLanes,
+ null
+ );
+ primaryChildren.return = workInProgress;
+ fallbackChildren.return = workInProgress;
+ primaryChildren.sibling = fallbackChildren;
+ workInProgress.child = primaryChildren;
+ return fallbackChildren;
+ }
+ function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
+ return createFiberFromOffscreen(offscreenProps, mode, 0, null);
+ }
+ function retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
+ current = mountSuspensePrimaryChildren(
+ workInProgress,
+ workInProgress.pendingProps.children
+ );
+ current.flags |= 2;
+ workInProgress.memoizedState = null;
+ return current;
+ }
+ function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
+ fiber.lanes |= renderLanes;
+ var alternate = fiber.alternate;
+ null !== alternate && (alternate.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ fiber.return,
+ renderLanes,
+ propagationRoot
+ );
+ }
+ function validateSuspenseListNestedChild(childSlot, index) {
+ var isAnArray = isArrayImpl(childSlot);
+ childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot);
+ return isAnArray || childSlot
+ ? ((isAnArray = isAnArray ? "array" : "iterable"),
+ console.error(
+ "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ",
+ isAnArray,
+ index,
+ isAnArray
+ ),
+ !1)
+ : !0;
+ }
+ function initSuspenseListRenderState(
+ workInProgress,
+ isBackwards,
+ tail,
+ lastContentRow,
+ tailMode
+ ) {
+ var renderState = workInProgress.memoizedState;
+ null === renderState
+ ? (workInProgress.memoizedState = {
+ isBackwards: isBackwards,
+ rendering: null,
+ renderingStartTime: 0,
+ last: lastContentRow,
+ tail: tail,
+ tailMode: tailMode
+ })
+ : ((renderState.isBackwards = isBackwards),
+ (renderState.rendering = null),
+ (renderState.renderingStartTime = 0),
+ (renderState.last = lastContentRow),
+ (renderState.tail = tail),
+ (renderState.tailMode = tailMode));
+ }
+ function updateSuspenseListComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ revealOrder = nextProps.revealOrder,
+ tailMode = nextProps.tail;
+ nextProps = nextProps.children;
+ if (
+ void 0 !== revealOrder &&
+ "forwards" !== revealOrder &&
+ "backwards" !== revealOrder &&
+ "together" !== revealOrder &&
+ !didWarnAboutRevealOrder[revealOrder]
+ )
+ if (
+ ((didWarnAboutRevealOrder[revealOrder] = !0),
+ "string" === typeof revealOrder)
+ )
+ switch (revealOrder.toLowerCase()) {
+ case "together":
+ case "forwards":
+ case "backwards":
+ console.error(
+ '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.',
+ revealOrder,
+ revealOrder.toLowerCase()
+ );
+ break;
+ case "forward":
+ case "backward":
+ console.error(
+ '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.',
+ revealOrder,
+ revealOrder.toLowerCase()
+ );
+ break;
+ default:
+ console.error(
+ '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?',
+ revealOrder
+ );
+ }
+ else
+ console.error(
+ '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?',
+ revealOrder
+ );
+ void 0 === tailMode ||
+ didWarnAboutTailOptions[tailMode] ||
+ ("collapsed" !== tailMode && "hidden" !== tailMode
+ ? ((didWarnAboutTailOptions[tailMode] = !0),
+ console.error(
+ '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?',
+ tailMode
+ ))
+ : "forwards" !== revealOrder &&
+ "backwards" !== revealOrder &&
+ ((didWarnAboutTailOptions[tailMode] = !0),
+ console.error(
+ ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',
+ tailMode
+ )));
+ a: if (
+ ("forwards" === revealOrder || "backwards" === revealOrder) &&
+ void 0 !== nextProps &&
+ null !== nextProps &&
+ !1 !== nextProps
+ )
+ if (isArrayImpl(nextProps))
+ for (var i = 0; i < nextProps.length; i++) {
+ if (!validateSuspenseListNestedChild(nextProps[i], i)) break a;
+ }
+ else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) {
+ if ((i = i.call(nextProps)))
+ for (var step = i.next(), _i = 0; !step.done; step = i.next()) {
+ if (!validateSuspenseListNestedChild(step.value, _i)) break a;
+ _i++;
+ }
+ } else
+ console.error(
+ 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',
+ revealOrder
+ );
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ nextProps = suspenseStackCursor.current;
+ if (0 !== (nextProps & ForceSuspenseFallback))
+ (nextProps =
+ (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback),
+ (workInProgress.flags |= 128);
+ else {
+ if (null !== current && 0 !== (current.flags & 128))
+ a: for (current = workInProgress.child; null !== current; ) {
+ if (13 === current.tag)
+ null !== current.memoizedState &&
+ scheduleSuspenseWorkOnFiber(
+ current,
+ renderLanes,
+ workInProgress
+ );
+ else if (19 === current.tag)
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (null !== current.child) {
+ current.child.return = current;
+ current = current.child;
+ continue;
+ }
+ if (current === workInProgress) break a;
+ for (; null === current.sibling; ) {
+ if (null === current.return || current.return === workInProgress)
+ break a;
+ current = current.return;
+ }
+ current.sibling.return = current.return;
+ current = current.sibling;
+ }
+ nextProps &= SubtreeSuspenseContextMask;
+ }
+ push(suspenseStackCursor, nextProps, workInProgress);
+ switch (revealOrder) {
+ case "forwards":
+ renderLanes = workInProgress.child;
+ for (revealOrder = null; null !== renderLanes; )
+ (current = renderLanes.alternate),
+ null !== current &&
+ null === findFirstSuspended(current) &&
+ (revealOrder = renderLanes),
+ (renderLanes = renderLanes.sibling);
+ renderLanes = revealOrder;
+ null === renderLanes
+ ? ((revealOrder = workInProgress.child),
+ (workInProgress.child = null))
+ : ((revealOrder = renderLanes.sibling),
+ (renderLanes.sibling = null));
+ initSuspenseListRenderState(
+ workInProgress,
+ !1,
+ revealOrder,
+ renderLanes,
+ tailMode
+ );
+ break;
+ case "backwards":
+ renderLanes = null;
+ revealOrder = workInProgress.child;
+ for (workInProgress.child = null; null !== revealOrder; ) {
+ current = revealOrder.alternate;
+ if (null !== current && null === findFirstSuspended(current)) {
+ workInProgress.child = revealOrder;
+ break;
+ }
+ current = revealOrder.sibling;
+ revealOrder.sibling = renderLanes;
+ renderLanes = revealOrder;
+ revealOrder = current;
+ }
+ initSuspenseListRenderState(
+ workInProgress,
+ !0,
+ renderLanes,
+ null,
+ tailMode
+ );
+ break;
+ case "together":
+ initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
+ break;
+ default:
+ workInProgress.memoizedState = null;
+ }
+ return workInProgress.child;
+ }
+ function bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ null !== current && (workInProgress.dependencies = current.dependencies);
+ profilerStartTime = -1;
+ workInProgressRootSkippedLanes |= workInProgress.lanes;
+ if (0 === (renderLanes & workInProgress.childLanes))
+ if (null !== current) {
+ if (
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ 0 === (renderLanes & workInProgress.childLanes))
+ )
+ return null;
+ } else return null;
+ if (null !== current && workInProgress.child !== current.child)
+ throw Error("Resuming work not yet implemented.");
+ if (null !== workInProgress.child) {
+ current = workInProgress.child;
+ renderLanes = createWorkInProgress(current, current.pendingProps);
+ workInProgress.child = renderLanes;
+ for (renderLanes.return = workInProgress; null !== current.sibling; )
+ (current = current.sibling),
+ (renderLanes = renderLanes.sibling =
+ createWorkInProgress(current, current.pendingProps)),
+ (renderLanes.return = workInProgress);
+ renderLanes.sibling = null;
+ }
+ return workInProgress.child;
+ }
+ function checkScheduledUpdateOrContext(current, renderLanes) {
+ if (0 !== (current.lanes & renderLanes)) return !0;
+ current = current.dependencies;
+ return null !== current && checkIfContextChanged(current) ? !0 : !1;
+ }
+ function attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ ) {
+ switch (workInProgress.tag) {
+ case 3:
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ pushProvider(
+ workInProgress,
+ CacheContext,
+ current.memoizedState.cache
+ );
+ resetHydrationState();
+ break;
+ case 27:
+ case 5:
+ pushHostContext(workInProgress);
+ break;
+ case 4:
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ break;
+ case 10:
+ pushProvider(
+ workInProgress,
+ workInProgress.type,
+ workInProgress.memoizedProps.value
+ );
+ break;
+ case 12:
+ 0 !== (renderLanes & workInProgress.childLanes) &&
+ (workInProgress.flags |= 4);
+ workInProgress.flags |= 2048;
+ var stateNode = workInProgress.stateNode;
+ stateNode.effectDuration = -0;
+ stateNode.passiveEffectDuration = -0;
+ break;
+ case 13:
+ stateNode = workInProgress.memoizedState;
+ if (null !== stateNode) {
+ if (null !== stateNode.dehydrated)
+ return (
+ pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags |= 128),
+ null
+ );
+ if (0 !== (renderLanes & workInProgress.child.childLanes))
+ return updateSuspenseComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ current = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ return null !== current ? current.sibling : null;
+ }
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ break;
+ case 19:
+ var didSuspendBefore = 0 !== (current.flags & 128);
+ stateNode = 0 !== (renderLanes & workInProgress.childLanes);
+ stateNode ||
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
+ if (didSuspendBefore) {
+ if (stateNode)
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ workInProgress.flags |= 128;
+ }
+ didSuspendBefore = workInProgress.memoizedState;
+ null !== didSuspendBefore &&
+ ((didSuspendBefore.rendering = null),
+ (didSuspendBefore.tail = null),
+ (didSuspendBefore.lastEffect = null));
+ push(
+ suspenseStackCursor,
+ suspenseStackCursor.current,
+ workInProgress
+ );
+ if (stateNode) break;
+ else return null;
+ case 22:
+ case 23:
+ return (
+ (workInProgress.lanes = 0),
+ updateOffscreenComponent(current, workInProgress, renderLanes)
+ );
+ case 24:
+ pushProvider(
+ workInProgress,
+ CacheContext,
+ current.memoizedState.cache
+ );
+ }
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+ }
+ function beginWork(current, workInProgress, renderLanes) {
+ if (workInProgress._debugNeedsRemount && null !== current) {
+ renderLanes = createFiberFromTypeAndProps(
+ workInProgress.type,
+ workInProgress.key,
+ workInProgress.pendingProps,
+ workInProgress._debugOwner || null,
+ workInProgress.mode,
+ workInProgress.lanes
+ );
+ renderLanes._debugStack = workInProgress._debugStack;
+ renderLanes._debugTask = workInProgress._debugTask;
+ var returnFiber = workInProgress.return;
+ if (null === returnFiber) throw Error("Cannot swap the root fiber.");
+ current.alternate = null;
+ workInProgress.alternate = null;
+ renderLanes.index = workInProgress.index;
+ renderLanes.sibling = workInProgress.sibling;
+ renderLanes.return = workInProgress.return;
+ renderLanes.ref = workInProgress.ref;
+ renderLanes._debugInfo = workInProgress._debugInfo;
+ if (workInProgress === returnFiber.child)
+ returnFiber.child = renderLanes;
+ else {
+ var prevSibling = returnFiber.child;
+ if (null === prevSibling)
+ throw Error("Expected parent to have a child.");
+ for (; prevSibling.sibling !== workInProgress; )
+ if (((prevSibling = prevSibling.sibling), null === prevSibling))
+ throw Error("Expected to find the previous sibling.");
+ prevSibling.sibling = renderLanes;
+ }
+ workInProgress = returnFiber.deletions;
+ null === workInProgress
+ ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16))
+ : workInProgress.push(current);
+ renderLanes.flags |= 2;
+ return renderLanes;
+ }
+ if (null !== current)
+ if (
+ current.memoizedProps !== workInProgress.pendingProps ||
+ workInProgress.type !== current.type
+ )
+ didReceiveUpdate = !0;
+ else {
+ if (
+ !checkScheduledUpdateOrContext(current, renderLanes) &&
+ 0 === (workInProgress.flags & 128)
+ )
+ return (
+ (didReceiveUpdate = !1),
+ attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ )
+ );
+ didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ }
+ else {
+ didReceiveUpdate = !1;
+ if ((returnFiber = isHydrating))
+ warnIfNotHydrating(),
+ (returnFiber = 0 !== (workInProgress.flags & 1048576));
+ returnFiber &&
+ ((returnFiber = workInProgress.index),
+ warnIfNotHydrating(),
+ pushTreeId(workInProgress, treeForkCount, returnFiber));
+ }
+ workInProgress.lanes = 0;
+ switch (workInProgress.tag) {
+ case 16:
+ a: if (
+ ((returnFiber = workInProgress.pendingProps),
+ (current = callLazyInitInDEV(workInProgress.elementType)),
+ (workInProgress.type = current),
+ "function" === typeof current)
+ )
+ shouldConstruct(current)
+ ? ((returnFiber = resolveClassComponentProps(
+ current,
+ returnFiber
+ )),
+ (workInProgress.tag = 1),
+ (workInProgress.type = current =
+ resolveFunctionForHotReloading(current)),
+ (workInProgress = updateClassComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ )))
+ : ((workInProgress.tag = 0),
+ validateFunctionComponentInDev(workInProgress, current),
+ (workInProgress.type = current =
+ resolveFunctionForHotReloading(current)),
+ (workInProgress = updateFunctionComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ )));
+ else {
+ if (void 0 !== current && null !== current)
+ if (
+ ((prevSibling = current.$$typeof),
+ prevSibling === REACT_FORWARD_REF_TYPE)
+ ) {
+ workInProgress.tag = 11;
+ workInProgress.type = current =
+ resolveForwardRefForHotReloading(current);
+ workInProgress = updateForwardRef(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ );
+ break a;
+ } else if (prevSibling === REACT_MEMO_TYPE) {
+ workInProgress.tag = 14;
+ workInProgress = updateMemoComponent(
+ null,
+ workInProgress,
+ current,
+ returnFiber,
+ renderLanes
+ );
+ break a;
+ }
+ workInProgress = "";
+ null !== current &&
+ "object" === typeof current &&
+ current.$$typeof === REACT_LAZY_TYPE &&
+ (workInProgress =
+ " Did you wrap a component in React.lazy() more than once?");
+ current = getComponentNameFromType(current) || current;
+ throw Error(
+ "Element type is invalid. Received a promise that resolves to: " +
+ current +
+ ". Lazy element type must resolve to a class or function." +
+ workInProgress
+ );
+ }
+ return workInProgress;
+ case 0:
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 1:
+ return (
+ (returnFiber = workInProgress.type),
+ (prevSibling = resolveClassComponentProps(
+ returnFiber,
+ workInProgress.pendingProps
+ )),
+ updateClassComponent(
+ current,
+ workInProgress,
+ returnFiber,
+ prevSibling,
+ renderLanes
+ )
+ );
+ case 3:
+ a: {
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ if (null === current)
+ throw Error(
+ "Should have a current fiber. This is a bug in React."
+ );
+ var nextProps = workInProgress.pendingProps;
+ prevSibling = workInProgress.memoizedState;
+ returnFiber = prevSibling.element;
+ cloneUpdateQueue(current, workInProgress);
+ processUpdateQueue(workInProgress, nextProps, null, renderLanes);
+ var nextState = workInProgress.memoizedState;
+ nextProps = nextState.cache;
+ pushProvider(workInProgress, CacheContext, nextProps);
+ nextProps !== prevSibling.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ );
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ nextProps = nextState.element;
+ if (prevSibling.isDehydrated)
+ if (
+ ((prevSibling = {
+ element: nextProps,
+ isDehydrated: !1,
+ cache: nextState.cache
+ }),
+ (workInProgress.updateQueue.baseState = prevSibling),
+ (workInProgress.memoizedState = prevSibling),
+ workInProgress.flags & 256)
+ ) {
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else if (nextProps !== returnFiber) {
+ returnFiber = createCapturedValueAtFiber(
+ Error(
+ "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."
+ ),
+ workInProgress
+ );
+ queueHydrationError(returnFiber);
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else
+ for (
+ nextHydratableInstance = getNextHydratable(
+ workInProgress.stateNode.containerInfo.firstChild
+ ),
+ hydrationParentFiber = workInProgress,
+ isHydrating = !0,
+ hydrationErrors = null,
+ didSuspendOrErrorDEV = !1,
+ hydrationDiffRootDEV = null,
+ rootOrSingletonContext = !0,
+ current = mountChildFibers(
+ workInProgress,
+ null,
+ nextProps,
+ renderLanes
+ ),
+ workInProgress.child = current;
+ current;
+
+ )
+ (current.flags = (current.flags & -3) | 4096),
+ (current = current.sibling);
+ else {
+ resetHydrationState();
+ if (nextProps === returnFiber) {
+ workInProgress = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ break a;
+ }
+ reconcileChildren(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ }
+ workInProgress = workInProgress.child;
+ }
+ return workInProgress;
+ case 26:
+ return (
+ markRef(current, workInProgress),
+ null === current
+ ? (current = getResource(
+ workInProgress.type,
+ null,
+ workInProgress.pendingProps,
+ null
+ ))
+ ? (workInProgress.memoizedState = current)
+ : isHydrating ||
+ ((current = workInProgress.type),
+ (renderLanes = workInProgress.pendingProps),
+ (returnFiber = requiredContext(
+ rootInstanceStackCursor.current
+ )),
+ (returnFiber =
+ getOwnerDocumentFromRootContainer(
+ returnFiber
+ ).createElement(current)),
+ (returnFiber[internalInstanceKey] = workInProgress),
+ (returnFiber[internalPropsKey] = renderLanes),
+ setInitialProperties(returnFiber, current, renderLanes),
+ markNodeAsHoistable(returnFiber),
+ (workInProgress.stateNode = returnFiber))
+ : (workInProgress.memoizedState = getResource(
+ workInProgress.type,
+ current.memoizedProps,
+ workInProgress.pendingProps,
+ current.memoizedState
+ )),
+ null
+ );
+ case 27:
+ return (
+ pushHostContext(workInProgress),
+ null === current &&
+ isHydrating &&
+ ((prevSibling = requiredContext(rootInstanceStackCursor.current)),
+ (returnFiber = getHostContext()),
+ (prevSibling = workInProgress.stateNode =
+ resolveSingletonInstance(
+ workInProgress.type,
+ workInProgress.pendingProps,
+ prevSibling,
+ returnFiber,
+ !1
+ )),
+ didSuspendOrErrorDEV ||
+ ((returnFiber = diffHydratedProperties(
+ prevSibling,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ returnFiber
+ )),
+ null !== returnFiber &&
+ (buildHydrationDiffNode(workInProgress, 0).serverProps =
+ returnFiber)),
+ (hydrationParentFiber = workInProgress),
+ (rootOrSingletonContext = !0),
+ (nextHydratableInstance = getNextHydratable(
+ prevSibling.firstChild
+ ))),
+ (returnFiber = workInProgress.pendingProps.children),
+ null !== current || isHydrating
+ ? reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ )
+ : (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ returnFiber,
+ renderLanes
+ )),
+ markRef(current, workInProgress),
+ workInProgress.child
+ );
+ case 5:
+ return (
+ null === current &&
+ isHydrating &&
+ ((nextProps = getHostContext()),
+ (returnFiber = validateDOMNesting(
+ workInProgress.type,
+ nextProps.ancestorInfo
+ )),
+ (prevSibling = nextHydratableInstance),
+ (nextState = !prevSibling) ||
+ ((nextState = canHydrateInstance(
+ prevSibling,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== nextState
+ ? ((workInProgress.stateNode = nextState),
+ didSuspendOrErrorDEV ||
+ ((nextProps = diffHydratedProperties(
+ nextState,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ nextProps
+ )),
+ null !== nextProps &&
+ (buildHydrationDiffNode(workInProgress, 0).serverProps =
+ nextProps)),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = getNextHydratable(
+ nextState.firstChild
+ )),
+ (rootOrSingletonContext = !1),
+ (nextProps = !0))
+ : (nextProps = !1),
+ (nextState = !nextProps)),
+ nextState &&
+ (returnFiber &&
+ warnNonHydratedInstance(workInProgress, prevSibling),
+ throwOnHydrationMismatch(workInProgress))),
+ pushHostContext(workInProgress),
+ (prevSibling = workInProgress.type),
+ (nextProps = workInProgress.pendingProps),
+ (nextState = null !== current ? current.memoizedProps : null),
+ (returnFiber = nextProps.children),
+ shouldSetTextContent(prevSibling, nextProps)
+ ? (returnFiber = null)
+ : null !== nextState &&
+ shouldSetTextContent(prevSibling, nextState) &&
+ (workInProgress.flags |= 32),
+ null !== workInProgress.memoizedState &&
+ ((prevSibling = renderWithHooks(
+ current,
+ workInProgress,
+ TransitionAwareHostComponent,
+ null,
+ null,
+ renderLanes
+ )),
+ (HostTransitionContext._currentValue = prevSibling)),
+ markRef(current, workInProgress),
+ reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 6:
+ return (
+ null === current &&
+ isHydrating &&
+ ((current = workInProgress.pendingProps),
+ (renderLanes = getHostContext().ancestorInfo.current),
+ (current =
+ null != renderLanes
+ ? validateTextNesting(current, renderLanes.tag)
+ : !0),
+ (renderLanes = nextHydratableInstance),
+ (returnFiber = !renderLanes) ||
+ ((returnFiber = canHydrateTextInstance(
+ renderLanes,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== returnFiber
+ ? ((workInProgress.stateNode = returnFiber),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (returnFiber = !0))
+ : (returnFiber = !1),
+ (returnFiber = !returnFiber)),
+ returnFiber &&
+ (current &&
+ warnNonHydratedInstance(workInProgress, renderLanes),
+ throwOnHydrationMismatch(workInProgress))),
+ null
+ );
+ case 13:
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ case 4:
+ return (
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ ),
+ (returnFiber = workInProgress.pendingProps),
+ null === current
+ ? (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ returnFiber,
+ renderLanes
+ ))
+ : reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 11:
+ return updateForwardRef(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 7:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 8:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 12:
+ return (
+ (workInProgress.flags |= 4),
+ (workInProgress.flags |= 2048),
+ (returnFiber = workInProgress.stateNode),
+ (returnFiber.effectDuration = -0),
+ (returnFiber.passiveEffectDuration = -0),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 10:
+ return (
+ (returnFiber = workInProgress.type),
+ (prevSibling = workInProgress.pendingProps),
+ (nextProps = prevSibling.value),
+ "value" in prevSibling ||
+ hasWarnedAboutUsingNoValuePropOnContextProvider ||
+ ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0),
+ console.error(
+ "The `value` prop is required for the ``. Did you misspell it or forget to pass it?"
+ )),
+ pushProvider(workInProgress, returnFiber, nextProps),
+ reconcileChildren(
+ current,
+ workInProgress,
+ prevSibling.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 9:
+ return (
+ (prevSibling = workInProgress.type._context),
+ (returnFiber = workInProgress.pendingProps.children),
+ "function" !== typeof returnFiber &&
+ console.error(
+ "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."
+ ),
+ prepareToReadContext(workInProgress),
+ (prevSibling = readContext(prevSibling)),
+ (returnFiber = callComponentInDEV(
+ returnFiber,
+ prevSibling,
+ void 0
+ )),
+ (workInProgress.flags |= 1),
+ reconcileChildren(
+ current,
+ workInProgress,
+ returnFiber,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 14:
+ return updateMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 15:
+ return updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 19:
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ case 22:
+ return updateOffscreenComponent(current, workInProgress, renderLanes);
+ case 24:
+ return (
+ prepareToReadContext(workInProgress),
+ (returnFiber = readContext(CacheContext)),
+ null === current
+ ? ((prevSibling = peekCacheFromPool()),
+ null === prevSibling &&
+ ((prevSibling = workInProgressRoot),
+ (nextProps = createCache()),
+ (prevSibling.pooledCache = nextProps),
+ retainCache(nextProps),
+ null !== nextProps &&
+ (prevSibling.pooledCacheLanes |= renderLanes),
+ (prevSibling = nextProps)),
+ (workInProgress.memoizedState = {
+ parent: returnFiber,
+ cache: prevSibling
+ }),
+ initializeUpdateQueue(workInProgress),
+ pushProvider(workInProgress, CacheContext, prevSibling))
+ : (0 !== (current.lanes & renderLanes) &&
+ (cloneUpdateQueue(current, workInProgress),
+ processUpdateQueue(workInProgress, null, null, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction()),
+ (prevSibling = current.memoizedState),
+ (nextProps = workInProgress.memoizedState),
+ prevSibling.parent !== returnFiber
+ ? ((prevSibling = {
+ parent: returnFiber,
+ cache: returnFiber
+ }),
+ (workInProgress.memoizedState = prevSibling),
+ 0 === workInProgress.lanes &&
+ (workInProgress.memoizedState =
+ workInProgress.updateQueue.baseState =
+ prevSibling),
+ pushProvider(workInProgress, CacheContext, returnFiber))
+ : ((returnFiber = nextProps.cache),
+ pushProvider(workInProgress, CacheContext, returnFiber),
+ returnFiber !== prevSibling.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ ))),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 29:
+ throw workInProgress.pendingProps;
}
- currentlyProcessingQueue = null;
- }
- function callCallback(callback, context) {
- if ("function" !== typeof callback)
- throw Error(
- "Invalid argument passed as callback. Expected a function. Instead received: " +
- callback
- );
- callback.call(context);
- }
- function commitHiddenCallbacks(updateQueue, context) {
- var hiddenCallbacks = updateQueue.shared.hiddenCallbacks;
- if (null !== hiddenCallbacks)
- for (
- updateQueue.shared.hiddenCallbacks = null, updateQueue = 0;
- updateQueue < hiddenCallbacks.length;
- updateQueue++
- )
- callCallback(hiddenCallbacks[updateQueue], context);
- }
- function commitCallbacks(updateQueue, context) {
- var callbacks = updateQueue.callbacks;
- if (null !== callbacks)
- for (
- updateQueue.callbacks = null, updateQueue = 0;
- updateQueue < callbacks.length;
- updateQueue++
- )
- callCallback(callbacks[updateQueue], context);
+ throw Error(
+ "Unknown unit of work tag (" +
+ workInProgress.tag +
+ "). This error is likely caused by a bug in React. Please file an issue."
+ );
}
function shouldProfile(current) {
return (current.mode & ProfileMode) !== NoMode;
@@ -12750,6 +12811,7 @@
(parentFiber = parentFiber.sibling);
}
function disappearLayoutEffects(finishedWork) {
+ var prevEffectStart = pushComponentEffectStart();
switch (finishedWork.tag) {
case 0:
case 11:
@@ -12787,6 +12849,17 @@
default:
recursivelyTraverseDisappearLayoutEffects(finishedWork);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
for (parentFiber = parentFiber.child; null !== parentFiber; )
@@ -12799,7 +12872,8 @@
finishedWork,
includeWorkInProgressEffects
) {
- var flags = finishedWork.flags;
+ var prevEffectStart = pushComponentEffectStart(),
+ flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
case 11:
@@ -12914,6 +12988,17 @@
includeWorkInProgressEffects
);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseReappearLayoutEffects(
finishedRoot,
@@ -12986,39 +13071,16 @@
endTime
) {
var prevEffectStart = pushComponentEffectStart();
- if (
- (finishedWork.mode & ProfileMode) !== NoMode &&
+ (finishedWork.mode & ProfileMode) !== NoMode &&
0 < finishedWork.actualStartTime &&
- 0 !== (finishedWork.flags & 1)
- ) {
- var startTime = finishedWork.actualStartTime,
- name = getComponentNameFromFiber(finishedWork);
- if (null !== name && supportsUserTiming) {
- var selfTime = finishedWork.actualDuration;
- if (
- null === finishedWork.alternate ||
- finishedWork.alternate.child !== finishedWork.child
- )
- for (
- var child = finishedWork.child;
- null !== child;
- child = child.sibling
- )
- selfTime -= child.actualDuration;
- reusableComponentDevToolDetails.color =
- 0.5 > selfTime
- ? "primary-light"
- : 10 > selfTime
- ? "primary"
- : 100 > selfTime
- ? "primary-dark"
- : "error";
- reusableComponentOptions.start = startTime;
- reusableComponentOptions.end = endTime;
- performance.measure(name, reusableComponentOptions);
- }
- }
- name = finishedWork.flags;
+ 0 !== (finishedWork.flags & 1) &&
+ logComponentRender(
+ finishedWork,
+ finishedWork.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
case 11:
@@ -13030,11 +13092,16 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ flags & 2048 &&
commitHookPassiveMountEffects(finishedWork, Passive | HasEffect);
break;
case 3:
- startTime = pushNestedEffectDurations();
+ var prevEffectDuration = pushNestedEffectDurations(),
+ wasInHydratedSubtree = inHydratedSubtree;
+ inHydratedSubtree =
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 === (finishedWork.flags & 256);
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13042,7 +13109,8 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ inHydratedSubtree = wasInHydratedSubtree;
+ flags & 2048 &&
((committedLanes = null),
null !== finishedWork.alternate &&
(committedLanes = finishedWork.alternate.memoizedState.cache),
@@ -13051,11 +13119,11 @@
(retainCache(committedTransitions),
null != committedLanes && releaseCache(committedLanes)));
finishedRoot.passiveEffectDuration +=
- popNestedEffectDurations(startTime);
+ popNestedEffectDurations(prevEffectDuration);
break;
case 12:
- if (name & 2048) {
- startTime = pushNestedEffectDurations();
+ if (flags & 2048) {
+ prevEffectDuration = pushNestedEffectDurations();
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13065,7 +13133,7 @@
);
finishedRoot = finishedWork.stateNode;
finishedRoot.passiveEffectDuration +=
- bubbleNestedEffectDurations(startTime);
+ bubbleNestedEffectDurations(prevEffectDuration);
try {
runWithFiberInDEV(
finishedWork,
@@ -13087,12 +13155,73 @@
endTime
);
break;
+ case 13:
+ prevEffectDuration = inHydratedSubtree;
+ flags =
+ null !== finishedWork.alternate
+ ? finishedWork.alternate.memoizedState
+ : null;
+ wasInHydratedSubtree = finishedWork.memoizedState;
+ if (
+ null === flags ||
+ null === flags.dehydrated ||
+ (null !== wasInHydratedSubtree &&
+ null !== wasInHydratedSubtree.dehydrated)
+ )
+ inHydratedSubtree = !1;
+ else if (
+ ((wasInHydratedSubtree = finishedWork.deletions),
+ null !== wasInHydratedSubtree &&
+ 0 < wasInHydratedSubtree.length &&
+ 18 === wasInHydratedSubtree[0].tag)
+ ) {
+ if (
+ ((inHydratedSubtree = !1),
+ (flags = flags.hydrationErrors),
+ null !== flags &&
+ ((wasInHydratedSubtree = finishedWork.actualStartTime),
+ supportsUserTiming))
+ ) {
+ for (var properties = [], i = 0; i < flags.length; i++) {
+ var error$jscomp$0 = flags[i].value;
+ properties.push([
+ "Error",
+ "object" === typeof error$jscomp$0 &&
+ null !== error$jscomp$0 &&
+ "string" === typeof error$jscomp$0.message
+ ? String(error$jscomp$0.message)
+ : String(error$jscomp$0)
+ ]);
+ }
+ performance.measure("Suspense", {
+ start: wasInHydratedSubtree,
+ end: endTime,
+ detail: {
+ devtools: {
+ color: "error",
+ track: COMPONENTS_TRACK,
+ tooltipText: "Hydration failed",
+ properties: properties
+ }
+ }
+ });
+ }
+ } else inHydratedSubtree = !0;
+ recursivelyTraversePassiveMountEffects(
+ finishedRoot,
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
+ inHydratedSubtree = prevEffectDuration;
+ break;
case 23:
break;
case 22:
- startTime = finishedWork.stateNode;
+ prevEffectDuration = finishedWork.stateNode;
null !== finishedWork.memoizedState
- ? startTime._visibility & OffscreenPassiveEffectsConnected
+ ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected
? recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13102,9 +13231,12 @@
)
: recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
)
- : startTime._visibility & OffscreenPassiveEffectsConnected
+ : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected
? recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -13112,15 +13244,17 @@
committedTransitions,
endTime
)
- : ((startTime._visibility |= OffscreenPassiveEffectsConnected),
+ : ((prevEffectDuration._visibility |=
+ OffscreenPassiveEffectsConnected),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
finishedWork,
committedLanes,
committedTransitions,
- 0 !== (finishedWork.subtreeFlags & 10256)
+ 0 !== (finishedWork.subtreeFlags & 10256),
+ endTime
));
- name & 2048 &&
+ flags & 2048 &&
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork
@@ -13134,7 +13268,7 @@
committedTransitions,
endTime
);
- name & 2048 &&
+ flags & 2048 &&
commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
break;
default:
@@ -13163,28 +13297,43 @@
parentFiber,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
) {
includeWorkInProgressEffects =
includeWorkInProgressEffects &&
0 !== (parentFiber.subtreeFlags & 10256);
- for (parentFiber = parentFiber.child; null !== parentFiber; )
+ for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ var nextSibling = parentFiber.sibling;
reconnectPassiveEffects(
finishedRoot,
parentFiber,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
- ),
- (parentFiber = parentFiber.sibling);
+ includeWorkInProgressEffects,
+ null !== nextSibling ? nextSibling.actualStartTime : endTime
+ );
+ parentFiber = nextSibling;
+ }
}
function reconnectPassiveEffects(
finishedRoot,
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
) {
+ var prevEffectStart = pushComponentEffectStart();
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 < finishedWork.actualStartTime &&
+ 0 !== (finishedWork.flags & 1) &&
+ logComponentRender(
+ finishedWork,
+ finishedWork.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
var flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
@@ -13195,7 +13344,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
commitHookPassiveMountEffects(finishedWork, Passive);
break;
@@ -13210,11 +13360,15 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
)
: recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
)
: ((_instance2._visibility |= OffscreenPassiveEffectsConnected),
recursivelyTraverseReconnectPassiveEffects(
@@ -13222,7 +13376,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
));
includeWorkInProgressEffects &&
flags & 2048 &&
@@ -13237,7 +13392,8 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
includeWorkInProgressEffects &&
flags & 2048 &&
@@ -13249,49 +13405,82 @@
finishedWork,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
}
+ (finishedWork.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
}
function recursivelyTraverseAtomicPassiveEffects(
finishedRoot$jscomp$0,
- parentFiber
+ parentFiber,
+ committedLanes$jscomp$0,
+ committedTransitions$jscomp$0,
+ endTime$jscomp$0
) {
if (parentFiber.subtreeFlags & 10256)
- for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ for (var child = parentFiber.child; null !== child; ) {
+ parentFiber = child.sibling;
var finishedRoot = finishedRoot$jscomp$0,
- finishedWork = parentFiber,
- flags = finishedWork.flags;
- switch (finishedWork.tag) {
+ committedLanes = committedLanes$jscomp$0,
+ committedTransitions = committedTransitions$jscomp$0,
+ endTime =
+ null !== parentFiber
+ ? parentFiber.actualStartTime
+ : endTime$jscomp$0;
+ (child.mode & ProfileMode) !== NoMode &&
+ 0 < child.actualStartTime &&
+ 0 !== (child.flags & 1) &&
+ logComponentRender(
+ child,
+ child.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = child.flags;
+ switch (child.tag) {
case 22:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
flags & 2048 &&
- commitOffscreenPassiveMountEffects(
- finishedWork.alternate,
- finishedWork
- );
+ commitOffscreenPassiveMountEffects(child.alternate, child);
break;
case 24:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
flags & 2048 &&
- commitCachePassiveMountEffect(
- finishedWork.alternate,
- finishedWork
- );
+ commitCachePassiveMountEffect(child.alternate, child);
break;
default:
recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
);
}
- parentFiber = parentFiber.sibling;
+ child = parentFiber;
}
}
function recursivelyAccumulateSuspenseyCommit(parentFiber) {
@@ -13465,11 +13654,13 @@
}
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
deletedSubtreeRoot,
- nearestMountedAncestor
+ nearestMountedAncestor$jscomp$0
) {
for (; null !== nextEffect; ) {
var fiber = nextEffect,
- current = fiber;
+ current = fiber,
+ nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
+ prevEffectStart = pushComponentEffectStart();
switch (current.tag) {
case 0:
case 11:
@@ -13484,30 +13675,42 @@
case 22:
null !== current.memoizedState &&
null !== current.memoizedState.cachePool &&
- ((current = current.memoizedState.cachePool.pool),
- null != current && retainCache(current));
+ ((nearestMountedAncestor = current.memoizedState.cachePool.pool),
+ null != nearestMountedAncestor &&
+ retainCache(nearestMountedAncestor));
break;
case 24:
releaseCache(current.memoizedState.cache);
}
+ (current.mode & ProfileMode) !== NoMode &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ current,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
current = fiber.child;
if (null !== current) (current.return = fiber), (nextEffect = current);
else
a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
current = nextEffect;
- var sibling = current.sibling,
- returnFiber = current.return;
+ prevEffectStart = current.sibling;
+ nearestMountedAncestor = current.return;
detachFiberAfterEffects(current);
if (current === fiber) {
nextEffect = null;
break a;
}
- if (null !== sibling) {
- sibling.return = returnFiber;
- nextEffect = sibling;
+ if (null !== prevEffectStart) {
+ prevEffectStart.return = nearestMountedAncestor;
+ nextEffect = prevEffectStart;
break a;
}
- nextEffect = returnFiber;
+ nextEffect = nearestMountedAncestor;
}
}
}
@@ -13998,16 +14201,16 @@
case 1:
return bubbleProperties(workInProgress), null;
case 3:
- newProps = workInProgress.stateNode;
- renderLanes = null;
- null !== current && (renderLanes = current.memoizedState.cache);
- workInProgress.memoizedState.cache !== renderLanes &&
+ renderLanes = workInProgress.stateNode;
+ newProps = null;
+ null !== current && (newProps = current.memoizedState.cache);
+ workInProgress.memoizedState.cache !== newProps &&
(workInProgress.flags |= 2048);
popProvider(CacheContext, workInProgress);
popHostContainer(workInProgress);
- newProps.pendingContext &&
- ((newProps.context = newProps.pendingContext),
- (newProps.pendingContext = null));
+ renderLanes.pendingContext &&
+ ((renderLanes.context = renderLanes.pendingContext),
+ (renderLanes.pendingContext = null));
if (null === current || null === current.child)
popHydrationState(workInProgress)
? (emitPendingHydrationWarnings(), markUpdate(workInProgress))
@@ -14015,9 +14218,7 @@
(current.memoizedState.isDehydrated &&
0 === (workInProgress.flags & 256)) ||
((workInProgress.flags |= 1024),
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)));
+ upgradeHydrationErrorsToRecoverable());
bubbleProperties(workInProgress);
return null;
case 26:
@@ -14226,9 +14427,9 @@
renderLanes = getHostContext();
if (popHydrationState(workInProgress)) {
current = workInProgress.stateNode;
- newProps = workInProgress.memoizedProps;
+ renderLanes = workInProgress.memoizedProps;
_type = !didSuspendOrErrorDEV;
- renderLanes = null;
+ newProps = null;
var returnFiber = hydrationParentFiber;
if (null !== returnFiber)
switch (returnFiber.tag) {
@@ -14236,8 +14437,8 @@
_type &&
((_type = diffHydratedTextForDevWarnings(
current,
- newProps,
- renderLanes
+ renderLanes,
+ newProps
)),
null !== _type &&
(buildHydrationDiffNode(workInProgress, 0).serverProps =
@@ -14245,12 +14446,12 @@
break;
case 27:
case 5:
- (renderLanes = returnFiber.memoizedProps),
+ (newProps = returnFiber.memoizedProps),
_type &&
((_type = diffHydratedTextForDevWarnings(
current,
- newProps,
- renderLanes
+ renderLanes,
+ newProps
)),
null !== _type &&
(buildHydrationDiffNode(
@@ -14260,10 +14461,10 @@
}
current[internalInstanceKey] = workInProgress;
current =
- current.nodeValue === newProps ||
- (null !== renderLanes &&
- !0 === renderLanes.suppressHydrationWarning) ||
- checkForUnmatchedText(current.nodeValue, newProps)
+ current.nodeValue === renderLanes ||
+ (null !== newProps &&
+ !0 === newProps.suppressHydrationWarning) ||
+ checkForUnmatchedText(current.nodeValue, renderLanes)
? !0
: !1;
current || throwOnHydrationMismatch(workInProgress);
@@ -14323,9 +14524,10 @@
_type.treeBaseDuration));
_type = !1;
} else
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)),
+ (_type = upgradeHydrationErrorsToRecoverable()),
+ null !== current &&
+ null !== current.memoizedState &&
+ (current.memoizedState.hydrationErrors = _type),
(_type = !0);
if (!_type) {
if (workInProgress.flags & 256)
@@ -14342,27 +14544,27 @@
transferActualDuration(workInProgress),
workInProgress
);
- newProps = null !== newProps;
+ renderLanes = null !== newProps;
current = null !== current && null !== current.memoizedState;
- newProps &&
- ((renderLanes = workInProgress.child),
+ renderLanes &&
+ ((newProps = workInProgress.child),
(_type = null),
- null !== renderLanes.alternate &&
- null !== renderLanes.alternate.memoizedState &&
- null !== renderLanes.alternate.memoizedState.cachePool &&
- (_type = renderLanes.alternate.memoizedState.cachePool.pool),
+ null !== newProps.alternate &&
+ null !== newProps.alternate.memoizedState &&
+ null !== newProps.alternate.memoizedState.cachePool &&
+ (_type = newProps.alternate.memoizedState.cachePool.pool),
(returnFiber = null),
- null !== renderLanes.memoizedState &&
- null !== renderLanes.memoizedState.cachePool &&
- (returnFiber = renderLanes.memoizedState.cachePool.pool),
- returnFiber !== _type && (renderLanes.flags |= 2048));
- newProps !== current &&
- newProps &&
+ null !== newProps.memoizedState &&
+ null !== newProps.memoizedState.cachePool &&
+ (returnFiber = newProps.memoizedState.cachePool.pool),
+ returnFiber !== _type && (newProps.flags |= 2048));
+ renderLanes !== current &&
+ renderLanes &&
(workInProgress.child.flags |= 8192);
scheduleRetryEffect(workInProgress, workInProgress.updateQueue);
bubbleProperties(workInProgress);
(workInProgress.mode & ProfileMode) !== NoMode &&
- newProps &&
+ renderLanes &&
((current = workInProgress.child),
null !== current &&
(workInProgress.treeBaseDuration -= current.treeBaseDuration));
@@ -14406,9 +14608,13 @@
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
current = renderLanes;
- for (newProps = workInProgress.child; null !== newProps; )
- resetWorkInProgress(newProps, current),
- (newProps = newProps.sibling);
+ for (
+ renderLanes = workInProgress.child;
+ null !== renderLanes;
+
+ )
+ resetWorkInProgress(renderLanes, current),
+ (renderLanes = renderLanes.sibling);
push(
suspenseStackCursor,
(suspenseStackCursor.current &
@@ -14496,27 +14702,27 @@
workInProgress.subtreeFlags & 6 &&
(workInProgress.flags |= 8192))
: bubbleProperties(workInProgress),
- (newProps = workInProgress.updateQueue),
- null !== newProps &&
- scheduleRetryEffect(workInProgress, newProps.retryQueue),
- (newProps = null),
+ (renderLanes = workInProgress.updateQueue),
+ null !== renderLanes &&
+ scheduleRetryEffect(workInProgress, renderLanes.retryQueue),
+ (renderLanes = null),
null !== current &&
null !== current.memoizedState &&
null !== current.memoizedState.cachePool &&
- (newProps = current.memoizedState.cachePool.pool),
- (renderLanes = null),
+ (renderLanes = current.memoizedState.cachePool.pool),
+ (newProps = null),
null !== workInProgress.memoizedState &&
null !== workInProgress.memoizedState.cachePool &&
- (renderLanes = workInProgress.memoizedState.cachePool.pool),
- renderLanes !== newProps && (workInProgress.flags |= 2048),
+ (newProps = workInProgress.memoizedState.cachePool.pool),
+ newProps !== renderLanes && (workInProgress.flags |= 2048),
null !== current && pop(resumedCache, workInProgress),
null
);
case 24:
return (
- (newProps = null),
- null !== current && (newProps = current.memoizedState.cache),
- workInProgress.memoizedState.cache !== newProps &&
+ (renderLanes = null),
+ null !== current && (renderLanes = current.memoizedState.cache),
+ workInProgress.memoizedState.cache !== renderLanes &&
(workInProgress.flags |= 2048),
popProvider(CacheContext, workInProgress),
bubbleProperties(workInProgress),
@@ -14838,23 +15044,20 @@
a: {
startTime = root;
yieldDuration = renderWasConcurrent;
- var errorRetryLanes$jscomp$0 = errorRetryLanes;
renderWasConcurrent = workInProgressRootConcurrentErrors;
- (errorRetryLanes =
- startTime.current.memoizedState.isDehydrated) &&
- (prepareFreshStack(
- startTime,
- errorRetryLanes$jscomp$0
- ).flags |= 256);
- errorRetryLanes$jscomp$0 = renderRootSync(
+ var wasRootDehydrated =
+ startTime.current.memoizedState.isDehydrated;
+ wasRootDehydrated &&
+ (prepareFreshStack(startTime, errorRetryLanes).flags |= 256);
+ errorRetryLanes = renderRootSync(
startTime,
- errorRetryLanes$jscomp$0,
+ errorRetryLanes,
!1
);
- if (errorRetryLanes$jscomp$0 !== RootErrored) {
+ if (errorRetryLanes !== RootErrored) {
if (
workInProgressRootDidAttachPingListener &&
- !errorRetryLanes
+ !wasRootDehydrated
) {
startTime.errorRecoveryDisabledLanes |= yieldDuration;
workInProgressRootInterleavedUpdatedLanes |= yieldDuration;
@@ -14863,9 +15066,15 @@
}
startTime = workInProgressRootRecoverableErrors;
workInProgressRootRecoverableErrors = renderWasConcurrent;
- null !== startTime && queueRecoverableErrors(startTime);
+ null !== startTime &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = startTime)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ startTime
+ ));
}
- yieldDuration = errorRetryLanes$jscomp$0;
+ yieldDuration = errorRetryLanes;
}
renderWasConcurrent = !1;
if (yieldDuration !== RootErrored) continue;
@@ -14890,7 +15099,7 @@
if ((lanes & 4194176) !== lanes) break;
case RootSuspendedAtTheShell:
setCurrentTrackFromLanes(lanes);
- logSuspendedRenderPhase(renderStartTime, startTime);
+ logSuspendedRenderPhase(renderStartTime, startTime, lanes);
finalizeRender(lanes, startTime);
yieldEndTime = lanes;
0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60)
@@ -14990,14 +15199,6 @@
} while (1);
ensureRootIsScheduled(root);
}
- function queueRecoverableErrors(errors) {
- null === workInProgressRootRecoverableErrors
- ? (workInProgressRootRecoverableErrors = errors)
- : workInProgressRootRecoverableErrors.push.apply(
- workInProgressRootRecoverableErrors,
- errors
- );
- }
function commitRootWhenReady(
root,
finishedWork,
@@ -15160,14 +15361,26 @@
workInProgressRootExitStatus === RootSuspended ||
workInProgressRootExitStatus === RootSuspendedWithDelay
)
- logSuspendedRenderPhase(previousRenderStartTime, renderStartTime);
+ logSuspendedRenderPhase(
+ previousRenderStartTime,
+ renderStartTime,
+ lanes
+ );
else {
var endTime = renderStartTime;
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Interrupted Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prewarm"
+ : (lanes & 201326677) === lanes
+ ? "Interrupted Hydration"
+ : "Interrupted Render",
+ reusableLaneOptions
+ ));
}
finalizeRender(workInProgressRootRenderLanes, renderStartTime);
}
@@ -15188,7 +15401,8 @@
? endTime
: 0 <= previousRenderStartTime
? previousRenderStartTime
- : renderStartTime
+ : renderStartTime,
+ lanes
));
var eventType = blockingEventType,
eventIsRepeat = blockingEventIsRepeat,
@@ -15210,7 +15424,10 @@
reusableLaneOptions
)),
0 < previousRenderStartTime &&
- ((reusableLaneDevToolDetails.color = "primary-light"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes
+ ? "tertiary-light"
+ : "primary-light"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = renderStartTime$jscomp$0),
performance.measure("Blocked", reusableLaneOptions)));
@@ -15239,7 +15456,8 @@
? eventType
: 0 <= endTime
? endTime
- : renderStartTime
+ : renderStartTime,
+ lanes
));
eventIsRepeat = transitionEventType;
renderStartTime$jscomp$0 = transitionEventIsRepeat;
@@ -15324,7 +15542,7 @@
return previousRenderStartTime;
}
function handleThrow(root, thrownValue) {
- currentlyRenderingFiber$1 = null;
+ currentlyRenderingFiber = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
ReactSharedInternals.getCurrentStack = null;
isRendering = !1;
@@ -15888,7 +16106,22 @@
completedRenderStartTime,
completedRenderEndTime
)
- : logRenderPhase(completedRenderStartTime, completedRenderEndTime);
+ : null !== recoverableErrors
+ ? logRecoveredRenderPhase(
+ completedRenderStartTime,
+ completedRenderEndTime,
+ didIncludeRenderPhaseUpdate,
+ recoverableErrors,
+ null !== finishedWork &&
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 !== (finishedWork.flags & 256)
+ )
+ : logRenderPhase(
+ completedRenderStartTime,
+ completedRenderEndTime,
+ didIncludeRenderPhaseUpdate
+ );
if (null === finishedWork) return null;
0 === didIncludeRenderPhaseUpdate &&
console.error(
@@ -15900,9 +16133,6 @@
throw Error(
"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
);
- root.callbackNode = null;
- root.callbackPriority = 0;
- root.cancelPendingCommit = null;
exitStatus = finishedWork.lanes | finishedWork.childLanes;
exitStatus |= concurrentlyUpdatedLanes;
markRootFinished(
@@ -15916,19 +16146,25 @@
root === workInProgressRoot &&
((workInProgress = workInProgressRoot = null),
(workInProgressRootRenderLanes = 0));
- (0 === finishedWork.actualDuration &&
- 0 === (finishedWork.subtreeFlags & 10256) &&
- 0 === (finishedWork.flags & 10256)) ||
- rootDoesHavePassiveEffects ||
- ((rootDoesHavePassiveEffects = !0),
- (pendingPassiveEffectsRemainingLanes = exitStatus),
- (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
- (pendingPassiveTransitions = transitions),
- scheduleCallback$1(NormalPriority$1, function () {
- schedulerEvent = window.event;
- flushPassiveEffects(!0);
- return null;
- }));
+ spawnedLane = !1;
+ 0 !== finishedWork.actualDuration ||
+ 0 !== (finishedWork.subtreeFlags & 10256) ||
+ 0 !== (finishedWork.flags & 10256)
+ ? ((spawnedLane = !0),
+ (pendingPassiveEffectsRemainingLanes = exitStatus),
+ (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
+ (pendingPassiveTransitions = transitions),
+ (root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null),
+ scheduleCallback$1(NormalPriority$1, function () {
+ schedulerEvent = window.event;
+ flushPassiveEffects(!0);
+ return null;
+ }))
+ : ((root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null));
commitStartTime = now();
suspendedCommitReason === SUSPENDED_COMMIT
? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime)
@@ -15938,9 +16174,9 @@
0 !== (finishedWork.subtreeFlags & 15990) || transitions
? ((transitions = ReactSharedInternals.T),
(ReactSharedInternals.T = null),
- (spawnedLane = ReactDOMSharedInternals.p),
+ (updatedLanes = ReactDOMSharedInternals.p),
(ReactDOMSharedInternals.p = DiscreteEventPriority),
- (updatedLanes = executionContext),
+ (suspendedRetryLanes = executionContext),
(executionContext |= CommitContext),
commitBeforeMutationEffects(root, finishedWork),
commitMutationEffects(
@@ -15954,8 +16190,8 @@
(root.current = finishedWork),
commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate),
requestPaint(),
- (executionContext = updatedLanes),
- (ReactDOMSharedInternals.p = spawnedLane),
+ (executionContext = suspendedRetryLanes),
+ (ReactDOMSharedInternals.p = updatedLanes),
(ReactSharedInternals.T = transitions))
: (root.current = finishedWork);
commitEndTime = now();
@@ -15965,8 +16201,8 @@
: commitStartTime,
commitEndTime
);
- (suspendedCommitReason = rootDoesHavePassiveEffects)
- ? ((rootDoesHavePassiveEffects = !1),
+ (suspendedCommitReason = spawnedLane)
+ ? ((spawnedLane = !1),
(rootWithPendingPassiveEffects = root),
(pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate))
: (releaseRootPooledCache(root, exitStatus),
@@ -15978,7 +16214,6 @@
onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel);
isDevToolsPresent && root.memoizedUpdaters.clear();
onCommitRoot();
- ensureRootIsScheduled(root);
if (null !== recoverableErrors)
for (
renderPriorityLevel = root.onRecoverableError,
@@ -15995,6 +16230,7 @@
exitStatus
);
0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects();
+ ensureRootIsScheduled(root);
exitStatus = root.pendingLanes;
0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42)
? ((nestedUpdateScheduled = !0),
@@ -16326,7 +16562,7 @@
shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber),
reappearLayoutEffects(root, fiber.alternate, fiber, !1),
shouldDoubleInvokePassiveEffects &&
- reconnectPassiveEffects(root, fiber, 0, null, !1);
+ reconnectPassiveEffects(root, fiber, 0, null, !1, 0);
} finally {
setIsStrictModeForDevtools(!1);
}
@@ -18758,7 +18994,7 @@
console.error(
"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
);
- else if (canDiffStyleForHydrationWarning) {
+ else {
var clientValue;
var delimiter = (clientValue = ""),
styleName;
@@ -19177,42 +19413,36 @@
}
case "src":
case "href":
- if (
- !(
- "" !== propKey ||
- ("a" === tag && "href" === value) ||
- ("object" === tag && "data" === value)
- )
- ) {
- "src" === value
- ? console.error(
- 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
- value,
- value
- )
- : console.error(
- 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
- value,
- value
- );
- hydrateSanitizedAttribute(
- domElement,
- value,
- value,
- null,
- extraAttributes,
- serverDifferences
- );
- continue;
- }
- hydrateSanitizedAttribute(
- domElement,
- value,
- value,
- propKey,
- extraAttributes,
- serverDifferences
- );
+ "" !== propKey ||
+ ("a" === tag && "href" === value) ||
+ ("object" === tag && "data" === value)
+ ? hydrateSanitizedAttribute(
+ domElement,
+ value,
+ value,
+ propKey,
+ extraAttributes,
+ serverDifferences
+ )
+ : ("src" === value
+ ? console.error(
+ 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
+ value,
+ value
+ )
+ : console.error(
+ 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
+ value,
+ value
+ ),
+ hydrateSanitizedAttribute(
+ domElement,
+ value,
+ value,
+ null,
+ extraAttributes,
+ serverDifferences
+ ));
continue;
case "action":
case "formAction":
@@ -21347,8 +21577,12 @@
queuedTarget.blockedOn = targetInst;
runWithPriority(queuedTarget.priority, function () {
if (13 === nearestMounted.tag) {
- var lane = requestUpdateLane(nearestMounted),
- root = enqueueConcurrentRenderForLane(nearestMounted, lane);
+ var lane = requestUpdateLane(nearestMounted);
+ lane = getBumpedLaneForHydrationByLane(lane);
+ var root = enqueueConcurrentRenderForLane(
+ nearestMounted,
+ lane
+ );
null !== root &&
scheduleUpdateOnFiber(root, nearestMounted, lane);
markRetryLaneIfNotHydrated(nearestMounted, lane);
@@ -21592,7 +21826,6 @@
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy");
Symbol.for("react.scope");
- Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker");
@@ -21676,11 +21909,6 @@
allNativeEvents = new Set(),
registrationNameDependencies = {},
possibleRegistrationNames = {},
- canUseDOM = !(
- "undefined" === typeof window ||
- "undefined" === typeof window.document ||
- "undefined" === typeof window.document.createElement
- ),
hasReadOnlyValue = {
button: !0,
checkbox: !0,
@@ -21727,8 +21955,6 @@
containerTagInScope: null
},
didWarn = {},
- MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML",
- SVG_NAMESPACE = "http://www.w3.org/2000/svg",
shorthandToLonghand = {
animation:
"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(
@@ -21879,6 +22105,8 @@
" "
)
),
+ MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML",
+ SVG_NAMESPACE = "http://www.w3.org/2000/svg",
aliases = new Map([
["acceptCharset", "accept-charset"],
["htmlFor", "for"],
@@ -22527,6 +22755,11 @@
restoreTarget = null,
restoreQueue = null,
isInsideEventHandler = !1,
+ canUseDOM = !(
+ "undefined" === typeof window ||
+ "undefined" === typeof window.document ||
+ "undefined" === typeof window.document.createElement
+ ),
passiveBrowserEventsSupported = !1;
if (canUseDOM)
try {
@@ -22854,19 +23087,21 @@
supportsUserTiming =
"undefined" !== typeof performance &&
"function" === typeof performance.measure,
+ COMPONENTS_TRACK = "Components \u269b",
reusableComponentDevToolDetails = {
color: "primary",
- track: "Components \u269b"
+ track: COMPONENTS_TRACK
},
reusableComponentOptions = {
start: -0,
end: -0,
detail: { devtools: reusableComponentDevToolDetails }
},
+ LANES_TRACK_GROUP = "Scheduler \u269b",
reusableLaneDevToolDetails = {
color: "primary",
track: "Blocking",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
},
reusableLaneOptions = {
start: -0,
@@ -22874,42 +23109,42 @@
detail: { devtools: reusableLaneDevToolDetails }
},
blockingLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Blocking",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
transitionLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Transition",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
suspenseLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Suspense",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
idleLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
track: "Idle",
- trackGroup: "Scheduler \u269b"
+ trackGroup: LANES_TRACK_GROUP
}
}
},
@@ -22955,6 +23190,59 @@
yieldStartTime = -1.1,
currentUpdateIsNested = !1,
nestedUpdateScheduled = !1,
+ valueCursor = createCursor(null);
+ var rendererCursorDEV = createCursor(null);
+ var rendererSigil = {};
+ var currentlyRenderingFiber$1 = null,
+ lastContextDependency = null,
+ isDisallowedContextReadInDEV = !1,
+ currentEntangledListeners = null,
+ currentEntangledPendingCount = 0,
+ currentEntangledLane = 0,
+ currentEntangledActionThenable = null,
+ UpdateState = 0,
+ ReplaceState = 1,
+ ForceUpdate = 2,
+ CaptureUpdate = 3,
+ hasForceUpdate = !1;
+ var didWarnUpdateInsideUpdate = !1;
+ var currentlyProcessingQueue = null;
+ var didReadFromEntangledAsyncAction = !1,
+ NoFlags = 0,
+ HasEffect = 1,
+ Insertion = 2,
+ Layout = 4,
+ Passive = 8,
+ AbortControllerLocal =
+ "undefined" !== typeof AbortController
+ ? AbortController
+ : function () {
+ var listeners = [],
+ signal = (this.signal = {
+ aborted: !1,
+ addEventListener: function (type, listener) {
+ listeners.push(listener);
+ }
+ });
+ this.abort = function () {
+ signal.aborted = !0;
+ listeners.forEach(function (listener) {
+ return listener();
+ });
+ };
+ },
+ scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
+ NormalPriority = Scheduler.unstable_NormalPriority,
+ CacheContext = {
+ $$typeof: REACT_CONTEXT_TYPE,
+ Consumer: null,
+ Provider: null,
+ _currentValue: null,
+ _currentValue2: null,
+ _threadCount: 0,
+ _currentRenderer: null,
+ _currentRenderer2: null
+ },
ReactStrictModeWarnings = {
recordUnsafeLifecycleWarnings: function () {},
flushPendingUnsafeLifecycleWarnings: function () {},
@@ -23149,7 +23437,79 @@
pendingUNSAFE_ComponentWillUpdateWarnings = [];
pendingLegacyContextWarning = new Map();
};
- var CapturedStacks = new WeakMap(),
+ var fakeInternalInstance = {};
+ var didWarnAboutStateAssignmentForComponent = new Set();
+ var didWarnAboutUninitializedState = new Set();
+ var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
+ var didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
+ var didWarnAboutDirectlyAssigningPropsToState = new Set();
+ var didWarnAboutUndefinedDerivedState = new Set();
+ var didWarnAboutContextTypes$1 = new Set();
+ var didWarnAboutChildContextTypes = new Set();
+ var didWarnAboutInvalidateContextType = new Set();
+ var didWarnOnInvalidCallback = new Set();
+ Object.freeze(fakeInternalInstance);
+ var classComponentUpdater = {
+ isMounted: function (component) {
+ var owner = current;
+ if (null !== owner && isRendering && 1 === owner.tag) {
+ var instance = owner.stateNode;
+ instance._warnedAboutRefsInRender ||
+ console.error(
+ "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",
+ getComponentNameFromFiber(owner) || "A component"
+ );
+ instance._warnedAboutRefsInRender = !0;
+ }
+ return (component = component._reactInternals)
+ ? getNearestMountedFiber(component) === component
+ : !1;
+ },
+ enqueueSetState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.payload = payload;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueReplaceState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.tag = ReplaceState;
+ update.payload = payload;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueForceUpdate: function (inst, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(inst),
+ update = createUpdate(lane);
+ update.tag = ForceUpdate;
+ void 0 !== callback &&
+ null !== callback &&
+ (warnOnInvalidCallback(callback), (update.callback = callback));
+ callback = enqueueUpdate(inst, update, lane);
+ null !== callback &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(callback, inst, lane),
+ entangleTransitions(callback, inst, lane));
+ }
+ },
+ CapturedStacks = new WeakMap(),
forkStack = [],
forkStackIndex = 0,
treeForkProvider = null,
@@ -23164,68 +23524,29 @@
isHydrating = !1,
didSuspendOrErrorDEV = !1,
hydrationDiffRootDEV = null,
- hydrationErrors = null,
- rootOrSingletonContext = !1,
- HydrationMismatchException = Error(
- "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
- ),
- SuspenseException = Error(
- "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
- ),
- SuspenseyCommitException = Error(
- "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
- ),
- SuspenseActionException = Error(
- "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
- ),
- noopSuspenseyCommitThenable = {
- then: function () {
- console.error(
- 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
- );
- }
- },
- suspendedThenable = null,
- needsToResetSuspendedThenableDEV = !1,
- NoFlags = 0,
- HasEffect = 1,
- Insertion = 2,
- Layout = 4,
- Passive = 8,
- AbortControllerLocal =
- "undefined" !== typeof AbortController
- ? AbortController
- : function () {
- var listeners = [],
- signal = (this.signal = {
- aborted: !1,
- addEventListener: function (type, listener) {
- listeners.push(listener);
- }
- });
- this.abort = function () {
- signal.aborted = !0;
- listeners.forEach(function (listener) {
- return listener();
- });
- };
- },
- scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
- NormalPriority = Scheduler.unstable_NormalPriority,
- CacheContext = {
- $$typeof: REACT_CONTEXT_TYPE,
- Consumer: null,
- Provider: null,
- _currentValue: null,
- _currentValue2: null,
- _threadCount: 0,
- _currentRenderer: null,
- _currentRenderer2: null
+ hydrationErrors = null,
+ rootOrSingletonContext = !1,
+ HydrationMismatchException = Error(
+ "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
+ ),
+ SuspenseException = Error(
+ "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
+ ),
+ SuspenseyCommitException = Error(
+ "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."
+ ),
+ SuspenseActionException = Error(
+ "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."
+ ),
+ noopSuspenseyCommitThenable = {
+ then: function () {
+ console.error(
+ 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.'
+ );
+ }
},
- currentEntangledListeners = null,
- currentEntangledPendingCount = 0,
- currentEntangledLane = 0,
- currentEntangledActionThenable = null,
+ suspendedThenable = null,
+ needsToResetSuspendedThenableDEV = !1,
currentTreeHiddenStackCursor = createCursor(null),
prevEntangledRenderLanesCursor = createCursor(0),
prevOnStartTransitionFinish = ReactSharedInternals.S;
@@ -23259,7 +23580,7 @@
var didWarnAboutAsyncClientComponent = new Set();
var didWarnAboutUseFormState = new Set();
var renderLanes = 0,
- currentlyRenderingFiber$1 = null,
+ currentlyRenderingFiber = null,
currentHook = null,
workInProgressHook = null,
didScheduleRenderPhaseUpdate = !1,
@@ -23273,36 +23594,33 @@
currentHookNameInDev = null,
hookTypesDev = null,
hookTypesUpdateIndexDev = -1,
- ignorePreviousDependencies = !1;
- var createFunctionComponentUpdateQueue = function () {
- return { lastEffect: null, events: null, stores: null, memoCache: null };
- };
- var ContextOnlyDispatcher = {
- readContext: readContext,
- use: use,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useInsertionEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError,
- useSyncExternalStore: throwInvalidHookError,
- useId: throwInvalidHookError
- };
- ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
- ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
+ ignorePreviousDependencies = !1,
+ ContextOnlyDispatcher = {
+ readContext: readContext,
+ use: use,
+ useCallback: throwInvalidHookError,
+ useContext: throwInvalidHookError,
+ useEffect: throwInvalidHookError,
+ useImperativeHandle: throwInvalidHookError,
+ useLayoutEffect: throwInvalidHookError,
+ useInsertionEffect: throwInvalidHookError,
+ useMemo: throwInvalidHookError,
+ useReducer: throwInvalidHookError,
+ useRef: throwInvalidHookError,
+ useState: throwInvalidHookError,
+ useDebugValue: throwInvalidHookError,
+ useDeferredValue: throwInvalidHookError,
+ useTransition: throwInvalidHookError,
+ useSyncExternalStore: throwInvalidHookError,
+ useId: throwInvalidHookError,
+ useHostTransitionStatus: throwInvalidHookError,
+ useFormState: throwInvalidHookError,
+ useActionState: throwInvalidHookError,
+ useOptimistic: throwInvalidHookError,
+ useMemoCache: throwInvalidHookError,
+ useCacheRefresh: throwInvalidHookError
+ };
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
- ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
- ContextOnlyDispatcher.useFormState = throwInvalidHookError;
- ContextOnlyDispatcher.useActionState = throwInvalidHookError;
- ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
var HooksDispatcherOnMountInDEV = null,
HooksDispatcherOnMountWithHookTypesInDEV = null,
HooksDispatcherOnUpdateInDEV = null,
@@ -23421,39 +23739,35 @@
mountHookTypesDev();
return mountId();
},
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ mountHookTypesDev();
+ warnOnUseFormStateInDev();
+ return mountActionState(action, initialState);
+ },
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ mountHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ mountHookTypesDev();
+ return mountOptimistic(passthrough);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
mountHookTypesDev();
return mountRefresh();
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ mountHookTypesDev();
+ return mountEvent(callback);
}
};
- HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- mountHookTypesDev();
- return mountEvent(callback);
- };
- HooksDispatcherOnMountInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) {
- currentHookNameInDev = "useFormState";
- mountHookTypesDev();
- warnOnUseFormStateInDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) {
- currentHookNameInDev = "useOptimistic";
- mountHookTypesDev();
- return mountOptimistic(passthrough);
- };
HooksDispatcherOnMountWithHookTypesInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23559,46 +23873,35 @@
updateHookTypesDev();
return mountId();
},
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return mountOptimistic(passthrough);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return mountRefresh();
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return mountEvent(callback);
}
};
- HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function (
- callback
- ) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return mountEvent(callback);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return mountActionState(action, initialState);
- };
- HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function (
- passthrough
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return mountOptimistic(passthrough);
- };
HooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23704,39 +24007,35 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return updateActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return updateActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return updateOptimistic(passthrough, reducer);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return updateEvent(callback);
}
};
- HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return updateEvent(callback);
- };
- HooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnUpdateInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return updateActionState(action);
- };
- HooksDispatcherOnUpdateInDEV.useActionState = function (action) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return updateActionState(action);
- };
- HooksDispatcherOnUpdateInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return updateOptimistic(passthrough, reducer);
- };
HooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
return readContext(context);
@@ -23842,39 +24141,35 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ updateHookTypesDev();
+ warnOnUseFormStateInDev();
+ return rerenderActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ updateHookTypesDev();
+ return rerenderActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ updateHookTypesDev();
+ return rerenderOptimistic(passthrough, reducer);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useMemoCache: useMemoCache,
useCacheRefresh: function () {
currentHookNameInDev = "useCacheRefresh";
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
+ },
+ useEffectEvent: function (callback) {
+ currentHookNameInDev = "useEffectEvent";
+ updateHookTypesDev();
+ return updateEvent(callback);
}
};
- HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache;
- HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) {
- currentHookNameInDev = "useEffectEvent";
- updateHookTypesDev();
- return updateEvent(callback);
- };
- HooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- HooksDispatcherOnRerenderInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- updateHookTypesDev();
- warnOnUseFormStateInDev();
- return rerenderActionState(action);
- };
- HooksDispatcherOnRerenderInDEV.useActionState = function (action) {
- currentHookNameInDev = "useActionState";
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- HooksDispatcherOnRerenderInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- updateHookTypesDev();
- return rerenderOptimistic(passthrough, reducer);
- };
InvalidNestedHooksDispatcherOnMountInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -23999,15 +24294,34 @@
mountHookTypesDev();
return mountId();
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action, initialState) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
mountHookTypesDev();
- return mountRefresh();
+ return mountActionState(action, initialState);
+ },
+ useActionState: function (action, initialState) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ mountHookTypesDev();
+ return mountActionState(action, initialState);
+ },
+ useOptimistic: function (passthrough) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ mountHookTypesDev();
+ return mountOptimistic(passthrough);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ mountHookTypesDev();
+ return mountRefresh();
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -24015,34 +24329,6 @@
return mountEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function (
- action,
- initialState
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountActionState(action, initialState);
- };
- InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function (
- passthrough
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountOptimistic(passthrough);
- };
InvalidNestedHooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -24167,15 +24453,34 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
updateHookTypesDev();
- return updateWorkInProgressHook().memoizedState;
+ return updateActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return updateActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return updateOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ updateHookTypesDev();
+ return updateWorkInProgressHook().memoizedState;
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -24183,31 +24488,6 @@
return updateEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateActionState(action);
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function (
- action
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateActionState(action);
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateOptimistic(passthrough, reducer);
- };
InvalidNestedHooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
@@ -24332,15 +24612,34 @@
updateHookTypesDev();
return updateWorkInProgressHook().memoizedState;
},
- useCacheRefresh: function () {
- currentHookNameInDev = "useCacheRefresh";
+ useFormState: function (action) {
+ currentHookNameInDev = "useFormState";
+ warnInvalidHookAccess();
updateHookTypesDev();
- return updateWorkInProgressHook().memoizedState;
+ return rerenderActionState(action);
+ },
+ useActionState: function (action) {
+ currentHookNameInDev = "useActionState";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return rerenderActionState(action);
+ },
+ useOptimistic: function (passthrough, reducer) {
+ currentHookNameInDev = "useOptimistic";
+ warnInvalidHookAccess();
+ updateHookTypesDev();
+ return rerenderOptimistic(passthrough, reducer);
},
useMemoCache: function (size) {
warnInvalidHookAccess();
return useMemoCache(size);
},
+ useHostTransitionStatus: useHostTransitionStatus,
+ useCacheRefresh: function () {
+ currentHookNameInDev = "useCacheRefresh";
+ updateHookTypesDev();
+ return updateWorkInProgressHook().memoizedState;
+ },
useEffectEvent: function (callback) {
currentHookNameInDev = "useEffectEvent";
warnInvalidHookAccess();
@@ -24348,33 +24647,6 @@
return updateEvent(callback);
}
};
- InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus =
- useHostTransitionStatus;
- InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function (
- action
- ) {
- currentHookNameInDev = "useFormState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function (
- action
- ) {
- currentHookNameInDev = "useActionState";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderActionState(action);
- };
- InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function (
- passthrough,
- reducer
- ) {
- currentHookNameInDev = "useOptimistic";
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderOptimistic(passthrough, reducer);
- };
var callComponent = {
"react-stack-bottom-frame": function (Component, props, secondArg) {
var wasRendering = isRendering;
@@ -24560,78 +24832,6 @@
SubtreeSuspenseContextMask = 1,
ForceSuspenseFallback = 2,
suspenseStackCursor = createCursor(0),
- fakeInternalInstance = {};
- var didWarnAboutStateAssignmentForComponent = new Set();
- var didWarnAboutUninitializedState = new Set();
- var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
- var didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
- var didWarnAboutDirectlyAssigningPropsToState = new Set();
- var didWarnAboutUndefinedDerivedState = new Set();
- var didWarnAboutContextTypes$1 = new Set();
- var didWarnAboutChildContextTypes = new Set();
- var didWarnAboutInvalidateContextType = new Set();
- var didWarnOnInvalidCallback = new Set();
- Object.freeze(fakeInternalInstance);
- var classComponentUpdater = {
- isMounted: function (component) {
- var owner = current;
- if (null !== owner && isRendering && 1 === owner.tag) {
- var instance = owner.stateNode;
- instance._warnedAboutRefsInRender ||
- console.error(
- "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",
- getComponentNameFromFiber(owner) || "A component"
- );
- instance._warnedAboutRefsInRender = !0;
- }
- return (component = component._reactInternals)
- ? getNearestMountedFiber(component) === component
- : !1;
- },
- enqueueSetState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.payload = payload;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueReplaceState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.tag = ReplaceState;
- update.payload = payload;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueForceUpdate: function (inst, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(inst),
- update = createUpdate(lane);
- update.tag = ForceUpdate;
- void 0 !== callback &&
- null !== callback &&
- (warnOnInvalidCallback(callback), (update.callback = callback));
- callback = enqueueUpdate(inst, update, lane);
- null !== callback &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(callback, inst, lane),
- entangleTransitions(callback, inst, lane));
- }
- },
reportGlobalError =
"function" === typeof reportError
? reportError
@@ -24677,23 +24877,10 @@
var SUSPENDED_MARKER = {
dehydrated: null,
treeContext: null,
- retryLane: 0
+ retryLane: 0,
+ hydrationErrors: null
},
hasWarnedAboutUsingNoValuePropOnContextProvider = !1,
- valueCursor = createCursor(null);
- var rendererCursorDEV = createCursor(null);
- var rendererSigil = {};
- var currentlyRenderingFiber = null,
- lastContextDependency = null,
- isDisallowedContextReadInDEV = !1,
- UpdateState = 0,
- ReplaceState = 1,
- ForceUpdate = 2,
- CaptureUpdate = 3,
- hasForceUpdate = !1;
- var didWarnUpdateInsideUpdate = !1;
- var currentlyProcessingQueue = null;
- var didReadFromEntangledAsyncAction = !1,
didWarnAboutUndefinedSnapshotBeforeUpdate = null;
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
var offscreenSubtreeIsHidden = !1,
@@ -24707,6 +24894,7 @@
hostParent = null,
hostParentIsContainer = !1,
currentHoistableRoot = null,
+ inHydratedSubtree = !1,
suspenseyCommitFlag = 8192;
var hasBadMapPolyfill = !1;
try {
@@ -24784,7 +24972,6 @@
RENDER_TIMEOUT_MS = 500,
workInProgressTransitions = null,
legacyErrorBoundariesThatAlreadyFailed = null,
- rootDoesHavePassiveEffects = !1,
rootWithPendingPassiveEffects = null,
pendingPassiveEffectsLanes = 0,
pendingPassiveEffectsRemainingLanes = 0,
@@ -24884,7 +25071,6 @@
didWarnFormActionMethod = !1,
didWarnPopoverTargetObject = !1;
var didWarnForNewBooleanPropsWithEmptyValue = {};
- var canDiffStyleForHydrationWarning = !0;
var NORMALIZE_NEWLINES_REGEX = /\r\n?/g,
NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g,
xlinkNamespace = "http://www.w3.org/1999/xlink",
@@ -25279,52 +25465,43 @@
),
lastScheduledReplayQueue = null;
ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
- function (children, JSCompiler_OptimizeArgumentsArray_p2) {
+ function (children) {
var root = this._internalRoot;
if (null === root) throw Error("Cannot update an unmounted root.");
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p2
+ var args = arguments;
+ "function" === typeof args[1]
? console.error(
"does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
)
- : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2)
+ : isValidContainer(args[1])
? console.error(
"You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."
)
- : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 &&
+ : "undefined" !== typeof args[1] &&
console.error(
"You passed a second argument to root.render(...) but it only accepts one argument."
);
- JSCompiler_OptimizeArgumentsArray_p2 = root.current;
- var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2);
- updateContainerImpl(
- JSCompiler_OptimizeArgumentsArray_p2,
- lane,
- children,
- root,
- null,
- null
- );
+ args = children;
+ var current = root.current,
+ lane = requestUpdateLane(current);
+ updateContainerImpl(current, lane, args, root, null, null);
};
ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount =
- function (JSCompiler_OptimizeArgumentsArray_p3) {
- "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 &&
+ function () {
+ var args = arguments;
+ "function" === typeof args[0] &&
console.error(
"does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."
);
- JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot;
- if (null !== JSCompiler_OptimizeArgumentsArray_p3) {
+ args = this._internalRoot;
+ if (null !== args) {
this._internalRoot = null;
- var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo;
+ var container = args.containerInfo;
(executionContext & (RenderContext | CommitContext)) !== NoContext &&
console.error(
"Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."
);
- updateContainerSync(
- null,
- JSCompiler_OptimizeArgumentsArray_p3,
- null,
- null
- );
+ updateContainerSync(null, args, null, null);
flushSyncWork$1();
container[internalContainerInstanceKey] = null;
}
@@ -25348,11 +25525,11 @@
};
(function () {
var isomorphicReactPackageVersion = React.version;
- if ("19.0.0-experimental-372ec00c-20241209" !== isomorphicReactPackageVersion)
+ if ("19.1.0-experimental-518d06d2-20241219" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
- "\n - react-dom: 19.0.0-experimental-372ec00c-20241209\nLearn more: https://react.dev/warnings/version-mismatch")
+ "\n - react-dom: 19.1.0-experimental-518d06d2-20241219\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
@@ -25389,11 +25566,10 @@
!(function () {
var internals = {
bundleType: 1,
- version: "19.0.0-experimental-372ec00c-20241209",
+ version: "19.1.0-experimental-518d06d2-20241219",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
- findFiberByHostInstance: getClosestInstanceFromNode,
- reconcilerVersion: "19.0.0-experimental-372ec00c-20241209"
+ reconcilerVersion: "19.1.0-experimental-518d06d2-20241219"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -25582,11 +25758,13 @@
initialChildren.context = getContextForSubtree(null);
options = initialChildren.current;
isStrictMode = requestUpdateLane(options);
+ isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
identifierPrefix = createUpdate(isStrictMode);
identifierPrefix.callback = null;
enqueueUpdate(options, identifierPrefix, isStrictMode);
- initialChildren.current.lanes = isStrictMode;
- markRootUpdated$1(initialChildren, isStrictMode);
+ options = isStrictMode;
+ initialChildren.current.lanes = options;
+ markRootUpdated$1(initialChildren, options);
ensureRootIsScheduled(initialChildren);
container[internalContainerInstanceKey] = initialChildren.current;
listenToAllSupportedEvents(container);
@@ -25865,7 +26043,7 @@
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
- exports.version = "19.0.0-experimental-372ec00c-20241209";
+ exports.version = "19.1.0-experimental-518d06d2-20241219";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js
index ebde9db05a8d2..374efbc36b90f 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js
@@ -55,7 +55,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy");
Symbol.for("react.scope");
-Symbol.for("react.debug_trace_mode");
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
Symbol.for("react.legacy_hidden");
Symbol.for("react.tracing_marker");
@@ -346,13 +345,11 @@ function describeFiber(fiber) {
return describeBuiltInComponentFrame("SuspenseList");
case 0:
case 15:
- return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber;
+ return describeNativeComponentFrame(fiber.type, !1);
case 11:
- return (
- (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber
- );
+ return describeNativeComponentFrame(fiber.type.render, !1);
case 1:
- return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber;
+ return describeNativeComponentFrame(fiber.type, !0);
default:
return "";
}
@@ -852,6 +849,46 @@ function markRootEntangled(root, entangledLanes) {
rootEntangledLanes &= ~lane;
}
}
+function getBumpedLaneForHydrationByLane(lane) {
+ switch (lane) {
+ case 2:
+ lane = 1;
+ break;
+ case 8:
+ lane = 4;
+ break;
+ case 32:
+ lane = 16;
+ break;
+ case 128:
+ case 256:
+ case 512:
+ case 1024:
+ case 2048:
+ case 4096:
+ case 8192:
+ case 16384:
+ case 32768:
+ case 65536:
+ case 131072:
+ case 262144:
+ case 524288:
+ case 1048576:
+ case 2097152:
+ case 4194304:
+ case 8388608:
+ case 16777216:
+ case 33554432:
+ lane = 64;
+ break;
+ case 268435456:
+ lane = 134217728;
+ break;
+ default:
+ lane = 0;
+ }
+ return lane;
+}
function addFiberToLanesMap(root, fiber, lanes) {
if (isDevToolsPresent)
for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) {
@@ -998,12 +1035,7 @@ function registerDirectEvent(registrationName, dependencies) {
)
allNativeEvents.add(dependencies[registrationName]);
}
-var canUseDOM = !(
- "undefined" === typeof window ||
- "undefined" === typeof window.document ||
- "undefined" === typeof window.document.createElement
- ),
- VALID_ATTRIBUTE_NAME_REGEX = RegExp(
+var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
"^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
),
illegalAttributeNameCache = {},
@@ -1612,7 +1644,12 @@ function getListener(inst, registrationName) {
);
return stateNode;
}
-var passiveBrowserEventsSupported = !1;
+var canUseDOM = !(
+ "undefined" === typeof window ||
+ "undefined" === typeof window.document ||
+ "undefined" === typeof window.document.createElement
+ ),
+ passiveBrowserEventsSupported = !1;
if (canUseDOM)
try {
var options = {};
@@ -2099,19 +2136,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) {
}
var isInputEventSupported = !1;
if (canUseDOM) {
- var JSCompiler_inline_result$jscomp$305;
+ var JSCompiler_inline_result$jscomp$306;
if (canUseDOM) {
- var isSupported$jscomp$inline_441 = "oninput" in document;
- if (!isSupported$jscomp$inline_441) {
- var element$jscomp$inline_442 = document.createElement("div");
- element$jscomp$inline_442.setAttribute("oninput", "return;");
- isSupported$jscomp$inline_441 =
- "function" === typeof element$jscomp$inline_442.oninput;
+ var isSupported$jscomp$inline_436 = "oninput" in document;
+ if (!isSupported$jscomp$inline_436) {
+ var element$jscomp$inline_437 = document.createElement("div");
+ element$jscomp$inline_437.setAttribute("oninput", "return;");
+ isSupported$jscomp$inline_436 =
+ "function" === typeof element$jscomp$inline_437.oninput;
}
- JSCompiler_inline_result$jscomp$305 = isSupported$jscomp$inline_441;
- } else JSCompiler_inline_result$jscomp$305 = !1;
+ JSCompiler_inline_result$jscomp$306 = isSupported$jscomp$inline_436;
+ } else JSCompiler_inline_result$jscomp$306 = !1;
isInputEventSupported =
- JSCompiler_inline_result$jscomp$305 &&
+ JSCompiler_inline_result$jscomp$306 &&
(!document.documentMode || 9 < document.documentMode);
}
function stopWatchingForValueChange() {
@@ -2484,7 +2521,7 @@ function setCurrentTrackFromLanes(lanes) {
: "Other";
}
var blockingLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
@@ -2494,7 +2531,7 @@ var blockingLaneMarker = {
}
},
transitionLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
@@ -2504,7 +2541,7 @@ var blockingLaneMarker = {
}
},
suspenseLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
@@ -2514,7 +2551,7 @@ var blockingLaneMarker = {
}
},
idleLaneMarker = {
- startTime: 0,
+ startTime: 0.003,
detail: {
devtools: {
color: "primary-light",
@@ -2523,6 +2560,32 @@ var blockingLaneMarker = {
}
}
};
+function logComponentRender(fiber, startTime, endTime, wasHydrated) {
+ var name = getComponentNameFromFiber(fiber);
+ if (null !== name && supportsUserTiming) {
+ var selfTime = fiber.actualDuration;
+ if (null === fiber.alternate || fiber.alternate.child !== fiber.child)
+ for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling)
+ selfTime -= fiber.actualDuration;
+ reusableComponentDevToolDetails.color =
+ 0.5 > selfTime
+ ? wasHydrated
+ ? "tertiary-light"
+ : "primary-light"
+ : 10 > selfTime
+ ? wasHydrated
+ ? "tertiary"
+ : "primary"
+ : 100 > selfTime
+ ? wasHydrated
+ ? "tertiary-dark"
+ : "primary-dark"
+ : "error";
+ reusableComponentOptions.start = startTime;
+ reusableComponentOptions.end = endTime;
+ performance.measure(name, reusableComponentOptions);
+ }
+}
function logComponentEffect(fiber, startTime, endTime, selfTime) {
fiber = getComponentNameFromFiber(fiber);
null !== fiber &&
@@ -2539,23 +2602,33 @@ function logComponentEffect(fiber, startTime, endTime, selfTime) {
(reusableComponentOptions.end = endTime),
performance.measure(fiber, reusableComponentOptions));
}
-function logRenderPhase(startTime, endTime) {
+function logRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prepared"
+ : (lanes & 201326677) === lanes
+ ? "Hydrated"
+ : "Render",
+ reusableLaneOptions
+ ));
}
-function logSuspendedRenderPhase(startTime, endTime) {
+function logSuspendedRenderPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Prewarm", reusableLaneOptions));
}
-function logSuspendedWithDelayPhase(startTime, endTime) {
+function logSuspendedWithDelayPhase(startTime, endTime, lanes) {
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
performance.measure("Suspended", reusableLaneOptions));
@@ -2565,7 +2638,7 @@ function logErroredRenderPhase(startTime, endTime) {
((reusableLaneDevToolDetails.color = "error"),
(reusableLaneOptions.start = startTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Errored Render", reusableLaneOptions));
+ performance.measure("Errored", reusableLaneOptions));
}
function logSuspenseThrottlePhase(startTime, endTime) {
supportsUserTiming &&
@@ -2788,380 +2861,195 @@ function transferActualDuration(fiber) {
for (var child = fiber.child; child; )
(fiber.actualDuration += child.actualDuration), (child = child.sibling);
}
-var CapturedStacks = new WeakMap();
-function createCapturedValueAtFiber(value, source) {
- if ("object" === typeof value && null !== value) {
- var existing = CapturedStacks.get(value);
- if (void 0 !== existing) return existing;
- source = {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- CapturedStacks.set(value, source);
- return source;
- }
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
-}
-var forkStack = [],
- forkStackIndex = 0,
- treeForkProvider = null,
- treeForkCount = 0,
- idStack = [],
- idStackIndex = 0,
- treeContextProvider = null,
- treeContextId = 1,
- treeContextOverflow = "";
-function pushTreeFork(workInProgress, totalChildren) {
- forkStack[forkStackIndex++] = treeForkCount;
- forkStack[forkStackIndex++] = treeForkProvider;
- treeForkProvider = workInProgress;
- treeForkCount = totalChildren;
+var valueCursor = createCursor(null),
+ currentlyRenderingFiber$1 = null,
+ lastContextDependency = null;
+function pushProvider(providerFiber, context, nextValue) {
+ push(valueCursor, context._currentValue);
+ context._currentValue = nextValue;
}
-function pushTreeId(workInProgress, totalChildren, index) {
- idStack[idStackIndex++] = treeContextId;
- idStack[idStackIndex++] = treeContextOverflow;
- idStack[idStackIndex++] = treeContextProvider;
- treeContextProvider = workInProgress;
- var baseIdWithLeadingBit = treeContextId;
- workInProgress = treeContextOverflow;
- var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
- baseIdWithLeadingBit &= ~(1 << baseLength);
- index += 1;
- var length = 32 - clz32(totalChildren) + baseLength;
- if (30 < length) {
- var numberOfOverflowBits = baseLength - (baseLength % 5);
- length = (
- baseIdWithLeadingBit &
- ((1 << numberOfOverflowBits) - 1)
- ).toString(32);
- baseIdWithLeadingBit >>= numberOfOverflowBits;
- baseLength -= numberOfOverflowBits;
- treeContextId =
- (1 << (32 - clz32(totalChildren) + baseLength)) |
- (index << baseLength) |
- baseIdWithLeadingBit;
- treeContextOverflow = length + workInProgress;
- } else
- (treeContextId =
- (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
- (treeContextOverflow = workInProgress);
+function popProvider(context) {
+ context._currentValue = valueCursor.current;
+ pop(valueCursor);
}
-function pushMaterializedTreeId(workInProgress) {
- null !== workInProgress.return &&
- (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
+function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
+ for (; null !== parent; ) {
+ var alternate = parent.alternate;
+ (parent.childLanes & renderLanes) !== renderLanes
+ ? ((parent.childLanes |= renderLanes),
+ null !== alternate && (alternate.childLanes |= renderLanes))
+ : null !== alternate &&
+ (alternate.childLanes & renderLanes) !== renderLanes &&
+ (alternate.childLanes |= renderLanes);
+ if (parent === propagationRoot) break;
+ parent = parent.return;
+ }
}
-function popTreeContext(workInProgress) {
- for (; workInProgress === treeForkProvider; )
- (treeForkProvider = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null),
- (treeForkCount = forkStack[--forkStackIndex]),
- (forkStack[forkStackIndex] = null);
- for (; workInProgress === treeContextProvider; )
- (treeContextProvider = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextOverflow = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null),
- (treeContextId = idStack[--idStackIndex]),
- (idStack[idStackIndex] = null);
+function propagateContextChanges(
+ workInProgress,
+ contexts,
+ renderLanes,
+ forcePropagateEntireTree
+) {
+ var fiber = workInProgress.child;
+ null !== fiber && (fiber.return = workInProgress);
+ for (; null !== fiber; ) {
+ var list = fiber.dependencies;
+ if (null !== list) {
+ var nextFiber = fiber.child;
+ list = list.firstContext;
+ a: for (; null !== list; ) {
+ var dependency = list;
+ list = fiber;
+ for (var i = 0; i < contexts.length; i++)
+ if (dependency.context === contexts[i]) {
+ list.lanes |= renderLanes;
+ dependency = list.alternate;
+ null !== dependency && (dependency.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(
+ list.return,
+ renderLanes,
+ workInProgress
+ );
+ forcePropagateEntireTree || (nextFiber = null);
+ break a;
+ }
+ list = dependency.next;
+ }
+ } else if (18 === fiber.tag) {
+ nextFiber = fiber.return;
+ if (null === nextFiber) throw Error(formatProdErrorMessage(341));
+ nextFiber.lanes |= renderLanes;
+ list = nextFiber.alternate;
+ null !== list && (list.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);
+ nextFiber = null;
+ } else nextFiber = fiber.child;
+ if (null !== nextFiber) nextFiber.return = fiber;
+ else
+ for (nextFiber = fiber; null !== nextFiber; ) {
+ if (nextFiber === workInProgress) {
+ nextFiber = null;
+ break;
+ }
+ fiber = nextFiber.sibling;
+ if (null !== fiber) {
+ fiber.return = nextFiber.return;
+ nextFiber = fiber;
+ break;
+ }
+ nextFiber = nextFiber.return;
+ }
+ fiber = nextFiber;
+ }
}
-var hydrationParentFiber = null,
- nextHydratableInstance = null,
- isHydrating = !1,
- hydrationErrors = null,
- rootOrSingletonContext = !1,
- HydrationMismatchException = Error(formatProdErrorMessage(519));
-function throwOnHydrationMismatch(fiber) {
- var error = Error(formatProdErrorMessage(418, ""));
- queueHydrationError(createCapturedValueAtFiber(error, fiber));
- throw HydrationMismatchException;
+function propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ forcePropagateEntireTree
+) {
+ current = null;
+ for (
+ var parent = workInProgress, isInsidePropagationBailout = !1;
+ null !== parent;
+
+ ) {
+ if (!isInsidePropagationBailout)
+ if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
+ else if (0 !== (parent.flags & 262144)) break;
+ if (10 === parent.tag) {
+ var currentParent = parent.alternate;
+ if (null === currentParent) throw Error(formatProdErrorMessage(387));
+ currentParent = currentParent.memoizedProps;
+ if (null !== currentParent) {
+ var context = parent.type;
+ objectIs(parent.pendingProps.value, currentParent.value) ||
+ (null !== current ? current.push(context) : (current = [context]));
+ }
+ } else if (parent === hostTransitionProviderCursor.current) {
+ currentParent = parent.alternate;
+ if (null === currentParent) throw Error(formatProdErrorMessage(387));
+ currentParent.memoizedState.memoizedState !==
+ parent.memoizedState.memoizedState &&
+ (null !== current
+ ? current.push(HostTransitionContext)
+ : (current = [HostTransitionContext]));
+ }
+ parent = parent.return;
+ }
+ null !== current &&
+ propagateContextChanges(
+ workInProgress,
+ current,
+ renderLanes,
+ forcePropagateEntireTree
+ );
+ workInProgress.flags |= 262144;
}
-function prepareToHydrateHostInstance(fiber) {
- var instance = fiber.stateNode,
- type = fiber.type,
- props = fiber.memoizedProps;
- instance[internalInstanceKey] = fiber;
- instance[internalPropsKey] = props;
- switch (type) {
- case "dialog":
- listenToNonDelegatedEvent("cancel", instance);
- listenToNonDelegatedEvent("close", instance);
- break;
- case "iframe":
- case "object":
- case "embed":
- listenToNonDelegatedEvent("load", instance);
- break;
- case "video":
- case "audio":
- for (type = 0; type < mediaEventTypes.length; type++)
- listenToNonDelegatedEvent(mediaEventTypes[type], instance);
- break;
- case "source":
- listenToNonDelegatedEvent("error", instance);
- break;
- case "img":
- case "image":
- case "link":
- listenToNonDelegatedEvent("error", instance);
- listenToNonDelegatedEvent("load", instance);
- break;
- case "details":
- listenToNonDelegatedEvent("toggle", instance);
- break;
- case "input":
- listenToNonDelegatedEvent("invalid", instance);
- initInput(
- instance,
- props.value,
- props.defaultValue,
- props.checked,
- props.defaultChecked,
- props.type,
- props.name,
- !0
- );
- track(instance);
- break;
- case "select":
- listenToNonDelegatedEvent("invalid", instance);
- break;
- case "textarea":
- listenToNonDelegatedEvent("invalid", instance),
- initTextarea(instance, props.value, props.defaultValue, props.children),
- track(instance);
+function checkIfContextChanged(currentDependencies) {
+ for (
+ currentDependencies = currentDependencies.firstContext;
+ null !== currentDependencies;
+
+ ) {
+ if (
+ !objectIs(
+ currentDependencies.context._currentValue,
+ currentDependencies.memoizedValue
+ )
+ )
+ return !0;
+ currentDependencies = currentDependencies.next;
}
- type = props.children;
- ("string" !== typeof type &&
- "number" !== typeof type &&
- "bigint" !== typeof type) ||
- instance.textContent === "" + type ||
- !0 === props.suppressHydrationWarning ||
- checkForUnmatchedText(instance.textContent, type)
- ? (null != props.popover &&
- (listenToNonDelegatedEvent("beforetoggle", instance),
- listenToNonDelegatedEvent("toggle", instance)),
- null != props.onScroll && listenToNonDelegatedEvent("scroll", instance),
- null != props.onScrollEnd &&
- listenToNonDelegatedEvent("scrollend", instance),
- null != props.onClick && (instance.onclick = noop$2),
- (instance = !0))
- : (instance = !1);
- instance || throwOnHydrationMismatch(fiber);
-}
-function popToNextHostParent(fiber) {
- for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
- switch (hydrationParentFiber.tag) {
- case 3:
- case 27:
- rootOrSingletonContext = !0;
- return;
- case 5:
- case 13:
- rootOrSingletonContext = !1;
- return;
- default:
- hydrationParentFiber = hydrationParentFiber.return;
- }
+ return !1;
}
-function popHydrationState(fiber) {
- if (fiber !== hydrationParentFiber) return !1;
- if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;
- var shouldClear = !1,
- JSCompiler_temp;
- if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
- if ((JSCompiler_temp = 5 === fiber.tag))
- (JSCompiler_temp = fiber.type),
- (JSCompiler_temp =
- !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
- shouldSetTextContent(fiber.type, fiber.memoizedProps));
- JSCompiler_temp = !JSCompiler_temp;
- }
- JSCompiler_temp && (shouldClear = !0);
- shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber);
- popToNextHostParent(fiber);
- if (13 === fiber.tag) {
- fiber = fiber.memoizedState;
- fiber = null !== fiber ? fiber.dehydrated : null;
- if (!fiber) throw Error(formatProdErrorMessage(317));
- a: {
- fiber = fiber.nextSibling;
- for (shouldClear = 0; fiber; ) {
- if (8 === fiber.nodeType)
- if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) {
- if (0 === shouldClear) {
- nextHydratableInstance = getNextHydratable(fiber.nextSibling);
- break a;
- }
- shouldClear--;
- } else
- ("$" !== JSCompiler_temp &&
- "$!" !== JSCompiler_temp &&
- "$?" !== JSCompiler_temp) ||
- shouldClear++;
- fiber = fiber.nextSibling;
- }
- nextHydratableInstance = null;
- }
- } else
- nextHydratableInstance = hydrationParentFiber
- ? getNextHydratable(fiber.stateNode.nextSibling)
- : null;
- return !0;
+function prepareToReadContext(workInProgress) {
+ currentlyRenderingFiber$1 = workInProgress;
+ lastContextDependency = null;
+ workInProgress = workInProgress.dependencies;
+ null !== workInProgress && (workInProgress.firstContext = null);
}
-function resetHydrationState() {
- nextHydratableInstance = hydrationParentFiber = null;
- isHydrating = !1;
+function readContext(context) {
+ return readContextForConsumer(currentlyRenderingFiber$1, context);
}
-function queueHydrationError(error) {
- null === hydrationErrors
- ? (hydrationErrors = [error])
- : hydrationErrors.push(error);
+function readContextDuringReconciliation(consumer, context) {
+ null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
+ return readContextForConsumer(consumer, context);
}
-var SuspenseException = Error(formatProdErrorMessage(460)),
- SuspenseyCommitException = Error(formatProdErrorMessage(474)),
- SuspenseActionException = Error(formatProdErrorMessage(542)),
- noopSuspenseyCommitThenable = { then: function () {} };
-function isThenableResolved(thenable) {
- thenable = thenable.status;
- return "fulfilled" === thenable || "rejected" === thenable;
+function readContextForConsumer(consumer, context) {
+ var value = context._currentValue;
+ context = { context: context, memoizedValue: value, next: null };
+ if (null === lastContextDependency) {
+ if (null === consumer) throw Error(formatProdErrorMessage(308));
+ lastContextDependency = context;
+ consumer.dependencies = { lanes: 0, firstContext: context };
+ consumer.flags |= 524288;
+ } else lastContextDependency = lastContextDependency.next = context;
+ return value;
}
-function noop$4() {}
-function trackUsedThenable(thenableState, thenable, index) {
- index = thenableState[index];
- void 0 === index
- ? thenableState.push(thenable)
- : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index));
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
- default:
- if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4);
- else {
- thenableState = workInProgressRoot;
- if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
- throw Error(formatProdErrorMessage(482));
- thenableState = thenable;
- thenableState.status = "pending";
- thenableState.then(
- function (fulfilledValue) {
- if ("pending" === thenable.status) {
- var fulfilledThenable = thenable;
- fulfilledThenable.status = "fulfilled";
- fulfilledThenable.value = fulfilledValue;
- }
- },
- function (error) {
- if ("pending" === thenable.status) {
- var rejectedThenable = thenable;
- rejectedThenable.status = "rejected";
- rejectedThenable.reason = error;
- }
- }
- );
- }
- switch (thenable.status) {
- case "fulfilled":
- return thenable.value;
- case "rejected":
- throw (
- ((thenableState = thenable.reason),
- checkIfUseWrappedInAsyncCatch(thenableState),
- thenableState)
- );
+var currentEntangledListeners = null,
+ currentEntangledPendingCount = 0,
+ currentEntangledLane = 0,
+ currentEntangledActionThenable = null;
+function entangleAsyncAction(transition, thenable) {
+ if (null === currentEntangledListeners) {
+ var entangledListeners = (currentEntangledListeners = []);
+ currentEntangledPendingCount = 0;
+ currentEntangledLane = requestTransitionLane();
+ currentEntangledActionThenable = {
+ status: "pending",
+ value: void 0,
+ then: function (resolve) {
+ entangledListeners.push(resolve);
}
- suspendedThenable = thenable;
- throw SuspenseException;
+ };
}
-}
-var suspendedThenable = null;
-function getSuspendedThenable() {
- if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
- var thenable = suspendedThenable;
- suspendedThenable = null;
+ currentEntangledPendingCount++;
+ thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
return thenable;
}
-function checkIfUseWrappedInAsyncCatch(rejectedReason) {
- if (
- rejectedReason === SuspenseException ||
- rejectedReason === SuspenseActionException
- )
- throw Error(formatProdErrorMessage(483));
-}
-var AbortControllerLocal =
- "undefined" !== typeof AbortController
- ? AbortController
- : function () {
- var listeners = [],
- signal = (this.signal = {
- aborted: !1,
- addEventListener: function (type, listener) {
- listeners.push(listener);
- }
- });
- this.abort = function () {
- signal.aborted = !0;
- listeners.forEach(function (listener) {
- return listener();
- });
- };
- },
- scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
- NormalPriority = Scheduler.unstable_NormalPriority,
- CacheContext = {
- $$typeof: REACT_CONTEXT_TYPE,
- Consumer: null,
- Provider: null,
- _currentValue: null,
- _currentValue2: null,
- _threadCount: 0
- };
-function createCache() {
- return {
- controller: new AbortControllerLocal(),
- data: new Map(),
- refCount: 0
- };
-}
-function releaseCache(cache) {
- cache.refCount--;
- 0 === cache.refCount &&
- scheduleCallback$2(NormalPriority, function () {
- cache.controller.abort();
- });
-}
-var currentEntangledListeners = null,
- currentEntangledPendingCount = 0,
- currentEntangledLane = 0,
- currentEntangledActionThenable = null;
-function entangleAsyncAction(transition, thenable) {
- if (null === currentEntangledListeners) {
- var entangledListeners = (currentEntangledListeners = []);
- currentEntangledPendingCount = 0;
- currentEntangledLane = requestTransitionLane();
- currentEntangledActionThenable = {
- status: "pending",
- value: void 0,
- then: function (resolve) {
- entangledListeners.push(resolve);
- }
- };
- }
- currentEntangledPendingCount++;
- thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
- return thenable;
-}
-function pingEngtangledActionScope() {
+function pingEngtangledActionScope() {
if (
0 === --currentEntangledPendingCount &&
(-1 < transitionUpdateTime || (transitionStartTime = -1.1),
@@ -3201,1346 +3089,1170 @@ function chainThenableValue(thenable, result) {
);
return thenableWithOverride;
}
-var currentTreeHiddenStackCursor = createCursor(null),
- prevEntangledRenderLanesCursor = createCursor(0);
-function pushHiddenContext(fiber, context) {
- fiber = entangledRenderLanes;
- push(prevEntangledRenderLanesCursor, fiber);
- push(currentTreeHiddenStackCursor, context);
- entangledRenderLanes = fiber | context.baseLanes;
+var hasForceUpdate = !1;
+function initializeUpdateQueue(fiber) {
+ fiber.updateQueue = {
+ baseState: fiber.memoizedState,
+ firstBaseUpdate: null,
+ lastBaseUpdate: null,
+ shared: { pending: null, lanes: 0, hiddenCallbacks: null },
+ callbacks: null
+ };
}
-function reuseHiddenContextOnStack() {
- push(prevEntangledRenderLanesCursor, entangledRenderLanes);
- push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
+function cloneUpdateQueue(current, workInProgress) {
+ current = current.updateQueue;
+ workInProgress.updateQueue === current &&
+ (workInProgress.updateQueue = {
+ baseState: current.baseState,
+ firstBaseUpdate: current.firstBaseUpdate,
+ lastBaseUpdate: current.lastBaseUpdate,
+ shared: current.shared,
+ callbacks: null
+ });
}
-function popHiddenContext() {
- entangledRenderLanes = prevEntangledRenderLanesCursor.current;
- pop(currentTreeHiddenStackCursor);
- pop(prevEntangledRenderLanesCursor);
+function createUpdate(lane) {
+ return { lane: lane, tag: 0, payload: null, callback: null, next: null };
}
-var prevOnStartTransitionFinish = ReactSharedInternals.S;
-ReactSharedInternals.S = function (transition, returnValue) {
- if (
- "object" === typeof returnValue &&
- null !== returnValue &&
- "function" === typeof returnValue.then
- ) {
- if (0 > transitionStartTime && 0 > transitionUpdateTime) {
- transitionStartTime = now();
- var newEventTime = resolveEventTimeStamp(),
- newEventType = resolveEventType();
- if (
- newEventTime !== transitionEventTime ||
- newEventType !== transitionEventType
- )
- transitionEventIsRepeat = !1;
- transitionEventTime = newEventTime;
- transitionEventType = newEventType;
- }
- entangleAsyncAction(transition, returnValue);
+function enqueueUpdate(fiber, update, lane) {
+ var updateQueue = fiber.updateQueue;
+ if (null === updateQueue) return null;
+ updateQueue = updateQueue.shared;
+ if (0 !== (executionContext & 2)) {
+ var pending = updateQueue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ updateQueue.pending = update;
+ update = getRootForUpdatedFiber(fiber);
+ markUpdateLaneFromFiberToRoot(fiber, null, lane);
+ return update;
}
- null !== prevOnStartTransitionFinish &&
- prevOnStartTransitionFinish(transition, returnValue);
-};
-var resumedCache = createCursor(null);
-function peekCacheFromPool() {
- var cacheResumedFromPreviousRender = resumedCache.current;
- return null !== cacheResumedFromPreviousRender
- ? cacheResumedFromPreviousRender
- : workInProgressRoot.pooledCache;
-}
-function pushTransition(offscreenWorkInProgress, prevCachePool) {
- null === prevCachePool
- ? push(resumedCache, resumedCache.current)
- : push(resumedCache, prevCachePool.pool);
+ enqueueUpdate$1(fiber, updateQueue, update, lane);
+ return getRootForUpdatedFiber(fiber);
}
-function getSuspendedCache() {
- var cacheFromPool = peekCacheFromPool();
- return null === cacheFromPool
- ? null
- : { parent: CacheContext._currentValue, pool: cacheFromPool };
+function entangleTransitions(root, fiber, lane) {
+ fiber = fiber.updateQueue;
+ if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
+ var queueLanes = fiber.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ fiber.lanes = lane;
+ markRootEntangled(root, lane);
+ }
}
-var renderLanes = 0,
- currentlyRenderingFiber$1 = null,
- currentHook = null,
- workInProgressHook = null,
- didScheduleRenderPhaseUpdate = !1,
- didScheduleRenderPhaseUpdateDuringThisPass = !1,
- shouldDoubleInvokeUserFnsInHooksDEV = !1,
- localIdCounter = 0,
- thenableIndexCounter$1 = 0,
- thenableState$1 = null,
- globalClientIdCounter = 0;
-function throwInvalidHookError() {
- throw Error(formatProdErrorMessage(321));
+function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
+ var queue = workInProgress.updateQueue,
+ current = workInProgress.alternate;
+ if (
+ null !== current &&
+ ((current = current.updateQueue), queue === current)
+ ) {
+ var newFirst = null,
+ newLast = null;
+ queue = queue.firstBaseUpdate;
+ if (null !== queue) {
+ do {
+ var clone = {
+ lane: queue.lane,
+ tag: queue.tag,
+ payload: queue.payload,
+ callback: null,
+ next: null
+ };
+ null === newLast
+ ? (newFirst = newLast = clone)
+ : (newLast = newLast.next = clone);
+ queue = queue.next;
+ } while (null !== queue);
+ null === newLast
+ ? (newFirst = newLast = capturedUpdate)
+ : (newLast = newLast.next = capturedUpdate);
+ } else newFirst = newLast = capturedUpdate;
+ queue = {
+ baseState: current.baseState,
+ firstBaseUpdate: newFirst,
+ lastBaseUpdate: newLast,
+ shared: current.shared,
+ callbacks: current.callbacks
+ };
+ workInProgress.updateQueue = queue;
+ return;
+ }
+ workInProgress = queue.lastBaseUpdate;
+ null === workInProgress
+ ? (queue.firstBaseUpdate = capturedUpdate)
+ : (workInProgress.next = capturedUpdate);
+ queue.lastBaseUpdate = capturedUpdate;
}
-function areHookInputsEqual(nextDeps, prevDeps) {
- if (null === prevDeps) return !1;
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
- if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
- return !0;
+var didReadFromEntangledAsyncAction = !1;
+function suspendIfUpdateReadFromEntangledAsyncAction() {
+ if (didReadFromEntangledAsyncAction) {
+ var entangledActionThenable = currentEntangledActionThenable;
+ if (null !== entangledActionThenable) throw entangledActionThenable;
+ }
}
-function renderWithHooks(
- current,
- workInProgress,
- Component,
+function processUpdateQueue(
+ workInProgress$jscomp$0,
props,
- secondArg,
- nextRenderLanes
+ instance$jscomp$0,
+ renderLanes
) {
- renderLanes = nextRenderLanes;
- currentlyRenderingFiber$1 = workInProgress;
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.lanes = 0;
- ReactSharedInternals.H =
- null === current || null === current.memoizedState
- ? HooksDispatcherOnMount
- : HooksDispatcherOnUpdate;
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- nextRenderLanes = Component(props, secondArg);
- shouldDoubleInvokeUserFnsInHooksDEV = !1;
- didScheduleRenderPhaseUpdateDuringThisPass &&
- (nextRenderLanes = renderWithHooksAgain(
- workInProgress,
- Component,
- props,
- secondArg
- ));
- finishRenderingHooks(current);
- return nextRenderLanes;
-}
-function finishRenderingHooks(current) {
- ReactSharedInternals.H = ContextOnlyDispatcher;
- var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
- renderLanes = 0;
- workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
- didScheduleRenderPhaseUpdate = !1;
- thenableIndexCounter$1 = 0;
- thenableState$1 = null;
- if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
- null === current ||
- didReceiveUpdate ||
- ((current = current.dependencies),
- null !== current &&
- checkIfContextChanged(current) &&
- (didReceiveUpdate = !0));
-}
-function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
- currentlyRenderingFiber$1 = workInProgress;
- var numberOfReRenders = 0;
- do {
- didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
- thenableIndexCounter$1 = 0;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
- numberOfReRenders += 1;
- workInProgressHook = currentHook = null;
- if (null != workInProgress.updateQueue) {
- var children = workInProgress.updateQueue;
- children.lastEffect = null;
- children.events = null;
- children.stores = null;
- null != children.memoCache && (children.memoCache.index = 0);
- }
- ReactSharedInternals.H = HooksDispatcherOnRerender;
- children = Component(props, secondArg);
- } while (didScheduleRenderPhaseUpdateDuringThisPass);
- return children;
-}
-function TransitionAwareHostComponent() {
- var dispatcher = ReactSharedInternals.H,
- maybeThenable = dispatcher.useState()[0];
- maybeThenable =
- "function" === typeof maybeThenable.then
- ? useThenable(maybeThenable)
- : maybeThenable;
- dispatcher = dispatcher.useState()[0];
- (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
- (currentlyRenderingFiber$1.flags |= 1024);
- return maybeThenable;
-}
-function checkDidRenderIdHook() {
- var didRenderIdHook = 0 !== localIdCounter;
- localIdCounter = 0;
- return didRenderIdHook;
-}
-function bailoutHooks(current, workInProgress, lanes) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.flags &= -2053;
- current.lanes &= ~lanes;
-}
-function resetHooksOnUnwind(workInProgress) {
- if (didScheduleRenderPhaseUpdate) {
- for (
- workInProgress = workInProgress.memoizedState;
- null !== workInProgress;
-
- ) {
- var queue = workInProgress.queue;
- null !== queue && (queue.pending = null);
- workInProgress = workInProgress.next;
- }
- didScheduleRenderPhaseUpdate = !1;
- }
- renderLanes = 0;
- workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
- didScheduleRenderPhaseUpdateDuringThisPass = !1;
- thenableIndexCounter$1 = localIdCounter = 0;
- thenableState$1 = null;
-}
-function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- baseQueue: null,
- queue: null,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
- : (workInProgressHook = workInProgressHook.next = hook);
- return workInProgressHook;
-}
-function updateWorkInProgressHook() {
- if (null === currentHook) {
- var nextCurrentHook = currentlyRenderingFiber$1.alternate;
- nextCurrentHook =
- null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
- } else nextCurrentHook = currentHook.next;
- var nextWorkInProgressHook =
- null === workInProgressHook
- ? currentlyRenderingFiber$1.memoizedState
- : workInProgressHook.next;
- if (null !== nextWorkInProgressHook)
- (workInProgressHook = nextWorkInProgressHook),
- (currentHook = nextCurrentHook);
- else {
- if (null === nextCurrentHook) {
- if (null === currentlyRenderingFiber$1.alternate)
- throw Error(formatProdErrorMessage(467));
- throw Error(formatProdErrorMessage(310));
- }
- currentHook = nextCurrentHook;
- nextCurrentHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- baseQueue: currentHook.baseQueue,
- queue: currentHook.queue,
- next: null
- };
- null === workInProgressHook
- ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook =
- nextCurrentHook)
- : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
- }
- return workInProgressHook;
-}
-var createFunctionComponentUpdateQueue;
-createFunctionComponentUpdateQueue = function () {
- return { lastEffect: null, events: null, stores: null, memoCache: null };
-};
-function useThenable(thenable) {
- var index = thenableIndexCounter$1;
- thenableIndexCounter$1 += 1;
- null === thenableState$1 && (thenableState$1 = []);
- thenable = trackUsedThenable(thenableState$1, thenable, index);
- index = currentlyRenderingFiber$1;
- null ===
- (null === workInProgressHook
- ? index.memoizedState
- : workInProgressHook.next) &&
- ((index = index.alternate),
- (ReactSharedInternals.H =
- null === index || null === index.memoizedState
- ? HooksDispatcherOnMount
- : HooksDispatcherOnUpdate));
- return thenable;
-}
-function use(usable) {
- if (null !== usable && "object" === typeof usable) {
- if ("function" === typeof usable.then) return useThenable(usable);
- if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
- }
- throw Error(formatProdErrorMessage(438, String(usable)));
-}
-function useMemoCache(size) {
- var memoCache = null,
- updateQueue = currentlyRenderingFiber$1.updateQueue;
- null !== updateQueue && (memoCache = updateQueue.memoCache);
- if (null == memoCache) {
- var current = currentlyRenderingFiber$1.alternate;
+ didReadFromEntangledAsyncAction = !1;
+ var queue = workInProgress$jscomp$0.updateQueue;
+ hasForceUpdate = !1;
+ var firstBaseUpdate = queue.firstBaseUpdate,
+ lastBaseUpdate = queue.lastBaseUpdate,
+ pendingQueue = queue.shared.pending;
+ if (null !== pendingQueue) {
+ queue.shared.pending = null;
+ var lastPendingUpdate = pendingQueue,
+ firstPendingUpdate = lastPendingUpdate.next;
+ lastPendingUpdate.next = null;
+ null === lastBaseUpdate
+ ? (firstBaseUpdate = firstPendingUpdate)
+ : (lastBaseUpdate.next = firstPendingUpdate);
+ lastBaseUpdate = lastPendingUpdate;
+ var current = workInProgress$jscomp$0.alternate;
null !== current &&
((current = current.updateQueue),
- null !== current &&
- ((current = current.memoCache),
- null != current &&
- (memoCache = {
- data: current.data.map(function (array) {
- return array.slice();
- }),
- index: 0
- })));
- }
- null == memoCache && (memoCache = { data: [], index: 0 });
- null === updateQueue &&
- ((updateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = updateQueue));
- updateQueue.memoCache = memoCache;
- updateQueue = memoCache.data[memoCache.index];
- if (void 0 === updateQueue)
- for (
- updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
- current < size;
- current++
- )
- updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
- memoCache.index++;
- return updateQueue;
-}
-function basicStateReducer(state, action) {
- return "function" === typeof action ? action(state) : action;
-}
-function updateReducer(reducer) {
- var hook = updateWorkInProgressHook();
- return updateReducerImpl(hook, currentHook, reducer);
-}
-function updateReducerImpl(hook, current, reducer) {
- var queue = hook.queue;
- if (null === queue) throw Error(formatProdErrorMessage(311));
- queue.lastRenderedReducer = reducer;
- var baseQueue = hook.baseQueue,
- pendingQueue = queue.pending;
- if (null !== pendingQueue) {
- if (null !== baseQueue) {
- var baseFirst = baseQueue.next;
- baseQueue.next = pendingQueue.next;
- pendingQueue.next = baseFirst;
- }
- current.baseQueue = baseQueue = pendingQueue;
- queue.pending = null;
+ (pendingQueue = current.lastBaseUpdate),
+ pendingQueue !== lastBaseUpdate &&
+ (null === pendingQueue
+ ? (current.firstBaseUpdate = firstPendingUpdate)
+ : (pendingQueue.next = firstPendingUpdate),
+ (current.lastBaseUpdate = lastPendingUpdate)));
}
- pendingQueue = hook.baseState;
- if (null === baseQueue) hook.memoizedState = pendingQueue;
- else {
- current = baseQueue.next;
- var newBaseQueueFirst = (baseFirst = null),
- newBaseQueueLast = null,
- update = current,
- didReadFromEntangledAsyncAction$30 = !1;
+ if (null !== firstBaseUpdate) {
+ var newState = queue.baseState;
+ lastBaseUpdate = 0;
+ current = firstPendingUpdate = lastPendingUpdate = null;
+ pendingQueue = firstBaseUpdate;
do {
- var updateLane = update.lane & -536870913;
+ var updateLane = pendingQueue.lane & -536870913,
+ isHiddenUpdate = updateLane !== pendingQueue.lane;
if (
- updateLane !== update.lane
+ isHiddenUpdate
? (workInProgressRootRenderLanes & updateLane) === updateLane
: (renderLanes & updateLane) === updateLane
) {
- var revertLane = update.revertLane;
- if (0 === revertLane)
- null !== newBaseQueueLast &&
- (newBaseQueueLast = newBaseQueueLast.next =
- {
- lane: 0,
- revertLane: 0,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction$30 = !0);
- else if ((renderLanes & revertLane) === revertLane) {
- update = update.next;
- revertLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction$30 = !0);
- continue;
- } else
- (updateLane = {
- lane: 0,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
- next: null
- }),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
- (currentlyRenderingFiber$1.lanes |= revertLane),
- (workInProgressRootSkippedLanes |= revertLane);
- updateLane = update.action;
- shouldDoubleInvokeUserFnsInHooksDEV &&
- reducer(pendingQueue, updateLane);
- pendingQueue = update.hasEagerState
- ? update.eagerState
- : reducer(pendingQueue, updateLane);
+ 0 !== updateLane &&
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction = !0);
+ null !== current &&
+ (current = current.next =
+ {
+ lane: 0,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: null,
+ next: null
+ });
+ a: {
+ var workInProgress = workInProgress$jscomp$0,
+ update = pendingQueue;
+ updateLane = props;
+ var instance = instance$jscomp$0;
+ switch (update.tag) {
+ case 1:
+ workInProgress = update.payload;
+ if ("function" === typeof workInProgress) {
+ newState = workInProgress.call(instance, newState, updateLane);
+ break a;
+ }
+ newState = workInProgress;
+ break a;
+ case 3:
+ workInProgress.flags = (workInProgress.flags & -65537) | 128;
+ case 0:
+ workInProgress = update.payload;
+ updateLane =
+ "function" === typeof workInProgress
+ ? workInProgress.call(instance, newState, updateLane)
+ : workInProgress;
+ if (null === updateLane || void 0 === updateLane) break a;
+ newState = assign({}, newState, updateLane);
+ break a;
+ case 2:
+ hasForceUpdate = !0;
+ }
+ }
+ updateLane = pendingQueue.callback;
+ null !== updateLane &&
+ ((workInProgress$jscomp$0.flags |= 64),
+ isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),
+ (isHiddenUpdate = queue.callbacks),
+ null === isHiddenUpdate
+ ? (queue.callbacks = [updateLane])
+ : isHiddenUpdate.push(updateLane));
} else
- (revertLane = {
+ (isHiddenUpdate = {
lane: updateLane,
- revertLane: update.revertLane,
- action: update.action,
- hasEagerState: update.hasEagerState,
- eagerState: update.eagerState,
+ tag: pendingQueue.tag,
+ payload: pendingQueue.payload,
+ callback: pendingQueue.callback,
next: null
}),
- null === newBaseQueueLast
- ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
- (baseFirst = pendingQueue))
- : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
- (currentlyRenderingFiber$1.lanes |= updateLane),
- (workInProgressRootSkippedLanes |= updateLane);
- update = update.next;
- } while (null !== update && update !== current);
- null === newBaseQueueLast
- ? (baseFirst = pendingQueue)
- : (newBaseQueueLast.next = newBaseQueueFirst);
- if (
- !objectIs(pendingQueue, hook.memoizedState) &&
- ((didReceiveUpdate = !0),
- didReadFromEntangledAsyncAction$30 &&
- ((reducer = currentEntangledActionThenable), null !== reducer))
- )
- throw reducer;
- hook.memoizedState = pendingQueue;
- hook.baseState = baseFirst;
- hook.baseQueue = newBaseQueueLast;
- queue.lastRenderedState = pendingQueue;
+ null === current
+ ? ((firstPendingUpdate = current = isHiddenUpdate),
+ (lastPendingUpdate = newState))
+ : (current = current.next = isHiddenUpdate),
+ (lastBaseUpdate |= updateLane);
+ pendingQueue = pendingQueue.next;
+ if (null === pendingQueue)
+ if (((pendingQueue = queue.shared.pending), null === pendingQueue))
+ break;
+ else
+ (isHiddenUpdate = pendingQueue),
+ (pendingQueue = isHiddenUpdate.next),
+ (isHiddenUpdate.next = null),
+ (queue.lastBaseUpdate = isHiddenUpdate),
+ (queue.shared.pending = null);
+ } while (1);
+ null === current && (lastPendingUpdate = newState);
+ queue.baseState = lastPendingUpdate;
+ queue.firstBaseUpdate = firstPendingUpdate;
+ queue.lastBaseUpdate = current;
+ null === firstBaseUpdate && (queue.shared.lanes = 0);
+ workInProgressRootSkippedLanes |= lastBaseUpdate;
+ workInProgress$jscomp$0.lanes = lastBaseUpdate;
+ workInProgress$jscomp$0.memoizedState = newState;
}
- null === baseQueue && (queue.lanes = 0);
- return [hook.memoizedState, queue.dispatch];
}
-function rerenderReducer(reducer) {
- var hook = updateWorkInProgressHook(),
- queue = hook.queue;
- if (null === queue) throw Error(formatProdErrorMessage(311));
- queue.lastRenderedReducer = reducer;
- var dispatch = queue.dispatch,
- lastRenderPhaseUpdate = queue.pending,
- newState = hook.memoizedState;
- if (null !== lastRenderPhaseUpdate) {
- queue.pending = null;
- var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
- do (newState = reducer(newState, update.action)), (update = update.next);
- while (update !== lastRenderPhaseUpdate);
- objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
- hook.memoizedState = newState;
- null === hook.baseQueue && (hook.baseState = newState);
- queue.lastRenderedState = newState;
- }
- return [newState, dispatch];
+function callCallback(callback, context) {
+ if ("function" !== typeof callback)
+ throw Error(formatProdErrorMessage(191, callback));
+ callback.call(context);
}
-function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = updateWorkInProgressHook(),
- isHydrating$jscomp$0 = isHydrating;
- if (isHydrating$jscomp$0) {
- if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
- getServerSnapshot = getServerSnapshot();
- } else getServerSnapshot = getSnapshot();
- var snapshotChanged = !objectIs(
- (currentHook || hook).memoizedState,
- getServerSnapshot
- );
- snapshotChanged &&
- ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));
- hook = hook.queue;
- updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
- subscribe
- ]);
- if (
- hook.getSnapshot !== getSnapshot ||
- snapshotChanged ||
- (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)
- ) {
- fiber.flags |= 2048;
- pushSimpleEffect(
- 9,
- createEffectInstance(),
- updateStoreInstance.bind(
- null,
- fiber,
- hook,
- getServerSnapshot,
- getSnapshot
- ),
- null
- );
- if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
- isHydrating$jscomp$0 ||
- 0 !== (renderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- return getServerSnapshot;
+function commitCallbacks(updateQueue, context) {
+ var callbacks = updateQueue.callbacks;
+ if (null !== callbacks)
+ for (
+ updateQueue.callbacks = null, updateQueue = 0;
+ updateQueue < callbacks.length;
+ updateQueue++
+ )
+ callCallback(callbacks[updateQueue], context);
}
-function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
- fiber.flags |= 16384;
- fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
- getSnapshot = currentlyRenderingFiber$1.updateQueue;
- null === getSnapshot
- ? ((getSnapshot = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = getSnapshot),
- (getSnapshot.stores = [fiber]))
- : ((renderedSnapshot = getSnapshot.stores),
- null === renderedSnapshot
- ? (getSnapshot.stores = [fiber])
- : renderedSnapshot.push(fiber));
+var AbortControllerLocal =
+ "undefined" !== typeof AbortController
+ ? AbortController
+ : function () {
+ var listeners = [],
+ signal = (this.signal = {
+ aborted: !1,
+ addEventListener: function (type, listener) {
+ listeners.push(listener);
+ }
+ });
+ this.abort = function () {
+ signal.aborted = !0;
+ listeners.forEach(function (listener) {
+ return listener();
+ });
+ };
+ },
+ scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
+ NormalPriority = Scheduler.unstable_NormalPriority,
+ CacheContext = {
+ $$typeof: REACT_CONTEXT_TYPE,
+ Consumer: null,
+ Provider: null,
+ _currentValue: null,
+ _currentValue2: null,
+ _threadCount: 0
+ };
+function createCache() {
+ return {
+ controller: new AbortControllerLocal(),
+ data: new Map(),
+ refCount: 0
+ };
}
-function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
- inst.value = nextSnapshot;
- inst.getSnapshot = getSnapshot;
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+function releaseCache(cache) {
+ cache.refCount--;
+ 0 === cache.refCount &&
+ scheduleCallback$2(NormalPriority, function () {
+ cache.controller.abort();
+ });
}
-function subscribeToStore(fiber, inst, subscribe) {
- return subscribe(function () {
- checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
- });
+function applyDerivedStateFromProps(
+ workInProgress,
+ ctor,
+ getDerivedStateFromProps,
+ nextProps
+) {
+ ctor = workInProgress.memoizedState;
+ getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
+ getDerivedStateFromProps =
+ null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
+ ? ctor
+ : assign({}, ctor, getDerivedStateFromProps);
+ workInProgress.memoizedState = getDerivedStateFromProps;
+ 0 === workInProgress.lanes &&
+ (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
}
-function checkIfSnapshotChanged(inst) {
- var latestGetSnapshot = inst.getSnapshot;
- inst = inst.value;
- try {
- var nextValue = latestGetSnapshot();
- return !objectIs(inst, nextValue);
- } catch (error) {
- return !0;
+var classComponentUpdater = {
+ isMounted: function (component) {
+ return (component = component._reactInternals)
+ ? getNearestMountedFiber(component) === component
+ : !1;
+ },
+ enqueueSetState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.payload = payload;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueReplaceState: function (inst, payload, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.tag = 1;
+ update.payload = payload;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ payload = enqueueUpdate(inst, update, lane);
+ null !== payload &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(payload, inst, lane),
+ entangleTransitions(payload, inst, lane));
+ },
+ enqueueForceUpdate: function (inst, callback) {
+ inst = inst._reactInternals;
+ var lane = requestUpdateLane(),
+ update = createUpdate(lane);
+ update.tag = 2;
+ void 0 !== callback && null !== callback && (update.callback = callback);
+ callback = enqueueUpdate(inst, update, lane);
+ null !== callback &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(callback, inst, lane),
+ entangleTransitions(callback, inst, lane));
}
+};
+function checkShouldComponentUpdate(
+ workInProgress,
+ ctor,
+ oldProps,
+ newProps,
+ oldState,
+ newState,
+ nextContext
+) {
+ workInProgress = workInProgress.stateNode;
+ return "function" === typeof workInProgress.shouldComponentUpdate
+ ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
+ : ctor.prototype && ctor.prototype.isPureReactComponent
+ ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
+ : !0;
}
-function forceStoreRerender(fiber) {
- var root = enqueueConcurrentRenderForLane(fiber, 2);
- null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+function callComponentWillReceiveProps(
+ workInProgress,
+ instance,
+ newProps,
+ nextContext
+) {
+ workInProgress = instance.state;
+ "function" === typeof instance.componentWillReceiveProps &&
+ instance.componentWillReceiveProps(newProps, nextContext);
+ "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
+ instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
+ instance.state !== workInProgress &&
+ classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
}
-function mountStateImpl(initialState) {
- var hook = mountWorkInProgressHook();
- if ("function" === typeof initialState) {
- var initialStateInitializer = initialState;
- initialState = initialStateInitializer();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- initialStateInitializer();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
+function resolveClassComponentProps(Component, baseProps) {
+ var newProps = baseProps;
+ if ("ref" in baseProps) {
+ newProps = {};
+ for (var propName in baseProps)
+ "ref" !== propName && (newProps[propName] = baseProps[propName]);
}
- hook.memoizedState = hook.baseState = initialState;
- hook.queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- return hook;
-}
-function updateOptimisticImpl(hook, current, passthrough, reducer) {
- hook.baseState = passthrough;
- return updateReducerImpl(
- hook,
- currentHook,
- "function" === typeof reducer ? reducer : basicStateReducer
- );
+ if ((Component = Component.defaultProps)) {
+ newProps === baseProps && (newProps = assign({}, newProps));
+ for (var propName$32 in Component)
+ void 0 === newProps[propName$32] &&
+ (newProps[propName$32] = Component[propName$32]);
+ }
+ return newProps;
}
-function dispatchActionState(
- fiber,
- actionQueue,
- setPendingState,
- setState,
- payload
-) {
- if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
- fiber = actionQueue.action;
- if (null !== fiber) {
- var actionNode = {
- payload: payload,
- action: fiber,
- next: null,
- isTransition: !0,
- status: "pending",
- value: null,
- reason: null,
- listeners: [],
- then: function (listener) {
- actionNode.listeners.push(listener);
- }
+var CapturedStacks = new WeakMap();
+function createCapturedValueAtFiber(value, source) {
+ if ("object" === typeof value && null !== value) {
+ var existing = CapturedStacks.get(value);
+ if (void 0 !== existing) return existing;
+ source = {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
};
- null !== ReactSharedInternals.T
- ? setPendingState(!0)
- : (actionNode.isTransition = !1);
- setState(actionNode);
- setPendingState = actionQueue.pending;
- null === setPendingState
- ? ((actionNode.next = actionQueue.pending = actionNode),
- runActionStateAction(actionQueue, actionNode))
- : ((actionNode.next = setPendingState.next),
- (actionQueue.pending = setPendingState.next = actionNode));
+ CapturedStacks.set(value, source);
+ return source;
}
+ return {
+ value: value,
+ source: source,
+ stack: getStackByFiberInDevAndProd(source)
+ };
}
-function runActionStateAction(actionQueue, node) {
- var action = node.action,
- payload = node.payload,
- prevState = actionQueue.state;
- if (node.isTransition) {
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- try {
- var returnValue = action(prevState, payload),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- handleActionReturnValue(actionQueue, node, returnValue);
- } catch (error) {
- onActionError(actionQueue, node, error);
- } finally {
- ReactSharedInternals.T = prevTransition;
- }
+var forkStack = [],
+ forkStackIndex = 0,
+ treeForkProvider = null,
+ treeForkCount = 0,
+ idStack = [],
+ idStackIndex = 0,
+ treeContextProvider = null,
+ treeContextId = 1,
+ treeContextOverflow = "";
+function pushTreeFork(workInProgress, totalChildren) {
+ forkStack[forkStackIndex++] = treeForkCount;
+ forkStack[forkStackIndex++] = treeForkProvider;
+ treeForkProvider = workInProgress;
+ treeForkCount = totalChildren;
+}
+function pushTreeId(workInProgress, totalChildren, index) {
+ idStack[idStackIndex++] = treeContextId;
+ idStack[idStackIndex++] = treeContextOverflow;
+ idStack[idStackIndex++] = treeContextProvider;
+ treeContextProvider = workInProgress;
+ var baseIdWithLeadingBit = treeContextId;
+ workInProgress = treeContextOverflow;
+ var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
+ baseIdWithLeadingBit &= ~(1 << baseLength);
+ index += 1;
+ var length = 32 - clz32(totalChildren) + baseLength;
+ if (30 < length) {
+ var numberOfOverflowBits = baseLength - (baseLength % 5);
+ length = (
+ baseIdWithLeadingBit &
+ ((1 << numberOfOverflowBits) - 1)
+ ).toString(32);
+ baseIdWithLeadingBit >>= numberOfOverflowBits;
+ baseLength -= numberOfOverflowBits;
+ treeContextId =
+ (1 << (32 - clz32(totalChildren) + baseLength)) |
+ (index << baseLength) |
+ baseIdWithLeadingBit;
+ treeContextOverflow = length + workInProgress;
} else
- try {
- (prevTransition = action(prevState, payload)),
- handleActionReturnValue(actionQueue, node, prevTransition);
- } catch (error$36) {
- onActionError(actionQueue, node, error$36);
- }
+ (treeContextId =
+ (1 << length) | (index << baseLength) | baseIdWithLeadingBit),
+ (treeContextOverflow = workInProgress);
}
-function handleActionReturnValue(actionQueue, node, returnValue) {
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
- ? returnValue.then(
- function (nextState) {
- onActionSuccess(actionQueue, node, nextState);
- },
- function (error) {
- return onActionError(actionQueue, node, error);
- }
- )
- : onActionSuccess(actionQueue, node, returnValue);
+function pushMaterializedTreeId(workInProgress) {
+ null !== workInProgress.return &&
+ (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));
}
-function onActionSuccess(actionQueue, actionNode, nextState) {
- actionNode.status = "fulfilled";
- actionNode.value = nextState;
- notifyActionListeners(actionNode);
- actionQueue.state = nextState;
- actionNode = actionQueue.pending;
- null !== actionNode &&
- ((nextState = actionNode.next),
- nextState === actionNode
- ? (actionQueue.pending = null)
- : ((nextState = nextState.next),
- (actionNode.next = nextState),
- runActionStateAction(actionQueue, nextState)));
+function popTreeContext(workInProgress) {
+ for (; workInProgress === treeForkProvider; )
+ (treeForkProvider = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null),
+ (treeForkCount = forkStack[--forkStackIndex]),
+ (forkStack[forkStackIndex] = null);
+ for (; workInProgress === treeContextProvider; )
+ (treeContextProvider = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextOverflow = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null),
+ (treeContextId = idStack[--idStackIndex]),
+ (idStack[idStackIndex] = null);
}
-function onActionError(actionQueue, actionNode, error) {
- var last = actionQueue.pending;
- actionQueue.pending = null;
- if (null !== last) {
- last = last.next;
- do
- (actionNode.status = "rejected"),
- (actionNode.reason = error),
- notifyActionListeners(actionNode),
- (actionNode = actionNode.next);
- while (actionNode !== last);
- }
- actionQueue.action = null;
+var hydrationParentFiber = null,
+ nextHydratableInstance = null,
+ isHydrating = !1,
+ hydrationErrors = null,
+ rootOrSingletonContext = !1,
+ HydrationMismatchException = Error(formatProdErrorMessage(519));
+function throwOnHydrationMismatch(fiber) {
+ var error = Error(formatProdErrorMessage(418, ""));
+ queueHydrationError(createCapturedValueAtFiber(error, fiber));
+ throw HydrationMismatchException;
}
-function notifyActionListeners(actionNode) {
- actionNode = actionNode.listeners;
- for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+function prepareToHydrateHostInstance(fiber) {
+ var instance = fiber.stateNode,
+ type = fiber.type,
+ props = fiber.memoizedProps;
+ instance[internalInstanceKey] = fiber;
+ instance[internalPropsKey] = props;
+ switch (type) {
+ case "dialog":
+ listenToNonDelegatedEvent("cancel", instance);
+ listenToNonDelegatedEvent("close", instance);
+ break;
+ case "iframe":
+ case "object":
+ case "embed":
+ listenToNonDelegatedEvent("load", instance);
+ break;
+ case "video":
+ case "audio":
+ for (type = 0; type < mediaEventTypes.length; type++)
+ listenToNonDelegatedEvent(mediaEventTypes[type], instance);
+ break;
+ case "source":
+ listenToNonDelegatedEvent("error", instance);
+ break;
+ case "img":
+ case "image":
+ case "link":
+ listenToNonDelegatedEvent("error", instance);
+ listenToNonDelegatedEvent("load", instance);
+ break;
+ case "details":
+ listenToNonDelegatedEvent("toggle", instance);
+ break;
+ case "input":
+ listenToNonDelegatedEvent("invalid", instance);
+ initInput(
+ instance,
+ props.value,
+ props.defaultValue,
+ props.checked,
+ props.defaultChecked,
+ props.type,
+ props.name,
+ !0
+ );
+ track(instance);
+ break;
+ case "select":
+ listenToNonDelegatedEvent("invalid", instance);
+ break;
+ case "textarea":
+ listenToNonDelegatedEvent("invalid", instance),
+ initTextarea(instance, props.value, props.defaultValue, props.children),
+ track(instance);
+ }
+ type = props.children;
+ ("string" !== typeof type &&
+ "number" !== typeof type &&
+ "bigint" !== typeof type) ||
+ instance.textContent === "" + type ||
+ !0 === props.suppressHydrationWarning ||
+ checkForUnmatchedText(instance.textContent, type)
+ ? (null != props.popover &&
+ (listenToNonDelegatedEvent("beforetoggle", instance),
+ listenToNonDelegatedEvent("toggle", instance)),
+ null != props.onScroll && listenToNonDelegatedEvent("scroll", instance),
+ null != props.onScrollEnd &&
+ listenToNonDelegatedEvent("scrollend", instance),
+ null != props.onClick && (instance.onclick = noop$2),
+ (instance = !0))
+ : (instance = !1);
+ instance || throwOnHydrationMismatch(fiber);
}
-function actionStateReducer(oldState, newState) {
- return newState;
+function popToNextHostParent(fiber) {
+ for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
+ switch (hydrationParentFiber.tag) {
+ case 3:
+ case 27:
+ rootOrSingletonContext = !0;
+ return;
+ case 5:
+ case 13:
+ rootOrSingletonContext = !1;
+ return;
+ default:
+ hydrationParentFiber = hydrationParentFiber.return;
+ }
}
-function mountActionState(action, initialStateProp) {
- if (isHydrating) {
- var ssrFormState = workInProgressRoot.formState;
- if (null !== ssrFormState) {
- a: {
- var JSCompiler_inline_result = currentlyRenderingFiber$1;
- if (isHydrating) {
- if (nextHydratableInstance) {
- b: {
- var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
- for (
- var inRootOrSingleton = rootOrSingletonContext;
- 8 !== JSCompiler_inline_result$jscomp$0.nodeType;
-
- ) {
- if (!inRootOrSingleton) {
- JSCompiler_inline_result$jscomp$0 = null;
- break b;
- }
- JSCompiler_inline_result$jscomp$0 = getNextHydratable(
- JSCompiler_inline_result$jscomp$0.nextSibling
- );
- if (null === JSCompiler_inline_result$jscomp$0) {
- JSCompiler_inline_result$jscomp$0 = null;
- break b;
- }
- }
- inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
- JSCompiler_inline_result$jscomp$0 =
- "F!" === inRootOrSingleton || "F" === inRootOrSingleton
- ? JSCompiler_inline_result$jscomp$0
- : null;
- }
- if (JSCompiler_inline_result$jscomp$0) {
- nextHydratableInstance = getNextHydratable(
- JSCompiler_inline_result$jscomp$0.nextSibling
- );
- JSCompiler_inline_result =
- "F!" === JSCompiler_inline_result$jscomp$0.data;
+function popHydrationState(fiber) {
+ if (fiber !== hydrationParentFiber) return !1;
+ if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;
+ var shouldClear = !1,
+ JSCompiler_temp;
+ if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) {
+ if ((JSCompiler_temp = 5 === fiber.tag))
+ (JSCompiler_temp = fiber.type),
+ (JSCompiler_temp =
+ !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) ||
+ shouldSetTextContent(fiber.type, fiber.memoizedProps));
+ JSCompiler_temp = !JSCompiler_temp;
+ }
+ JSCompiler_temp && (shouldClear = !0);
+ shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber);
+ popToNextHostParent(fiber);
+ if (13 === fiber.tag) {
+ fiber = fiber.memoizedState;
+ fiber = null !== fiber ? fiber.dehydrated : null;
+ if (!fiber) throw Error(formatProdErrorMessage(317));
+ a: {
+ fiber = fiber.nextSibling;
+ for (shouldClear = 0; fiber; ) {
+ if (8 === fiber.nodeType)
+ if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) {
+ if (0 === shouldClear) {
+ nextHydratableInstance = getNextHydratable(fiber.nextSibling);
break a;
}
- }
- throwOnHydrationMismatch(JSCompiler_inline_result);
- }
- JSCompiler_inline_result = !1;
+ shouldClear--;
+ } else
+ ("$" !== JSCompiler_temp &&
+ "$!" !== JSCompiler_temp &&
+ "$?" !== JSCompiler_temp) ||
+ shouldClear++;
+ fiber = fiber.nextSibling;
}
- JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
+ nextHydratableInstance = null;
}
- }
- ssrFormState = mountWorkInProgressHook();
- ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
- JSCompiler_inline_result = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: actionStateReducer,
- lastRenderedState: initialStateProp
- };
- ssrFormState.queue = JSCompiler_inline_result;
- ssrFormState = dispatchSetState.bind(
- null,
- currentlyRenderingFiber$1,
- JSCompiler_inline_result
- );
- JSCompiler_inline_result.dispatch = ssrFormState;
- JSCompiler_inline_result = mountStateImpl(!1);
- inRootOrSingleton = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !1,
- JSCompiler_inline_result.queue
- );
- JSCompiler_inline_result = mountWorkInProgressHook();
- JSCompiler_inline_result$jscomp$0 = {
- state: initialStateProp,
- dispatch: null,
- action: action,
- pending: null
- };
- JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
- ssrFormState = dispatchActionState.bind(
- null,
- currentlyRenderingFiber$1,
- JSCompiler_inline_result$jscomp$0,
- inRootOrSingleton,
- ssrFormState
- );
- JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
- JSCompiler_inline_result.memoizedState = action;
- return [initialStateProp, ssrFormState, !1];
-}
-function updateActionState(action) {
- var stateHook = updateWorkInProgressHook();
- return updateActionStateImpl(stateHook, currentHook, action);
+ } else
+ nextHydratableInstance = hydrationParentFiber
+ ? getNextHydratable(fiber.stateNode.nextSibling)
+ : null;
+ return !0;
}
-function updateActionStateImpl(stateHook, currentStateHook, action) {
- currentStateHook = updateReducerImpl(
- stateHook,
- currentStateHook,
- actionStateReducer
- )[0];
- stateHook = updateReducer(basicStateReducer)[0];
- if (
- "object" === typeof currentStateHook &&
- null !== currentStateHook &&
- "function" === typeof currentStateHook.then
- )
- try {
- var state = useThenable(currentStateHook);
- } catch (x) {
- if (x === SuspenseException) throw SuspenseActionException;
- throw x;
- }
- else state = currentStateHook;
- currentStateHook = updateWorkInProgressHook();
- var actionQueue = currentStateHook.queue,
- dispatch = actionQueue.dispatch;
- action !== currentStateHook.memoizedState &&
- ((currentlyRenderingFiber$1.flags |= 2048),
- pushSimpleEffect(
- 9,
- createEffectInstance(),
- actionStateActionEffect.bind(null, actionQueue, action),
- null
- ));
- return [state, dispatch, stateHook];
+function resetHydrationState() {
+ nextHydratableInstance = hydrationParentFiber = null;
+ isHydrating = !1;
}
-function actionStateActionEffect(actionQueue, action) {
- actionQueue.action = action;
+function upgradeHydrationErrorsToRecoverable() {
+ var queuedErrors = hydrationErrors;
+ null !== queuedErrors &&
+ (null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = queuedErrors)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ queuedErrors
+ ),
+ (hydrationErrors = null));
+ return queuedErrors;
}
-function rerenderActionState(action) {
- var stateHook = updateWorkInProgressHook(),
- currentStateHook = currentHook;
- if (null !== currentStateHook)
- return updateActionStateImpl(stateHook, currentStateHook, action);
- updateWorkInProgressHook();
- stateHook = stateHook.memoizedState;
- currentStateHook = updateWorkInProgressHook();
- var dispatch = currentStateHook.queue.dispatch;
- currentStateHook.memoizedState = action;
- return [stateHook, dispatch, !1];
+function queueHydrationError(error) {
+ null === hydrationErrors
+ ? (hydrationErrors = [error])
+ : hydrationErrors.push(error);
}
-function pushSimpleEffect(tag, inst, create, deps) {
- tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
- inst = currentlyRenderingFiber$1.updateQueue;
- null === inst &&
- ((inst = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = inst));
- create = inst.lastEffect;
- null === create
- ? (inst.lastEffect = tag.next = tag)
- : ((deps = create.next),
- (create.next = tag),
- (tag.next = deps),
- (inst.lastEffect = tag));
- return tag;
+var SuspenseException = Error(formatProdErrorMessage(460)),
+ SuspenseyCommitException = Error(formatProdErrorMessage(474)),
+ SuspenseActionException = Error(formatProdErrorMessage(542)),
+ noopSuspenseyCommitThenable = { then: function () {} };
+function isThenableResolved(thenable) {
+ thenable = thenable.status;
+ return "fulfilled" === thenable || "rejected" === thenable;
}
-function createEffectInstance() {
- return { destroy: void 0, resource: void 0 };
+function noop$4() {}
+function trackUsedThenable(thenableState, thenable, index) {
+ index = thenableState[index];
+ void 0 === index
+ ? thenableState.push(thenable)
+ : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index));
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ default:
+ if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4);
+ else {
+ thenableState = workInProgressRoot;
+ if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
+ throw Error(formatProdErrorMessage(482));
+ thenableState = thenable;
+ thenableState.status = "pending";
+ thenableState.then(
+ function (fulfilledValue) {
+ if ("pending" === thenable.status) {
+ var fulfilledThenable = thenable;
+ fulfilledThenable.status = "fulfilled";
+ fulfilledThenable.value = fulfilledValue;
+ }
+ },
+ function (error) {
+ if ("pending" === thenable.status) {
+ var rejectedThenable = thenable;
+ rejectedThenable.status = "rejected";
+ rejectedThenable.reason = error;
+ }
+ }
+ );
+ }
+ switch (thenable.status) {
+ case "fulfilled":
+ return thenable.value;
+ case "rejected":
+ throw (
+ ((thenableState = thenable.reason),
+ checkIfUseWrappedInAsyncCatch(thenableState),
+ thenableState)
+ );
+ }
+ suspendedThenable = thenable;
+ throw SuspenseException;
+ }
}
-function updateRef() {
- return updateWorkInProgressHook().memoizedState;
+var suspendedThenable = null;
+function getSuspendedThenable() {
+ if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
+ var thenable = suspendedThenable;
+ suspendedThenable = null;
+ return thenable;
}
-function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- currentlyRenderingFiber$1.flags |= fiberFlags;
- hook.memoizedState = pushSimpleEffect(
- 1 | hookFlags,
- createEffectInstance(),
- create,
- deps
- );
+function checkIfUseWrappedInAsyncCatch(rejectedReason) {
+ if (
+ rejectedReason === SuspenseException ||
+ rejectedReason === SuspenseActionException
+ )
+ throw Error(formatProdErrorMessage(483));
}
-function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var inst = hook.memoizedState.inst;
- null !== currentHook &&
- null !== deps &&
- areHookInputsEqual(deps, currentHook.memoizedState.deps)
- ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
- : ((currentlyRenderingFiber$1.flags |= fiberFlags),
- (hook.memoizedState = pushSimpleEffect(
- 1 | hookFlags,
- inst,
- create,
- deps
- )));
+var currentTreeHiddenStackCursor = createCursor(null),
+ prevEntangledRenderLanesCursor = createCursor(0);
+function pushHiddenContext(fiber, context) {
+ fiber = entangledRenderLanes;
+ push(prevEntangledRenderLanesCursor, fiber);
+ push(currentTreeHiddenStackCursor, context);
+ entangledRenderLanes = fiber | context.baseLanes;
}
-function mountEffect(create, deps) {
- mountEffectImpl(8390656, 8, create, deps);
+function reuseHiddenContextOnStack() {
+ push(prevEntangledRenderLanesCursor, entangledRenderLanes);
+ push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
}
-function updateEffect(create, deps) {
- updateEffectImpl(2048, 8, create, deps);
+function popHiddenContext() {
+ entangledRenderLanes = prevEntangledRenderLanesCursor.current;
+ pop(currentTreeHiddenStackCursor);
+ pop(prevEntangledRenderLanesCursor);
}
-function useEffectEventImpl(payload) {
- currentlyRenderingFiber$1.flags |= 4;
- var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
- if (null === componentUpdateQueue)
- (componentUpdateQueue = createFunctionComponentUpdateQueue()),
- (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue),
- (componentUpdateQueue.events = [payload]);
- else {
- var events = componentUpdateQueue.events;
- null === events
- ? (componentUpdateQueue.events = [payload])
- : events.push(payload);
+var prevOnStartTransitionFinish = ReactSharedInternals.S;
+ReactSharedInternals.S = function (transition, returnValue) {
+ if (
+ "object" === typeof returnValue &&
+ null !== returnValue &&
+ "function" === typeof returnValue.then
+ ) {
+ if (0 > transitionStartTime && 0 > transitionUpdateTime) {
+ transitionStartTime = now();
+ var newEventTime = resolveEventTimeStamp(),
+ newEventType = resolveEventType();
+ if (
+ newEventTime !== transitionEventTime ||
+ newEventType !== transitionEventType
+ )
+ transitionEventIsRepeat = !1;
+ transitionEventTime = newEventTime;
+ transitionEventType = newEventType;
+ }
+ entangleAsyncAction(transition, returnValue);
}
+ null !== prevOnStartTransitionFinish &&
+ prevOnStartTransitionFinish(transition, returnValue);
+};
+var resumedCache = createCursor(null);
+function peekCacheFromPool() {
+ var cacheResumedFromPreviousRender = resumedCache.current;
+ return null !== cacheResumedFromPreviousRender
+ ? cacheResumedFromPreviousRender
+ : workInProgressRoot.pooledCache;
}
-function updateEvent(callback) {
- var ref = updateWorkInProgressHook().memoizedState;
- useEffectEventImpl({ ref: ref, nextImpl: callback });
- return function () {
- if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
- return ref.impl.apply(void 0, arguments);
- };
-}
-function updateInsertionEffect(create, deps) {
- return updateEffectImpl(4, 2, create, deps);
-}
-function updateLayoutEffect(create, deps) {
- return updateEffectImpl(4, 4, create, deps);
+function pushTransition(offscreenWorkInProgress, prevCachePool) {
+ null === prevCachePool
+ ? push(resumedCache, resumedCache.current)
+ : push(resumedCache, prevCachePool.pool);
}
-function imperativeHandleEffect(create, ref) {
- if ("function" === typeof ref) {
- create = create();
- var refCleanup = ref(create);
- return function () {
- "function" === typeof refCleanup ? refCleanup() : ref(null);
- };
- }
- if (null !== ref && void 0 !== ref)
- return (
- (create = create()),
- (ref.current = create),
- function () {
- ref.current = null;
- }
- );
+function getSuspendedCache() {
+ var cacheFromPool = peekCacheFromPool();
+ return null === cacheFromPool
+ ? null
+ : { parent: CacheContext._currentValue, pool: cacheFromPool };
}
-function updateImperativeHandle(ref, create, deps) {
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
+var renderLanes = 0,
+ currentlyRenderingFiber = null,
+ currentHook = null,
+ workInProgressHook = null,
+ didScheduleRenderPhaseUpdate = !1,
+ didScheduleRenderPhaseUpdateDuringThisPass = !1,
+ shouldDoubleInvokeUserFnsInHooksDEV = !1,
+ localIdCounter = 0,
+ thenableIndexCounter$1 = 0,
+ thenableState$1 = null,
+ globalClientIdCounter = 0;
+function throwInvalidHookError() {
+ throw Error(formatProdErrorMessage(321));
}
-function mountDebugValue() {}
-function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- hook.memoizedState = [callback, deps];
- return callback;
+function areHookInputsEqual(nextDeps, prevDeps) {
+ if (null === prevDeps) return !1;
+ for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
+ if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
+ return !0;
}
-function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var prevState = hook.memoizedState;
- if (null !== deps && areHookInputsEqual(deps, prevState[1]))
- return prevState[0];
- prevState = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
+function renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ props,
+ secondArg,
+ nextRenderLanes
+) {
+ renderLanes = nextRenderLanes;
+ currentlyRenderingFiber = workInProgress;
+ workInProgress.memoizedState = null;
+ workInProgress.updateQueue = null;
+ workInProgress.lanes = 0;
+ ReactSharedInternals.H =
+ null === current || null === current.memoizedState
+ ? HooksDispatcherOnMount
+ : HooksDispatcherOnUpdate;
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ nextRenderLanes = Component(props, secondArg);
+ shouldDoubleInvokeUserFnsInHooksDEV = !1;
+ didScheduleRenderPhaseUpdateDuringThisPass &&
+ (nextRenderLanes = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ props,
+ secondArg
+ ));
+ finishRenderingHooks(current);
+ return nextRenderLanes;
+}
+function finishRenderingHooks(current) {
+ ReactSharedInternals.H = ContextOnlyDispatcher;
+ var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
+ renderLanes = 0;
+ workInProgressHook = currentHook = currentlyRenderingFiber = null;
+ didScheduleRenderPhaseUpdate = !1;
+ thenableIndexCounter$1 = 0;
+ thenableState$1 = null;
+ if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
+ null === current ||
+ didReceiveUpdate ||
+ ((current = current.dependencies),
+ null !== current &&
+ checkIfContextChanged(current) &&
+ (didReceiveUpdate = !0));
+}
+function renderWithHooksAgain(workInProgress, Component, props, secondArg) {
+ currentlyRenderingFiber = workInProgress;
+ var numberOfReRenders = 0;
+ do {
+ didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
+ thenableIndexCounter$1 = 0;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
+ numberOfReRenders += 1;
+ workInProgressHook = currentHook = null;
+ if (null != workInProgress.updateQueue) {
+ var children = workInProgress.updateQueue;
+ children.lastEffect = null;
+ children.events = null;
+ children.stores = null;
+ null != children.memoCache && (children.memoCache.index = 0);
}
- }
- hook.memoizedState = [prevState, deps];
- return prevState;
+ ReactSharedInternals.H = HooksDispatcherOnRerender;
+ children = Component(props, secondArg);
+ } while (didScheduleRenderPhaseUpdateDuringThisPass);
+ return children;
}
-function mountDeferredValueImpl(hook, value, initialValue) {
- if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
- return (hook.memoizedState = value);
- hook.memoizedState = initialValue;
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return initialValue;
+function TransitionAwareHostComponent() {
+ var dispatcher = ReactSharedInternals.H,
+ maybeThenable = dispatcher.useState()[0];
+ maybeThenable =
+ "function" === typeof maybeThenable.then
+ ? useThenable(maybeThenable)
+ : maybeThenable;
+ dispatcher = dispatcher.useState()[0];
+ (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&
+ (currentlyRenderingFiber.flags |= 1024);
+ return maybeThenable;
}
-function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
- if (objectIs(value, prevValue)) return value;
- if (null !== currentTreeHiddenStackCursor.current)
- return (
- (hook = mountDeferredValueImpl(hook, value, initialValue)),
- objectIs(hook, prevValue) || (didReceiveUpdate = !0),
- hook
- );
- if (0 === (renderLanes & 42))
- return (didReceiveUpdate = !0), (hook.memoizedState = value);
- hook = requestDeferredLane();
- currentlyRenderingFiber$1.lanes |= hook;
- workInProgressRootSkippedLanes |= hook;
- return prevValue;
+function checkDidRenderIdHook() {
+ var didRenderIdHook = 0 !== localIdCounter;
+ localIdCounter = 0;
+ return didRenderIdHook;
}
-function startTransition(fiber, queue, pendingState, finishedState, callback) {
- var previousPriority = ReactDOMSharedInternals.p;
- ReactDOMSharedInternals.p =
- 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
- var prevTransition = ReactSharedInternals.T,
- currentTransition = {};
- ReactSharedInternals.T = currentTransition;
- dispatchOptimisticSetState(fiber, !1, queue, pendingState);
- try {
- var returnValue = callback(),
- onStartTransitionFinish = ReactSharedInternals.S;
- null !== onStartTransitionFinish &&
- onStartTransitionFinish(currentTransition, returnValue);
- if (
- null !== returnValue &&
- "object" === typeof returnValue &&
- "function" === typeof returnValue.then
+function bailoutHooks(current, workInProgress, lanes) {
+ workInProgress.updateQueue = current.updateQueue;
+ workInProgress.flags &= -2053;
+ current.lanes &= ~lanes;
+}
+function resetHooksOnUnwind(workInProgress) {
+ if (didScheduleRenderPhaseUpdate) {
+ for (
+ workInProgress = workInProgress.memoizedState;
+ null !== workInProgress;
+
) {
- var thenableForFinishedState = chainThenableValue(
- returnValue,
- finishedState
- );
- dispatchSetStateInternal(
- fiber,
- queue,
- thenableForFinishedState,
- requestUpdateLane(fiber)
- );
- } else
- dispatchSetStateInternal(
- fiber,
- queue,
- finishedState,
- requestUpdateLane(fiber)
- );
- } catch (error) {
- dispatchSetStateInternal(
- fiber,
- queue,
- { then: function () {}, status: "rejected", reason: error },
- requestUpdateLane()
- );
- } finally {
- (ReactDOMSharedInternals.p = previousPriority),
- (ReactSharedInternals.T = prevTransition);
+ var queue = workInProgress.queue;
+ null !== queue && (queue.pending = null);
+ workInProgress = workInProgress.next;
+ }
+ didScheduleRenderPhaseUpdate = !1;
}
+ renderLanes = 0;
+ workInProgressHook = currentHook = currentlyRenderingFiber = null;
+ didScheduleRenderPhaseUpdateDuringThisPass = !1;
+ thenableIndexCounter$1 = localIdCounter = 0;
+ thenableState$1 = null;
}
-function noop$3() {}
-function startHostTransition(formFiber, pendingState, action, formData) {
- if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
- var queue = ensureFormComponentIsStateful(formFiber).queue;
- startTransition(
- formFiber,
- queue,
- pendingState,
- sharedNotPendingObject,
- null === action
- ? noop$3
- : function () {
- requestFormReset$2(formFiber);
- return action(formData);
- }
- );
-}
-function ensureFormComponentIsStateful(formFiber) {
- var existingStateHook = formFiber.memoizedState;
- if (null !== existingStateHook) return existingStateHook;
- existingStateHook = {
- memoizedState: sharedNotPendingObject,
- baseState: sharedNotPendingObject,
- baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: sharedNotPendingObject
- },
- next: null
- };
- var initialResetState = {};
- existingStateHook.next = {
- memoizedState: initialResetState,
- baseState: initialResetState,
+function mountWorkInProgressHook() {
+ var hook = {
+ memoizedState: null,
+ baseState: null,
baseQueue: null,
- queue: {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialResetState
- },
+ queue: null,
next: null
};
- formFiber.memoizedState = existingStateHook;
- formFiber = formFiber.alternate;
- null !== formFiber && (formFiber.memoizedState = existingStateHook);
- return existingStateHook;
-}
-function requestFormReset$2(formFiber) {
- var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
- dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
-}
-function useHostTransitionStatus() {
- return readContext(HostTransitionContext);
-}
-function updateId() {
- return updateWorkInProgressHook().memoizedState;
-}
-function updateRefresh() {
- return updateWorkInProgressHook().memoizedState;
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)
+ : (workInProgressHook = workInProgressHook.next = hook);
+ return workInProgressHook;
}
-function refreshCache(fiber, seedKey, seedValue) {
- for (var provider = fiber.return; null !== provider; ) {
- switch (provider.tag) {
- case 24:
- case 3:
- var lane = requestUpdateLane();
- fiber = createUpdate(lane);
- var root$39 = enqueueUpdate(provider, fiber, lane);
- null !== root$39 &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(root$39, provider, lane),
- entangleTransitions(root$39, provider, lane));
- provider = createCache();
- null !== seedKey &&
- void 0 !== seedKey &&
- null !== root$39 &&
- provider.data.set(seedKey, seedValue);
- fiber.payload = { cache: provider };
- return;
+function updateWorkInProgressHook() {
+ if (null === currentHook) {
+ var nextCurrentHook = currentlyRenderingFiber.alternate;
+ nextCurrentHook =
+ null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
+ } else nextCurrentHook = currentHook.next;
+ var nextWorkInProgressHook =
+ null === workInProgressHook
+ ? currentlyRenderingFiber.memoizedState
+ : workInProgressHook.next;
+ if (null !== nextWorkInProgressHook)
+ (workInProgressHook = nextWorkInProgressHook),
+ (currentHook = nextCurrentHook);
+ else {
+ if (null === nextCurrentHook) {
+ if (null === currentlyRenderingFiber.alternate)
+ throw Error(formatProdErrorMessage(467));
+ throw Error(formatProdErrorMessage(310));
}
- provider = provider.return;
+ currentHook = nextCurrentHook;
+ nextCurrentHook = {
+ memoizedState: currentHook.memoizedState,
+ baseState: currentHook.baseState,
+ baseQueue: currentHook.baseQueue,
+ queue: currentHook.queue,
+ next: null
+ };
+ null === workInProgressHook
+ ? (currentlyRenderingFiber.memoizedState = workInProgressHook =
+ nextCurrentHook)
+ : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
}
+ return workInProgressHook;
}
-function dispatchReducerAction(fiber, queue, action) {
- var lane = requestUpdateLane();
- action = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- isRenderPhaseUpdate(fiber)
- ? enqueueRenderPhaseUpdate(queue, action)
- : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),
- null !== action &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane)));
+function createFunctionComponentUpdateQueue() {
+ return { lastEffect: null, events: null, stores: null, memoCache: null };
}
-function dispatchSetState(fiber, queue, action) {
- var lane = requestUpdateLane();
- dispatchSetStateInternal(fiber, queue, action, lane) &&
- startUpdateTimerByLane(lane);
+function useThenable(thenable) {
+ var index = thenableIndexCounter$1;
+ thenableIndexCounter$1 += 1;
+ null === thenableState$1 && (thenableState$1 = []);
+ thenable = trackUsedThenable(thenableState$1, thenable, index);
+ index = currentlyRenderingFiber;
+ null ===
+ (null === workInProgressHook
+ ? index.memoizedState
+ : workInProgressHook.next) &&
+ ((index = index.alternate),
+ (ReactSharedInternals.H =
+ null === index || null === index.memoizedState
+ ? HooksDispatcherOnMount
+ : HooksDispatcherOnUpdate));
+ return thenable;
}
-function dispatchSetStateInternal(fiber, queue, action, lane) {
- var update = {
- lane: lane,
- revertLane: 0,
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
- else {
- var alternate = fiber.alternate;
- if (
- 0 === fiber.lanes &&
- (null === alternate || 0 === alternate.lanes) &&
- ((alternate = queue.lastRenderedReducer), null !== alternate)
- )
- try {
- var currentState = queue.lastRenderedState,
- eagerState = alternate(currentState, action);
- update.hasEagerState = !0;
- update.eagerState = eagerState;
- if (objectIs(eagerState, currentState))
- return (
- enqueueUpdate$1(fiber, queue, update, 0),
- null === workInProgressRoot && finishQueueingConcurrentUpdates(),
- !1
- );
- } catch (error) {
- } finally {
- }
- action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
- if (null !== action)
- return (
- scheduleUpdateOnFiber(action, fiber, lane),
- entangleTransitionUpdate(action, queue, lane),
- !0
- );
+function use(usable) {
+ if (null !== usable && "object" === typeof usable) {
+ if ("function" === typeof usable.then) return useThenable(usable);
+ if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
}
- return !1;
+ throw Error(formatProdErrorMessage(438, String(usable)));
}
-function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
- action = {
- lane: 2,
- revertLane: requestTransitionLane(),
- action: action,
- hasEagerState: !1,
- eagerState: null,
- next: null
- };
- if (isRenderPhaseUpdate(fiber)) {
- if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
- } else
- (throwIfDuringRender = enqueueConcurrentHookUpdate(
- fiber,
- queue,
- action,
- 2
- )),
- null !== throwIfDuringRender &&
- (startUpdateTimerByLane(2),
- scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
+function useMemoCache(size) {
+ var memoCache = null,
+ updateQueue = currentlyRenderingFiber.updateQueue;
+ null !== updateQueue && (memoCache = updateQueue.memoCache);
+ if (null == memoCache) {
+ var current = currentlyRenderingFiber.alternate;
+ null !== current &&
+ ((current = current.updateQueue),
+ null !== current &&
+ ((current = current.memoCache),
+ null != current &&
+ (memoCache = {
+ data: current.data.map(function (array) {
+ return array.slice();
+ }),
+ index: 0
+ })));
+ }
+ null == memoCache && (memoCache = { data: [], index: 0 });
+ null === updateQueue &&
+ ((updateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = updateQueue));
+ updateQueue.memoCache = memoCache;
+ updateQueue = memoCache.data[memoCache.index];
+ if (void 0 === updateQueue)
+ for (
+ updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;
+ current < size;
+ current++
+ )
+ updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
+ memoCache.index++;
+ return updateQueue;
}
-function isRenderPhaseUpdate(fiber) {
- var alternate = fiber.alternate;
- return (
- fiber === currentlyRenderingFiber$1 ||
- (null !== alternate && alternate === currentlyRenderingFiber$1)
- );
+function basicStateReducer(state, action) {
+ return "function" === typeof action ? action(state) : action;
}
-function enqueueRenderPhaseUpdate(queue, update) {
- didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
- !0;
- var pending = queue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- queue.pending = update;
+function updateReducer(reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateReducerImpl(hook, currentHook, reducer);
}
-function entangleTransitionUpdate(root, queue, lane) {
- if (0 !== (lane & 4194176)) {
- var queueLanes = queue.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- queue.lanes = lane;
- markRootEntangled(root, lane);
+function updateReducerImpl(hook, current, reducer) {
+ var queue = hook.queue;
+ if (null === queue) throw Error(formatProdErrorMessage(311));
+ queue.lastRenderedReducer = reducer;
+ var baseQueue = hook.baseQueue,
+ pendingQueue = queue.pending;
+ if (null !== pendingQueue) {
+ if (null !== baseQueue) {
+ var baseFirst = baseQueue.next;
+ baseQueue.next = pendingQueue.next;
+ pendingQueue.next = baseFirst;
+ }
+ current.baseQueue = baseQueue = pendingQueue;
+ queue.pending = null;
}
-}
-var ContextOnlyDispatcher = {
- readContext: readContext,
- use: use,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useInsertionEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError,
- useSyncExternalStore: throwInvalidHookError,
- useId: throwInvalidHookError
-};
-ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError;
-ContextOnlyDispatcher.useMemoCache = throwInvalidHookError;
-ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
-ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError;
-ContextOnlyDispatcher.useFormState = throwInvalidHookError;
-ContextOnlyDispatcher.useActionState = throwInvalidHookError;
-ContextOnlyDispatcher.useOptimistic = throwInvalidHookError;
-var HooksDispatcherOnMount = {
- readContext: readContext,
- use: use,
- useCallback: function (callback, deps) {
- mountWorkInProgressHook().memoizedState = [
- callback,
- void 0 === deps ? null : deps
- ];
- return callback;
- },
- useContext: readContext,
- useEffect: mountEffect,
- useImperativeHandle: function (ref, create, deps) {
- deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
- mountEffectImpl(
- 4194308,
- 4,
- imperativeHandleEffect.bind(null, create, ref),
- deps
- );
- },
- useLayoutEffect: function (create, deps) {
- return mountEffectImpl(4194308, 4, create, deps);
- },
- useInsertionEffect: function (create, deps) {
- mountEffectImpl(4, 2, create, deps);
- },
- useMemo: function (nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- deps = void 0 === deps ? null : deps;
- var nextValue = nextCreate();
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- nextCreate();
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- hook.memoizedState = [nextValue, deps];
- return nextValue;
- },
- useReducer: function (reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- if (void 0 !== init) {
- var initialState = init(initialArg);
- if (shouldDoubleInvokeUserFnsInHooksDEV) {
- setIsStrictModeForDevtools(!0);
- try {
- init(initialArg);
- } finally {
- setIsStrictModeForDevtools(!1);
- }
- }
- } else initialState = initialArg;
- hook.memoizedState = hook.baseState = initialState;
- reducer = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- hook.queue = reducer;
- reducer = reducer.dispatch = dispatchReducerAction.bind(
- null,
- currentlyRenderingFiber$1,
- reducer
- );
- return [hook.memoizedState, reducer];
- },
- useRef: function (initialValue) {
- var hook = mountWorkInProgressHook();
- initialValue = { current: initialValue };
- return (hook.memoizedState = initialValue);
- },
- useState: function (initialState) {
- initialState = mountStateImpl(initialState);
- var queue = initialState.queue,
- dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
- queue.dispatch = dispatch;
- return [initialState.memoizedState, dispatch];
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = mountWorkInProgressHook();
- return mountDeferredValueImpl(hook, value, initialValue);
- },
- useTransition: function () {
- var stateHook = mountStateImpl(!1);
- stateHook = startTransition.bind(
- null,
- currentlyRenderingFiber$1,
- stateHook.queue,
- !0,
- !1
- );
- mountWorkInProgressHook().memoizedState = stateHook;
- return [!1, stateHook];
- },
- useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
- var fiber = currentlyRenderingFiber$1,
- hook = mountWorkInProgressHook();
- if (isHydrating) {
- if (void 0 === getServerSnapshot)
- throw Error(formatProdErrorMessage(407));
- getServerSnapshot = getServerSnapshot();
- } else {
- getServerSnapshot = getSnapshot();
- if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
- 0 !== (workInProgressRootRenderLanes & 60) ||
- pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
- }
- hook.memoizedState = getServerSnapshot;
- var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };
- hook.queue = inst;
- mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
- subscribe
- ]);
+ pendingQueue = hook.baseState;
+ if (null === baseQueue) hook.memoizedState = pendingQueue;
+ else {
+ current = baseQueue.next;
+ var newBaseQueueFirst = (baseFirst = null),
+ newBaseQueueLast = null,
+ update = current,
+ didReadFromEntangledAsyncAction$37 = !1;
+ do {
+ var updateLane = update.lane & -536870913;
+ if (
+ updateLane !== update.lane
+ ? (workInProgressRootRenderLanes & updateLane) === updateLane
+ : (renderLanes & updateLane) === updateLane
+ ) {
+ var revertLane = update.revertLane;
+ if (0 === revertLane)
+ null !== newBaseQueueLast &&
+ (newBaseQueueLast = newBaseQueueLast.next =
+ {
+ lane: 0,
+ revertLane: 0,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ updateLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction$37 = !0);
+ else if ((renderLanes & revertLane) === revertLane) {
+ update = update.next;
+ revertLane === currentEntangledLane &&
+ (didReadFromEntangledAsyncAction$37 = !0);
+ continue;
+ } else
+ (updateLane = {
+ lane: 0,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = updateLane),
+ (currentlyRenderingFiber.lanes |= revertLane),
+ (workInProgressRootSkippedLanes |= revertLane);
+ updateLane = update.action;
+ shouldDoubleInvokeUserFnsInHooksDEV &&
+ reducer(pendingQueue, updateLane);
+ pendingQueue = update.hasEagerState
+ ? update.eagerState
+ : reducer(pendingQueue, updateLane);
+ } else
+ (revertLane = {
+ lane: updateLane,
+ revertLane: update.revertLane,
+ action: update.action,
+ hasEagerState: update.hasEagerState,
+ eagerState: update.eagerState,
+ next: null
+ }),
+ null === newBaseQueueLast
+ ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),
+ (baseFirst = pendingQueue))
+ : (newBaseQueueLast = newBaseQueueLast.next = revertLane),
+ (currentlyRenderingFiber.lanes |= updateLane),
+ (workInProgressRootSkippedLanes |= updateLane);
+ update = update.next;
+ } while (null !== update && update !== current);
+ null === newBaseQueueLast
+ ? (baseFirst = pendingQueue)
+ : (newBaseQueueLast.next = newBaseQueueFirst);
+ if (
+ !objectIs(pendingQueue, hook.memoizedState) &&
+ ((didReceiveUpdate = !0),
+ didReadFromEntangledAsyncAction$37 &&
+ ((reducer = currentEntangledActionThenable), null !== reducer))
+ )
+ throw reducer;
+ hook.memoizedState = pendingQueue;
+ hook.baseState = baseFirst;
+ hook.baseQueue = newBaseQueueLast;
+ queue.lastRenderedState = pendingQueue;
+ }
+ null === baseQueue && (queue.lanes = 0);
+ return [hook.memoizedState, queue.dispatch];
+}
+function rerenderReducer(reducer) {
+ var hook = updateWorkInProgressHook(),
+ queue = hook.queue;
+ if (null === queue) throw Error(formatProdErrorMessage(311));
+ queue.lastRenderedReducer = reducer;
+ var dispatch = queue.dispatch,
+ lastRenderPhaseUpdate = queue.pending,
+ newState = hook.memoizedState;
+ if (null !== lastRenderPhaseUpdate) {
+ queue.pending = null;
+ var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
+ do (newState = reducer(newState, update.action)), (update = update.next);
+ while (update !== lastRenderPhaseUpdate);
+ objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
+ hook.memoizedState = newState;
+ null === hook.baseQueue && (hook.baseState = newState);
+ queue.lastRenderedState = newState;
+ }
+ return [newState, dispatch];
+}
+function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = updateWorkInProgressHook(),
+ isHydrating$jscomp$0 = isHydrating;
+ if (isHydrating$jscomp$0) {
+ if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
+ getServerSnapshot = getServerSnapshot();
+ } else getServerSnapshot = getSnapshot();
+ var snapshotChanged = !objectIs(
+ (currentHook || hook).memoizedState,
+ getServerSnapshot
+ );
+ snapshotChanged &&
+ ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));
+ hook = hook.queue;
+ updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [
+ subscribe
+ ]);
+ if (
+ hook.getSnapshot !== getSnapshot ||
+ snapshotChanged ||
+ (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)
+ ) {
fiber.flags |= 2048;
pushSimpleEffect(
9,
@@ -4548,3494 +4260,3840 @@ var HooksDispatcherOnMount = {
updateStoreInstance.bind(
null,
fiber,
- inst,
+ hook,
getServerSnapshot,
getSnapshot
),
null
);
- return getServerSnapshot;
- },
- useId: function () {
- var hook = mountWorkInProgressHook(),
- identifierPrefix = workInProgressRoot.identifierPrefix;
- if (isHydrating) {
- var JSCompiler_inline_result = treeContextOverflow;
- var idWithLeadingBit = treeContextId;
- JSCompiler_inline_result =
- (
- idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
- ).toString(32) + JSCompiler_inline_result;
- identifierPrefix =
- ":" + identifierPrefix + "R" + JSCompiler_inline_result;
- JSCompiler_inline_result = localIdCounter++;
- 0 < JSCompiler_inline_result &&
- (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
- identifierPrefix += ":";
- } else
- (JSCompiler_inline_result = globalClientIdCounter++),
- (identifierPrefix =
- ":" +
- identifierPrefix +
- "r" +
- JSCompiler_inline_result.toString(32) +
- ":");
- return (hook.memoizedState = identifierPrefix);
- },
- useCacheRefresh: function () {
- return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
- null,
- currentlyRenderingFiber$1
- ));
+ if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
+ isHydrating$jscomp$0 ||
+ 0 !== (renderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
}
-};
-HooksDispatcherOnMount.useMemoCache = useMemoCache;
-HooksDispatcherOnMount.useEffectEvent = function (callback) {
- var hook = mountWorkInProgressHook(),
- ref = { impl: callback };
- hook.memoizedState = ref;
- return function () {
- if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
- return ref.impl.apply(void 0, arguments);
- };
-};
-HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnMount.useFormState = mountActionState;
-HooksDispatcherOnMount.useActionState = mountActionState;
-HooksDispatcherOnMount.useOptimistic = function (passthrough) {
+ return getServerSnapshot;
+}
+function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
+ fiber.flags |= 16384;
+ fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };
+ getSnapshot = currentlyRenderingFiber.updateQueue;
+ null === getSnapshot
+ ? ((getSnapshot = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = getSnapshot),
+ (getSnapshot.stores = [fiber]))
+ : ((renderedSnapshot = getSnapshot.stores),
+ null === renderedSnapshot
+ ? (getSnapshot.stores = [fiber])
+ : renderedSnapshot.push(fiber));
+}
+function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
+ inst.value = nextSnapshot;
+ inst.getSnapshot = getSnapshot;
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+}
+function subscribeToStore(fiber, inst, subscribe) {
+ return subscribe(function () {
+ checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
+ });
+}
+function checkIfSnapshotChanged(inst) {
+ var latestGetSnapshot = inst.getSnapshot;
+ inst = inst.value;
+ try {
+ var nextValue = latestGetSnapshot();
+ return !objectIs(inst, nextValue);
+ } catch (error) {
+ return !0;
+ }
+}
+function forceStoreRerender(fiber) {
+ var root = enqueueConcurrentRenderForLane(fiber, 2);
+ null !== root && scheduleUpdateOnFiber(root, fiber, 2);
+}
+function mountStateImpl(initialState) {
var hook = mountWorkInProgressHook();
- hook.memoizedState = hook.baseState = passthrough;
- var queue = {
- pending: null,
- lanes: 0,
- dispatch: null,
- lastRenderedReducer: null,
- lastRenderedState: null
- };
- hook.queue = queue;
- hook = dispatchOptimisticSetState.bind(
- null,
- currentlyRenderingFiber$1,
- !0,
- queue
- );
- queue.dispatch = hook;
- return [passthrough, hook];
-};
-var HooksDispatcherOnUpdate = {
- readContext: readContext,
- use: use,
- useCallback: updateCallback,
- useContext: readContext,
- useEffect: updateEffect,
- useImperativeHandle: updateImperativeHandle,
- useInsertionEffect: updateInsertionEffect,
- useLayoutEffect: updateLayoutEffect,
- useMemo: updateMemo,
- useReducer: updateReducer,
- useRef: updateRef,
- useState: function () {
- return updateReducer(basicStateReducer);
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = updateWorkInProgressHook();
- return updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
- },
- useTransition: function () {
- var booleanOrThenable = updateReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- },
- useSyncExternalStore: updateSyncExternalStore,
- useId: updateId
-};
-HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh;
-HooksDispatcherOnUpdate.useMemoCache = useMemoCache;
-HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
-HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnUpdate.useFormState = updateActionState;
-HooksDispatcherOnUpdate.useActionState = updateActionState;
-HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
-};
-var HooksDispatcherOnRerender = {
- readContext: readContext,
- use: use,
- useCallback: updateCallback,
- useContext: readContext,
- useEffect: updateEffect,
- useImperativeHandle: updateImperativeHandle,
- useInsertionEffect: updateInsertionEffect,
- useLayoutEffect: updateLayoutEffect,
- useMemo: updateMemo,
- useReducer: rerenderReducer,
- useRef: updateRef,
- useState: function () {
- return rerenderReducer(basicStateReducer);
- },
- useDebugValue: mountDebugValue,
- useDeferredValue: function (value, initialValue) {
- var hook = updateWorkInProgressHook();
- return null === currentHook
- ? mountDeferredValueImpl(hook, value, initialValue)
- : updateDeferredValueImpl(
- hook,
- currentHook.memoizedState,
- value,
- initialValue
- );
- },
- useTransition: function () {
- var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
- start = updateWorkInProgressHook().memoizedState;
- return [
- "boolean" === typeof booleanOrThenable
- ? booleanOrThenable
- : useThenable(booleanOrThenable),
- start
- ];
- },
- useSyncExternalStore: updateSyncExternalStore,
- useId: updateId
-};
-HooksDispatcherOnRerender.useCacheRefresh = updateRefresh;
-HooksDispatcherOnRerender.useMemoCache = useMemoCache;
-HooksDispatcherOnRerender.useEffectEvent = updateEvent;
-HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus;
-HooksDispatcherOnRerender.useFormState = rerenderActionState;
-HooksDispatcherOnRerender.useActionState = rerenderActionState;
-HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) {
- var hook = updateWorkInProgressHook();
- if (null !== currentHook)
- return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
- hook.baseState = passthrough;
- return [passthrough, hook.queue.dispatch];
-};
-var thenableState = null,
- thenableIndexCounter = 0;
-function unwrapThenable(thenable) {
- var index = thenableIndexCounter;
- thenableIndexCounter += 1;
- null === thenableState && (thenableState = []);
- return trackUsedThenable(thenableState, thenable, index);
-}
-function coerceRef(workInProgress, element) {
- element = element.props.ref;
- workInProgress.ref = void 0 !== element ? element : null;
+ if ("function" === typeof initialState) {
+ var initialStateInitializer = initialState;
+ initialState = initialStateInitializer();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ initialStateInitializer();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ }
+ hook.memoizedState = hook.baseState = initialState;
+ hook.queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialState
+ };
+ return hook;
}
-function throwOnInvalidObjectType(returnFiber, newChild) {
- if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
- throw Error(formatProdErrorMessage(525));
- returnFiber = Object.prototype.toString.call(newChild);
- throw Error(
- formatProdErrorMessage(
- 31,
- "[object Object]" === returnFiber
- ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
- : returnFiber
- )
+function updateOptimisticImpl(hook, current, passthrough, reducer) {
+ hook.baseState = passthrough;
+ return updateReducerImpl(
+ hook,
+ currentHook,
+ "function" === typeof reducer ? reducer : basicStateReducer
);
}
-function resolveLazy(lazyType) {
- var init = lazyType._init;
- return init(lazyType._payload);
+function dispatchActionState(
+ fiber,
+ actionQueue,
+ setPendingState,
+ setState,
+ payload
+) {
+ if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
+ fiber = actionQueue.action;
+ if (null !== fiber) {
+ var actionNode = {
+ payload: payload,
+ action: fiber,
+ next: null,
+ isTransition: !0,
+ status: "pending",
+ value: null,
+ reason: null,
+ listeners: [],
+ then: function (listener) {
+ actionNode.listeners.push(listener);
+ }
+ };
+ null !== ReactSharedInternals.T
+ ? setPendingState(!0)
+ : (actionNode.isTransition = !1);
+ setState(actionNode);
+ setPendingState = actionQueue.pending;
+ null === setPendingState
+ ? ((actionNode.next = actionQueue.pending = actionNode),
+ runActionStateAction(actionQueue, actionNode))
+ : ((actionNode.next = setPendingState.next),
+ (actionQueue.pending = setPendingState.next = actionNode));
+ }
}
-function createChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (shouldTrackSideEffects) {
- var deletions = returnFiber.deletions;
- null === deletions
- ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))
- : deletions.push(childToDelete);
+function runActionStateAction(actionQueue, node) {
+ var action = node.action,
+ payload = node.payload,
+ prevState = actionQueue.state;
+ if (node.isTransition) {
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ try {
+ var returnValue = action(prevState, payload),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ handleActionReturnValue(actionQueue, node, returnValue);
+ } catch (error) {
+ onActionError(actionQueue, node, error);
+ } finally {
+ ReactSharedInternals.T = prevTransition;
}
+ } else
+ try {
+ (prevTransition = action(prevState, payload)),
+ handleActionReturnValue(actionQueue, node, prevTransition);
+ } catch (error$43) {
+ onActionError(actionQueue, node, error$43);
+ }
+}
+function handleActionReturnValue(actionQueue, node, returnValue) {
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
+ ? returnValue.then(
+ function (nextState) {
+ onActionSuccess(actionQueue, node, nextState);
+ },
+ function (error) {
+ return onActionError(actionQueue, node, error);
+ }
+ )
+ : onActionSuccess(actionQueue, node, returnValue);
+}
+function onActionSuccess(actionQueue, actionNode, nextState) {
+ actionNode.status = "fulfilled";
+ actionNode.value = nextState;
+ notifyActionListeners(actionNode);
+ actionQueue.state = nextState;
+ actionNode = actionQueue.pending;
+ null !== actionNode &&
+ ((nextState = actionNode.next),
+ nextState === actionNode
+ ? (actionQueue.pending = null)
+ : ((nextState = nextState.next),
+ (actionNode.next = nextState),
+ runActionStateAction(actionQueue, nextState)));
+}
+function onActionError(actionQueue, actionNode, error) {
+ var last = actionQueue.pending;
+ actionQueue.pending = null;
+ if (null !== last) {
+ last = last.next;
+ do
+ (actionNode.status = "rejected"),
+ (actionNode.reason = error),
+ notifyActionListeners(actionNode),
+ (actionNode = actionNode.next);
+ while (actionNode !== last);
}
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) return null;
- for (; null !== currentFirstChild; )
- deleteChild(returnFiber, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return null;
- }
- function mapRemainingChildren(currentFirstChild) {
- for (var existingChildren = new Map(); null !== currentFirstChild; )
- null !== currentFirstChild.key
- ? existingChildren.set(currentFirstChild.key, currentFirstChild)
- : existingChildren.set(currentFirstChild.index, currentFirstChild),
- (currentFirstChild = currentFirstChild.sibling);
- return existingChildren;
- }
- function useFiber(fiber, pendingProps) {
- fiber = createWorkInProgress(fiber, pendingProps);
- fiber.index = 0;
- fiber.sibling = null;
- return fiber;
- }
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
- if (!shouldTrackSideEffects)
- return (newFiber.flags |= 1048576), lastPlacedIndex;
- newIndex = newFiber.alternate;
- if (null !== newIndex)
- return (
- (newIndex = newIndex.index),
- newIndex < lastPlacedIndex
- ? ((newFiber.flags |= 33554434), lastPlacedIndex)
- : newIndex
- );
- newFiber.flags |= 33554434;
- return lastPlacedIndex;
- }
- function placeSingleChild(newFiber) {
- shouldTrackSideEffects &&
- null === newFiber.alternate &&
- (newFiber.flags |= 33554434);
- return newFiber;
- }
- function updateTextNode(returnFiber, current, textContent, lanes) {
- if (null === current || 6 !== current.tag)
- return (
- (current = createFiberFromText(textContent, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- current
- );
- current = useFiber(current, textContent);
- current.return = returnFiber;
- return current;
- }
- function updateElement(returnFiber, current, element, lanes) {
- var elementType = element.type;
- if (elementType === REACT_FRAGMENT_TYPE)
- return updateFragment(
- returnFiber,
- current,
- element.props.children,
- lanes,
- element.key
- );
- if (
- null !== current &&
- (current.elementType === elementType ||
- ("object" === typeof elementType &&
- null !== elementType &&
- elementType.$$typeof === REACT_LAZY_TYPE &&
- resolveLazy(elementType) === current.type))
- )
- return (
- (current = useFiber(current, element.props)),
- coerceRef(current, element),
- (current.return = returnFiber),
- current
- );
- current = createFiberFromTypeAndProps(
- element.type,
- element.key,
- element.props,
- null,
- returnFiber.mode,
- lanes
- );
- coerceRef(current, element);
- current.return = returnFiber;
- return current;
- }
- function updatePortal(returnFiber, current, portal, lanes) {
- if (
- null === current ||
- 4 !== current.tag ||
- current.stateNode.containerInfo !== portal.containerInfo ||
- current.stateNode.implementation !== portal.implementation
- )
- return (
- (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
- (current.return = returnFiber),
- current
- );
- current = useFiber(current, portal.children || []);
- current.return = returnFiber;
- return current;
- }
- function updateFragment(returnFiber, current, fragment, lanes, key) {
- if (null === current || 7 !== current.tag)
- return (
- (current = createFiberFromFragment(
- fragment,
- returnFiber.mode,
- lanes,
- key
- )),
- (current.return = returnFiber),
- current
- );
- current = useFiber(current, fragment);
- current.return = returnFiber;
- return current;
- }
- function createChild(returnFiber, newChild, lanes) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (newChild = createFiberFromText(
- "" + newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- newChild
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (lanes = createFiberFromTypeAndProps(
- newChild.type,
- newChild.key,
- newChild.props,
- null,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- lanes
- );
- case REACT_PORTAL_TYPE:
- return (
- (newChild = createFiberFromPortal(
- newChild,
- returnFiber.mode,
- lanes
- )),
- (newChild.return = returnFiber),
- newChild
- );
- case REACT_LAZY_TYPE:
- var init = newChild._init;
- newChild = init(newChild._payload);
- return createChild(returnFiber, newChild, lanes);
+ actionQueue.action = null;
+}
+function notifyActionListeners(actionNode) {
+ actionNode = actionNode.listeners;
+ for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();
+}
+function actionStateReducer(oldState, newState) {
+ return newState;
+}
+function mountActionState(action, initialStateProp) {
+ if (isHydrating) {
+ var ssrFormState = workInProgressRoot.formState;
+ if (null !== ssrFormState) {
+ a: {
+ var JSCompiler_inline_result = currentlyRenderingFiber;
+ if (isHydrating) {
+ if (nextHydratableInstance) {
+ b: {
+ var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
+ for (
+ var inRootOrSingleton = rootOrSingletonContext;
+ 8 !== JSCompiler_inline_result$jscomp$0.nodeType;
+
+ ) {
+ if (!inRootOrSingleton) {
+ JSCompiler_inline_result$jscomp$0 = null;
+ break b;
+ }
+ JSCompiler_inline_result$jscomp$0 = getNextHydratable(
+ JSCompiler_inline_result$jscomp$0.nextSibling
+ );
+ if (null === JSCompiler_inline_result$jscomp$0) {
+ JSCompiler_inline_result$jscomp$0 = null;
+ break b;
+ }
+ }
+ inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
+ JSCompiler_inline_result$jscomp$0 =
+ "F!" === inRootOrSingleton || "F" === inRootOrSingleton
+ ? JSCompiler_inline_result$jscomp$0
+ : null;
+ }
+ if (JSCompiler_inline_result$jscomp$0) {
+ nextHydratableInstance = getNextHydratable(
+ JSCompiler_inline_result$jscomp$0.nextSibling
+ );
+ JSCompiler_inline_result =
+ "F!" === JSCompiler_inline_result$jscomp$0.data;
+ break a;
+ }
+ }
+ throwOnHydrationMismatch(JSCompiler_inline_result);
+ }
+ JSCompiler_inline_result = !1;
}
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (newChild = createFiberFromFragment(
- newChild,
- returnFiber.mode,
- lanes,
- null
- )),
- (newChild.return = returnFiber),
- newChild
- );
- if ("function" === typeof newChild.then)
- return createChild(returnFiber, unwrapThenable(newChild), lanes);
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return createChild(
- returnFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
+ JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
}
- return null;
}
- function updateSlot(returnFiber, oldFiber, newChild, lanes) {
- var key = null !== oldFiber ? oldFiber.key : null;
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return null !== key
- ? null
- : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return newChild.key === key
- ? updateElement(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_PORTAL_TYPE:
- return newChild.key === key
- ? updatePortal(returnFiber, oldFiber, newChild, lanes)
- : null;
- case REACT_LAZY_TYPE:
- return (
- (key = newChild._init),
- (newChild = key(newChild._payload)),
- updateSlot(returnFiber, oldFiber, newChild, lanes)
- );
- }
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return null !== key
- ? null
- : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
- if ("function" === typeof newChild.then)
- return updateSlot(
- returnFiber,
- oldFiber,
- unwrapThenable(newChild),
- lanes
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateSlot(
- returnFiber,
- oldFiber,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
+ ssrFormState = mountWorkInProgressHook();
+ ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
+ JSCompiler_inline_result = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: actionStateReducer,
+ lastRenderedState: initialStateProp
+ };
+ ssrFormState.queue = JSCompiler_inline_result;
+ ssrFormState = dispatchSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ JSCompiler_inline_result
+ );
+ JSCompiler_inline_result.dispatch = ssrFormState;
+ JSCompiler_inline_result = mountStateImpl(!1);
+ inRootOrSingleton = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !1,
+ JSCompiler_inline_result.queue
+ );
+ JSCompiler_inline_result = mountWorkInProgressHook();
+ JSCompiler_inline_result$jscomp$0 = {
+ state: initialStateProp,
+ dispatch: null,
+ action: action,
+ pending: null
+ };
+ JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
+ ssrFormState = dispatchActionState.bind(
+ null,
+ currentlyRenderingFiber,
+ JSCompiler_inline_result$jscomp$0,
+ inRootOrSingleton,
+ ssrFormState
+ );
+ JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
+ JSCompiler_inline_result.memoizedState = action;
+ return [initialStateProp, ssrFormState, !1];
+}
+function updateActionState(action) {
+ var stateHook = updateWorkInProgressHook();
+ return updateActionStateImpl(stateHook, currentHook, action);
+}
+function updateActionStateImpl(stateHook, currentStateHook, action) {
+ currentStateHook = updateReducerImpl(
+ stateHook,
+ currentStateHook,
+ actionStateReducer
+ )[0];
+ stateHook = updateReducer(basicStateReducer)[0];
+ if (
+ "object" === typeof currentStateHook &&
+ null !== currentStateHook &&
+ "function" === typeof currentStateHook.then
+ )
+ try {
+ var state = useThenable(currentStateHook);
+ } catch (x) {
+ if (x === SuspenseException) throw SuspenseActionException;
+ throw x;
}
- return null;
+ else state = currentStateHook;
+ currentStateHook = updateWorkInProgressHook();
+ var actionQueue = currentStateHook.queue,
+ dispatch = actionQueue.dispatch;
+ action !== currentStateHook.memoizedState &&
+ ((currentlyRenderingFiber.flags |= 2048),
+ pushSimpleEffect(
+ 9,
+ createEffectInstance(),
+ actionStateActionEffect.bind(null, actionQueue, action),
+ null
+ ));
+ return [state, dispatch, stateHook];
+}
+function actionStateActionEffect(actionQueue, action) {
+ actionQueue.action = action;
+}
+function rerenderActionState(action) {
+ var stateHook = updateWorkInProgressHook(),
+ currentStateHook = currentHook;
+ if (null !== currentStateHook)
+ return updateActionStateImpl(stateHook, currentStateHook, action);
+ updateWorkInProgressHook();
+ stateHook = stateHook.memoizedState;
+ currentStateHook = updateWorkInProgressHook();
+ var dispatch = currentStateHook.queue.dispatch;
+ currentStateHook.memoizedState = action;
+ return [stateHook, dispatch, !1];
+}
+function pushSimpleEffect(tag, inst, create, deps) {
+ tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };
+ inst = currentlyRenderingFiber.updateQueue;
+ null === inst &&
+ ((inst = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = inst));
+ create = inst.lastEffect;
+ null === create
+ ? (inst.lastEffect = tag.next = tag)
+ : ((deps = create.next),
+ (create.next = tag),
+ (tag.next = deps),
+ (inst.lastEffect = tag));
+ return tag;
+}
+function createEffectInstance() {
+ return { destroy: void 0, resource: void 0 };
+}
+function updateRef() {
+ return updateWorkInProgressHook().memoizedState;
+}
+function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ currentlyRenderingFiber.flags |= fiberFlags;
+ hook.memoizedState = pushSimpleEffect(
+ 1 | hookFlags,
+ createEffectInstance(),
+ create,
+ deps
+ );
+}
+function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var inst = hook.memoizedState.inst;
+ null !== currentHook &&
+ null !== deps &&
+ areHookInputsEqual(deps, currentHook.memoizedState.deps)
+ ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))
+ : ((currentlyRenderingFiber.flags |= fiberFlags),
+ (hook.memoizedState = pushSimpleEffect(
+ 1 | hookFlags,
+ inst,
+ create,
+ deps
+ )));
+}
+function mountEffect(create, deps) {
+ mountEffectImpl(8390656, 8, create, deps);
+}
+function updateEffect(create, deps) {
+ updateEffectImpl(2048, 8, create, deps);
+}
+function useEffectEventImpl(payload) {
+ currentlyRenderingFiber.flags |= 4;
+ var componentUpdateQueue = currentlyRenderingFiber.updateQueue;
+ if (null === componentUpdateQueue)
+ (componentUpdateQueue = createFunctionComponentUpdateQueue()),
+ (currentlyRenderingFiber.updateQueue = componentUpdateQueue),
+ (componentUpdateQueue.events = [payload]);
+ else {
+ var events = componentUpdateQueue.events;
+ null === events
+ ? (componentUpdateQueue.events = [payload])
+ : events.push(payload);
}
- function updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- ) {
- if (
- ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
- );
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updateElement(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_PORTAL_TYPE:
- return (
- (existingChildren =
- existingChildren.get(
- null === newChild.key ? newIdx : newChild.key
- ) || null),
- updatePortal(returnFiber, existingChildren, newChild, lanes)
- );
- case REACT_LAZY_TYPE:
- var init = newChild._init;
- newChild = init(newChild._payload);
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- newChild,
- lanes
- );
- }
- if (
- isArrayImpl(newChild) ||
- getIteratorFn(newChild) ||
- "function" === typeof newChild[ASYNC_ITERATOR]
- )
- return (
- (existingChildren = existingChildren.get(newIdx) || null),
- updateFragment(returnFiber, existingChildren, newChild, lanes, null)
- );
- if ("function" === typeof newChild.then)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- unwrapThenable(newChild),
- lanes
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return updateFromMap(
- existingChildren,
- returnFiber,
- newIdx,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- return null;
+}
+function updateEvent(callback) {
+ var ref = updateWorkInProgressHook().memoizedState;
+ useEffectEventImpl({ ref: ref, nextImpl: callback });
+ return function () {
+ if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));
+ return ref.impl.apply(void 0, arguments);
+ };
+}
+function updateInsertionEffect(create, deps) {
+ return updateEffectImpl(4, 2, create, deps);
+}
+function updateLayoutEffect(create, deps) {
+ return updateEffectImpl(4, 4, create, deps);
+}
+function imperativeHandleEffect(create, ref) {
+ if ("function" === typeof ref) {
+ create = create();
+ var refCleanup = ref(create);
+ return function () {
+ "function" === typeof refCleanup ? refCleanup() : ref(null);
+ };
}
- function reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null;
- null !== oldFiber && newIdx < newChildren.length;
- newIdx++
- ) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(
- returnFiber,
- oldFiber,
- newChildren[newIdx],
- lanes
- );
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
+ if (null !== ref && void 0 !== ref)
+ return (
+ (create = create()),
+ (ref.current = create),
+ function () {
+ ref.current = null;
}
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (newIdx === newChildren.length)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
- );
- if (null === oldFiber) {
- for (; newIdx < newChildren.length; newIdx++)
- (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
- null !== oldFiber &&
- ((currentFirstChild = placeChild(
- oldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = oldFiber)
- : (previousNewFiber.sibling = oldFiber),
- (previousNewFiber = oldFiber));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
+ );
+}
+function updateImperativeHandle(ref, create, deps) {
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);
+}
+function mountDebugValue() {}
+function updateCallback(callback, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ hook.memoizedState = [callback, deps];
+ return callback;
+}
+function updateMemo(nextCreate, deps) {
+ var hook = updateWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var prevState = hook.memoizedState;
+ if (null !== deps && areHookInputsEqual(deps, prevState[1]))
+ return prevState[0];
+ prevState = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
}
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- newIdx < newChildren.length;
- newIdx++
- )
- (nextOldFiber = updateFromMap(
- oldFiber,
- returnFiber,
- newIdx,
- newChildren[newIdx],
- lanes
- )),
- null !== nextOldFiber &&
- (shouldTrackSideEffects &&
- null !== nextOldFiber.alternate &&
- oldFiber.delete(
- null === nextOldFiber.key ? newIdx : nextOldFiber.key
- ),
- (currentFirstChild = placeChild(
- nextOldFiber,
- currentFirstChild,
- newIdx
- )),
- null === previousNewFiber
- ? (resultingFirstChild = nextOldFiber)
- : (previousNewFiber.sibling = nextOldFiber),
- (previousNewFiber = nextOldFiber));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
}
- function reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChildrenIterable,
- lanes
- ) {
- var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
- if (null == newChildren) throw Error(formatProdErrorMessage(151));
- return reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- {
- next: function () {
- return unwrapThenable(newChildren.next());
- }
- },
- lanes
+ hook.memoizedState = [prevState, deps];
+ return prevState;
+}
+function mountDeferredValueImpl(hook, value, initialValue) {
+ if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
+ return (hook.memoizedState = value);
+ hook.memoizedState = initialValue;
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return initialValue;
+}
+function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
+ if (objectIs(value, prevValue)) return value;
+ if (null !== currentTreeHiddenStackCursor.current)
+ return (
+ (hook = mountDeferredValueImpl(hook, value, initialValue)),
+ objectIs(hook, prevValue) || (didReceiveUpdate = !0),
+ hook
);
- }
- function reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChildren,
- lanes
- ) {
- if (null == newChildren) throw Error(formatProdErrorMessage(151));
- for (
- var resultingFirstChild = null,
- previousNewFiber = null,
- oldFiber = currentFirstChild,
- newIdx = (currentFirstChild = 0),
- nextOldFiber = null,
- step = newChildren.next();
- null !== oldFiber && !step.done;
- newIdx++, step = newChildren.next()
+ if (0 === (renderLanes & 42))
+ return (didReceiveUpdate = !0), (hook.memoizedState = value);
+ hook = requestDeferredLane();
+ currentlyRenderingFiber.lanes |= hook;
+ workInProgressRootSkippedLanes |= hook;
+ return prevValue;
+}
+function startTransition(fiber, queue, pendingState, finishedState, callback) {
+ var previousPriority = ReactDOMSharedInternals.p;
+ ReactDOMSharedInternals.p =
+ 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
+ var prevTransition = ReactSharedInternals.T,
+ currentTransition = {};
+ ReactSharedInternals.T = currentTransition;
+ dispatchOptimisticSetState(fiber, !1, queue, pendingState);
+ try {
+ var returnValue = callback(),
+ onStartTransitionFinish = ReactSharedInternals.S;
+ null !== onStartTransitionFinish &&
+ onStartTransitionFinish(currentTransition, returnValue);
+ if (
+ null !== returnValue &&
+ "object" === typeof returnValue &&
+ "function" === typeof returnValue.then
) {
- oldFiber.index > newIdx
- ? ((nextOldFiber = oldFiber), (oldFiber = null))
- : (nextOldFiber = oldFiber.sibling);
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
- if (null === newFiber) {
- null === oldFiber && (oldFiber = nextOldFiber);
- break;
- }
- shouldTrackSideEffects &&
- oldFiber &&
- null === newFiber.alternate &&
- deleteChild(returnFiber, oldFiber);
- currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
- null === previousNewFiber
- ? (resultingFirstChild = newFiber)
- : (previousNewFiber.sibling = newFiber);
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (step.done)
- return (
- deleteRemainingChildren(returnFiber, oldFiber),
- isHydrating && pushTreeFork(returnFiber, newIdx),
- resultingFirstChild
+ var thenableForFinishedState = chainThenableValue(
+ returnValue,
+ finishedState
);
- if (null === oldFiber) {
- for (; !step.done; newIdx++, step = newChildren.next())
- (step = createChild(returnFiber, step.value, lanes)),
- null !== step &&
- ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
- null === previousNewFiber
- ? (resultingFirstChild = step)
- : (previousNewFiber.sibling = step),
- (previousNewFiber = step));
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- for (
- oldFiber = mapRemainingChildren(oldFiber);
- !step.done;
- newIdx++, step = newChildren.next()
- )
- (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
- null !== step &&
- (shouldTrackSideEffects &&
- null !== step.alternate &&
- oldFiber.delete(null === step.key ? newIdx : step.key),
- (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
- null === previousNewFiber
- ? (resultingFirstChild = step)
- : (previousNewFiber.sibling = step),
- (previousNewFiber = step));
- shouldTrackSideEffects &&
- oldFiber.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- isHydrating && pushTreeFork(returnFiber, newIdx);
- return resultingFirstChild;
- }
- function reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- ) {
- "object" === typeof newChild &&
- null !== newChild &&
- newChild.type === REACT_FRAGMENT_TYPE &&
- null === newChild.key &&
- (newChild = newChild.props.children);
- if ("object" === typeof newChild && null !== newChild) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- a: {
- for (var key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key) {
- key = newChild.type;
- if (key === REACT_FRAGMENT_TYPE) {
- if (7 === currentFirstChild.tag) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(
- currentFirstChild,
- newChild.props.children
- );
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- }
- } else if (
- currentFirstChild.elementType === key ||
- ("object" === typeof key &&
- null !== key &&
- key.$$typeof === REACT_LAZY_TYPE &&
- resolveLazy(key) === currentFirstChild.type)
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.props);
- coerceRef(lanes, newChild);
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- }
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- } else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- newChild.type === REACT_FRAGMENT_TYPE
- ? ((lanes = createFiberFromFragment(
- newChild.props.children,
- returnFiber.mode,
- lanes,
- newChild.key
- )),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : ((lanes = createFiberFromTypeAndProps(
- newChild.type,
- newChild.key,
- newChild.props,
- null,
- returnFiber.mode,
- lanes
- )),
- coerceRef(lanes, newChild),
- (lanes.return = returnFiber),
- (returnFiber = lanes));
- }
- return placeSingleChild(returnFiber);
- case REACT_PORTAL_TYPE:
- a: {
- for (key = newChild.key; null !== currentFirstChild; ) {
- if (currentFirstChild.key === key)
- if (
- 4 === currentFirstChild.tag &&
- currentFirstChild.stateNode.containerInfo ===
- newChild.containerInfo &&
- currentFirstChild.stateNode.implementation ===
- newChild.implementation
- ) {
- deleteRemainingChildren(
- returnFiber,
- currentFirstChild.sibling
- );
- lanes = useFiber(currentFirstChild, newChild.children || []);
- lanes.return = returnFiber;
- returnFiber = lanes;
- break a;
- } else {
- deleteRemainingChildren(returnFiber, currentFirstChild);
- break;
- }
- else deleteChild(returnFiber, currentFirstChild);
- currentFirstChild = currentFirstChild.sibling;
- }
- lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
- lanes.return = returnFiber;
- returnFiber = lanes;
- }
- return placeSingleChild(returnFiber);
- case REACT_LAZY_TYPE:
- return (
- (key = newChild._init),
- (newChild = key(newChild._payload)),
- reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- )
- );
- }
- if (isArrayImpl(newChild))
- return reconcileChildrenArray(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- );
- if (getIteratorFn(newChild)) {
- key = getIteratorFn(newChild);
- if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
- newChild = key.call(newChild);
- return reconcileChildrenIterator(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- );
- }
- if ("function" === typeof newChild[ASYNC_ITERATOR])
- return reconcileChildrenAsyncIteratable(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
- );
- if ("function" === typeof newChild.then)
- return reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- unwrapThenable(newChild),
- lanes
- );
- if (newChild.$$typeof === REACT_CONTEXT_TYPE)
- return reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- readContextDuringReconciliation(returnFiber, newChild),
- lanes
- );
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- return ("string" === typeof newChild && "" !== newChild) ||
- "number" === typeof newChild ||
- "bigint" === typeof newChild
- ? ((newChild = "" + newChild),
- null !== currentFirstChild && 6 === currentFirstChild.tag
- ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
- (lanes = useFiber(currentFirstChild, newChild)),
- (lanes.return = returnFiber),
- (returnFiber = lanes))
- : (deleteRemainingChildren(returnFiber, currentFirstChild),
- (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),
- (lanes.return = returnFiber),
- (returnFiber = lanes)),
- placeSingleChild(returnFiber))
- : deleteRemainingChildren(returnFiber, currentFirstChild);
- }
- return function (returnFiber, currentFirstChild, newChild, lanes) {
- try {
- thenableIndexCounter = 0;
- var firstChildFiber = reconcileChildFibersImpl(
- returnFiber,
- currentFirstChild,
- newChild,
- lanes
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ thenableForFinishedState,
+ requestUpdateLane(fiber)
);
- thenableState = null;
- return firstChildFiber;
- } catch (x) {
- if (x === SuspenseException || x === SuspenseActionException) throw x;
- var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
- fiber.lanes = lanes;
- fiber.return = returnFiber;
- return fiber;
- } finally {
- }
- };
+ } else
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ finishedState,
+ requestUpdateLane(fiber)
+ );
+ } catch (error) {
+ dispatchSetStateInternal(
+ fiber,
+ queue,
+ { then: function () {}, status: "rejected", reason: error },
+ requestUpdateLane()
+ );
+ } finally {
+ (ReactDOMSharedInternals.p = previousPriority),
+ (ReactSharedInternals.T = prevTransition);
+ }
}
-var reconcileChildFibers = createChildReconciler(!0),
- mountChildFibers = createChildReconciler(!1),
- suspenseHandlerStackCursor = createCursor(null),
- shellBoundary = null;
-function pushPrimaryTreeSuspenseHandler(handler) {
- var current = handler.alternate;
- push(suspenseStackCursor, suspenseStackCursor.current & 1);
- push(suspenseHandlerStackCursor, handler);
- null === shellBoundary &&
- (null === current || null !== currentTreeHiddenStackCursor.current
- ? (shellBoundary = handler)
- : null !== current.memoizedState && (shellBoundary = handler));
+function noop$3() {}
+function startHostTransition(formFiber, pendingState, action, formData) {
+ if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
+ var queue = ensureFormComponentIsStateful(formFiber).queue;
+ startTransition(
+ formFiber,
+ queue,
+ pendingState,
+ sharedNotPendingObject,
+ null === action
+ ? noop$3
+ : function () {
+ requestFormReset$2(formFiber);
+ return action(formData);
+ }
+ );
}
-function pushOffscreenSuspenseHandler(fiber) {
- if (22 === fiber.tag) {
- if (
- (push(suspenseStackCursor, suspenseStackCursor.current),
- push(suspenseHandlerStackCursor, fiber),
- null === shellBoundary)
- ) {
- var current = fiber.alternate;
- null !== current &&
- null !== current.memoizedState &&
- (shellBoundary = fiber);
- }
- } else reuseSuspenseHandlerOnStack(fiber);
-}
-function reuseSuspenseHandlerOnStack() {
- push(suspenseStackCursor, suspenseStackCursor.current);
- push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
-}
-function popSuspenseHandler(fiber) {
- pop(suspenseHandlerStackCursor);
- shellBoundary === fiber && (shellBoundary = null);
- pop(suspenseStackCursor);
+function ensureFormComponentIsStateful(formFiber) {
+ var existingStateHook = formFiber.memoizedState;
+ if (null !== existingStateHook) return existingStateHook;
+ existingStateHook = {
+ memoizedState: sharedNotPendingObject,
+ baseState: sharedNotPendingObject,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: sharedNotPendingObject
+ },
+ next: null
+ };
+ var initialResetState = {};
+ existingStateHook.next = {
+ memoizedState: initialResetState,
+ baseState: initialResetState,
+ baseQueue: null,
+ queue: {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: basicStateReducer,
+ lastRenderedState: initialResetState
+ },
+ next: null
+ };
+ formFiber.memoizedState = existingStateHook;
+ formFiber = formFiber.alternate;
+ null !== formFiber && (formFiber.memoizedState = existingStateHook);
+ return existingStateHook;
}
-var suspenseStackCursor = createCursor(0);
-function findFirstSuspended(row) {
- for (var node = row; null !== node; ) {
- if (13 === node.tag) {
- var state = node.memoizedState;
- if (
- null !== state &&
- ((state = state.dehydrated),
- null === state ||
- "$?" === state.data ||
- isSuspenseInstanceFallback(state))
- )
- return node;
- } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
- if (0 !== (node.flags & 128)) return node;
- } else if (null !== node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === row) break;
- for (; null === node.sibling; ) {
- if (null === node.return || node.return === row) return null;
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- return null;
+function requestFormReset$2(formFiber) {
+ var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
+ dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
}
-function applyDerivedStateFromProps(
- workInProgress,
- ctor,
- getDerivedStateFromProps,
- nextProps
-) {
- ctor = workInProgress.memoizedState;
- getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
- getDerivedStateFromProps =
- null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
- ? ctor
- : assign({}, ctor, getDerivedStateFromProps);
- workInProgress.memoizedState = getDerivedStateFromProps;
- 0 === workInProgress.lanes &&
- (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
+function useHostTransitionStatus() {
+ return readContext(HostTransitionContext);
}
-var classComponentUpdater = {
- isMounted: function (component) {
- return (component = component._reactInternals)
- ? getNearestMountedFiber(component) === component
- : !1;
- },
- enqueueSetState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.payload = payload;
- void 0 !== callback && null !== callback && (update.callback = callback);
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueReplaceState: function (inst, payload, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.tag = 1;
- update.payload = payload;
- void 0 !== callback && null !== callback && (update.callback = callback);
- payload = enqueueUpdate(inst, update, lane);
- null !== payload &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(payload, inst, lane),
- entangleTransitions(payload, inst, lane));
- },
- enqueueForceUpdate: function (inst, callback) {
- inst = inst._reactInternals;
- var lane = requestUpdateLane(),
- update = createUpdate(lane);
- update.tag = 2;
- void 0 !== callback && null !== callback && (update.callback = callback);
- callback = enqueueUpdate(inst, update, lane);
- null !== callback &&
- (startUpdateTimerByLane(lane),
- scheduleUpdateOnFiber(callback, inst, lane),
- entangleTransitions(callback, inst, lane));
- }
-};
-function checkShouldComponentUpdate(
- workInProgress,
- ctor,
- oldProps,
- newProps,
- oldState,
- newState,
- nextContext
-) {
- workInProgress = workInProgress.stateNode;
- return "function" === typeof workInProgress.shouldComponentUpdate
- ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
- : ctor.prototype && ctor.prototype.isPureReactComponent
- ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
- : !0;
+function updateId() {
+ return updateWorkInProgressHook().memoizedState;
}
-function callComponentWillReceiveProps(
- workInProgress,
- instance,
- newProps,
- nextContext
-) {
- workInProgress = instance.state;
- "function" === typeof instance.componentWillReceiveProps &&
- instance.componentWillReceiveProps(newProps, nextContext);
- "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- instance.state !== workInProgress &&
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
+function updateRefresh() {
+ return updateWorkInProgressHook().memoizedState;
}
-function resolveClassComponentProps(Component, baseProps) {
- var newProps = baseProps;
- if ("ref" in baseProps) {
- newProps = {};
- for (var propName in baseProps)
- "ref" !== propName && (newProps[propName] = baseProps[propName]);
- }
- if ((Component = Component.defaultProps)) {
- newProps === baseProps && (newProps = assign({}, newProps));
- for (var propName$72 in Component)
- void 0 === newProps[propName$72] &&
- (newProps[propName$72] = Component[propName$72]);
+function refreshCache(fiber, seedKey, seedValue) {
+ for (var provider = fiber.return; null !== provider; ) {
+ switch (provider.tag) {
+ case 24:
+ case 3:
+ var lane = requestUpdateLane();
+ fiber = createUpdate(lane);
+ var root$46 = enqueueUpdate(provider, fiber, lane);
+ null !== root$46 &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(root$46, provider, lane),
+ entangleTransitions(root$46, provider, lane));
+ provider = createCache();
+ null !== seedKey &&
+ void 0 !== seedKey &&
+ null !== root$46 &&
+ provider.data.set(seedKey, seedValue);
+ fiber.payload = { cache: provider };
+ return;
+ }
+ provider = provider.return;
}
- return newProps;
}
-var reportGlobalError =
- "function" === typeof reportError
- ? reportError
- : function (error) {
- if (
- "object" === typeof window &&
- "function" === typeof window.ErrorEvent
- ) {
- var event = new window.ErrorEvent("error", {
- bubbles: !0,
- cancelable: !0,
- message:
- "object" === typeof error &&
- null !== error &&
- "string" === typeof error.message
- ? String(error.message)
- : String(error),
- error: error
- });
- if (!window.dispatchEvent(event)) return;
- } else if (
- "object" === typeof process &&
- "function" === typeof process.emit
- ) {
- process.emit("uncaughtException", error);
- return;
- }
- console.error(error);
- };
-function defaultOnUncaughtError(error) {
- reportGlobalError(error);
+function dispatchReducerAction(fiber, queue, action) {
+ var lane = requestUpdateLane();
+ action = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ isRenderPhaseUpdate(fiber)
+ ? enqueueRenderPhaseUpdate(queue, action)
+ : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),
+ null !== action &&
+ (startUpdateTimerByLane(lane),
+ scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane)));
}
-function defaultOnCaughtError(error) {
- console.error(error);
+function dispatchSetState(fiber, queue, action) {
+ var lane = requestUpdateLane();
+ dispatchSetStateInternal(fiber, queue, action, lane) &&
+ startUpdateTimerByLane(lane);
}
-function defaultOnRecoverableError(error) {
- reportGlobalError(error);
-}
-function logUncaughtError(root, errorInfo) {
- try {
- var onUncaughtError = root.onUncaughtError;
- onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
- } catch (e$73) {
- setTimeout(function () {
- throw e$73;
- });
- }
-}
-function logCaughtError(root, boundary, errorInfo) {
- try {
- var onCaughtError = root.onCaughtError;
- onCaughtError(errorInfo.value, {
- componentStack: errorInfo.stack,
- errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
- });
- } catch (e$74) {
- setTimeout(function () {
- throw e$74;
- });
+function dispatchSetStateInternal(fiber, queue, action, lane) {
+ var update = {
+ lane: lane,
+ revertLane: 0,
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
+ };
+ if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
+ else {
+ var alternate = fiber.alternate;
+ if (
+ 0 === fiber.lanes &&
+ (null === alternate || 0 === alternate.lanes) &&
+ ((alternate = queue.lastRenderedReducer), null !== alternate)
+ )
+ try {
+ var currentState = queue.lastRenderedState,
+ eagerState = alternate(currentState, action);
+ update.hasEagerState = !0;
+ update.eagerState = eagerState;
+ if (objectIs(eagerState, currentState))
+ return (
+ enqueueUpdate$1(fiber, queue, update, 0),
+ null === workInProgressRoot && finishQueueingConcurrentUpdates(),
+ !1
+ );
+ } catch (error) {
+ } finally {
+ }
+ action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
+ if (null !== action)
+ return (
+ scheduleUpdateOnFiber(action, fiber, lane),
+ entangleTransitionUpdate(action, queue, lane),
+ !0
+ );
}
+ return !1;
}
-function createRootErrorUpdate(root, errorInfo, lane) {
- lane = createUpdate(lane);
- lane.tag = 3;
- lane.payload = { element: null };
- lane.callback = function () {
- logUncaughtError(root, errorInfo);
+function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
+ action = {
+ lane: 2,
+ revertLane: requestTransitionLane(),
+ action: action,
+ hasEagerState: !1,
+ eagerState: null,
+ next: null
};
- return lane;
-}
-function createClassErrorUpdate(lane) {
- lane = createUpdate(lane);
- lane.tag = 3;
- return lane;
+ if (isRenderPhaseUpdate(fiber)) {
+ if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
+ } else
+ (throwIfDuringRender = enqueueConcurrentHookUpdate(
+ fiber,
+ queue,
+ action,
+ 2
+ )),
+ null !== throwIfDuringRender &&
+ (startUpdateTimerByLane(2),
+ scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2));
}
-function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
- var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
- if ("function" === typeof getDerivedStateFromError) {
- var error = errorInfo.value;
- update.payload = function () {
- return getDerivedStateFromError(error);
- };
- update.callback = function () {
- logCaughtError(root, fiber, errorInfo);
- };
- }
- var inst = fiber.stateNode;
- null !== inst &&
- "function" === typeof inst.componentDidCatch &&
- (update.callback = function () {
- logCaughtError(root, fiber, errorInfo);
- "function" !== typeof getDerivedStateFromError &&
- (null === legacyErrorBoundariesThatAlreadyFailed
- ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
- : legacyErrorBoundariesThatAlreadyFailed.add(this));
- var stack = errorInfo.stack;
- this.componentDidCatch(errorInfo.value, {
- componentStack: null !== stack ? stack : ""
- });
- });
+function isRenderPhaseUpdate(fiber) {
+ var alternate = fiber.alternate;
+ return (
+ fiber === currentlyRenderingFiber ||
+ (null !== alternate && alternate === currentlyRenderingFiber)
+ );
}
-function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
- var currentSourceFiber = sourceFiber.alternate;
- null !== currentSourceFiber &&
- propagateParentContextChanges(
- currentSourceFiber,
- sourceFiber,
- rootRenderLanes,
- !0
- );
+function enqueueRenderPhaseUpdate(queue, update) {
+ didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
+ !0;
+ var pending = queue.pending;
+ null === pending
+ ? (update.next = update)
+ : ((update.next = pending.next), (pending.next = update));
+ queue.pending = update;
}
-function markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
-) {
- suspenseBoundary.flags |= 65536;
- suspenseBoundary.lanes = rootRenderLanes;
- return suspenseBoundary;
+function entangleTransitionUpdate(root, queue, lane) {
+ if (0 !== (lane & 4194176)) {
+ var queueLanes = queue.lanes;
+ queueLanes &= root.pendingLanes;
+ lane |= queueLanes;
+ queue.lanes = lane;
+ markRootEntangled(root, lane);
+ }
}
-function throwException(
- root,
- returnFiber,
- sourceFiber,
- value,
- rootRenderLanes
-) {
- sourceFiber.flags |= 32768;
- isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
- if (
- null !== value &&
- "object" === typeof value &&
- (value.$$typeof === REACT_POSTPONE_TYPE &&
- (value = { then: function () {} }),
- "function" === typeof value.then)
- ) {
- resetSuspendedComponent(sourceFiber, rootRenderLanes);
- var suspenseBoundary = suspenseHandlerStackCursor.current;
- if (null !== suspenseBoundary) {
- switch (suspenseBoundary.tag) {
- case 13:
- return (
- null === shellBoundary
- ? renderDidSuspendDelayIfPossible()
- : null === suspenseBoundary.alternate &&
- 0 === workInProgressRootExitStatus &&
- (workInProgressRootExitStatus = 3),
- (suspenseBoundary.flags &= -257),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? (suspenseBoundary.updateQueue = new Set([value]))
- : sourceFiber.add(value),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
- case 22:
- return (
- (suspenseBoundary.flags |= 65536),
- value === noopSuspenseyCommitThenable
- ? (suspenseBoundary.flags |= 16384)
- : ((sourceFiber = suspenseBoundary.updateQueue),
- null === sourceFiber
- ? ((sourceFiber = {
- transitions: null,
- markerInstances: null,
- retryQueue: new Set([value])
- }),
- (suspenseBoundary.updateQueue = sourceFiber))
- : ((returnFiber = sourceFiber.retryQueue),
- null === returnFiber
- ? (sourceFiber.retryQueue = new Set([value]))
- : returnFiber.add(value)),
- attachPingListener(root, value, rootRenderLanes)),
- !1
- );
+var ContextOnlyDispatcher = {
+ readContext: readContext,
+ use: use,
+ useCallback: throwInvalidHookError,
+ useContext: throwInvalidHookError,
+ useEffect: throwInvalidHookError,
+ useImperativeHandle: throwInvalidHookError,
+ useLayoutEffect: throwInvalidHookError,
+ useInsertionEffect: throwInvalidHookError,
+ useMemo: throwInvalidHookError,
+ useReducer: throwInvalidHookError,
+ useRef: throwInvalidHookError,
+ useState: throwInvalidHookError,
+ useDebugValue: throwInvalidHookError,
+ useDeferredValue: throwInvalidHookError,
+ useTransition: throwInvalidHookError,
+ useSyncExternalStore: throwInvalidHookError,
+ useId: throwInvalidHookError,
+ useHostTransitionStatus: throwInvalidHookError,
+ useFormState: throwInvalidHookError,
+ useActionState: throwInvalidHookError,
+ useOptimistic: throwInvalidHookError,
+ useMemoCache: throwInvalidHookError,
+ useCacheRefresh: throwInvalidHookError
+};
+ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
+var HooksDispatcherOnMount = {
+ readContext: readContext,
+ use: use,
+ useCallback: function (callback, deps) {
+ mountWorkInProgressHook().memoizedState = [
+ callback,
+ void 0 === deps ? null : deps
+ ];
+ return callback;
+ },
+ useContext: readContext,
+ useEffect: mountEffect,
+ useImperativeHandle: function (ref, create, deps) {
+ deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
+ mountEffectImpl(
+ 4194308,
+ 4,
+ imperativeHandleEffect.bind(null, create, ref),
+ deps
+ );
+ },
+ useLayoutEffect: function (create, deps) {
+ return mountEffectImpl(4194308, 4, create, deps);
+ },
+ useInsertionEffect: function (create, deps) {
+ mountEffectImpl(4, 2, create, deps);
+ },
+ useMemo: function (nextCreate, deps) {
+ var hook = mountWorkInProgressHook();
+ deps = void 0 === deps ? null : deps;
+ var nextValue = nextCreate();
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ nextCreate();
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
}
- throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
- }
- attachPingListener(root, value, rootRenderLanes);
- renderDidSuspendDelayIfPossible();
- return !1;
- }
- if (isHydrating)
- return (
- (suspenseBoundary = suspenseHandlerStackCursor.current),
- null !== suspenseBoundary
- ? (0 === (suspenseBoundary.flags & 65536) &&
- (suspenseBoundary.flags |= 256),
- markSuspenseBoundaryShouldCapture(
- suspenseBoundary,
- returnFiber,
- sourceFiber,
- root,
- rootRenderLanes
- ),
- value !== HydrationMismatchException &&
- ((root = Error(formatProdErrorMessage(422), { cause: value })),
- queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))
- : (value !== HydrationMismatchException &&
- ((returnFiber = Error(formatProdErrorMessage(423), {
- cause: value
- })),
- queueHydrationError(
- createCapturedValueAtFiber(returnFiber, sourceFiber)
- )),
- (root = root.current.alternate),
- (root.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (root.lanes |= rootRenderLanes),
- (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
- (rootRenderLanes = createRootErrorUpdate(
- root.stateNode,
- sourceFiber,
- rootRenderLanes
- )),
- enqueueCapturedUpdate(root, rootRenderLanes),
- 4 !== workInProgressRootExitStatus &&
- (workInProgressRootExitStatus = 2)),
- !1
- );
- suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value });
- queueConcurrentError(
- createCapturedValueAtFiber(suspenseBoundary, sourceFiber)
- );
- 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
- if (null === returnFiber) return !0;
- sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
- do {
- switch (returnFiber.tag) {
- case 3:
- return (
- (returnFiber.flags |= 65536),
- (root = rootRenderLanes & -rootRenderLanes),
- (returnFiber.lanes |= root),
- (root = createRootErrorUpdate(
- returnFiber.stateNode,
- sourceFiber,
- root
- )),
- enqueueCapturedUpdate(returnFiber, root),
- !1
- );
- case 1:
- if (
- ((value = returnFiber.type),
- (suspenseBoundary = returnFiber.stateNode),
- 0 === (returnFiber.flags & 128) &&
- ("function" === typeof value.getDerivedStateFromError ||
- (null !== suspenseBoundary &&
- "function" === typeof suspenseBoundary.componentDidCatch &&
- (null === legacyErrorBoundariesThatAlreadyFailed ||
- !legacyErrorBoundariesThatAlreadyFailed.has(
- suspenseBoundary
- )))))
- )
- return (
- (returnFiber.flags |= 65536),
- (rootRenderLanes &= -rootRenderLanes),
- (returnFiber.lanes |= rootRenderLanes),
- (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
- initializeClassErrorUpdate(
- rootRenderLanes,
- root,
- returnFiber,
- sourceFiber
- ),
- enqueueCapturedUpdate(returnFiber, rootRenderLanes),
- !1
- );
+ hook.memoizedState = [nextValue, deps];
+ return nextValue;
+ },
+ useReducer: function (reducer, initialArg, init) {
+ var hook = mountWorkInProgressHook();
+ if (void 0 !== init) {
+ var initialState = init(initialArg);
+ if (shouldDoubleInvokeUserFnsInHooksDEV) {
+ setIsStrictModeForDevtools(!0);
+ try {
+ init(initialArg);
+ } finally {
+ setIsStrictModeForDevtools(!1);
+ }
+ }
+ } else initialState = initialArg;
+ hook.memoizedState = hook.baseState = initialState;
+ reducer = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: reducer,
+ lastRenderedState: initialState
+ };
+ hook.queue = reducer;
+ reducer = reducer.dispatch = dispatchReducerAction.bind(
+ null,
+ currentlyRenderingFiber,
+ reducer
+ );
+ return [hook.memoizedState, reducer];
+ },
+ useRef: function (initialValue) {
+ var hook = mountWorkInProgressHook();
+ initialValue = { current: initialValue };
+ return (hook.memoizedState = initialValue);
+ },
+ useState: function (initialState) {
+ initialState = mountStateImpl(initialState);
+ var queue = initialState.queue,
+ dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
+ queue.dispatch = dispatch;
+ return [initialState.memoizedState, dispatch];
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = mountWorkInProgressHook();
+ return mountDeferredValueImpl(hook, value, initialValue);
+ },
+ useTransition: function () {
+ var stateHook = mountStateImpl(!1);
+ stateHook = startTransition.bind(
+ null,
+ currentlyRenderingFiber,
+ stateHook.queue,
+ !0,
+ !1
+ );
+ mountWorkInProgressHook().memoizedState = stateHook;
+ return [!1, stateHook];
+ },
+ useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {
+ var fiber = currentlyRenderingFiber,
+ hook = mountWorkInProgressHook();
+ if (isHydrating) {
+ if (void 0 === getServerSnapshot)
+ throw Error(formatProdErrorMessage(407));
+ getServerSnapshot = getServerSnapshot();
+ } else {
+ getServerSnapshot = getSnapshot();
+ if (null === workInProgressRoot)
+ throw Error(formatProdErrorMessage(349));
+ 0 !== (workInProgressRootRenderLanes & 60) ||
+ pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
+ }
+ hook.memoizedState = getServerSnapshot;
+ var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };
+ hook.queue = inst;
+ mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
+ subscribe
+ ]);
+ fiber.flags |= 2048;
+ pushSimpleEffect(
+ 9,
+ createEffectInstance(),
+ updateStoreInstance.bind(
+ null,
+ fiber,
+ inst,
+ getServerSnapshot,
+ getSnapshot
+ ),
+ null
+ );
+ return getServerSnapshot;
+ },
+ useId: function () {
+ var hook = mountWorkInProgressHook(),
+ identifierPrefix = workInProgressRoot.identifierPrefix;
+ if (isHydrating) {
+ var JSCompiler_inline_result = treeContextOverflow;
+ var idWithLeadingBit = treeContextId;
+ JSCompiler_inline_result =
+ (
+ idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))
+ ).toString(32) + JSCompiler_inline_result;
+ identifierPrefix =
+ ":" + identifierPrefix + "R" + JSCompiler_inline_result;
+ JSCompiler_inline_result = localIdCounter++;
+ 0 < JSCompiler_inline_result &&
+ (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
+ identifierPrefix += ":";
+ } else
+ (JSCompiler_inline_result = globalClientIdCounter++),
+ (identifierPrefix =
+ ":" +
+ identifierPrefix +
+ "r" +
+ JSCompiler_inline_result.toString(32) +
+ ":");
+ return (hook.memoizedState = identifierPrefix);
+ },
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: mountActionState,
+ useActionState: mountActionState,
+ useOptimistic: function (passthrough) {
+ var hook = mountWorkInProgressHook();
+ hook.memoizedState = hook.baseState = passthrough;
+ var queue = {
+ pending: null,
+ lanes: 0,
+ dispatch: null,
+ lastRenderedReducer: null,
+ lastRenderedState: null
+ };
+ hook.queue = queue;
+ hook = dispatchOptimisticSetState.bind(
+ null,
+ currentlyRenderingFiber,
+ !0,
+ queue
+ );
+ queue.dispatch = hook;
+ return [passthrough, hook];
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: function () {
+ return (mountWorkInProgressHook().memoizedState = refreshCache.bind(
+ null,
+ currentlyRenderingFiber
+ ));
+ },
+ useEffectEvent: function (callback) {
+ var hook = mountWorkInProgressHook(),
+ ref = { impl: callback };
+ hook.memoizedState = ref;
+ return function () {
+ if (0 !== (executionContext & 2))
+ throw Error(formatProdErrorMessage(440));
+ return ref.impl.apply(void 0, arguments);
+ };
}
- returnFiber = returnFiber.return;
- } while (null !== returnFiber);
- return !1;
-}
-var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
- didReceiveUpdate = !1;
-function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
- workInProgress.child =
- null === current
- ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
- : reconcileChildFibers(
- workInProgress,
- current.child,
- nextChildren,
- renderLanes
+ },
+ HooksDispatcherOnUpdate = {
+ readContext: readContext,
+ use: use,
+ useCallback: updateCallback,
+ useContext: readContext,
+ useEffect: updateEffect,
+ useImperativeHandle: updateImperativeHandle,
+ useInsertionEffect: updateInsertionEffect,
+ useLayoutEffect: updateLayoutEffect,
+ useMemo: updateMemo,
+ useReducer: updateReducer,
+ useRef: updateRef,
+ useState: function () {
+ return updateReducer(basicStateReducer);
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
+ );
+ },
+ useTransition: function () {
+ var booleanOrThenable = updateReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ },
+ useSyncExternalStore: updateSyncExternalStore,
+ useId: updateId,
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: updateActionState,
+ useActionState: updateActionState,
+ useOptimistic: function (passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: updateRefresh
+ };
+HooksDispatcherOnUpdate.useEffectEvent = updateEvent;
+var HooksDispatcherOnRerender = {
+ readContext: readContext,
+ use: use,
+ useCallback: updateCallback,
+ useContext: readContext,
+ useEffect: updateEffect,
+ useImperativeHandle: updateImperativeHandle,
+ useInsertionEffect: updateInsertionEffect,
+ useLayoutEffect: updateLayoutEffect,
+ useMemo: updateMemo,
+ useReducer: rerenderReducer,
+ useRef: updateRef,
+ useState: function () {
+ return rerenderReducer(basicStateReducer);
+ },
+ useDebugValue: mountDebugValue,
+ useDeferredValue: function (value, initialValue) {
+ var hook = updateWorkInProgressHook();
+ return null === currentHook
+ ? mountDeferredValueImpl(hook, value, initialValue)
+ : updateDeferredValueImpl(
+ hook,
+ currentHook.memoizedState,
+ value,
+ initialValue
);
+ },
+ useTransition: function () {
+ var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
+ start = updateWorkInProgressHook().memoizedState;
+ return [
+ "boolean" === typeof booleanOrThenable
+ ? booleanOrThenable
+ : useThenable(booleanOrThenable),
+ start
+ ];
+ },
+ useSyncExternalStore: updateSyncExternalStore,
+ useId: updateId,
+ useHostTransitionStatus: useHostTransitionStatus,
+ useFormState: rerenderActionState,
+ useActionState: rerenderActionState,
+ useOptimistic: function (passthrough, reducer) {
+ var hook = updateWorkInProgressHook();
+ if (null !== currentHook)
+ return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
+ hook.baseState = passthrough;
+ return [passthrough, hook.queue.dispatch];
+ },
+ useMemoCache: useMemoCache,
+ useCacheRefresh: updateRefresh
+};
+HooksDispatcherOnRerender.useEffectEvent = updateEvent;
+var thenableState = null,
+ thenableIndexCounter = 0;
+function unwrapThenable(thenable) {
+ var index = thenableIndexCounter;
+ thenableIndexCounter += 1;
+ null === thenableState && (thenableState = []);
+ return trackUsedThenable(thenableState, thenable, index);
}
-function updateForwardRef(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- Component = Component.render;
- var ref = workInProgress.ref;
- if ("ref" in nextProps) {
- var propsWithoutRef = {};
- for (var key in nextProps)
- "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
- } else propsWithoutRef = nextProps;
- prepareToReadContext(workInProgress);
- nextProps = renderWithHooks(
- current,
- workInProgress,
- Component,
- propsWithoutRef,
- ref,
- renderLanes
+function coerceRef(workInProgress, element) {
+ element = element.props.ref;
+ workInProgress.ref = void 0 !== element ? element : null;
+}
+function throwOnInvalidObjectType(returnFiber, newChild) {
+ if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
+ throw Error(formatProdErrorMessage(525));
+ returnFiber = Object.prototype.toString.call(newChild);
+ throw Error(
+ formatProdErrorMessage(
+ 31,
+ "[object Object]" === returnFiber
+ ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
+ : returnFiber
+ )
);
- key = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && key && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
}
-function updateMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- if (null === current) {
- var type = Component.type;
- if (
- "function" === typeof type &&
- !shouldConstruct(type) &&
- void 0 === type.defaultProps &&
- null === Component.compare
+function resolveLazy(lazyType) {
+ var init = lazyType._init;
+ return init(lazyType._payload);
+}
+function createChildReconciler(shouldTrackSideEffects) {
+ function deleteChild(returnFiber, childToDelete) {
+ if (shouldTrackSideEffects) {
+ var deletions = returnFiber.deletions;
+ null === deletions
+ ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))
+ : deletions.push(childToDelete);
+ }
+ }
+ function deleteRemainingChildren(returnFiber, currentFirstChild) {
+ if (!shouldTrackSideEffects) return null;
+ for (; null !== currentFirstChild; )
+ deleteChild(returnFiber, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return null;
+ }
+ function mapRemainingChildren(currentFirstChild) {
+ for (var existingChildren = new Map(); null !== currentFirstChild; )
+ null !== currentFirstChild.key
+ ? existingChildren.set(currentFirstChild.key, currentFirstChild)
+ : existingChildren.set(currentFirstChild.index, currentFirstChild),
+ (currentFirstChild = currentFirstChild.sibling);
+ return existingChildren;
+ }
+ function useFiber(fiber, pendingProps) {
+ fiber = createWorkInProgress(fiber, pendingProps);
+ fiber.index = 0;
+ fiber.sibling = null;
+ return fiber;
+ }
+ function placeChild(newFiber, lastPlacedIndex, newIndex) {
+ newFiber.index = newIndex;
+ if (!shouldTrackSideEffects)
+ return (newFiber.flags |= 1048576), lastPlacedIndex;
+ newIndex = newFiber.alternate;
+ if (null !== newIndex)
+ return (
+ (newIndex = newIndex.index),
+ newIndex < lastPlacedIndex
+ ? ((newFiber.flags |= 33554434), lastPlacedIndex)
+ : newIndex
+ );
+ newFiber.flags |= 33554434;
+ return lastPlacedIndex;
+ }
+ function placeSingleChild(newFiber) {
+ shouldTrackSideEffects &&
+ null === newFiber.alternate &&
+ (newFiber.flags |= 33554434);
+ return newFiber;
+ }
+ function updateTextNode(returnFiber, current, textContent, lanes) {
+ if (null === current || 6 !== current.tag)
+ return (
+ (current = createFiberFromText(textContent, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, textContent);
+ current.return = returnFiber;
+ return current;
+ }
+ function updateElement(returnFiber, current, element, lanes) {
+ var elementType = element.type;
+ if (elementType === REACT_FRAGMENT_TYPE)
+ return updateFragment(
+ returnFiber,
+ current,
+ element.props.children,
+ lanes,
+ element.key
+ );
+ if (
+ null !== current &&
+ (current.elementType === elementType ||
+ ("object" === typeof elementType &&
+ null !== elementType &&
+ elementType.$$typeof === REACT_LAZY_TYPE &&
+ resolveLazy(elementType) === current.type))
)
return (
- (workInProgress.tag = 15),
- (workInProgress.type = type),
- updateSimpleMemoComponent(
- current,
- workInProgress,
- type,
- nextProps,
- renderLanes
- )
+ (current = useFiber(current, element.props)),
+ coerceRef(current, element),
+ (current.return = returnFiber),
+ current
);
current = createFiberFromTypeAndProps(
- Component.type,
+ element.type,
+ element.key,
+ element.props,
null,
- nextProps,
- workInProgress,
- workInProgress.mode,
- renderLanes
+ returnFiber.mode,
+ lanes
);
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
+ coerceRef(current, element);
+ current.return = returnFiber;
+ return current;
}
- type = current.child;
- if (!checkScheduledUpdateOrContext(current, renderLanes)) {
- var prevProps = type.memoizedProps;
- Component = Component.compare;
- Component = null !== Component ? Component : shallowEqual;
- if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+ function updatePortal(returnFiber, current, portal, lanes) {
+ if (
+ null === current ||
+ 4 !== current.tag ||
+ current.stateNode.containerInfo !== portal.containerInfo ||
+ current.stateNode.implementation !== portal.implementation
+ )
+ return (
+ (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, portal.children || []);
+ current.return = returnFiber;
+ return current;
}
- workInProgress.flags |= 1;
- current = createWorkInProgress(type, nextProps);
- current.ref = workInProgress.ref;
- current.return = workInProgress;
- return (workInProgress.child = current);
-}
-function updateSimpleMemoComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- if (null !== current) {
- var prevProps = current.memoizedProps;
+ function updateFragment(returnFiber, current, fragment, lanes, key) {
+ if (null === current || 7 !== current.tag)
+ return (
+ (current = createFiberFromFragment(
+ fragment,
+ returnFiber.mode,
+ lanes,
+ key
+ )),
+ (current.return = returnFiber),
+ current
+ );
+ current = useFiber(current, fragment);
+ current.return = returnFiber;
+ return current;
+ }
+ function createChild(returnFiber, newChild, lanes) {
if (
- shallowEqual(prevProps, nextProps) &&
- current.ref === workInProgress.ref
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
)
+ return (
+ (newChild = createFiberFromText(
+ "" + newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ newChild
+ );
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return (
+ (lanes = createFiberFromTypeAndProps(
+ newChild.type,
+ newChild.key,
+ newChild.props,
+ null,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ lanes
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (newChild = createFiberFromPortal(
+ newChild,
+ returnFiber.mode,
+ lanes
+ )),
+ (newChild.return = returnFiber),
+ newChild
+ );
+ case REACT_LAZY_TYPE:
+ var init = newChild._init;
+ newChild = init(newChild._payload);
+ return createChild(returnFiber, newChild, lanes);
+ }
if (
- ((didReceiveUpdate = !1),
- (workInProgress.pendingProps = nextProps = prevProps),
- checkScheduledUpdateOrContext(current, renderLanes))
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
)
- 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
- else
return (
- (workInProgress.lanes = current.lanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ (newChild = createFiberFromFragment(
+ newChild,
+ returnFiber.mode,
+ lanes,
+ null
+ )),
+ (newChild.return = returnFiber),
+ newChild
+ );
+ if ("function" === typeof newChild.then)
+ return createChild(returnFiber, unwrapThenable(newChild), lanes);
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return createChild(
+ returnFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
);
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return null;
}
- return updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
- );
-}
-function updateOffscreenComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- nextChildren = nextProps.children,
- nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2),
- prevState = null !== current ? current.memoizedState : null;
- markRef(current, workInProgress);
- if ("hidden" === nextProps.mode || nextIsDetached) {
- if (0 !== (workInProgress.flags & 128)) {
- nextProps =
- null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
- if (null !== current) {
- nextChildren = workInProgress.child = current.child;
- for (nextIsDetached = 0; null !== nextChildren; )
- (nextIsDetached =
- nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
- (nextChildren = nextChildren.sibling);
- workInProgress.childLanes = nextIsDetached & ~nextProps;
- } else (workInProgress.childLanes = 0), (workInProgress.child = null);
- return deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
+ function updateSlot(returnFiber, oldFiber, newChild, lanes) {
+ var key = null !== oldFiber ? oldFiber.key : null;
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
+ return null !== key
+ ? null
+ : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return newChild.key === key
+ ? updateElement(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_PORTAL_TYPE:
+ return newChild.key === key
+ ? updatePortal(returnFiber, oldFiber, newChild, lanes)
+ : null;
+ case REACT_LAZY_TYPE:
+ return (
+ (key = newChild._init),
+ (newChild = key(newChild._payload)),
+ updateSlot(returnFiber, oldFiber, newChild, lanes)
+ );
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return null !== key
+ ? null
+ : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
+ if ("function" === typeof newChild.then)
+ return updateSlot(
+ returnFiber,
+ oldFiber,
+ unwrapThenable(newChild),
+ lanes
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateSlot(
+ returnFiber,
+ oldFiber,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
}
- if (0 !== (renderLanes & 536870912))
- (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
- null !== current &&
- pushTransition(
- workInProgress,
- null !== prevState ? prevState.cachePool : null
- ),
- null !== prevState
- ? pushHiddenContext(workInProgress, prevState)
- : reuseHiddenContextOnStack(),
- pushOffscreenSuspenseHandler(workInProgress);
- else
+ return null;
+ }
+ function updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ ) {
+ if (
+ ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ )
return (
- (workInProgress.lanes = workInProgress.childLanes = 536870912),
- deferHiddenOffscreenComponent(
- current,
- workInProgress,
- null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
- renderLanes
- )
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateTextNode(returnFiber, existingChildren, "" + newChild, lanes)
);
- } else
- null !== prevState
- ? (pushTransition(workInProgress, prevState.cachePool),
- pushHiddenContext(workInProgress, prevState),
- reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.memoizedState = null))
- : (null !== current && pushTransition(workInProgress, null),
- reuseHiddenContextOnStack(),
- reuseSuspenseHandlerOnStack(workInProgress));
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
- return workInProgress.child;
-}
-function deferHiddenOffscreenComponent(
- current,
- workInProgress,
- nextBaseLanes,
- renderLanes
-) {
- var JSCompiler_inline_result = peekCacheFromPool();
- JSCompiler_inline_result =
- null === JSCompiler_inline_result
- ? null
- : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
- workInProgress.memoizedState = {
- baseLanes: nextBaseLanes,
- cachePool: JSCompiler_inline_result
- };
- null !== current && pushTransition(workInProgress, null);
- reuseHiddenContextOnStack();
- pushOffscreenSuspenseHandler(workInProgress);
- null !== current &&
- propagateParentContextChanges(current, workInProgress, renderLanes, !0);
- return null;
-}
-function markRef(current, workInProgress) {
- var ref = workInProgress.ref;
- if (null === ref)
- null !== current &&
- null !== current.ref &&
- (workInProgress.flags |= 2097664);
- else {
- if ("function" !== typeof ref && "object" !== typeof ref)
- throw Error(formatProdErrorMessage(284));
- if (null === current || current.ref !== ref)
- workInProgress.flags |= 2097664;
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updateElement(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_PORTAL_TYPE:
+ return (
+ (existingChildren =
+ existingChildren.get(
+ null === newChild.key ? newIdx : newChild.key
+ ) || null),
+ updatePortal(returnFiber, existingChildren, newChild, lanes)
+ );
+ case REACT_LAZY_TYPE:
+ var init = newChild._init;
+ newChild = init(newChild._payload);
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ newChild,
+ lanes
+ );
+ }
+ if (
+ isArrayImpl(newChild) ||
+ getIteratorFn(newChild) ||
+ "function" === typeof newChild[ASYNC_ITERATOR]
+ )
+ return (
+ (existingChildren = existingChildren.get(newIdx) || null),
+ updateFragment(returnFiber, existingChildren, newChild, lanes, null)
+ );
+ if ("function" === typeof newChild.then)
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ unwrapThenable(newChild),
+ lanes
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return updateFromMap(
+ existingChildren,
+ returnFiber,
+ newIdx,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return null;
+ }
+ function reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null;
+ null !== oldFiber && newIdx < newChildren.length;
+ newIdx++
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(
+ returnFiber,
+ oldFiber,
+ newChildren[newIdx],
+ lanes
+ );
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
+ }
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (newIdx === newChildren.length)
+ return (
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; newIdx < newChildren.length; newIdx++)
+ (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),
+ null !== oldFiber &&
+ ((currentFirstChild = placeChild(
+ oldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = oldFiber)
+ : (previousNewFiber.sibling = oldFiber),
+ (previousNewFiber = oldFiber));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ newIdx < newChildren.length;
+ newIdx++
+ )
+ (nextOldFiber = updateFromMap(
+ oldFiber,
+ returnFiber,
+ newIdx,
+ newChildren[newIdx],
+ lanes
+ )),
+ null !== nextOldFiber &&
+ (shouldTrackSideEffects &&
+ null !== nextOldFiber.alternate &&
+ oldFiber.delete(
+ null === nextOldFiber.key ? newIdx : nextOldFiber.key
+ ),
+ (currentFirstChild = placeChild(
+ nextOldFiber,
+ currentFirstChild,
+ newIdx
+ )),
+ null === previousNewFiber
+ ? (resultingFirstChild = nextOldFiber)
+ : (previousNewFiber.sibling = nextOldFiber),
+ (previousNewFiber = nextOldFiber));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ function reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChildrenIterable,
+ lanes
+ ) {
+ var newChildren = newChildrenIterable[ASYNC_ITERATOR]();
+ if (null == newChildren) throw Error(formatProdErrorMessage(151));
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ {
+ next: function () {
+ return unwrapThenable(newChildren.next());
+ }
+ },
+ lanes
+ );
+ }
+ function reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChildren,
+ lanes
+ ) {
+ if (null == newChildren) throw Error(formatProdErrorMessage(151));
+ for (
+ var resultingFirstChild = null,
+ previousNewFiber = null,
+ oldFiber = currentFirstChild,
+ newIdx = (currentFirstChild = 0),
+ nextOldFiber = null,
+ step = newChildren.next();
+ null !== oldFiber && !step.done;
+ newIdx++, step = newChildren.next()
+ ) {
+ oldFiber.index > newIdx
+ ? ((nextOldFiber = oldFiber), (oldFiber = null))
+ : (nextOldFiber = oldFiber.sibling);
+ var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
+ if (null === newFiber) {
+ null === oldFiber && (oldFiber = nextOldFiber);
+ break;
+ }
+ shouldTrackSideEffects &&
+ oldFiber &&
+ null === newFiber.alternate &&
+ deleteChild(returnFiber, oldFiber);
+ currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
+ null === previousNewFiber
+ ? (resultingFirstChild = newFiber)
+ : (previousNewFiber.sibling = newFiber);
+ previousNewFiber = newFiber;
+ oldFiber = nextOldFiber;
+ }
+ if (step.done)
+ return (
+ deleteRemainingChildren(returnFiber, oldFiber),
+ isHydrating && pushTreeFork(returnFiber, newIdx),
+ resultingFirstChild
+ );
+ if (null === oldFiber) {
+ for (; !step.done; newIdx++, step = newChildren.next())
+ (step = createChild(returnFiber, step.value, lanes)),
+ null !== step &&
+ ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
+ null === previousNewFiber
+ ? (resultingFirstChild = step)
+ : (previousNewFiber.sibling = step),
+ (previousNewFiber = step));
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ for (
+ oldFiber = mapRemainingChildren(oldFiber);
+ !step.done;
+ newIdx++, step = newChildren.next()
+ )
+ (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
+ null !== step &&
+ (shouldTrackSideEffects &&
+ null !== step.alternate &&
+ oldFiber.delete(null === step.key ? newIdx : step.key),
+ (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
+ null === previousNewFiber
+ ? (resultingFirstChild = step)
+ : (previousNewFiber.sibling = step),
+ (previousNewFiber = step));
+ shouldTrackSideEffects &&
+ oldFiber.forEach(function (child) {
+ return deleteChild(returnFiber, child);
+ });
+ isHydrating && pushTreeFork(returnFiber, newIdx);
+ return resultingFirstChild;
+ }
+ function reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ ) {
+ "object" === typeof newChild &&
+ null !== newChild &&
+ newChild.type === REACT_FRAGMENT_TYPE &&
+ null === newChild.key &&
+ (newChild = newChild.props.children);
+ if ("object" === typeof newChild && null !== newChild) {
+ switch (newChild.$$typeof) {
+ case REACT_ELEMENT_TYPE:
+ a: {
+ for (var key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key) {
+ key = newChild.type;
+ if (key === REACT_FRAGMENT_TYPE) {
+ if (7 === currentFirstChild.tag) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(
+ currentFirstChild,
+ newChild.props.children
+ );
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ }
+ } else if (
+ currentFirstChild.elementType === key ||
+ ("object" === typeof key &&
+ null !== key &&
+ key.$$typeof === REACT_LAZY_TYPE &&
+ resolveLazy(key) === currentFirstChild.type)
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.props);
+ coerceRef(lanes, newChild);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ }
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ } else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ newChild.type === REACT_FRAGMENT_TYPE
+ ? ((lanes = createFiberFromFragment(
+ newChild.props.children,
+ returnFiber.mode,
+ lanes,
+ newChild.key
+ )),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : ((lanes = createFiberFromTypeAndProps(
+ newChild.type,
+ newChild.key,
+ newChild.props,
+ null,
+ returnFiber.mode,
+ lanes
+ )),
+ coerceRef(lanes, newChild),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes));
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_PORTAL_TYPE:
+ a: {
+ for (key = newChild.key; null !== currentFirstChild; ) {
+ if (currentFirstChild.key === key)
+ if (
+ 4 === currentFirstChild.tag &&
+ currentFirstChild.stateNode.containerInfo ===
+ newChild.containerInfo &&
+ currentFirstChild.stateNode.implementation ===
+ newChild.implementation
+ ) {
+ deleteRemainingChildren(
+ returnFiber,
+ currentFirstChild.sibling
+ );
+ lanes = useFiber(currentFirstChild, newChild.children || []);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ break a;
+ } else {
+ deleteRemainingChildren(returnFiber, currentFirstChild);
+ break;
+ }
+ else deleteChild(returnFiber, currentFirstChild);
+ currentFirstChild = currentFirstChild.sibling;
+ }
+ lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
+ lanes.return = returnFiber;
+ returnFiber = lanes;
+ }
+ return placeSingleChild(returnFiber);
+ case REACT_LAZY_TYPE:
+ return (
+ (key = newChild._init),
+ (newChild = key(newChild._payload)),
+ reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ )
+ );
+ }
+ if (isArrayImpl(newChild))
+ return reconcileChildrenArray(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ if (getIteratorFn(newChild)) {
+ key = getIteratorFn(newChild);
+ if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
+ newChild = key.call(newChild);
+ return reconcileChildrenIterator(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ }
+ if ("function" === typeof newChild[ASYNC_ITERATOR])
+ return reconcileChildrenAsyncIteratable(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ if ("function" === typeof newChild.then)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ unwrapThenable(newChild),
+ lanes
+ );
+ if (newChild.$$typeof === REACT_CONTEXT_TYPE)
+ return reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ readContextDuringReconciliation(returnFiber, newChild),
+ lanes
+ );
+ throwOnInvalidObjectType(returnFiber, newChild);
+ }
+ return ("string" === typeof newChild && "" !== newChild) ||
+ "number" === typeof newChild ||
+ "bigint" === typeof newChild
+ ? ((newChild = "" + newChild),
+ null !== currentFirstChild && 6 === currentFirstChild.tag
+ ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
+ (lanes = useFiber(currentFirstChild, newChild)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes))
+ : (deleteRemainingChildren(returnFiber, currentFirstChild),
+ (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),
+ (lanes.return = returnFiber),
+ (returnFiber = lanes)),
+ placeSingleChild(returnFiber))
+ : deleteRemainingChildren(returnFiber, currentFirstChild);
+ }
+ return function (returnFiber, currentFirstChild, newChild, lanes) {
+ try {
+ thenableIndexCounter = 0;
+ var firstChildFiber = reconcileChildFibersImpl(
+ returnFiber,
+ currentFirstChild,
+ newChild,
+ lanes
+ );
+ thenableState = null;
+ return firstChildFiber;
+ } catch (x) {
+ if (x === SuspenseException || x === SuspenseActionException) throw x;
+ var fiber = createFiberImplClass(29, x, null, returnFiber.mode);
+ fiber.lanes = lanes;
+ fiber.return = returnFiber;
+ return fiber;
+ } finally {
+ }
+ };
+}
+var reconcileChildFibers = createChildReconciler(!0),
+ mountChildFibers = createChildReconciler(!1),
+ suspenseHandlerStackCursor = createCursor(null),
+ shellBoundary = null;
+function pushPrimaryTreeSuspenseHandler(handler) {
+ var current = handler.alternate;
+ push(suspenseStackCursor, suspenseStackCursor.current & 1);
+ push(suspenseHandlerStackCursor, handler);
+ null === shellBoundary &&
+ (null === current || null !== currentTreeHiddenStackCursor.current
+ ? (shellBoundary = handler)
+ : null !== current.memoizedState && (shellBoundary = handler));
+}
+function pushOffscreenSuspenseHandler(fiber) {
+ if (22 === fiber.tag) {
+ if (
+ (push(suspenseStackCursor, suspenseStackCursor.current),
+ push(suspenseHandlerStackCursor, fiber),
+ null === shellBoundary)
+ ) {
+ var current = fiber.alternate;
+ null !== current &&
+ null !== current.memoizedState &&
+ (shellBoundary = fiber);
+ }
+ } else reuseSuspenseHandlerOnStack(fiber);
+}
+function reuseSuspenseHandlerOnStack() {
+ push(suspenseStackCursor, suspenseStackCursor.current);
+ push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
+}
+function popSuspenseHandler(fiber) {
+ pop(suspenseHandlerStackCursor);
+ shellBoundary === fiber && (shellBoundary = null);
+ pop(suspenseStackCursor);
+}
+var suspenseStackCursor = createCursor(0);
+function findFirstSuspended(row) {
+ for (var node = row; null !== node; ) {
+ if (13 === node.tag) {
+ var state = node.memoizedState;
+ if (
+ null !== state &&
+ ((state = state.dehydrated),
+ null === state ||
+ "$?" === state.data ||
+ isSuspenseInstanceFallback(state))
+ )
+ return node;
+ } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
+ if (0 !== (node.flags & 128)) return node;
+ } else if (null !== node.child) {
+ node.child.return = node;
+ node = node.child;
+ continue;
+ }
+ if (node === row) break;
+ for (; null === node.sibling; ) {
+ if (null === node.return || node.return === row) return null;
+ node = node.return;
+ }
+ node.sibling.return = node.return;
+ node = node.sibling;
+ }
+ return null;
+}
+var reportGlobalError =
+ "function" === typeof reportError
+ ? reportError
+ : function (error) {
+ if (
+ "object" === typeof window &&
+ "function" === typeof window.ErrorEvent
+ ) {
+ var event = new window.ErrorEvent("error", {
+ bubbles: !0,
+ cancelable: !0,
+ message:
+ "object" === typeof error &&
+ null !== error &&
+ "string" === typeof error.message
+ ? String(error.message)
+ : String(error),
+ error: error
+ });
+ if (!window.dispatchEvent(event)) return;
+ } else if (
+ "object" === typeof process &&
+ "function" === typeof process.emit
+ ) {
+ process.emit("uncaughtException", error);
+ return;
+ }
+ console.error(error);
+ };
+function defaultOnUncaughtError(error) {
+ reportGlobalError(error);
+}
+function defaultOnCaughtError(error) {
+ console.error(error);
+}
+function defaultOnRecoverableError(error) {
+ reportGlobalError(error);
+}
+function logUncaughtError(root, errorInfo) {
+ try {
+ var onUncaughtError = root.onUncaughtError;
+ onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
+ } catch (e$79) {
+ setTimeout(function () {
+ throw e$79;
+ });
+ }
+}
+function logCaughtError(root, boundary, errorInfo) {
+ try {
+ var onCaughtError = root.onCaughtError;
+ onCaughtError(errorInfo.value, {
+ componentStack: errorInfo.stack,
+ errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
+ });
+ } catch (e$80) {
+ setTimeout(function () {
+ throw e$80;
+ });
}
}
-function updateFunctionComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- Component = renderWithHooks(
- current,
- workInProgress,
- Component,
- nextProps,
- void 0,
- renderLanes
- );
- nextProps = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, Component, renderLanes);
- return workInProgress.child;
-}
-function replayFunctionComponent(
- current,
- workInProgress,
- nextProps,
- Component,
- secondArg,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- workInProgress.updateQueue = null;
- nextProps = renderWithHooksAgain(
- workInProgress,
- Component,
- nextProps,
- secondArg
- );
- finishRenderingHooks(current);
- Component = checkDidRenderIdHook();
- if (null !== current && !didReceiveUpdate)
- return (
- bailoutHooks(current, workInProgress, renderLanes),
- bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
- );
- isHydrating && Component && pushMaterializedTreeId(workInProgress);
- workInProgress.flags |= 1;
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
- return workInProgress.child;
-}
-function updateClassComponent(
- current,
- workInProgress,
- Component,
- nextProps,
- renderLanes
-) {
- prepareToReadContext(workInProgress);
- if (null === workInProgress.stateNode) {
- var context = emptyContextObject,
- contextType = Component.contextType;
- "object" === typeof contextType &&
- null !== contextType &&
- (context = readContext(contextType));
- context = new Component(nextProps, context);
- workInProgress.memoizedState =
- null !== context.state && void 0 !== context.state ? context.state : null;
- context.updater = classComponentUpdater;
- workInProgress.stateNode = context;
- context._reactInternals = workInProgress;
- context = workInProgress.stateNode;
- context.props = nextProps;
- context.state = workInProgress.memoizedState;
- context.refs = {};
- initializeUpdateQueue(workInProgress);
- contextType = Component.contextType;
- context.context =
- "object" === typeof contextType && null !== contextType
- ? readContext(contextType)
- : emptyContextObject;
- context.state = workInProgress.memoizedState;
- contextType = Component.getDerivedStateFromProps;
- "function" === typeof contextType &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- contextType,
- nextProps
- ),
- (context.state = workInProgress.memoizedState));
- "function" === typeof Component.getDerivedStateFromProps ||
- "function" === typeof context.getSnapshotBeforeUpdate ||
- ("function" !== typeof context.UNSAFE_componentWillMount &&
- "function" !== typeof context.componentWillMount) ||
- ((contextType = context.state),
- "function" === typeof context.componentWillMount &&
- context.componentWillMount(),
- "function" === typeof context.UNSAFE_componentWillMount &&
- context.UNSAFE_componentWillMount(),
- contextType !== context.state &&
- classComponentUpdater.enqueueReplaceState(context, context.state, null),
- processUpdateQueue(workInProgress, nextProps, context, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction(),
- (context.state = workInProgress.memoizedState));
- "function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308);
- nextProps = !0;
- } else if (null === current) {
- context = workInProgress.stateNode;
- var unresolvedOldProps = workInProgress.memoizedProps,
- oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
- context.props = oldProps;
- var oldContext = context.context,
- contextType$jscomp$0 = Component.contextType;
- contextType = emptyContextObject;
- "object" === typeof contextType$jscomp$0 &&
- null !== contextType$jscomp$0 &&
- (contextType = readContext(contextType$jscomp$0));
- var getDerivedStateFromProps = Component.getDerivedStateFromProps;
- contextType$jscomp$0 =
- "function" === typeof getDerivedStateFromProps ||
- "function" === typeof context.getSnapshotBeforeUpdate;
- unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
- contextType$jscomp$0 ||
- ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof context.componentWillReceiveProps) ||
- ((unresolvedOldProps || oldContext !== contextType) &&
- callComponentWillReceiveProps(
- workInProgress,
- context,
- nextProps,
- contextType
- ));
- hasForceUpdate = !1;
- var oldState = workInProgress.memoizedState;
- context.state = oldState;
- processUpdateQueue(workInProgress, nextProps, context, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- oldContext = workInProgress.memoizedState;
- unresolvedOldProps || oldState !== oldContext || hasForceUpdate
- ? ("function" === typeof getDerivedStateFromProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- getDerivedStateFromProps,
- nextProps
- ),
- (oldContext = workInProgress.memoizedState)),
- (oldProps =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- oldProps,
- nextProps,
- oldState,
- oldContext,
- contextType
- ))
- ? (contextType$jscomp$0 ||
- ("function" !== typeof context.UNSAFE_componentWillMount &&
- "function" !== typeof context.componentWillMount) ||
- ("function" === typeof context.componentWillMount &&
- context.componentWillMount(),
- "function" === typeof context.UNSAFE_componentWillMount &&
- context.UNSAFE_componentWillMount()),
- "function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308))
- : ("function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = oldContext)),
- (context.props = nextProps),
- (context.state = oldContext),
- (context.context = contextType),
- (nextProps = oldProps))
- : ("function" === typeof context.componentDidMount &&
- (workInProgress.flags |= 4194308),
- (nextProps = !1));
- } else {
- context = workInProgress.stateNode;
- cloneUpdateQueue(current, workInProgress);
- contextType = workInProgress.memoizedProps;
- contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
- context.props = contextType$jscomp$0;
- getDerivedStateFromProps = workInProgress.pendingProps;
- oldState = context.context;
- oldContext = Component.contextType;
- oldProps = emptyContextObject;
- "object" === typeof oldContext &&
- null !== oldContext &&
- (oldProps = readContext(oldContext));
- unresolvedOldProps = Component.getDerivedStateFromProps;
- (oldContext =
- "function" === typeof unresolvedOldProps ||
- "function" === typeof context.getSnapshotBeforeUpdate) ||
- ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
- "function" !== typeof context.componentWillReceiveProps) ||
- ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&
- callComponentWillReceiveProps(
- workInProgress,
- context,
- nextProps,
- oldProps
- ));
- hasForceUpdate = !1;
- oldState = workInProgress.memoizedState;
- context.state = oldState;
- processUpdateQueue(workInProgress, nextProps, context, renderLanes);
- suspendIfUpdateReadFromEntangledAsyncAction();
- var newState = workInProgress.memoizedState;
- contextType !== getDerivedStateFromProps ||
- oldState !== newState ||
- hasForceUpdate ||
- (null !== current &&
- null !== current.dependencies &&
- checkIfContextChanged(current.dependencies))
- ? ("function" === typeof unresolvedOldProps &&
- (applyDerivedStateFromProps(
- workInProgress,
- Component,
- unresolvedOldProps,
- nextProps
- ),
- (newState = workInProgress.memoizedState)),
- (contextType$jscomp$0 =
- hasForceUpdate ||
- checkShouldComponentUpdate(
- workInProgress,
- Component,
- contextType$jscomp$0,
- nextProps,
- oldState,
- newState,
- oldProps
- ) ||
- (null !== current &&
- null !== current.dependencies &&
- checkIfContextChanged(current.dependencies)))
- ? (oldContext ||
- ("function" !== typeof context.UNSAFE_componentWillUpdate &&
- "function" !== typeof context.componentWillUpdate) ||
- ("function" === typeof context.componentWillUpdate &&
- context.componentWillUpdate(nextProps, newState, oldProps),
- "function" === typeof context.UNSAFE_componentWillUpdate &&
- context.UNSAFE_componentWillUpdate(
- nextProps,
- newState,
- oldProps
- )),
- "function" === typeof context.componentDidUpdate &&
- (workInProgress.flags |= 4),
- "function" === typeof context.getSnapshotBeforeUpdate &&
- (workInProgress.flags |= 1024))
- : ("function" !== typeof context.componentDidUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof context.getSnapshotBeforeUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 1024),
- (workInProgress.memoizedProps = nextProps),
- (workInProgress.memoizedState = newState)),
- (context.props = nextProps),
- (context.state = newState),
- (context.context = oldProps),
- (nextProps = contextType$jscomp$0))
- : ("function" !== typeof context.componentDidUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 4),
- "function" !== typeof context.getSnapshotBeforeUpdate ||
- (contextType === current.memoizedProps &&
- oldState === current.memoizedState) ||
- (workInProgress.flags |= 1024),
- (nextProps = !1));
+function createRootErrorUpdate(root, errorInfo, lane) {
+ lane = createUpdate(lane);
+ lane.tag = 3;
+ lane.payload = { element: null };
+ lane.callback = function () {
+ logUncaughtError(root, errorInfo);
+ };
+ return lane;
+}
+function createClassErrorUpdate(lane) {
+ lane = createUpdate(lane);
+ lane.tag = 3;
+ return lane;
+}
+function initializeClassErrorUpdate(update, root, fiber, errorInfo) {
+ var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
+ if ("function" === typeof getDerivedStateFromError) {
+ var error = errorInfo.value;
+ update.payload = function () {
+ return getDerivedStateFromError(error);
+ };
+ update.callback = function () {
+ logCaughtError(root, fiber, errorInfo);
+ };
}
- context = nextProps;
- markRef(current, workInProgress);
- nextProps = 0 !== (workInProgress.flags & 128);
- context || nextProps
- ? ((context = workInProgress.stateNode),
- nextProps && "function" !== typeof Component.getDerivedStateFromError
- ? ((Component = null), (profilerStartTime = -1))
- : (Component = context.render()),
- (workInProgress.flags |= 1),
- null !== current && nextProps
- ? ((workInProgress.child = reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
+ var inst = fiber.stateNode;
+ null !== inst &&
+ "function" === typeof inst.componentDidCatch &&
+ (update.callback = function () {
+ logCaughtError(root, fiber, errorInfo);
+ "function" !== typeof getDerivedStateFromError &&
+ (null === legacyErrorBoundariesThatAlreadyFailed
+ ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
+ : legacyErrorBoundariesThatAlreadyFailed.add(this));
+ var stack = errorInfo.stack;
+ this.componentDidCatch(errorInfo.value, {
+ componentStack: null !== stack ? stack : ""
+ });
+ });
+}
+function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
+ var currentSourceFiber = sourceFiber.alternate;
+ null !== currentSourceFiber &&
+ propagateParentContextChanges(
+ currentSourceFiber,
+ sourceFiber,
+ rootRenderLanes,
+ !0
+ );
+}
+function markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+) {
+ suspenseBoundary.flags |= 65536;
+ suspenseBoundary.lanes = rootRenderLanes;
+ return suspenseBoundary;
+}
+function throwException(
+ root,
+ returnFiber,
+ sourceFiber,
+ value,
+ rootRenderLanes
+) {
+ sourceFiber.flags |= 32768;
+ isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes);
+ if (
+ null !== value &&
+ "object" === typeof value &&
+ (value.$$typeof === REACT_POSTPONE_TYPE &&
+ (value = { then: function () {} }),
+ "function" === typeof value.then)
+ ) {
+ resetSuspendedComponent(sourceFiber, rootRenderLanes);
+ var suspenseBoundary = suspenseHandlerStackCursor.current;
+ if (null !== suspenseBoundary) {
+ switch (suspenseBoundary.tag) {
+ case 13:
+ return (
+ null === shellBoundary
+ ? renderDidSuspendDelayIfPossible()
+ : null === suspenseBoundary.alternate &&
+ 0 === workInProgressRootExitStatus &&
+ (workInProgressRootExitStatus = 3),
+ (suspenseBoundary.flags &= -257),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? (suspenseBoundary.updateQueue = new Set([value]))
+ : sourceFiber.add(value),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ case 22:
+ return (
+ (suspenseBoundary.flags |= 65536),
+ value === noopSuspenseyCommitThenable
+ ? (suspenseBoundary.flags |= 16384)
+ : ((sourceFiber = suspenseBoundary.updateQueue),
+ null === sourceFiber
+ ? ((sourceFiber = {
+ transitions: null,
+ markerInstances: null,
+ retryQueue: new Set([value])
+ }),
+ (suspenseBoundary.updateQueue = sourceFiber))
+ : ((returnFiber = sourceFiber.retryQueue),
+ null === returnFiber
+ ? (sourceFiber.retryQueue = new Set([value]))
+ : returnFiber.add(value)),
+ attachPingListener(root, value, rootRenderLanes)),
+ !1
+ );
+ }
+ throw Error(formatProdErrorMessage(435, suspenseBoundary.tag));
+ }
+ attachPingListener(root, value, rootRenderLanes);
+ renderDidSuspendDelayIfPossible();
+ return !1;
+ }
+ if (isHydrating)
+ return (
+ (suspenseBoundary = suspenseHandlerStackCursor.current),
+ null !== suspenseBoundary
+ ? (0 === (suspenseBoundary.flags & 65536) &&
+ (suspenseBoundary.flags |= 256),
+ markSuspenseBoundaryShouldCapture(
+ suspenseBoundary,
+ returnFiber,
+ sourceFiber,
+ root,
+ rootRenderLanes
+ ),
+ value !== HydrationMismatchException &&
+ ((root = Error(formatProdErrorMessage(422), { cause: value })),
+ queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))
+ : (value !== HydrationMismatchException &&
+ ((returnFiber = Error(formatProdErrorMessage(423), {
+ cause: value
+ })),
+ queueHydrationError(
+ createCapturedValueAtFiber(returnFiber, sourceFiber)
+ )),
+ (root = root.current.alternate),
+ (root.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (root.lanes |= rootRenderLanes),
+ (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)),
+ (rootRenderLanes = createRootErrorUpdate(
+ root.stateNode,
+ sourceFiber,
+ rootRenderLanes
)),
- (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- Component,
- renderLanes
- )))
- : reconcileChildren(current, workInProgress, Component, renderLanes),
- (workInProgress.memoizedState = context.state),
- (current = workInProgress.child))
- : (current = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- ));
- return current;
+ enqueueCapturedUpdate(root, rootRenderLanes),
+ 4 !== workInProgressRootExitStatus &&
+ (workInProgressRootExitStatus = 2)),
+ !1
+ );
+ suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value });
+ queueConcurrentError(
+ createCapturedValueAtFiber(suspenseBoundary, sourceFiber)
+ );
+ 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
+ if (null === returnFiber) return !0;
+ sourceFiber = createCapturedValueAtFiber(value, sourceFiber);
+ do {
+ switch (returnFiber.tag) {
+ case 3:
+ return (
+ (returnFiber.flags |= 65536),
+ (root = rootRenderLanes & -rootRenderLanes),
+ (returnFiber.lanes |= root),
+ (root = createRootErrorUpdate(
+ returnFiber.stateNode,
+ sourceFiber,
+ root
+ )),
+ enqueueCapturedUpdate(returnFiber, root),
+ !1
+ );
+ case 1:
+ if (
+ ((value = returnFiber.type),
+ (suspenseBoundary = returnFiber.stateNode),
+ 0 === (returnFiber.flags & 128) &&
+ ("function" === typeof value.getDerivedStateFromError ||
+ (null !== suspenseBoundary &&
+ "function" === typeof suspenseBoundary.componentDidCatch &&
+ (null === legacyErrorBoundariesThatAlreadyFailed ||
+ !legacyErrorBoundariesThatAlreadyFailed.has(
+ suspenseBoundary
+ )))))
+ )
+ return (
+ (returnFiber.flags |= 65536),
+ (rootRenderLanes &= -rootRenderLanes),
+ (returnFiber.lanes |= rootRenderLanes),
+ (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),
+ initializeClassErrorUpdate(
+ rootRenderLanes,
+ root,
+ returnFiber,
+ sourceFiber
+ ),
+ enqueueCapturedUpdate(returnFiber, rootRenderLanes),
+ !1
+ );
+ }
+ returnFiber = returnFiber.return;
+ } while (null !== returnFiber);
+ return !1;
}
-function mountHostRootWithoutHydrating(
+var SelectiveHydrationException = Error(formatProdErrorMessage(461)),
+ didReceiveUpdate = !1;
+function reconcileChildren(current, workInProgress, nextChildren, renderLanes) {
+ workInProgress.child =
+ null === current
+ ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)
+ : reconcileChildFibers(
+ workInProgress,
+ current.child,
+ nextChildren,
+ renderLanes
+ );
+}
+function updateForwardRef(
current,
workInProgress,
- nextChildren,
+ Component,
+ nextProps,
renderLanes
) {
- resetHydrationState();
- workInProgress.flags |= 256;
- reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ Component = Component.render;
+ var ref = workInProgress.ref;
+ if ("ref" in nextProps) {
+ var propsWithoutRef = {};
+ for (var key in nextProps)
+ "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
+ } else propsWithoutRef = nextProps;
+ prepareToReadContext(workInProgress);
+ nextProps = renderWithHooks(
+ current,
+ workInProgress,
+ Component,
+ propsWithoutRef,
+ ref,
+ renderLanes
+ );
+ key = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && key && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
return workInProgress.child;
}
-var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 };
-function mountSuspenseOffscreenState(renderLanes) {
- return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
-}
-function getRemainingWorkInPrimaryTree(
+function updateMemoComponent(
current,
- primaryTreeDidDefer,
+ workInProgress,
+ Component,
+ nextProps,
renderLanes
) {
- current = null !== current ? current.childLanes & ~renderLanes : 0;
- primaryTreeDidDefer && (current |= workInProgressDeferredLane);
- return current;
-}
-function updateSuspenseComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- showFallback = !1,
- didSuspend = 0 !== (workInProgress.flags & 128),
- JSCompiler_temp;
- (JSCompiler_temp = didSuspend) ||
- (JSCompiler_temp =
- null !== current && null === current.memoizedState
- ? !1
- : 0 !== (suspenseStackCursor.current & 2));
- JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));
- JSCompiler_temp = 0 !== (workInProgress.flags & 32);
- workInProgress.flags &= -33;
if (null === current) {
- if (isHydrating) {
- showFallback
- ? pushPrimaryTreeSuspenseHandler(workInProgress)
- : reuseSuspenseHandlerOnStack(workInProgress);
- if (isHydrating) {
- var nextInstance = nextHydratableInstance,
- JSCompiler_temp$jscomp$0;
- if ((JSCompiler_temp$jscomp$0 = nextInstance)) {
- c: {
- JSCompiler_temp$jscomp$0 = nextInstance;
- for (
- nextInstance = rootOrSingletonContext;
- 8 !== JSCompiler_temp$jscomp$0.nodeType;
-
- ) {
- if (!nextInstance) {
- nextInstance = null;
- break c;
- }
- JSCompiler_temp$jscomp$0 = getNextHydratable(
- JSCompiler_temp$jscomp$0.nextSibling
- );
- if (null === JSCompiler_temp$jscomp$0) {
- nextInstance = null;
- break c;
- }
- }
- nextInstance = JSCompiler_temp$jscomp$0;
- }
- null !== nextInstance
- ? ((workInProgress.memoizedState = {
- dehydrated: nextInstance,
- treeContext:
- null !== treeContextProvider
- ? { id: treeContextId, overflow: treeContextOverflow }
- : null,
- retryLane: 536870912
- }),
- (JSCompiler_temp$jscomp$0 = createFiberImplClass(
- 18,
- null,
- null,
- 0
- )),
- (JSCompiler_temp$jscomp$0.stateNode = nextInstance),
- (JSCompiler_temp$jscomp$0.return = workInProgress),
- (workInProgress.child = JSCompiler_temp$jscomp$0),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (JSCompiler_temp$jscomp$0 = !0))
- : (JSCompiler_temp$jscomp$0 = !1);
- }
- JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress);
- }
- nextInstance = workInProgress.memoizedState;
- if (
- null !== nextInstance &&
- ((nextInstance = nextInstance.dehydrated), null !== nextInstance)
- )
- return (
- isSuspenseInstanceFallback(nextInstance)
- ? (workInProgress.lanes = 16)
- : (workInProgress.lanes = 536870912),
- null
- );
- popSuspenseHandler(workInProgress);
- }
- nextInstance = nextProps.children;
- JSCompiler_temp$jscomp$0 = nextProps.fallback;
- if (showFallback)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (nextProps = mountSuspenseFallbackChildren(
- workInProgress,
- nextInstance,
- JSCompiler_temp$jscomp$0,
- renderLanes
- )),
- (showFallback = workInProgress.child),
- (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- nextProps
- );
- if ("number" === typeof nextProps.unstable_expectedLoadTime)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (nextProps = mountSuspenseFallbackChildren(
- workInProgress,
- nextInstance,
- JSCompiler_temp$jscomp$0,
- renderLanes
- )),
- (showFallback = workInProgress.child),
- (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress.lanes = 4194304),
- nextProps
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- return mountSuspensePrimaryChildren(workInProgress, nextInstance);
- }
- JSCompiler_temp$jscomp$0 = current.memoizedState;
- if (
- null !== JSCompiler_temp$jscomp$0 &&
- ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated),
- null !== nextInstance)
- ) {
- if (didSuspend)
- workInProgress.flags & 256
- ? (pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags &= -257),
- (workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- )))
- : null !== workInProgress.memoizedState
- ? (reuseSuspenseHandlerOnStack(workInProgress),
- (workInProgress.child = current.child),
- (workInProgress.flags |= 128),
- (workInProgress = null))
- : (reuseSuspenseHandlerOnStack(workInProgress),
- (showFallback = nextProps.fallback),
- (nextInstance = workInProgress.mode),
- (nextProps = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: nextProps.children },
- nextInstance
- )),
- (showFallback = createFiberFromFragment(
- showFallback,
- nextInstance,
- renderLanes,
- null
- )),
- (showFallback.flags |= 2),
- (nextProps.return = workInProgress),
- (showFallback.return = workInProgress),
- (nextProps.sibling = showFallback),
- (workInProgress.child = nextProps),
- reconcileChildFibers(
- workInProgress,
- current.child,
- null,
- renderLanes
- ),
- (nextProps = workInProgress.child),
- (nextProps.memoizedState =
- mountSuspenseOffscreenState(renderLanes)),
- (nextProps.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- (workInProgress = showFallback));
- else if (
- (pushPrimaryTreeSuspenseHandler(workInProgress),
- isSuspenseInstanceFallback(nextInstance))
- ) {
- JSCompiler_temp =
- nextInstance.nextSibling && nextInstance.nextSibling.dataset;
- if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
- JSCompiler_temp = digest;
- "POSTPONE" !== JSCompiler_temp &&
- ((nextProps = Error(formatProdErrorMessage(419))),
- (nextProps.stack = ""),
- (nextProps.digest = JSCompiler_temp),
- queueHydrationError({ value: nextProps, source: null, stack: null }));
- workInProgress = retrySuspenseComponentWithoutHydrating(
- current,
- workInProgress,
- renderLanes
- );
- } else if (
- (didReceiveUpdate ||
- propagateParentContextChanges(current, workInProgress, renderLanes, !1),
- (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
- didReceiveUpdate || JSCompiler_temp)
- ) {
- JSCompiler_temp = workInProgressRoot;
- if (null !== JSCompiler_temp) {
- nextProps = renderLanes & -renderLanes;
- if (0 !== (nextProps & 42)) nextProps = 1;
- else
- switch (nextProps) {
- case 2:
- nextProps = 1;
- break;
- case 8:
- nextProps = 4;
- break;
- case 32:
- nextProps = 16;
- break;
- case 128:
- case 256:
- case 512:
- case 1024:
- case 2048:
- case 4096:
- case 8192:
- case 16384:
- case 32768:
- case 65536:
- case 131072:
- case 262144:
- case 524288:
- case 1048576:
- case 2097152:
- case 4194304:
- case 8388608:
- case 16777216:
- case 33554432:
- nextProps = 64;
- break;
- case 268435456:
- nextProps = 134217728;
- break;
- default:
- nextProps = 0;
- }
- nextProps =
- 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
- ? 0
- : nextProps;
- if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane)
- throw (
- ((JSCompiler_temp$jscomp$0.retryLane = nextProps),
- enqueueConcurrentRenderForLane(current, nextProps),
- scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
- SelectiveHydrationException)
- );
- }
- "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
- workInProgress = retrySuspenseComponentWithoutHydrating(
+ var type = Component.type;
+ if (
+ "function" === typeof type &&
+ !shouldConstruct(type) &&
+ void 0 === type.defaultProps &&
+ null === Component.compare
+ )
+ return (
+ (workInProgress.tag = 15),
+ (workInProgress.type = type),
+ updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ type,
+ nextProps,
+ renderLanes
+ )
+ );
+ current = createFiberFromTypeAndProps(
+ Component.type,
+ null,
+ nextProps,
+ workInProgress,
+ workInProgress.mode,
+ renderLanes
+ );
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+ }
+ type = current.child;
+ if (!checkScheduledUpdateOrContext(current, renderLanes)) {
+ var prevProps = type.memoizedProps;
+ Component = Component.compare;
+ Component = null !== Component ? Component : shallowEqual;
+ if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
+ }
+ workInProgress.flags |= 1;
+ current = createWorkInProgress(type, nextProps);
+ current.ref = workInProgress.ref;
+ current.return = workInProgress;
+ return (workInProgress.child = current);
+}
+function updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+) {
+ if (null !== current) {
+ var prevProps = current.memoizedProps;
+ if (
+ shallowEqual(prevProps, nextProps) &&
+ current.ref === workInProgress.ref
+ )
+ if (
+ ((didReceiveUpdate = !1),
+ (workInProgress.pendingProps = nextProps = prevProps),
+ checkScheduledUpdateOrContext(current, renderLanes))
+ )
+ 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);
+ else
+ return (
+ (workInProgress.lanes = current.lanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ }
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ Component,
+ nextProps,
+ renderLanes
+ );
+}
+function updateOffscreenComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ nextChildren = nextProps.children,
+ nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2),
+ prevState = null !== current ? current.memoizedState : null;
+ markRef(current, workInProgress);
+ if ("hidden" === nextProps.mode || nextIsDetached) {
+ if (0 !== (workInProgress.flags & 128)) {
+ nextProps =
+ null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;
+ if (null !== current) {
+ nextChildren = workInProgress.child = current.child;
+ for (nextIsDetached = 0; null !== nextChildren; )
+ (nextIsDetached =
+ nextIsDetached | nextChildren.lanes | nextChildren.childLanes),
+ (nextChildren = nextChildren.sibling);
+ workInProgress.childLanes = nextIsDetached & ~nextProps;
+ } else (workInProgress.childLanes = 0), (workInProgress.child = null);
+ return deferHiddenOffscreenComponent(
current,
workInProgress,
+ nextProps,
renderLanes
);
- } else
- "$?" === nextInstance.data
- ? ((workInProgress.flags |= 192),
- (workInProgress.child = current.child),
- (workInProgress = null))
- : ((current = JSCompiler_temp$jscomp$0.treeContext),
- (nextHydratableInstance = getNextHydratable(
- nextInstance.nextSibling
- )),
- (hydrationParentFiber = workInProgress),
- (isHydrating = !0),
- (hydrationErrors = null),
- (rootOrSingletonContext = !1),
- null !== current &&
- ((idStack[idStackIndex++] = treeContextId),
- (idStack[idStackIndex++] = treeContextOverflow),
- (idStack[idStackIndex++] = treeContextProvider),
- (treeContextId = current.id),
- (treeContextOverflow = current.overflow),
- (treeContextProvider = workInProgress)),
- (workInProgress = mountSuspensePrimaryChildren(
+ }
+ if (0 !== (renderLanes & 536870912))
+ (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),
+ null !== current &&
+ pushTransition(
workInProgress,
- nextProps.children
- )),
- (workInProgress.flags |= 4096));
- return workInProgress;
- }
- if (showFallback)
- return (
- reuseSuspenseHandlerOnStack(workInProgress),
- (showFallback = nextProps.fallback),
- (nextInstance = workInProgress.mode),
- (JSCompiler_temp$jscomp$0 = current.child),
- (digest = JSCompiler_temp$jscomp$0.sibling),
- (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, {
- mode: "hidden",
- children: nextProps.children
- })),
- (nextProps.subtreeFlags =
- JSCompiler_temp$jscomp$0.subtreeFlags & 31457280),
- null !== digest
- ? (showFallback = createWorkInProgress(digest, showFallback))
- : ((showFallback = createFiberFromFragment(
- showFallback,
- nextInstance,
- renderLanes,
- null
- )),
- (showFallback.flags |= 2)),
- (showFallback.return = workInProgress),
- (nextProps.return = workInProgress),
- (nextProps.sibling = showFallback),
- (workInProgress.child = nextProps),
- (nextProps = showFallback),
- (showFallback = workInProgress.child),
- (nextInstance = current.child.memoizedState),
- null === nextInstance
- ? (nextInstance = mountSuspenseOffscreenState(renderLanes))
- : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool),
- null !== JSCompiler_temp$jscomp$0
- ? ((digest = CacheContext._currentValue),
- (JSCompiler_temp$jscomp$0 =
- JSCompiler_temp$jscomp$0.parent !== digest
- ? { parent: digest, pool: digest }
- : JSCompiler_temp$jscomp$0))
- : (JSCompiler_temp$jscomp$0 = getSuspendedCache()),
- (nextInstance = {
- baseLanes: nextInstance.baseLanes | renderLanes,
- cachePool: JSCompiler_temp$jscomp$0
- })),
- (showFallback.memoizedState = nextInstance),
- (showFallback.childLanes = getRemainingWorkInPrimaryTree(
- current,
- JSCompiler_temp,
- renderLanes
- )),
- (workInProgress.memoizedState = SUSPENDED_MARKER),
- nextProps
- );
- pushPrimaryTreeSuspenseHandler(workInProgress);
- renderLanes = current.child;
- current = renderLanes.sibling;
- renderLanes = createWorkInProgress(renderLanes, {
- mode: "visible",
- children: nextProps.children
- });
- renderLanes.return = workInProgress;
- renderLanes.sibling = null;
- null !== current &&
- ((JSCompiler_temp = workInProgress.deletions),
- null === JSCompiler_temp
- ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
- : JSCompiler_temp.push(current));
- workInProgress.child = renderLanes;
- workInProgress.memoizedState = null;
- return renderLanes;
-}
-function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "visible", children: primaryChildren },
- workInProgress.mode
- );
- primaryChildren.return = workInProgress;
- return (workInProgress.child = primaryChildren);
+ null !== prevState ? prevState.cachePool : null
+ ),
+ null !== prevState
+ ? pushHiddenContext(workInProgress, prevState)
+ : reuseHiddenContextOnStack(),
+ pushOffscreenSuspenseHandler(workInProgress);
+ else
+ return (
+ (workInProgress.lanes = workInProgress.childLanes = 536870912),
+ deferHiddenOffscreenComponent(
+ current,
+ workInProgress,
+ null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,
+ renderLanes
+ )
+ );
+ } else
+ null !== prevState
+ ? (pushTransition(workInProgress, prevState.cachePool),
+ pushHiddenContext(workInProgress, prevState),
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.memoizedState = null))
+ : (null !== current && pushTransition(workInProgress, null),
+ reuseHiddenContextOnStack(),
+ reuseSuspenseHandlerOnStack(workInProgress));
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
}
-function mountSuspenseFallbackChildren(
+function deferHiddenOffscreenComponent(
+ current,
workInProgress,
- primaryChildren,
- fallbackChildren,
+ nextBaseLanes,
renderLanes
) {
- var mode = workInProgress.mode;
- primaryChildren = mountWorkInProgressOffscreenFiber(
- { mode: "hidden", children: primaryChildren },
- mode
- );
- fallbackChildren = createFiberFromFragment(
- fallbackChildren,
- mode,
- renderLanes,
- null
- );
- primaryChildren.return = workInProgress;
- fallbackChildren.return = workInProgress;
- primaryChildren.sibling = fallbackChildren;
- workInProgress.child = primaryChildren;
- return fallbackChildren;
+ var JSCompiler_inline_result = peekCacheFromPool();
+ JSCompiler_inline_result =
+ null === JSCompiler_inline_result
+ ? null
+ : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
+ workInProgress.memoizedState = {
+ baseLanes: nextBaseLanes,
+ cachePool: JSCompiler_inline_result
+ };
+ null !== current && pushTransition(workInProgress, null);
+ reuseHiddenContextOnStack();
+ pushOffscreenSuspenseHandler(workInProgress);
+ null !== current &&
+ propagateParentContextChanges(current, workInProgress, renderLanes, !0);
+ return null;
}
-function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
- return createFiberFromOffscreen(offscreenProps, mode, 0, null);
+function markRef(current, workInProgress) {
+ var ref = workInProgress.ref;
+ if (null === ref)
+ null !== current &&
+ null !== current.ref &&
+ (workInProgress.flags |= 2097664);
+ else {
+ if ("function" !== typeof ref && "object" !== typeof ref)
+ throw Error(formatProdErrorMessage(284));
+ if (null === current || current.ref !== ref)
+ workInProgress.flags |= 2097664;
+ }
}
-function retrySuspenseComponentWithoutHydrating(
+function updateFunctionComponent(
current,
workInProgress,
+ Component,
+ nextProps,
renderLanes
) {
- reconcileChildFibers(workInProgress, current.child, null, renderLanes);
- current = mountSuspensePrimaryChildren(
+ prepareToReadContext(workInProgress);
+ Component = renderWithHooks(
+ current,
workInProgress,
- workInProgress.pendingProps.children
+ Component,
+ nextProps,
+ void 0,
+ renderLanes
);
- current.flags |= 2;
- workInProgress.memoizedState = null;
- return current;
-}
-function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
- fiber.lanes |= renderLanes;
- var alternate = fiber.alternate;
- null !== alternate && (alternate.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
+ nextProps = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && nextProps && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, Component, renderLanes);
+ return workInProgress.child;
}
-function initSuspenseListRenderState(
+function replayFunctionComponent(
+ current,
workInProgress,
- isBackwards,
- tail,
- lastContentRow,
- tailMode
+ nextProps,
+ Component,
+ secondArg,
+ renderLanes
) {
- var renderState = workInProgress.memoizedState;
- null === renderState
- ? (workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- renderingStartTime: 0,
- last: lastContentRow,
- tail: tail,
- tailMode: tailMode
- })
- : ((renderState.isBackwards = isBackwards),
- (renderState.rendering = null),
- (renderState.renderingStartTime = 0),
- (renderState.last = lastContentRow),
- (renderState.tail = tail),
- (renderState.tailMode = tailMode));
-}
-function updateSuspenseListComponent(current, workInProgress, renderLanes) {
- var nextProps = workInProgress.pendingProps,
- revealOrder = nextProps.revealOrder,
- tailMode = nextProps.tail;
- reconcileChildren(current, workInProgress, nextProps.children, renderLanes);
- nextProps = suspenseStackCursor.current;
- if (0 !== (nextProps & 2))
- (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128);
- else {
- if (null !== current && 0 !== (current.flags & 128))
- a: for (current = workInProgress.child; null !== current; ) {
- if (13 === current.tag)
- null !== current.memoizedState &&
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (19 === current.tag)
- scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
- else if (null !== current.child) {
- current.child.return = current;
- current = current.child;
- continue;
- }
- if (current === workInProgress) break a;
- for (; null === current.sibling; ) {
- if (null === current.return || current.return === workInProgress)
- break a;
- current = current.return;
- }
- current.sibling.return = current.return;
- current = current.sibling;
- }
- nextProps &= 1;
- }
- push(suspenseStackCursor, nextProps);
- switch (revealOrder) {
- case "forwards":
- renderLanes = workInProgress.child;
- for (revealOrder = null; null !== renderLanes; )
- (current = renderLanes.alternate),
- null !== current &&
- null === findFirstSuspended(current) &&
- (revealOrder = renderLanes),
- (renderLanes = renderLanes.sibling);
- renderLanes = revealOrder;
- null === renderLanes
- ? ((revealOrder = workInProgress.child), (workInProgress.child = null))
- : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null));
- initSuspenseListRenderState(
- workInProgress,
- !1,
- revealOrder,
- renderLanes,
- tailMode
- );
- break;
- case "backwards":
- renderLanes = null;
- revealOrder = workInProgress.child;
- for (workInProgress.child = null; null !== revealOrder; ) {
- current = revealOrder.alternate;
- if (null !== current && null === findFirstSuspended(current)) {
- workInProgress.child = revealOrder;
- break;
- }
- current = revealOrder.sibling;
- revealOrder.sibling = renderLanes;
- renderLanes = revealOrder;
- revealOrder = current;
- }
- initSuspenseListRenderState(
- workInProgress,
- !0,
- renderLanes,
- null,
- tailMode
- );
- break;
- case "together":
- initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
- break;
- default:
- workInProgress.memoizedState = null;
- }
- return workInProgress.child;
-}
-function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
- null !== current && (workInProgress.dependencies = current.dependencies);
- profilerStartTime = -1;
- workInProgressRootSkippedLanes |= workInProgress.lanes;
- if (0 === (renderLanes & workInProgress.childLanes))
- if (null !== current) {
- if (
- (propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- !1
- ),
- 0 === (renderLanes & workInProgress.childLanes))
- )
- return null;
- } else return null;
- if (null !== current && workInProgress.child !== current.child)
- throw Error(formatProdErrorMessage(153));
- if (null !== workInProgress.child) {
- current = workInProgress.child;
- renderLanes = createWorkInProgress(current, current.pendingProps);
- workInProgress.child = renderLanes;
- for (renderLanes.return = workInProgress; null !== current.sibling; )
- (current = current.sibling),
- (renderLanes = renderLanes.sibling =
- createWorkInProgress(current, current.pendingProps)),
- (renderLanes.return = workInProgress);
- renderLanes.sibling = null;
- }
+ prepareToReadContext(workInProgress);
+ workInProgress.updateQueue = null;
+ nextProps = renderWithHooksAgain(
+ workInProgress,
+ Component,
+ nextProps,
+ secondArg
+ );
+ finishRenderingHooks(current);
+ Component = checkDidRenderIdHook();
+ if (null !== current && !didReceiveUpdate)
+ return (
+ bailoutHooks(current, workInProgress, renderLanes),
+ bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)
+ );
+ isHydrating && Component && pushMaterializedTreeId(workInProgress);
+ workInProgress.flags |= 1;
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
return workInProgress.child;
}
-function checkScheduledUpdateOrContext(current, renderLanes) {
- if (0 !== (current.lanes & renderLanes)) return !0;
- current = current.dependencies;
- return null !== current && checkIfContextChanged(current) ? !0 : !1;
-}
-function attemptEarlyBailoutIfNoScheduledUpdate(
+function updateClassComponent(
current,
workInProgress,
+ Component,
+ nextProps,
renderLanes
) {
- switch (workInProgress.tag) {
- case 3:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
- resetHydrationState();
- break;
- case 27:
- case 5:
- pushHostContext(workInProgress);
- break;
- case 4:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- break;
- case 10:
- pushProvider(
+ prepareToReadContext(workInProgress);
+ if (null === workInProgress.stateNode) {
+ var context = emptyContextObject,
+ contextType = Component.contextType;
+ "object" === typeof contextType &&
+ null !== contextType &&
+ (context = readContext(contextType));
+ context = new Component(nextProps, context);
+ workInProgress.memoizedState =
+ null !== context.state && void 0 !== context.state ? context.state : null;
+ context.updater = classComponentUpdater;
+ workInProgress.stateNode = context;
+ context._reactInternals = workInProgress;
+ context = workInProgress.stateNode;
+ context.props = nextProps;
+ context.state = workInProgress.memoizedState;
+ context.refs = {};
+ initializeUpdateQueue(workInProgress);
+ contextType = Component.contextType;
+ context.context =
+ "object" === typeof contextType && null !== contextType
+ ? readContext(contextType)
+ : emptyContextObject;
+ context.state = workInProgress.memoizedState;
+ contextType = Component.getDerivedStateFromProps;
+ "function" === typeof contextType &&
+ (applyDerivedStateFromProps(
workInProgress,
- workInProgress.type,
- workInProgress.memoizedProps.value
- );
- break;
- case 12:
- 0 !== (renderLanes & workInProgress.childLanes) &&
- (workInProgress.flags |= 4);
- workInProgress.flags |= 2048;
- var stateNode = workInProgress.stateNode;
- stateNode.effectDuration = -0;
- stateNode.passiveEffectDuration = -0;
- break;
- case 13:
- stateNode = workInProgress.memoizedState;
- if (null !== stateNode) {
- if (null !== stateNode.dehydrated)
- return (
- pushPrimaryTreeSuspenseHandler(workInProgress),
- (workInProgress.flags |= 128),
- null
- );
- if (0 !== (renderLanes & workInProgress.child.childLanes))
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- pushPrimaryTreeSuspenseHandler(workInProgress);
- current = bailoutOnAlreadyFinishedWork(
- current,
+ Component,
+ contextType,
+ nextProps
+ ),
+ (context.state = workInProgress.memoizedState));
+ "function" === typeof Component.getDerivedStateFromProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate ||
+ ("function" !== typeof context.UNSAFE_componentWillMount &&
+ "function" !== typeof context.componentWillMount) ||
+ ((contextType = context.state),
+ "function" === typeof context.componentWillMount &&
+ context.componentWillMount(),
+ "function" === typeof context.UNSAFE_componentWillMount &&
+ context.UNSAFE_componentWillMount(),
+ contextType !== context.state &&
+ classComponentUpdater.enqueueReplaceState(context, context.state, null),
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction(),
+ (context.state = workInProgress.memoizedState));
+ "function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308);
+ nextProps = !0;
+ } else if (null === current) {
+ context = workInProgress.stateNode;
+ var unresolvedOldProps = workInProgress.memoizedProps,
+ oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
+ context.props = oldProps;
+ var oldContext = context.context,
+ contextType$jscomp$0 = Component.contextType;
+ contextType = emptyContextObject;
+ "object" === typeof contextType$jscomp$0 &&
+ null !== contextType$jscomp$0 &&
+ (contextType = readContext(contextType$jscomp$0));
+ var getDerivedStateFromProps = Component.getDerivedStateFromProps;
+ contextType$jscomp$0 =
+ "function" === typeof getDerivedStateFromProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate;
+ unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;
+ contextType$jscomp$0 ||
+ ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof context.componentWillReceiveProps) ||
+ ((unresolvedOldProps || oldContext !== contextType) &&
+ callComponentWillReceiveProps(
workInProgress,
- renderLanes
- );
- return null !== current ? current.sibling : null;
- }
- pushPrimaryTreeSuspenseHandler(workInProgress);
- break;
- case 19:
- var didSuspendBefore = 0 !== (current.flags & 128);
- stateNode = 0 !== (renderLanes & workInProgress.childLanes);
- stateNode ||
- (propagateParentContextChanges(
- current,
+ context,
+ nextProps,
+ contextType
+ ));
+ hasForceUpdate = !1;
+ var oldState = workInProgress.memoizedState;
+ context.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ oldContext = workInProgress.memoizedState;
+ unresolvedOldProps || oldState !== oldContext || hasForceUpdate
+ ? ("function" === typeof getDerivedStateFromProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ getDerivedStateFromProps,
+ nextProps
+ ),
+ (oldContext = workInProgress.memoizedState)),
+ (oldProps =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ oldProps,
+ nextProps,
+ oldState,
+ oldContext,
+ contextType
+ ))
+ ? (contextType$jscomp$0 ||
+ ("function" !== typeof context.UNSAFE_componentWillMount &&
+ "function" !== typeof context.componentWillMount) ||
+ ("function" === typeof context.componentWillMount &&
+ context.componentWillMount(),
+ "function" === typeof context.UNSAFE_componentWillMount &&
+ context.UNSAFE_componentWillMount()),
+ "function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308))
+ : ("function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = oldContext)),
+ (context.props = nextProps),
+ (context.state = oldContext),
+ (context.context = contextType),
+ (nextProps = oldProps))
+ : ("function" === typeof context.componentDidMount &&
+ (workInProgress.flags |= 4194308),
+ (nextProps = !1));
+ } else {
+ context = workInProgress.stateNode;
+ cloneUpdateQueue(current, workInProgress);
+ contextType = workInProgress.memoizedProps;
+ contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
+ context.props = contextType$jscomp$0;
+ getDerivedStateFromProps = workInProgress.pendingProps;
+ oldState = context.context;
+ oldContext = Component.contextType;
+ oldProps = emptyContextObject;
+ "object" === typeof oldContext &&
+ null !== oldContext &&
+ (oldProps = readContext(oldContext));
+ unresolvedOldProps = Component.getDerivedStateFromProps;
+ (oldContext =
+ "function" === typeof unresolvedOldProps ||
+ "function" === typeof context.getSnapshotBeforeUpdate) ||
+ ("function" !== typeof context.UNSAFE_componentWillReceiveProps &&
+ "function" !== typeof context.componentWillReceiveProps) ||
+ ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&
+ callComponentWillReceiveProps(
workInProgress,
- renderLanes,
- !1
- ),
- (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
- if (didSuspendBefore) {
- if (stateNode)
- return updateSuspenseListComponent(
- current,
+ context,
+ nextProps,
+ oldProps
+ ));
+ hasForceUpdate = !1;
+ oldState = workInProgress.memoizedState;
+ context.state = oldState;
+ processUpdateQueue(workInProgress, nextProps, context, renderLanes);
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ var newState = workInProgress.memoizedState;
+ contextType !== getDerivedStateFromProps ||
+ oldState !== newState ||
+ hasForceUpdate ||
+ (null !== current &&
+ null !== current.dependencies &&
+ checkIfContextChanged(current.dependencies))
+ ? ("function" === typeof unresolvedOldProps &&
+ (applyDerivedStateFromProps(
+ workInProgress,
+ Component,
+ unresolvedOldProps,
+ nextProps
+ ),
+ (newState = workInProgress.memoizedState)),
+ (contextType$jscomp$0 =
+ hasForceUpdate ||
+ checkShouldComponentUpdate(
+ workInProgress,
+ Component,
+ contextType$jscomp$0,
+ nextProps,
+ oldState,
+ newState,
+ oldProps
+ ) ||
+ (null !== current &&
+ null !== current.dependencies &&
+ checkIfContextChanged(current.dependencies)))
+ ? (oldContext ||
+ ("function" !== typeof context.UNSAFE_componentWillUpdate &&
+ "function" !== typeof context.componentWillUpdate) ||
+ ("function" === typeof context.componentWillUpdate &&
+ context.componentWillUpdate(nextProps, newState, oldProps),
+ "function" === typeof context.UNSAFE_componentWillUpdate &&
+ context.UNSAFE_componentWillUpdate(
+ nextProps,
+ newState,
+ oldProps
+ )),
+ "function" === typeof context.componentDidUpdate &&
+ (workInProgress.flags |= 4),
+ "function" === typeof context.getSnapshotBeforeUpdate &&
+ (workInProgress.flags |= 1024))
+ : ("function" !== typeof context.componentDidUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof context.getSnapshotBeforeUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (workInProgress.memoizedProps = nextProps),
+ (workInProgress.memoizedState = newState)),
+ (context.props = nextProps),
+ (context.state = newState),
+ (context.context = oldProps),
+ (nextProps = contextType$jscomp$0))
+ : ("function" !== typeof context.componentDidUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 4),
+ "function" !== typeof context.getSnapshotBeforeUpdate ||
+ (contextType === current.memoizedProps &&
+ oldState === current.memoizedState) ||
+ (workInProgress.flags |= 1024),
+ (nextProps = !1));
+ }
+ context = nextProps;
+ markRef(current, workInProgress);
+ nextProps = 0 !== (workInProgress.flags & 128);
+ context || nextProps
+ ? ((context = workInProgress.stateNode),
+ nextProps && "function" !== typeof Component.getDerivedStateFromError
+ ? ((Component = null), (profilerStartTime = -1))
+ : (Component = context.render()),
+ (workInProgress.flags |= 1),
+ null !== current && nextProps
+ ? ((workInProgress.child = reconcileChildFibers(
workInProgress,
+ current.child,
+ null,
renderLanes
- );
- workInProgress.flags |= 128;
- }
- didSuspendBefore = workInProgress.memoizedState;
- null !== didSuspendBefore &&
- ((didSuspendBefore.rendering = null),
- (didSuspendBefore.tail = null),
- (didSuspendBefore.lastEffect = null));
- push(suspenseStackCursor, suspenseStackCursor.current);
- if (stateNode) break;
- else return null;
- case 22:
- case 23:
- return (
- (workInProgress.lanes = 0),
- updateOffscreenComponent(current, workInProgress, renderLanes)
- );
- case 24:
- pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
-}
-function beginWork(current, workInProgress, renderLanes) {
- if (null !== current)
- if (current.memoizedProps !== workInProgress.pendingProps)
- didReceiveUpdate = !0;
- else {
- if (
- !checkScheduledUpdateOrContext(current, renderLanes) &&
- 0 === (workInProgress.flags & 128)
- )
- return (
- (didReceiveUpdate = !1),
- attemptEarlyBailoutIfNoScheduledUpdate(
- current,
+ )),
+ (workInProgress.child = reconcileChildFibers(
workInProgress,
+ null,
+ Component,
renderLanes
- )
- );
- didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
- }
- else
- (didReceiveUpdate = !1),
- isHydrating &&
- 0 !== (workInProgress.flags & 1048576) &&
- pushTreeId(workInProgress, treeForkCount, workInProgress.index);
- workInProgress.lanes = 0;
- switch (workInProgress.tag) {
- case 16:
- a: {
- current = workInProgress.pendingProps;
- var lazyComponent = workInProgress.elementType,
- init = lazyComponent._init;
- lazyComponent = init(lazyComponent._payload);
- workInProgress.type = lazyComponent;
- if ("function" === typeof lazyComponent)
- shouldConstruct(lazyComponent)
- ? ((current = resolveClassComponentProps(lazyComponent, current)),
- (workInProgress.tag = 1),
- (workInProgress = updateClassComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- )))
- : ((workInProgress.tag = 0),
- (workInProgress = updateFunctionComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- )));
- else {
- if (void 0 !== lazyComponent && null !== lazyComponent)
- if (
- ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE)
- ) {
- workInProgress.tag = 11;
- workInProgress = updateForwardRef(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- );
- break a;
- } else if (init === REACT_MEMO_TYPE) {
- workInProgress.tag = 14;
- workInProgress = updateMemoComponent(
- null,
- workInProgress,
- lazyComponent,
- current,
- renderLanes
- );
- break a;
- }
- workInProgress =
- getComponentNameFromType(lazyComponent) || lazyComponent;
- throw Error(formatProdErrorMessage(306, workInProgress, ""));
- }
- }
- return workInProgress;
- case 0:
- return updateFunctionComponent(
+ )))
+ : reconcileChildren(current, workInProgress, Component, renderLanes),
+ (workInProgress.memoizedState = context.state),
+ (current = workInProgress.child))
+ : (current = bailoutOnAlreadyFinishedWork(
current,
workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
renderLanes
- );
- case 1:
- return (
- (lazyComponent = workInProgress.type),
- (init = resolveClassComponentProps(
- lazyComponent,
- workInProgress.pendingProps
- )),
- updateClassComponent(
- current,
- workInProgress,
- lazyComponent,
- init,
- renderLanes
- )
- );
- case 3:
- a: {
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- );
- if (null === current) throw Error(formatProdErrorMessage(387));
- var nextProps = workInProgress.pendingProps;
- init = workInProgress.memoizedState;
- lazyComponent = init.element;
- cloneUpdateQueue(current, workInProgress);
- processUpdateQueue(workInProgress, nextProps, null, renderLanes);
- var nextState = workInProgress.memoizedState;
- nextProps = nextState.cache;
- pushProvider(workInProgress, CacheContext, nextProps);
- nextProps !== init.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- );
- suspendIfUpdateReadFromEntangledAsyncAction();
- nextProps = nextState.element;
- if (init.isDehydrated)
- if (
- ((init = {
- element: nextProps,
- isDehydrated: !1,
- cache: nextState.cache
- }),
- (workInProgress.updateQueue.baseState = init),
- (workInProgress.memoizedState = init),
- workInProgress.flags & 256)
- ) {
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else if (nextProps !== lazyComponent) {
- lazyComponent = createCapturedValueAtFiber(
- Error(formatProdErrorMessage(424)),
- workInProgress
- );
- queueHydrationError(lazyComponent);
- workInProgress = mountHostRootWithoutHydrating(
- current,
- workInProgress,
- nextProps,
- renderLanes
- );
- break a;
- } else
- for (
- nextHydratableInstance = getNextHydratable(
- workInProgress.stateNode.containerInfo.firstChild
- ),
- hydrationParentFiber = workInProgress,
- isHydrating = !0,
- hydrationErrors = null,
- rootOrSingletonContext = !0,
- renderLanes = mountChildFibers(
- workInProgress,
- null,
- nextProps,
- renderLanes
- ),
- workInProgress.child = renderLanes;
- renderLanes;
+ ));
+ return current;
+}
+function mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextChildren,
+ renderLanes
+) {
+ resetHydrationState();
+ workInProgress.flags |= 256;
+ reconcileChildren(current, workInProgress, nextChildren, renderLanes);
+ return workInProgress.child;
+}
+var SUSPENDED_MARKER = {
+ dehydrated: null,
+ treeContext: null,
+ retryLane: 0,
+ hydrationErrors: null
+};
+function mountSuspenseOffscreenState(renderLanes) {
+ return { baseLanes: renderLanes, cachePool: getSuspendedCache() };
+}
+function getRemainingWorkInPrimaryTree(
+ current,
+ primaryTreeDidDefer,
+ renderLanes
+) {
+ current = null !== current ? current.childLanes & ~renderLanes : 0;
+ primaryTreeDidDefer && (current |= workInProgressDeferredLane);
+ return current;
+}
+function updateSuspenseComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ showFallback = !1,
+ didSuspend = 0 !== (workInProgress.flags & 128),
+ JSCompiler_temp;
+ (JSCompiler_temp = didSuspend) ||
+ (JSCompiler_temp =
+ null !== current && null === current.memoizedState
+ ? !1
+ : 0 !== (suspenseStackCursor.current & 2));
+ JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));
+ JSCompiler_temp = 0 !== (workInProgress.flags & 32);
+ workInProgress.flags &= -33;
+ if (null === current) {
+ if (isHydrating) {
+ showFallback
+ ? pushPrimaryTreeSuspenseHandler(workInProgress)
+ : reuseSuspenseHandlerOnStack(workInProgress);
+ if (isHydrating) {
+ var nextInstance = nextHydratableInstance,
+ JSCompiler_temp$jscomp$0;
+ if ((JSCompiler_temp$jscomp$0 = nextInstance)) {
+ c: {
+ JSCompiler_temp$jscomp$0 = nextInstance;
+ for (
+ nextInstance = rootOrSingletonContext;
+ 8 !== JSCompiler_temp$jscomp$0.nodeType;
- )
- (renderLanes.flags = (renderLanes.flags & -3) | 4096),
- (renderLanes = renderLanes.sibling);
- else {
- resetHydrationState();
- if (nextProps === lazyComponent) {
- workInProgress = bailoutOnAlreadyFinishedWork(
- current,
- workInProgress,
- renderLanes
- );
- break a;
+ ) {
+ if (!nextInstance) {
+ nextInstance = null;
+ break c;
+ }
+ JSCompiler_temp$jscomp$0 = getNextHydratable(
+ JSCompiler_temp$jscomp$0.nextSibling
+ );
+ if (null === JSCompiler_temp$jscomp$0) {
+ nextInstance = null;
+ break c;
+ }
+ }
+ nextInstance = JSCompiler_temp$jscomp$0;
}
- reconcileChildren(current, workInProgress, nextProps, renderLanes);
+ null !== nextInstance
+ ? ((workInProgress.memoizedState = {
+ dehydrated: nextInstance,
+ treeContext:
+ null !== treeContextProvider
+ ? { id: treeContextId, overflow: treeContextOverflow }
+ : null,
+ retryLane: 536870912,
+ hydrationErrors: null
+ }),
+ (JSCompiler_temp$jscomp$0 = createFiberImplClass(
+ 18,
+ null,
+ null,
+ 0
+ )),
+ (JSCompiler_temp$jscomp$0.stateNode = nextInstance),
+ (JSCompiler_temp$jscomp$0.return = workInProgress),
+ (workInProgress.child = JSCompiler_temp$jscomp$0),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (JSCompiler_temp$jscomp$0 = !0))
+ : (JSCompiler_temp$jscomp$0 = !1);
}
- workInProgress = workInProgress.child;
+ JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress);
}
- return workInProgress;
- case 26:
- return (
- markRef(current, workInProgress),
- null === current
- ? (renderLanes = getResource(
- workInProgress.type,
- null,
- workInProgress.pendingProps,
- null
- ))
- ? (workInProgress.memoizedState = renderLanes)
- : isHydrating ||
- ((renderLanes = workInProgress.type),
- (current = workInProgress.pendingProps),
- (lazyComponent = getOwnerDocumentFromRootContainer(
- rootInstanceStackCursor.current
- ).createElement(renderLanes)),
- (lazyComponent[internalInstanceKey] = workInProgress),
- (lazyComponent[internalPropsKey] = current),
- setInitialProperties(lazyComponent, renderLanes, current),
- markNodeAsHoistable(lazyComponent),
- (workInProgress.stateNode = lazyComponent))
- : (workInProgress.memoizedState = getResource(
- workInProgress.type,
- current.memoizedProps,
- workInProgress.pendingProps,
- current.memoizedState
- )),
- null
- );
- case 27:
+ nextInstance = workInProgress.memoizedState;
+ if (
+ null !== nextInstance &&
+ ((nextInstance = nextInstance.dehydrated), null !== nextInstance)
+ )
+ return (
+ isSuspenseInstanceFallback(nextInstance)
+ ? (workInProgress.lanes = 32)
+ : (workInProgress.lanes = 536870912),
+ null
+ );
+ popSuspenseHandler(workInProgress);
+ }
+ nextInstance = nextProps.children;
+ JSCompiler_temp$jscomp$0 = nextProps.fallback;
+ if (showFallback)
return (
- pushHostContext(workInProgress),
- null === current &&
- isHydrating &&
- ((lazyComponent = workInProgress.stateNode =
- resolveSingletonInstance(
- workInProgress.type,
- workInProgress.pendingProps,
- rootInstanceStackCursor.current
- )),
- (hydrationParentFiber = workInProgress),
- (rootOrSingletonContext = !0),
- (nextHydratableInstance = getNextHydratable(
- lazyComponent.firstChild
- ))),
- (lazyComponent = workInProgress.pendingProps.children),
- null !== current || isHydrating
- ? reconcileChildren(
- current,
- workInProgress,
- lazyComponent,
- renderLanes
- )
- : (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- lazyComponent,
- renderLanes
- )),
- markRef(current, workInProgress),
- workInProgress.child
- );
- case 5:
- if (null === current && isHydrating) {
- if ((init = lazyComponent = nextHydratableInstance))
- (lazyComponent = canHydrateInstance(
- lazyComponent,
- workInProgress.type,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== lazyComponent
- ? ((workInProgress.stateNode = lazyComponent),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = getNextHydratable(
- lazyComponent.firstChild
- )),
- (rootOrSingletonContext = !1),
- (init = !0))
- : (init = !1);
- init || throwOnHydrationMismatch(workInProgress);
- }
- pushHostContext(workInProgress);
- init = workInProgress.type;
- nextProps = workInProgress.pendingProps;
- nextState = null !== current ? current.memoizedProps : null;
- lazyComponent = nextProps.children;
- shouldSetTextContent(init, nextProps)
- ? (lazyComponent = null)
- : null !== nextState &&
- shouldSetTextContent(init, nextState) &&
- (workInProgress.flags |= 32);
- null !== workInProgress.memoizedState &&
- ((init = renderWithHooks(
- current,
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (nextProps = mountSuspenseFallbackChildren(
workInProgress,
- TransitionAwareHostComponent,
- null,
- null,
+ nextInstance,
+ JSCompiler_temp$jscomp$0,
renderLanes
)),
- (HostTransitionContext._currentValue = init));
- markRef(current, workInProgress);
- reconcileChildren(current, workInProgress, lazyComponent, renderLanes);
- return workInProgress.child;
- case 6:
- if (null === current && isHydrating) {
- if ((current = renderLanes = nextHydratableInstance))
- (renderLanes = canHydrateTextInstance(
- renderLanes,
- workInProgress.pendingProps,
- rootOrSingletonContext
- )),
- null !== renderLanes
- ? ((workInProgress.stateNode = renderLanes),
- (hydrationParentFiber = workInProgress),
- (nextHydratableInstance = null),
- (current = !0))
- : (current = !1);
- current || throwOnHydrationMismatch(workInProgress);
- }
- return null;
- case 13:
- return updateSuspenseComponent(current, workInProgress, renderLanes);
- case 4:
- return (
- pushHostContainer(
- workInProgress,
- workInProgress.stateNode.containerInfo
- ),
- (lazyComponent = workInProgress.pendingProps),
- null === current
- ? (workInProgress.child = reconcileChildFibers(
- workInProgress,
- null,
- lazyComponent,
- renderLanes
- ))
- : reconcileChildren(
- current,
- workInProgress,
- lazyComponent,
- renderLanes
- ),
- workInProgress.child
- );
- case 11:
- return updateForwardRef(
- current,
- workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
- renderLanes
- );
- case 7:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps,
- renderLanes
- ),
- workInProgress.child
- );
- case 8:
- return (
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 12:
- return (
- (workInProgress.flags |= 4),
- (workInProgress.flags |= 2048),
- (lazyComponent = workInProgress.stateNode),
- (lazyComponent.effectDuration = -0),
- (lazyComponent.passiveEffectDuration = -0),
- reconcileChildren(
+ (showFallback = workInProgress.child),
+ (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
current,
- workInProgress,
- workInProgress.pendingProps.children,
+ JSCompiler_temp,
renderLanes
- ),
- workInProgress.child
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ nextProps
);
- case 10:
+ if ("number" === typeof nextProps.unstable_expectedLoadTime)
return (
- (lazyComponent = workInProgress.pendingProps),
- pushProvider(workInProgress, workInProgress.type, lazyComponent.value),
- reconcileChildren(
- current,
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (nextProps = mountSuspenseFallbackChildren(
workInProgress,
- lazyComponent.children,
+ nextInstance,
+ JSCompiler_temp$jscomp$0,
renderLanes
- ),
- workInProgress.child
- );
- case 9:
- return (
- (init = workInProgress.type._context),
- (lazyComponent = workInProgress.pendingProps.children),
- prepareToReadContext(workInProgress),
- (init = readContext(init)),
- (lazyComponent = lazyComponent(init)),
- (workInProgress.flags |= 1),
- reconcileChildren(current, workInProgress, lazyComponent, renderLanes),
- workInProgress.child
+ )),
+ (showFallback = workInProgress.child),
+ (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress.lanes = 4194304),
+ nextProps
);
- case 14:
- return updateMemoComponent(
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ return mountSuspensePrimaryChildren(workInProgress, nextInstance);
+ }
+ JSCompiler_temp$jscomp$0 = current.memoizedState;
+ if (
+ null !== JSCompiler_temp$jscomp$0 &&
+ ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated),
+ null !== nextInstance)
+ ) {
+ if (didSuspend)
+ workInProgress.flags & 256
+ ? (pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags &= -257),
+ (workInProgress = retrySuspenseComponentWithoutHydrating(
+ current,
+ workInProgress,
+ renderLanes
+ )))
+ : null !== workInProgress.memoizedState
+ ? (reuseSuspenseHandlerOnStack(workInProgress),
+ (workInProgress.child = current.child),
+ (workInProgress.flags |= 128),
+ (workInProgress = null))
+ : (reuseSuspenseHandlerOnStack(workInProgress),
+ (showFallback = nextProps.fallback),
+ (nextInstance = workInProgress.mode),
+ (nextProps = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: nextProps.children },
+ nextInstance
+ )),
+ (showFallback = createFiberFromFragment(
+ showFallback,
+ nextInstance,
+ renderLanes,
+ null
+ )),
+ (showFallback.flags |= 2),
+ (nextProps.return = workInProgress),
+ (showFallback.return = workInProgress),
+ (nextProps.sibling = showFallback),
+ (workInProgress.child = nextProps),
+ reconcileChildFibers(
+ workInProgress,
+ current.child,
+ null,
+ renderLanes
+ ),
+ (nextProps = workInProgress.child),
+ (nextProps.memoizedState =
+ mountSuspenseOffscreenState(renderLanes)),
+ (nextProps.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ (workInProgress = showFallback));
+ else if (
+ (pushPrimaryTreeSuspenseHandler(workInProgress),
+ isSuspenseInstanceFallback(nextInstance))
+ ) {
+ JSCompiler_temp =
+ nextInstance.nextSibling && nextInstance.nextSibling.dataset;
+ if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
+ JSCompiler_temp = digest;
+ "POSTPONE" !== JSCompiler_temp &&
+ ((nextProps = Error(formatProdErrorMessage(419))),
+ (nextProps.stack = ""),
+ (nextProps.digest = JSCompiler_temp),
+ queueHydrationError({ value: nextProps, source: null, stack: null }));
+ workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
renderLanes
);
- case 15:
- return updateSimpleMemoComponent(
+ } else if (
+ (didReceiveUpdate ||
+ propagateParentContextChanges(current, workInProgress, renderLanes, !1),
+ (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),
+ didReceiveUpdate || JSCompiler_temp)
+ ) {
+ JSCompiler_temp = workInProgressRoot;
+ if (
+ null !== JSCompiler_temp &&
+ ((nextProps = renderLanes & -renderLanes),
+ (nextProps =
+ 0 !== (nextProps & 42)
+ ? 1
+ : getBumpedLaneForHydrationByLane(nextProps)),
+ (nextProps =
+ 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes))
+ ? 0
+ : nextProps),
+ 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane)
+ )
+ throw (
+ ((JSCompiler_temp$jscomp$0.retryLane = nextProps),
+ enqueueConcurrentRenderForLane(current, nextProps),
+ scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),
+ SelectiveHydrationException)
+ );
+ "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
+ workInProgress = retrySuspenseComponentWithoutHydrating(
current,
workInProgress,
- workInProgress.type,
- workInProgress.pendingProps,
renderLanes
);
- case 19:
- return updateSuspenseListComponent(current, workInProgress, renderLanes);
- case 22:
- return updateOffscreenComponent(current, workInProgress, renderLanes);
- case 24:
- return (
- prepareToReadContext(workInProgress),
- (lazyComponent = readContext(CacheContext)),
- null === current
- ? ((init = peekCacheFromPool()),
- null === init &&
- ((init = workInProgressRoot),
- (nextProps = createCache()),
- (init.pooledCache = nextProps),
- nextProps.refCount++,
- null !== nextProps && (init.pooledCacheLanes |= renderLanes),
- (init = nextProps)),
- (workInProgress.memoizedState = {
- parent: lazyComponent,
- cache: init
- }),
- initializeUpdateQueue(workInProgress),
- pushProvider(workInProgress, CacheContext, init))
- : (0 !== (current.lanes & renderLanes) &&
- (cloneUpdateQueue(current, workInProgress),
- processUpdateQueue(workInProgress, null, null, renderLanes),
- suspendIfUpdateReadFromEntangledAsyncAction()),
- (init = current.memoizedState),
- (nextProps = workInProgress.memoizedState),
- init.parent !== lazyComponent
- ? ((init = { parent: lazyComponent, cache: lazyComponent }),
- (workInProgress.memoizedState = init),
- 0 === workInProgress.lanes &&
- (workInProgress.memoizedState =
- workInProgress.updateQueue.baseState =
- init),
- pushProvider(workInProgress, CacheContext, lazyComponent))
- : ((lazyComponent = nextProps.cache),
- pushProvider(workInProgress, CacheContext, lazyComponent),
- lazyComponent !== init.cache &&
- propagateContextChanges(
- workInProgress,
- [CacheContext],
- renderLanes,
- !0
- ))),
- reconcileChildren(
- current,
- workInProgress,
- workInProgress.pendingProps.children,
- renderLanes
- ),
- workInProgress.child
- );
- case 29:
- throw workInProgress.pendingProps;
+ } else
+ "$?" === nextInstance.data
+ ? ((workInProgress.flags |= 192),
+ (workInProgress.child = current.child),
+ (workInProgress = null))
+ : ((current = JSCompiler_temp$jscomp$0.treeContext),
+ (nextHydratableInstance = getNextHydratable(
+ nextInstance.nextSibling
+ )),
+ (hydrationParentFiber = workInProgress),
+ (isHydrating = !0),
+ (hydrationErrors = null),
+ (rootOrSingletonContext = !1),
+ null !== current &&
+ ((idStack[idStackIndex++] = treeContextId),
+ (idStack[idStackIndex++] = treeContextOverflow),
+ (idStack[idStackIndex++] = treeContextProvider),
+ (treeContextId = current.id),
+ (treeContextOverflow = current.overflow),
+ (treeContextProvider = workInProgress)),
+ (workInProgress = mountSuspensePrimaryChildren(
+ workInProgress,
+ nextProps.children
+ )),
+ (workInProgress.flags |= 4096));
+ return workInProgress;
}
- throw Error(formatProdErrorMessage(156, workInProgress.tag));
+ if (showFallback)
+ return (
+ reuseSuspenseHandlerOnStack(workInProgress),
+ (showFallback = nextProps.fallback),
+ (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),
+ null !== digest
+ ? (showFallback = createWorkInProgress(digest, showFallback))
+ : ((showFallback = createFiberFromFragment(
+ showFallback,
+ nextInstance,
+ renderLanes,
+ null
+ )),
+ (showFallback.flags |= 2)),
+ (showFallback.return = workInProgress),
+ (nextProps.return = workInProgress),
+ (nextProps.sibling = showFallback),
+ (workInProgress.child = nextProps),
+ (nextProps = showFallback),
+ (showFallback = workInProgress.child),
+ (nextInstance = current.child.memoizedState),
+ null === nextInstance
+ ? (nextInstance = mountSuspenseOffscreenState(renderLanes))
+ : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool),
+ null !== JSCompiler_temp$jscomp$0
+ ? ((digest = CacheContext._currentValue),
+ (JSCompiler_temp$jscomp$0 =
+ JSCompiler_temp$jscomp$0.parent !== digest
+ ? { parent: digest, pool: digest }
+ : JSCompiler_temp$jscomp$0))
+ : (JSCompiler_temp$jscomp$0 = getSuspendedCache()),
+ (nextInstance = {
+ baseLanes: nextInstance.baseLanes | renderLanes,
+ cachePool: JSCompiler_temp$jscomp$0
+ })),
+ (showFallback.memoizedState = nextInstance),
+ (showFallback.childLanes = getRemainingWorkInPrimaryTree(
+ current,
+ JSCompiler_temp,
+ renderLanes
+ )),
+ (workInProgress.memoizedState = SUSPENDED_MARKER),
+ nextProps
+ );
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ renderLanes = current.child;
+ current = renderLanes.sibling;
+ renderLanes = createWorkInProgress(renderLanes, {
+ mode: "visible",
+ children: nextProps.children
+ });
+ renderLanes.return = workInProgress;
+ renderLanes.sibling = null;
+ null !== current &&
+ ((JSCompiler_temp = workInProgress.deletions),
+ null === JSCompiler_temp
+ ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))
+ : JSCompiler_temp.push(current));
+ workInProgress.child = renderLanes;
+ workInProgress.memoizedState = null;
+ return renderLanes;
}
-var valueCursor = createCursor(null),
- currentlyRenderingFiber = null,
- lastContextDependency = null;
-function pushProvider(providerFiber, context, nextValue) {
- push(valueCursor, context._currentValue);
- context._currentValue = nextValue;
+function mountSuspensePrimaryChildren(workInProgress, primaryChildren) {
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "visible", children: primaryChildren },
+ workInProgress.mode
+ );
+ primaryChildren.return = workInProgress;
+ return (workInProgress.child = primaryChildren);
}
-function popProvider(context) {
- context._currentValue = valueCursor.current;
- pop(valueCursor);
+function mountSuspenseFallbackChildren(
+ workInProgress,
+ primaryChildren,
+ fallbackChildren,
+ renderLanes
+) {
+ var mode = workInProgress.mode;
+ primaryChildren = mountWorkInProgressOffscreenFiber(
+ { mode: "hidden", children: primaryChildren },
+ mode
+ );
+ fallbackChildren = createFiberFromFragment(
+ fallbackChildren,
+ mode,
+ renderLanes,
+ null
+ );
+ primaryChildren.return = workInProgress;
+ fallbackChildren.return = workInProgress;
+ primaryChildren.sibling = fallbackChildren;
+ workInProgress.child = primaryChildren;
+ return fallbackChildren;
}
-function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {
- for (; null !== parent; ) {
- var alternate = parent.alternate;
- (parent.childLanes & renderLanes) !== renderLanes
- ? ((parent.childLanes |= renderLanes),
- null !== alternate && (alternate.childLanes |= renderLanes))
- : null !== alternate &&
- (alternate.childLanes & renderLanes) !== renderLanes &&
- (alternate.childLanes |= renderLanes);
- if (parent === propagationRoot) break;
- parent = parent.return;
- }
+function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
+ return createFiberFromOffscreen(offscreenProps, mode, 0, null);
}
-function propagateContextChanges(
+function retrySuspenseComponentWithoutHydrating(
+ current,
workInProgress,
- contexts,
- renderLanes,
- forcePropagateEntireTree
+ renderLanes
) {
- var fiber = workInProgress.child;
- null !== fiber && (fiber.return = workInProgress);
- for (; null !== fiber; ) {
- var list = fiber.dependencies;
- if (null !== list) {
- var nextFiber = fiber.child;
- list = list.firstContext;
- a: for (; null !== list; ) {
- var dependency = list;
- list = fiber;
- for (var i = 0; i < contexts.length; i++)
- if (dependency.context === contexts[i]) {
- list.lanes |= renderLanes;
- dependency = list.alternate;
- null !== dependency && (dependency.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(
- list.return,
- renderLanes,
- workInProgress
- );
- forcePropagateEntireTree || (nextFiber = null);
- break a;
- }
- list = dependency.next;
- }
- } else if (18 === fiber.tag) {
- nextFiber = fiber.return;
- if (null === nextFiber) throw Error(formatProdErrorMessage(341));
- nextFiber.lanes |= renderLanes;
- list = nextFiber.alternate;
- null !== list && (list.lanes |= renderLanes);
- scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);
- nextFiber = null;
- } else nextFiber = fiber.child;
- if (null !== nextFiber) nextFiber.return = fiber;
- else
- for (nextFiber = fiber; null !== nextFiber; ) {
- if (nextFiber === workInProgress) {
- nextFiber = null;
- break;
+ reconcileChildFibers(workInProgress, current.child, null, renderLanes);
+ current = mountSuspensePrimaryChildren(
+ workInProgress,
+ workInProgress.pendingProps.children
+ );
+ current.flags |= 2;
+ workInProgress.memoizedState = null;
+ return current;
+}
+function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {
+ fiber.lanes |= renderLanes;
+ var alternate = fiber.alternate;
+ null !== alternate && (alternate.lanes |= renderLanes);
+ scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);
+}
+function initSuspenseListRenderState(
+ workInProgress,
+ isBackwards,
+ tail,
+ lastContentRow,
+ tailMode
+) {
+ var renderState = workInProgress.memoizedState;
+ null === renderState
+ ? (workInProgress.memoizedState = {
+ isBackwards: isBackwards,
+ rendering: null,
+ renderingStartTime: 0,
+ last: lastContentRow,
+ tail: tail,
+ tailMode: tailMode
+ })
+ : ((renderState.isBackwards = isBackwards),
+ (renderState.rendering = null),
+ (renderState.renderingStartTime = 0),
+ (renderState.last = lastContentRow),
+ (renderState.tail = tail),
+ (renderState.tailMode = tailMode));
+}
+function updateSuspenseListComponent(current, workInProgress, renderLanes) {
+ var nextProps = workInProgress.pendingProps,
+ revealOrder = nextProps.revealOrder,
+ tailMode = nextProps.tail;
+ reconcileChildren(current, workInProgress, nextProps.children, renderLanes);
+ nextProps = suspenseStackCursor.current;
+ if (0 !== (nextProps & 2))
+ (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128);
+ else {
+ if (null !== current && 0 !== (current.flags & 128))
+ a: for (current = workInProgress.child; null !== current; ) {
+ if (13 === current.tag)
+ null !== current.memoizedState &&
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (19 === current.tag)
+ scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);
+ else if (null !== current.child) {
+ current.child.return = current;
+ current = current.child;
+ continue;
}
- fiber = nextFiber.sibling;
- if (null !== fiber) {
- fiber.return = nextFiber.return;
- nextFiber = fiber;
- break;
+ if (current === workInProgress) break a;
+ for (; null === current.sibling; ) {
+ if (null === current.return || current.return === workInProgress)
+ break a;
+ current = current.return;
}
- nextFiber = nextFiber.return;
+ current.sibling.return = current.return;
+ current = current.sibling;
}
- fiber = nextFiber;
+ nextProps &= 1;
}
-}
-function propagateParentContextChanges(
- current,
- workInProgress,
- renderLanes,
- forcePropagateEntireTree
-) {
- current = null;
- for (
- var parent = workInProgress, isInsidePropagationBailout = !1;
- null !== parent;
-
- ) {
- if (!isInsidePropagationBailout)
- if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;
- else if (0 !== (parent.flags & 262144)) break;
- if (10 === parent.tag) {
- var currentParent = parent.alternate;
- if (null === currentParent) throw Error(formatProdErrorMessage(387));
- currentParent = currentParent.memoizedProps;
- if (null !== currentParent) {
- var context = parent.type;
- objectIs(parent.pendingProps.value, currentParent.value) ||
- (null !== current ? current.push(context) : (current = [context]));
+ 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;
+ renderLanes = revealOrder;
+ revealOrder = current;
}
- } else if (parent === hostTransitionProviderCursor.current) {
- currentParent = parent.alternate;
- if (null === currentParent) throw Error(formatProdErrorMessage(387));
- currentParent.memoizedState.memoizedState !==
- parent.memoizedState.memoizedState &&
- (null !== current
- ? current.push(HostTransitionContext)
- : (current = [HostTransitionContext]));
- }
- parent = parent.return;
+ initSuspenseListRenderState(
+ workInProgress,
+ !0,
+ renderLanes,
+ null,
+ tailMode
+ );
+ break;
+ case "together":
+ initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
+ break;
+ default:
+ workInProgress.memoizedState = null;
}
- null !== current &&
- propagateContextChanges(
- workInProgress,
- current,
- renderLanes,
- forcePropagateEntireTree
- );
- workInProgress.flags |= 262144;
+ return workInProgress.child;
}
-function checkIfContextChanged(currentDependencies) {
- for (
- currentDependencies = currentDependencies.firstContext;
- null !== currentDependencies;
-
- ) {
- if (
- !objectIs(
- currentDependencies.context._currentValue,
- currentDependencies.memoizedValue
+function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
+ null !== current && (workInProgress.dependencies = current.dependencies);
+ profilerStartTime = -1;
+ workInProgressRootSkippedLanes |= workInProgress.lanes;
+ if (0 === (renderLanes & workInProgress.childLanes))
+ if (null !== current) {
+ if (
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ 0 === (renderLanes & workInProgress.childLanes))
)
- )
- return !0;
- currentDependencies = currentDependencies.next;
- }
- return !1;
-}
-function prepareToReadContext(workInProgress) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- workInProgress = workInProgress.dependencies;
- null !== workInProgress && (workInProgress.firstContext = null);
-}
-function readContext(context) {
- return readContextForConsumer(currentlyRenderingFiber, context);
-}
-function readContextDuringReconciliation(consumer, context) {
- null === currentlyRenderingFiber && prepareToReadContext(consumer);
- return readContextForConsumer(consumer, context);
-}
-function readContextForConsumer(consumer, context) {
- var value = context._currentValue;
- context = { context: context, memoizedValue: value, next: null };
- if (null === lastContextDependency) {
- if (null === consumer) throw Error(formatProdErrorMessage(308));
- lastContextDependency = context;
- consumer.dependencies = { lanes: 0, firstContext: context };
- consumer.flags |= 524288;
- } else lastContextDependency = lastContextDependency.next = context;
- return value;
-}
-var hasForceUpdate = !1;
-function initializeUpdateQueue(fiber) {
- fiber.updateQueue = {
- baseState: fiber.memoizedState,
- firstBaseUpdate: null,
- lastBaseUpdate: null,
- shared: { pending: null, lanes: 0, hiddenCallbacks: null },
- callbacks: null
- };
-}
-function cloneUpdateQueue(current, workInProgress) {
- current = current.updateQueue;
- workInProgress.updateQueue === current &&
- (workInProgress.updateQueue = {
- baseState: current.baseState,
- firstBaseUpdate: current.firstBaseUpdate,
- lastBaseUpdate: current.lastBaseUpdate,
- shared: current.shared,
- callbacks: null
- });
-}
-function createUpdate(lane) {
- return { lane: lane, tag: 0, payload: null, callback: null, next: null };
-}
-function enqueueUpdate(fiber, update, lane) {
- var updateQueue = fiber.updateQueue;
- if (null === updateQueue) return null;
- updateQueue = updateQueue.shared;
- if (0 !== (executionContext & 2)) {
- var pending = updateQueue.pending;
- null === pending
- ? (update.next = update)
- : ((update.next = pending.next), (pending.next = update));
- updateQueue.pending = update;
- update = getRootForUpdatedFiber(fiber);
- markUpdateLaneFromFiberToRoot(fiber, null, lane);
- return update;
- }
- enqueueUpdate$1(fiber, updateQueue, update, lane);
- return getRootForUpdatedFiber(fiber);
-}
-function entangleTransitions(root, fiber, lane) {
- fiber = fiber.updateQueue;
- if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) {
- var queueLanes = fiber.lanes;
- queueLanes &= root.pendingLanes;
- lane |= queueLanes;
- fiber.lanes = lane;
- markRootEntangled(root, lane);
+ return null;
+ } else return null;
+ if (null !== current && workInProgress.child !== current.child)
+ throw Error(formatProdErrorMessage(153));
+ if (null !== workInProgress.child) {
+ current = workInProgress.child;
+ renderLanes = createWorkInProgress(current, current.pendingProps);
+ workInProgress.child = renderLanes;
+ for (renderLanes.return = workInProgress; null !== current.sibling; )
+ (current = current.sibling),
+ (renderLanes = renderLanes.sibling =
+ createWorkInProgress(current, current.pendingProps)),
+ (renderLanes.return = workInProgress);
+ renderLanes.sibling = null;
}
+ return workInProgress.child;
}
-function enqueueCapturedUpdate(workInProgress, capturedUpdate) {
- var queue = workInProgress.updateQueue,
- current = workInProgress.alternate;
- if (
- null !== current &&
- ((current = current.updateQueue), queue === current)
- ) {
- var newFirst = null,
- newLast = null;
- queue = queue.firstBaseUpdate;
- if (null !== queue) {
- do {
- var clone = {
- lane: queue.lane,
- tag: queue.tag,
- payload: queue.payload,
- callback: null,
- next: null
- };
- null === newLast
- ? (newFirst = newLast = clone)
- : (newLast = newLast.next = clone);
- queue = queue.next;
- } while (null !== queue);
- null === newLast
- ? (newFirst = newLast = capturedUpdate)
- : (newLast = newLast.next = capturedUpdate);
- } else newFirst = newLast = capturedUpdate;
- queue = {
- baseState: current.baseState,
- firstBaseUpdate: newFirst,
- lastBaseUpdate: newLast,
- shared: current.shared,
- callbacks: current.callbacks
- };
- workInProgress.updateQueue = queue;
- return;
- }
- workInProgress = queue.lastBaseUpdate;
- null === workInProgress
- ? (queue.firstBaseUpdate = capturedUpdate)
- : (workInProgress.next = capturedUpdate);
- queue.lastBaseUpdate = capturedUpdate;
+function checkScheduledUpdateOrContext(current, renderLanes) {
+ if (0 !== (current.lanes & renderLanes)) return !0;
+ current = current.dependencies;
+ return null !== current && checkIfContextChanged(current) ? !0 : !1;
}
-var didReadFromEntangledAsyncAction = !1;
-function suspendIfUpdateReadFromEntangledAsyncAction() {
- if (didReadFromEntangledAsyncAction) {
- var entangledActionThenable = currentEntangledActionThenable;
- if (null !== entangledActionThenable) throw entangledActionThenable;
+function attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+) {
+ switch (workInProgress.tag) {
+ case 3:
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
+ pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
+ resetHydrationState();
+ break;
+ case 27:
+ case 5:
+ pushHostContext(workInProgress);
+ break;
+ case 4:
+ pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
+ break;
+ case 10:
+ pushProvider(
+ workInProgress,
+ workInProgress.type,
+ workInProgress.memoizedProps.value
+ );
+ break;
+ case 12:
+ 0 !== (renderLanes & workInProgress.childLanes) &&
+ (workInProgress.flags |= 4);
+ workInProgress.flags |= 2048;
+ var stateNode = workInProgress.stateNode;
+ stateNode.effectDuration = -0;
+ stateNode.passiveEffectDuration = -0;
+ break;
+ case 13:
+ stateNode = workInProgress.memoizedState;
+ if (null !== stateNode) {
+ if (null !== stateNode.dehydrated)
+ return (
+ pushPrimaryTreeSuspenseHandler(workInProgress),
+ (workInProgress.flags |= 128),
+ null
+ );
+ if (0 !== (renderLanes & workInProgress.child.childLanes))
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ current = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ return null !== current ? current.sibling : null;
+ }
+ pushPrimaryTreeSuspenseHandler(workInProgress);
+ break;
+ case 19:
+ var didSuspendBefore = 0 !== (current.flags & 128);
+ stateNode = 0 !== (renderLanes & workInProgress.childLanes);
+ stateNode ||
+ (propagateParentContextChanges(
+ current,
+ workInProgress,
+ renderLanes,
+ !1
+ ),
+ (stateNode = 0 !== (renderLanes & workInProgress.childLanes)));
+ if (didSuspendBefore) {
+ if (stateNode)
+ return updateSuspenseListComponent(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ workInProgress.flags |= 128;
+ }
+ didSuspendBefore = workInProgress.memoizedState;
+ null !== didSuspendBefore &&
+ ((didSuspendBefore.rendering = null),
+ (didSuspendBefore.tail = null),
+ (didSuspendBefore.lastEffect = null));
+ push(suspenseStackCursor, suspenseStackCursor.current);
+ if (stateNode) break;
+ else return null;
+ case 22:
+ case 23:
+ return (
+ (workInProgress.lanes = 0),
+ updateOffscreenComponent(current, workInProgress, renderLanes)
+ );
+ case 24:
+ pushProvider(workInProgress, CacheContext, current.memoizedState.cache);
}
+ return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
}
-function processUpdateQueue(
- workInProgress$jscomp$0,
- props,
- instance$jscomp$0,
- renderLanes
-) {
- didReadFromEntangledAsyncAction = !1;
- var queue = workInProgress$jscomp$0.updateQueue;
- hasForceUpdate = !1;
- var firstBaseUpdate = queue.firstBaseUpdate,
- lastBaseUpdate = queue.lastBaseUpdate,
- pendingQueue = queue.shared.pending;
- if (null !== pendingQueue) {
- queue.shared.pending = null;
- var lastPendingUpdate = pendingQueue,
- firstPendingUpdate = lastPendingUpdate.next;
- lastPendingUpdate.next = null;
- null === lastBaseUpdate
- ? (firstBaseUpdate = firstPendingUpdate)
- : (lastBaseUpdate.next = firstPendingUpdate);
- lastBaseUpdate = lastPendingUpdate;
- var current = workInProgress$jscomp$0.alternate;
- null !== current &&
- ((current = current.updateQueue),
- (pendingQueue = current.lastBaseUpdate),
- pendingQueue !== lastBaseUpdate &&
- (null === pendingQueue
- ? (current.firstBaseUpdate = firstPendingUpdate)
- : (pendingQueue.next = firstPendingUpdate),
- (current.lastBaseUpdate = lastPendingUpdate)));
- }
- if (null !== firstBaseUpdate) {
- var newState = queue.baseState;
- lastBaseUpdate = 0;
- current = firstPendingUpdate = lastPendingUpdate = null;
- pendingQueue = firstBaseUpdate;
- do {
- var updateLane = pendingQueue.lane & -536870913,
- isHiddenUpdate = updateLane !== pendingQueue.lane;
+function beginWork(current, workInProgress, renderLanes) {
+ if (null !== current)
+ if (current.memoizedProps !== workInProgress.pendingProps)
+ didReceiveUpdate = !0;
+ else {
if (
- isHiddenUpdate
- ? (workInProgressRootRenderLanes & updateLane) === updateLane
- : (renderLanes & updateLane) === updateLane
- ) {
- 0 !== updateLane &&
- updateLane === currentEntangledLane &&
- (didReadFromEntangledAsyncAction = !0);
- null !== current &&
- (current = current.next =
- {
- lane: 0,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: null,
- next: null
- });
- a: {
- var workInProgress = workInProgress$jscomp$0,
- update = pendingQueue;
- updateLane = props;
- var instance = instance$jscomp$0;
- switch (update.tag) {
- case 1:
- workInProgress = update.payload;
- if ("function" === typeof workInProgress) {
- newState = workInProgress.call(instance, newState, updateLane);
- break a;
- }
- newState = workInProgress;
+ !checkScheduledUpdateOrContext(current, renderLanes) &&
+ 0 === (workInProgress.flags & 128)
+ )
+ return (
+ (didReceiveUpdate = !1),
+ attemptEarlyBailoutIfNoScheduledUpdate(
+ current,
+ workInProgress,
+ renderLanes
+ )
+ );
+ didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;
+ }
+ else
+ (didReceiveUpdate = !1),
+ isHydrating &&
+ 0 !== (workInProgress.flags & 1048576) &&
+ pushTreeId(workInProgress, treeForkCount, workInProgress.index);
+ workInProgress.lanes = 0;
+ switch (workInProgress.tag) {
+ case 16:
+ a: {
+ current = workInProgress.pendingProps;
+ var lazyComponent = workInProgress.elementType,
+ init = lazyComponent._init;
+ lazyComponent = init(lazyComponent._payload);
+ workInProgress.type = lazyComponent;
+ if ("function" === typeof lazyComponent)
+ shouldConstruct(lazyComponent)
+ ? ((current = resolveClassComponentProps(lazyComponent, current)),
+ (workInProgress.tag = 1),
+ (workInProgress = updateClassComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ )))
+ : ((workInProgress.tag = 0),
+ (workInProgress = updateFunctionComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ )));
+ else {
+ if (void 0 !== lazyComponent && null !== lazyComponent)
+ if (
+ ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE)
+ ) {
+ workInProgress.tag = 11;
+ workInProgress = updateForwardRef(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ );
break a;
- case 3:
- workInProgress.flags = (workInProgress.flags & -65537) | 128;
- case 0:
- workInProgress = update.payload;
- updateLane =
- "function" === typeof workInProgress
- ? workInProgress.call(instance, newState, updateLane)
- : workInProgress;
- if (null === updateLane || void 0 === updateLane) break a;
- newState = assign({}, newState, updateLane);
+ } else if (init === REACT_MEMO_TYPE) {
+ workInProgress.tag = 14;
+ workInProgress = updateMemoComponent(
+ null,
+ workInProgress,
+ lazyComponent,
+ current,
+ renderLanes
+ );
break a;
- case 2:
- hasForceUpdate = !0;
+ }
+ workInProgress =
+ getComponentNameFromType(lazyComponent) || lazyComponent;
+ throw Error(formatProdErrorMessage(306, workInProgress, ""));
+ }
+ }
+ return workInProgress;
+ case 0:
+ return updateFunctionComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 1:
+ return (
+ (lazyComponent = workInProgress.type),
+ (init = resolveClassComponentProps(
+ lazyComponent,
+ workInProgress.pendingProps
+ )),
+ updateClassComponent(
+ current,
+ workInProgress,
+ lazyComponent,
+ init,
+ renderLanes
+ )
+ );
+ case 3:
+ a: {
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ );
+ if (null === current) throw Error(formatProdErrorMessage(387));
+ var nextProps = workInProgress.pendingProps;
+ init = workInProgress.memoizedState;
+ lazyComponent = init.element;
+ cloneUpdateQueue(current, workInProgress);
+ processUpdateQueue(workInProgress, nextProps, null, renderLanes);
+ var nextState = workInProgress.memoizedState;
+ nextProps = nextState.cache;
+ pushProvider(workInProgress, CacheContext, nextProps);
+ nextProps !== init.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ );
+ suspendIfUpdateReadFromEntangledAsyncAction();
+ nextProps = nextState.element;
+ if (init.isDehydrated)
+ if (
+ ((init = {
+ element: nextProps,
+ isDehydrated: !1,
+ cache: nextState.cache
+ }),
+ (workInProgress.updateQueue.baseState = init),
+ (workInProgress.memoizedState = init),
+ workInProgress.flags & 256)
+ ) {
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else if (nextProps !== lazyComponent) {
+ lazyComponent = createCapturedValueAtFiber(
+ Error(formatProdErrorMessage(424)),
+ workInProgress
+ );
+ queueHydrationError(lazyComponent);
+ workInProgress = mountHostRootWithoutHydrating(
+ current,
+ workInProgress,
+ nextProps,
+ renderLanes
+ );
+ break a;
+ } else
+ for (
+ nextHydratableInstance = getNextHydratable(
+ workInProgress.stateNode.containerInfo.firstChild
+ ),
+ hydrationParentFiber = workInProgress,
+ isHydrating = !0,
+ hydrationErrors = null,
+ rootOrSingletonContext = !0,
+ renderLanes = mountChildFibers(
+ workInProgress,
+ null,
+ nextProps,
+ renderLanes
+ ),
+ workInProgress.child = renderLanes;
+ renderLanes;
+
+ )
+ (renderLanes.flags = (renderLanes.flags & -3) | 4096),
+ (renderLanes = renderLanes.sibling);
+ else {
+ resetHydrationState();
+ if (nextProps === lazyComponent) {
+ workInProgress = bailoutOnAlreadyFinishedWork(
+ current,
+ workInProgress,
+ renderLanes
+ );
+ break a;
}
+ reconcileChildren(current, workInProgress, nextProps, renderLanes);
}
- updateLane = pendingQueue.callback;
- null !== updateLane &&
- ((workInProgress$jscomp$0.flags |= 64),
- isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),
- (isHiddenUpdate = queue.callbacks),
- null === isHiddenUpdate
- ? (queue.callbacks = [updateLane])
- : isHiddenUpdate.push(updateLane));
- } else
- (isHiddenUpdate = {
- lane: updateLane,
- tag: pendingQueue.tag,
- payload: pendingQueue.payload,
- callback: pendingQueue.callback,
- next: null
- }),
- null === current
- ? ((firstPendingUpdate = current = isHiddenUpdate),
- (lastPendingUpdate = newState))
- : (current = current.next = isHiddenUpdate),
- (lastBaseUpdate |= updateLane);
- pendingQueue = pendingQueue.next;
- if (null === pendingQueue)
- if (((pendingQueue = queue.shared.pending), null === pendingQueue))
- break;
- else
- (isHiddenUpdate = pendingQueue),
- (pendingQueue = isHiddenUpdate.next),
- (isHiddenUpdate.next = null),
- (queue.lastBaseUpdate = isHiddenUpdate),
- (queue.shared.pending = null);
- } while (1);
- null === current && (lastPendingUpdate = newState);
- queue.baseState = lastPendingUpdate;
- queue.firstBaseUpdate = firstPendingUpdate;
- queue.lastBaseUpdate = current;
- null === firstBaseUpdate && (queue.shared.lanes = 0);
- workInProgressRootSkippedLanes |= lastBaseUpdate;
- workInProgress$jscomp$0.lanes = lastBaseUpdate;
- workInProgress$jscomp$0.memoizedState = newState;
+ workInProgress = workInProgress.child;
+ }
+ return workInProgress;
+ case 26:
+ return (
+ markRef(current, workInProgress),
+ null === current
+ ? (renderLanes = getResource(
+ workInProgress.type,
+ null,
+ workInProgress.pendingProps,
+ null
+ ))
+ ? (workInProgress.memoizedState = renderLanes)
+ : isHydrating ||
+ ((renderLanes = workInProgress.type),
+ (current = workInProgress.pendingProps),
+ (lazyComponent = getOwnerDocumentFromRootContainer(
+ rootInstanceStackCursor.current
+ ).createElement(renderLanes)),
+ (lazyComponent[internalInstanceKey] = workInProgress),
+ (lazyComponent[internalPropsKey] = current),
+ setInitialProperties(lazyComponent, renderLanes, current),
+ markNodeAsHoistable(lazyComponent),
+ (workInProgress.stateNode = lazyComponent))
+ : (workInProgress.memoizedState = getResource(
+ workInProgress.type,
+ current.memoizedProps,
+ workInProgress.pendingProps,
+ current.memoizedState
+ )),
+ null
+ );
+ case 27:
+ return (
+ pushHostContext(workInProgress),
+ null === current &&
+ isHydrating &&
+ ((lazyComponent = workInProgress.stateNode =
+ resolveSingletonInstance(
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootInstanceStackCursor.current
+ )),
+ (hydrationParentFiber = workInProgress),
+ (rootOrSingletonContext = !0),
+ (nextHydratableInstance = getNextHydratable(
+ lazyComponent.firstChild
+ ))),
+ (lazyComponent = workInProgress.pendingProps.children),
+ null !== current || isHydrating
+ ? reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent,
+ renderLanes
+ )
+ : (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ lazyComponent,
+ renderLanes
+ )),
+ markRef(current, workInProgress),
+ workInProgress.child
+ );
+ case 5:
+ if (null === current && isHydrating) {
+ if ((init = lazyComponent = nextHydratableInstance))
+ (lazyComponent = canHydrateInstance(
+ lazyComponent,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== lazyComponent
+ ? ((workInProgress.stateNode = lazyComponent),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = getNextHydratable(
+ lazyComponent.firstChild
+ )),
+ (rootOrSingletonContext = !1),
+ (init = !0))
+ : (init = !1);
+ init || throwOnHydrationMismatch(workInProgress);
+ }
+ pushHostContext(workInProgress);
+ init = workInProgress.type;
+ nextProps = workInProgress.pendingProps;
+ nextState = null !== current ? current.memoizedProps : null;
+ lazyComponent = nextProps.children;
+ shouldSetTextContent(init, nextProps)
+ ? (lazyComponent = null)
+ : null !== nextState &&
+ shouldSetTextContent(init, nextState) &&
+ (workInProgress.flags |= 32);
+ null !== workInProgress.memoizedState &&
+ ((init = renderWithHooks(
+ current,
+ workInProgress,
+ TransitionAwareHostComponent,
+ null,
+ null,
+ renderLanes
+ )),
+ (HostTransitionContext._currentValue = init));
+ markRef(current, workInProgress);
+ reconcileChildren(current, workInProgress, lazyComponent, renderLanes);
+ return workInProgress.child;
+ case 6:
+ if (null === current && isHydrating) {
+ if ((current = renderLanes = nextHydratableInstance))
+ (renderLanes = canHydrateTextInstance(
+ renderLanes,
+ workInProgress.pendingProps,
+ rootOrSingletonContext
+ )),
+ null !== renderLanes
+ ? ((workInProgress.stateNode = renderLanes),
+ (hydrationParentFiber = workInProgress),
+ (nextHydratableInstance = null),
+ (current = !0))
+ : (current = !1);
+ current || throwOnHydrationMismatch(workInProgress);
+ }
+ return null;
+ case 13:
+ return updateSuspenseComponent(current, workInProgress, renderLanes);
+ case 4:
+ return (
+ pushHostContainer(
+ workInProgress,
+ workInProgress.stateNode.containerInfo
+ ),
+ (lazyComponent = workInProgress.pendingProps),
+ null === current
+ ? (workInProgress.child = reconcileChildFibers(
+ workInProgress,
+ null,
+ lazyComponent,
+ renderLanes
+ ))
+ : reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 11:
+ return updateForwardRef(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 7:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 8:
+ return (
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 12:
+ return (
+ (workInProgress.flags |= 4),
+ (workInProgress.flags |= 2048),
+ (lazyComponent = workInProgress.stateNode),
+ (lazyComponent.effectDuration = -0),
+ (lazyComponent.passiveEffectDuration = -0),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 10:
+ return (
+ (lazyComponent = workInProgress.pendingProps),
+ pushProvider(workInProgress, workInProgress.type, lazyComponent.value),
+ reconcileChildren(
+ current,
+ workInProgress,
+ lazyComponent.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 9:
+ return (
+ (init = workInProgress.type._context),
+ (lazyComponent = workInProgress.pendingProps.children),
+ prepareToReadContext(workInProgress),
+ (init = readContext(init)),
+ (lazyComponent = lazyComponent(init)),
+ (workInProgress.flags |= 1),
+ reconcileChildren(current, workInProgress, lazyComponent, renderLanes),
+ workInProgress.child
+ );
+ case 14:
+ return updateMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 15:
+ return updateSimpleMemoComponent(
+ current,
+ workInProgress,
+ workInProgress.type,
+ workInProgress.pendingProps,
+ renderLanes
+ );
+ case 19:
+ return updateSuspenseListComponent(current, workInProgress, renderLanes);
+ case 22:
+ return updateOffscreenComponent(current, workInProgress, renderLanes);
+ case 24:
+ return (
+ prepareToReadContext(workInProgress),
+ (lazyComponent = readContext(CacheContext)),
+ null === current
+ ? ((init = peekCacheFromPool()),
+ null === init &&
+ ((init = workInProgressRoot),
+ (nextProps = createCache()),
+ (init.pooledCache = nextProps),
+ nextProps.refCount++,
+ null !== nextProps && (init.pooledCacheLanes |= renderLanes),
+ (init = nextProps)),
+ (workInProgress.memoizedState = {
+ parent: lazyComponent,
+ cache: init
+ }),
+ initializeUpdateQueue(workInProgress),
+ pushProvider(workInProgress, CacheContext, init))
+ : (0 !== (current.lanes & renderLanes) &&
+ (cloneUpdateQueue(current, workInProgress),
+ processUpdateQueue(workInProgress, null, null, renderLanes),
+ suspendIfUpdateReadFromEntangledAsyncAction()),
+ (init = current.memoizedState),
+ (nextProps = workInProgress.memoizedState),
+ init.parent !== lazyComponent
+ ? ((init = { parent: lazyComponent, cache: lazyComponent }),
+ (workInProgress.memoizedState = init),
+ 0 === workInProgress.lanes &&
+ (workInProgress.memoizedState =
+ workInProgress.updateQueue.baseState =
+ init),
+ pushProvider(workInProgress, CacheContext, lazyComponent))
+ : ((lazyComponent = nextProps.cache),
+ pushProvider(workInProgress, CacheContext, lazyComponent),
+ lazyComponent !== init.cache &&
+ propagateContextChanges(
+ workInProgress,
+ [CacheContext],
+ renderLanes,
+ !0
+ ))),
+ reconcileChildren(
+ current,
+ workInProgress,
+ workInProgress.pendingProps.children,
+ renderLanes
+ ),
+ workInProgress.child
+ );
+ case 29:
+ throw workInProgress.pendingProps;
}
-}
-function callCallback(callback, context) {
- if ("function" !== typeof callback)
- throw Error(formatProdErrorMessage(191, callback));
- callback.call(context);
-}
-function commitCallbacks(updateQueue, context) {
- var callbacks = updateQueue.callbacks;
- if (null !== callbacks)
- for (
- updateQueue.callbacks = null, updateQueue = 0;
- updateQueue < callbacks.length;
- updateQueue++
- )
- callCallback(callbacks[updateQueue], context);
+ throw Error(formatProdErrorMessage(156, workInProgress.tag));
}
function shouldProfile(current) {
return 0 !== (current.mode & 2);
@@ -9530,7 +9588,8 @@ function recursivelyTraverseLayoutEffects(root, parentFiber) {
}
function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
for (parentFiber = parentFiber.child; null !== parentFiber; ) {
- var finishedWork = parentFiber;
+ var finishedWork = parentFiber,
+ prevEffectStart = pushComponentEffectStart();
switch (finishedWork.tag) {
case 0:
case 11:
@@ -9564,6 +9623,17 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
default:
recursivelyTraverseDisappearLayoutEffects(finishedWork);
}
+ 0 !== (finishedWork.mode & 2) &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
parentFiber = parentFiber.sibling;
}
}
@@ -9578,6 +9648,7 @@ function recursivelyTraverseReappearLayoutEffects(
var current = parentFiber.alternate,
finishedRoot = finishedRoot$jscomp$0,
finishedWork = parentFiber,
+ prevEffectStart = pushComponentEffectStart(),
flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
@@ -9688,6 +9759,17 @@ function recursivelyTraverseReappearLayoutEffects(
includeWorkInProgressEffects
);
}
+ 0 !== (finishedWork.mode & 2) &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ finishedWork,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
parentFiber = parentFiber.sibling;
}
}
@@ -9738,6 +9820,7 @@ function recursivelyTraversePassiveMountEffects(
parentFiber = nextSibling;
}
}
+var inHydratedSubtree = !1;
function commitPassiveMountOnFiber(
finishedRoot,
finishedWork,
@@ -9746,39 +9829,16 @@ function commitPassiveMountOnFiber(
endTime
) {
var prevEffectStart = pushComponentEffectStart();
- if (
- 0 !== (finishedWork.mode & 2) &&
+ 0 !== (finishedWork.mode & 2) &&
0 < finishedWork.actualStartTime &&
- 0 !== (finishedWork.flags & 1)
- ) {
- var startTime = finishedWork.actualStartTime,
- name = getComponentNameFromFiber(finishedWork);
- if (null !== name && supportsUserTiming) {
- var selfTime = finishedWork.actualDuration;
- if (
- null === finishedWork.alternate ||
- finishedWork.alternate.child !== finishedWork.child
- )
- for (
- var child = finishedWork.child;
- null !== child;
- child = child.sibling
- )
- selfTime -= child.actualDuration;
- reusableComponentDevToolDetails.color =
- 0.5 > selfTime
- ? "primary-light"
- : 10 > selfTime
- ? "primary"
- : 100 > selfTime
- ? "primary-dark"
- : "error";
- reusableComponentOptions.start = startTime;
- reusableComponentOptions.end = endTime;
- performance.measure(name, reusableComponentOptions);
- }
- }
- startTime = finishedWork.flags;
+ 0 !== (finishedWork.flags & 1) &&
+ logComponentRender(
+ finishedWork,
+ finishedWork.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = finishedWork.flags;
switch (finishedWork.tag) {
case 0:
case 11:
@@ -9790,10 +9850,15 @@ function commitPassiveMountOnFiber(
committedTransitions,
endTime
);
- startTime & 2048 && commitHookPassiveMountEffects(finishedWork, 9);
+ flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9);
break;
case 3:
- var prevEffectDuration = pushNestedEffectDurations();
+ var prevEffectDuration = pushNestedEffectDurations(),
+ wasInHydratedSubtree = inHydratedSubtree;
+ inHydratedSubtree =
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 === (finishedWork.flags & 256);
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -9801,7 +9866,8 @@ function commitPassiveMountOnFiber(
committedTransitions,
endTime
);
- startTime & 2048 &&
+ inHydratedSubtree = wasInHydratedSubtree;
+ flags & 2048 &&
((committedLanes = null),
null !== finishedWork.alternate &&
(committedLanes = finishedWork.alternate.memoizedState.cache),
@@ -9813,8 +9879,8 @@ function commitPassiveMountOnFiber(
popNestedEffectDurations(prevEffectDuration);
break;
case 12:
- if (startTime & 2048) {
- startTime = pushNestedEffectDurations();
+ if (flags & 2048) {
+ flags = pushNestedEffectDurations();
recursivelyTraversePassiveMountEffects(
finishedRoot,
finishedWork,
@@ -9824,16 +9890,16 @@ function commitPassiveMountOnFiber(
);
finishedRoot = finishedWork.stateNode;
finishedRoot.passiveEffectDuration +=
- bubbleNestedEffectDurations(startTime);
+ bubbleNestedEffectDurations(flags);
try {
prevEffectDuration = finishedWork.memoizedProps;
- var id = prevEffectDuration.id,
- onPostCommit = prevEffectDuration.onPostCommit,
+ wasInHydratedSubtree = prevEffectDuration.id;
+ var onPostCommit = prevEffectDuration.onPostCommit,
phase = null === finishedWork.alternate ? "mount" : "update";
currentUpdateIsNested && (phase = "nested-update");
"function" === typeof onPostCommit &&
onPostCommit(
- id,
+ wasInHydratedSubtree,
phase,
finishedRoot.passiveEffectDuration,
commitStartTime
@@ -9850,6 +9916,48 @@ function commitPassiveMountOnFiber(
endTime
);
break;
+ case 13:
+ flags = inHydratedSubtree;
+ prevEffectDuration =
+ null !== finishedWork.alternate
+ ? finishedWork.alternate.memoizedState
+ : null;
+ wasInHydratedSubtree = finishedWork.memoizedState;
+ null === prevEffectDuration ||
+ null === prevEffectDuration.dehydrated ||
+ (null !== wasInHydratedSubtree &&
+ null !== wasInHydratedSubtree.dehydrated)
+ ? (inHydratedSubtree = !1)
+ : ((wasInHydratedSubtree = finishedWork.deletions),
+ null !== wasInHydratedSubtree &&
+ 0 < wasInHydratedSubtree.length &&
+ 18 === wasInHydratedSubtree[0].tag
+ ? ((inHydratedSubtree = !1),
+ null !== prevEffectDuration.hydrationErrors &&
+ ((prevEffectDuration = finishedWork.actualStartTime),
+ supportsUserTiming &&
+ performance.measure("Suspense", {
+ start: prevEffectDuration,
+ end: endTime,
+ detail: {
+ devtools: {
+ color: "error",
+ track: "Components \u269b",
+ tooltipText: "Hydration failed",
+ properties: []
+ }
+ }
+ })))
+ : (inHydratedSubtree = !0));
+ recursivelyTraversePassiveMountEffects(
+ finishedRoot,
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
+ inHydratedSubtree = flags;
+ break;
case 23:
break;
case 22:
@@ -9863,7 +9971,13 @@ function commitPassiveMountOnFiber(
committedTransitions,
endTime
)
- : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork)
+ : recursivelyTraverseAtomicPassiveEffects(
+ finishedRoot,
+ finishedWork,
+ committedLanes,
+ committedTransitions,
+ endTime
+ )
: prevEffectDuration._visibility & 4
? recursivelyTraversePassiveMountEffects(
finishedRoot,
@@ -9878,9 +9992,10 @@ function commitPassiveMountOnFiber(
finishedWork,
committedLanes,
committedTransitions,
- 0 !== (finishedWork.subtreeFlags & 10256)
+ 0 !== (finishedWork.subtreeFlags & 10256),
+ endTime
));
- startTime & 2048 &&
+ flags & 2048 &&
commitOffscreenPassiveMountEffects(
finishedWork.alternate,
finishedWork
@@ -9894,7 +10009,7 @@ function commitPassiveMountOnFiber(
committedTransitions,
endTime
);
- startTime & 2048 &&
+ flags & 2048 &&
commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
break;
default:
@@ -9923,112 +10038,171 @@ function recursivelyTraverseReconnectPassiveEffects(
parentFiber,
committedLanes$jscomp$0,
committedTransitions$jscomp$0,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime$jscomp$0
) {
includeWorkInProgressEffects =
includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256);
- for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ for (var child = parentFiber.child; null !== child; ) {
+ parentFiber = child.sibling;
var finishedRoot = finishedRoot$jscomp$0,
- finishedWork = parentFiber,
committedLanes = committedLanes$jscomp$0,
committedTransitions = committedTransitions$jscomp$0,
- flags = finishedWork.flags;
- switch (finishedWork.tag) {
+ endTime =
+ null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0,
+ prevEffectStart = pushComponentEffectStart();
+ 0 !== (child.mode & 2) &&
+ 0 < child.actualStartTime &&
+ 0 !== (child.flags & 1) &&
+ logComponentRender(
+ child,
+ child.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = child.flags;
+ switch (child.tag) {
case 0:
case 11:
case 15:
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
- finishedWork,
+ child,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
- commitHookPassiveMountEffects(finishedWork, 8);
+ commitHookPassiveMountEffects(child, 8);
break;
case 23:
break;
case 22:
- var instance = finishedWork.stateNode;
- null !== finishedWork.memoizedState
+ var instance = child.stateNode;
+ null !== child.memoizedState
? instance._visibility & 4
? recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
- finishedWork,
+ child,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
)
: recursivelyTraverseAtomicPassiveEffects(
finishedRoot,
- finishedWork
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
)
: ((instance._visibility |= 4),
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
- finishedWork,
+ child,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
));
includeWorkInProgressEffects &&
flags & 2048 &&
- commitOffscreenPassiveMountEffects(
- finishedWork.alternate,
- finishedWork
- );
+ commitOffscreenPassiveMountEffects(child.alternate, child);
break;
case 24:
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
- finishedWork,
+ child,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
includeWorkInProgressEffects &&
flags & 2048 &&
- commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
+ commitCachePassiveMountEffect(child.alternate, child);
break;
default:
recursivelyTraverseReconnectPassiveEffects(
finishedRoot,
- finishedWork,
+ child,
committedLanes,
committedTransitions,
- includeWorkInProgressEffects
+ includeWorkInProgressEffects,
+ endTime
);
}
- parentFiber = parentFiber.sibling;
+ 0 !== (child.mode & 2) &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ child,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
+ child = parentFiber;
}
}
function recursivelyTraverseAtomicPassiveEffects(
finishedRoot$jscomp$0,
- parentFiber
+ parentFiber,
+ committedLanes$jscomp$0,
+ committedTransitions$jscomp$0,
+ endTime$jscomp$0
) {
if (parentFiber.subtreeFlags & 10256)
- for (parentFiber = parentFiber.child; null !== parentFiber; ) {
+ for (var child = parentFiber.child; null !== child; ) {
+ parentFiber = child.sibling;
var finishedRoot = finishedRoot$jscomp$0,
- finishedWork = parentFiber,
- flags = finishedWork.flags;
- switch (finishedWork.tag) {
+ committedLanes = committedLanes$jscomp$0,
+ committedTransitions = committedTransitions$jscomp$0,
+ endTime =
+ null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0;
+ 0 !== (child.mode & 2) &&
+ 0 < child.actualStartTime &&
+ 0 !== (child.flags & 1) &&
+ logComponentRender(
+ child,
+ child.actualStartTime,
+ endTime,
+ inHydratedSubtree
+ );
+ var flags = child.flags;
+ switch (child.tag) {
case 22:
- recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
+ recursivelyTraverseAtomicPassiveEffects(
+ finishedRoot,
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
flags & 2048 &&
- commitOffscreenPassiveMountEffects(
- finishedWork.alternate,
- finishedWork
- );
+ commitOffscreenPassiveMountEffects(child.alternate, child);
break;
case 24:
- recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
- flags & 2048 &&
- commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
+ recursivelyTraverseAtomicPassiveEffects(
+ finishedRoot,
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
+ flags & 2048 && commitCachePassiveMountEffect(child.alternate, child);
break;
default:
- recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
+ recursivelyTraverseAtomicPassiveEffects(
+ finishedRoot,
+ child,
+ committedLanes,
+ committedTransitions,
+ endTime
+ );
}
- parentFiber = parentFiber.sibling;
+ child = parentFiber;
}
}
var suspenseyCommitFlag = 8192;
@@ -10191,10 +10365,12 @@ function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
}
function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
deletedSubtreeRoot,
- nearestMountedAncestor
+ nearestMountedAncestor$jscomp$0
) {
for (; null !== nextEffect; ) {
- var fiber = nextEffect;
+ var fiber = nextEffect,
+ nearestMountedAncestor = nearestMountedAncestor$jscomp$0,
+ prevEffectStart = pushComponentEffectStart();
switch (fiber.tag) {
case 0:
case 11:
@@ -10203,32 +10379,41 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
break;
case 23:
case 22:
- if (
- null !== fiber.memoizedState &&
- null !== fiber.memoizedState.cachePool
- ) {
- var cache = fiber.memoizedState.cachePool.pool;
- null != cache && cache.refCount++;
- }
+ null !== fiber.memoizedState &&
+ null !== fiber.memoizedState.cachePool &&
+ ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool),
+ null != nearestMountedAncestor && nearestMountedAncestor.refCount++);
break;
case 24:
releaseCache(fiber.memoizedState.cache);
}
- cache = fiber.child;
- if (null !== cache) (cache.return = fiber), (nextEffect = cache);
+ 0 !== (fiber.mode & 2) &&
+ 0 <= componentEffectStartTime &&
+ 0 <= componentEffectEndTime &&
+ 0.05 < componentEffectDuration &&
+ logComponentEffect(
+ fiber,
+ componentEffectStartTime,
+ componentEffectEndTime,
+ componentEffectDuration
+ );
+ popComponentEffectStart(prevEffectStart);
+ prevEffectStart = fiber.child;
+ if (null !== prevEffectStart)
+ (prevEffectStart.return = fiber), (nextEffect = prevEffectStart);
else
a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
- cache = nextEffect;
- var sibling = cache.sibling,
- returnFiber = cache.return;
- detachFiberAfterEffects(cache);
- if (cache === fiber) {
+ prevEffectStart = nextEffect;
+ nearestMountedAncestor = prevEffectStart.sibling;
+ var returnFiber = prevEffectStart.return;
+ detachFiberAfterEffects(prevEffectStart);
+ if (prevEffectStart === fiber) {
nextEffect = null;
break a;
}
- if (null !== sibling) {
- sibling.return = returnFiber;
- nextEffect = sibling;
+ if (null !== nearestMountedAncestor) {
+ nearestMountedAncestor.return = returnFiber;
+ nextEffect = nearestMountedAncestor;
break a;
}
nextEffect = returnFiber;
@@ -10540,14 +10725,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
break;
case "collapsed":
lastTailNode = renderState.tail;
- for (var lastTailNode$146 = null; null !== lastTailNode; )
- null !== lastTailNode.alternate && (lastTailNode$146 = lastTailNode),
+ for (var lastTailNode$149 = null; null !== lastTailNode; )
+ null !== lastTailNode.alternate && (lastTailNode$149 = lastTailNode),
(lastTailNode = lastTailNode.sibling);
- null === lastTailNode$146
+ null === lastTailNode$149
? hasRenderedATailFallback || null === renderState.tail
? (renderState.tail = null)
: (renderState.tail.sibling = null)
- : (lastTailNode$146.sibling = null);
+ : (lastTailNode$149.sibling = null);
}
}
function bubbleProperties(completedWork) {
@@ -10559,53 +10744,53 @@ function bubbleProperties(completedWork) {
if (didBailout)
if (0 !== (completedWork.mode & 2)) {
for (
- var treeBaseDuration$148 = completedWork.selfBaseDuration,
- child$149 = completedWork.child;
- null !== child$149;
+ var treeBaseDuration$151 = completedWork.selfBaseDuration,
+ child$152 = completedWork.child;
+ null !== child$152;
)
- (newChildLanes |= child$149.lanes | child$149.childLanes),
- (subtreeFlags |= child$149.subtreeFlags & 31457280),
- (subtreeFlags |= child$149.flags & 31457280),
- (treeBaseDuration$148 += child$149.treeBaseDuration),
- (child$149 = child$149.sibling);
- completedWork.treeBaseDuration = treeBaseDuration$148;
+ (newChildLanes |= child$152.lanes | child$152.childLanes),
+ (subtreeFlags |= child$152.subtreeFlags & 31457280),
+ (subtreeFlags |= child$152.flags & 31457280),
+ (treeBaseDuration$151 += child$152.treeBaseDuration),
+ (child$152 = child$152.sibling);
+ completedWork.treeBaseDuration = treeBaseDuration$151;
} else
for (
- treeBaseDuration$148 = completedWork.child;
- null !== treeBaseDuration$148;
+ treeBaseDuration$151 = completedWork.child;
+ null !== treeBaseDuration$151;
)
(newChildLanes |=
- treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes),
- (subtreeFlags |= treeBaseDuration$148.subtreeFlags & 31457280),
- (subtreeFlags |= treeBaseDuration$148.flags & 31457280),
- (treeBaseDuration$148.return = completedWork),
- (treeBaseDuration$148 = treeBaseDuration$148.sibling);
+ treeBaseDuration$151.lanes | treeBaseDuration$151.childLanes),
+ (subtreeFlags |= treeBaseDuration$151.subtreeFlags & 31457280),
+ (subtreeFlags |= treeBaseDuration$151.flags & 31457280),
+ (treeBaseDuration$151.return = completedWork),
+ (treeBaseDuration$151 = treeBaseDuration$151.sibling);
else if (0 !== (completedWork.mode & 2)) {
- treeBaseDuration$148 = completedWork.actualDuration;
- child$149 = completedWork.selfBaseDuration;
+ treeBaseDuration$151 = completedWork.actualDuration;
+ child$152 = completedWork.selfBaseDuration;
for (var child = completedWork.child; null !== child; )
(newChildLanes |= child.lanes | child.childLanes),
(subtreeFlags |= child.subtreeFlags),
(subtreeFlags |= child.flags),
- (treeBaseDuration$148 += child.actualDuration),
- (child$149 += child.treeBaseDuration),
+ (treeBaseDuration$151 += child.actualDuration),
+ (child$152 += child.treeBaseDuration),
(child = child.sibling);
- completedWork.actualDuration = treeBaseDuration$148;
- completedWork.treeBaseDuration = child$149;
+ completedWork.actualDuration = treeBaseDuration$151;
+ completedWork.treeBaseDuration = child$152;
} else
for (
- treeBaseDuration$148 = completedWork.child;
- null !== treeBaseDuration$148;
+ treeBaseDuration$151 = completedWork.child;
+ null !== treeBaseDuration$151;
)
(newChildLanes |=
- treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes),
- (subtreeFlags |= treeBaseDuration$148.subtreeFlags),
- (subtreeFlags |= treeBaseDuration$148.flags),
- (treeBaseDuration$148.return = completedWork),
- (treeBaseDuration$148 = treeBaseDuration$148.sibling);
+ treeBaseDuration$151.lanes | treeBaseDuration$151.childLanes),
+ (subtreeFlags |= treeBaseDuration$151.subtreeFlags),
+ (subtreeFlags |= treeBaseDuration$151.flags),
+ (treeBaseDuration$151.return = completedWork),
+ (treeBaseDuration$151 = treeBaseDuration$151.sibling);
completedWork.subtreeFlags |= subtreeFlags;
completedWork.childLanes = newChildLanes;
return didBailout;
@@ -10644,9 +10829,7 @@ function completeWork(current, workInProgress, renderLanes) {
(current.memoizedState.isDehydrated &&
0 === (workInProgress.flags & 256)) ||
((workInProgress.flags |= 1024),
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors),
- (hydrationErrors = null)));
+ upgradeHydrationErrorsToRecoverable());
bubbleProperties(workInProgress);
return null;
case 26:
@@ -10871,8 +11054,10 @@ function completeWork(current, workInProgress, renderLanes) {
(workInProgress.treeBaseDuration -= type.treeBaseDuration));
type = !1;
} else
- null !== hydrationErrors &&
- (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)),
+ (type = upgradeHydrationErrorsToRecoverable()),
+ null !== current &&
+ null !== current.memoizedState &&
+ (current.memoizedState.hydrationErrors = type),
(type = !0);
if (!type) {
if (workInProgress.flags & 256)
@@ -10898,11 +11083,11 @@ function completeWork(current, workInProgress, renderLanes) {
null !== newProps.alternate.memoizedState &&
null !== newProps.alternate.memoizedState.cachePool &&
(type = newProps.alternate.memoizedState.cachePool.pool);
- var cache$164 = null;
+ var cache$168 = null;
null !== newProps.memoizedState &&
null !== newProps.memoizedState.cachePool &&
- (cache$164 = newProps.memoizedState.cachePool.pool);
- cache$164 !== type && (newProps.flags |= 2048);
+ (cache$168 = newProps.memoizedState.cachePool.pool);
+ cache$168 !== type && (newProps.flags |= 2048);
}
renderLanes !== current &&
renderLanes &&
@@ -10932,8 +11117,8 @@ function completeWork(current, workInProgress, renderLanes) {
type = workInProgress.memoizedState;
if (null === type) return bubbleProperties(workInProgress), null;
newProps = 0 !== (workInProgress.flags & 128);
- cache$164 = type.rendering;
- if (null === cache$164)
+ cache$168 = type.rendering;
+ if (null === cache$168)
if (newProps) cutOffTailIfNeeded(type, !1);
else {
if (
@@ -10941,11 +11126,11 @@ function completeWork(current, workInProgress, renderLanes) {
(null !== current && 0 !== (current.flags & 128))
)
for (current = workInProgress.child; null !== current; ) {
- cache$164 = findFirstSuspended(current);
- if (null !== cache$164) {
+ cache$168 = findFirstSuspended(current);
+ if (null !== cache$168) {
workInProgress.flags |= 128;
cutOffTailIfNeeded(type, !1);
- current = cache$164.updateQueue;
+ current = cache$168.updateQueue;
workInProgress.updateQueue = current;
scheduleRetryEffect(workInProgress, current);
workInProgress.subtreeFlags = 0;
@@ -10970,7 +11155,7 @@ function completeWork(current, workInProgress, renderLanes) {
}
else {
if (!newProps)
- if (((current = findFirstSuspended(cache$164)), null !== current)) {
+ if (((current = findFirstSuspended(cache$168)), null !== current)) {
if (
((workInProgress.flags |= 128),
(newProps = !0),
@@ -10980,7 +11165,7 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(type, !0),
null === type.tail &&
"hidden" === type.tailMode &&
- !cache$164.alternate &&
+ !cache$168.alternate &&
!isHydrating)
)
return bubbleProperties(workInProgress), null;
@@ -10993,13 +11178,13 @@ function completeWork(current, workInProgress, renderLanes) {
cutOffTailIfNeeded(type, !1),
(workInProgress.lanes = 4194304));
type.isBackwards
- ? ((cache$164.sibling = workInProgress.child),
- (workInProgress.child = cache$164))
+ ? ((cache$168.sibling = workInProgress.child),
+ (workInProgress.child = cache$168))
: ((current = type.last),
null !== current
- ? (current.sibling = cache$164)
- : (workInProgress.child = cache$164),
- (type.last = cache$164));
+ ? (current.sibling = cache$168)
+ : (workInProgress.child = cache$168),
+ (type.last = cache$168));
}
if (null !== type.tail)
return (
@@ -11198,7 +11383,6 @@ var DefaultAsyncDispatcher = {
workInProgressRootRenderTargetTime = Infinity,
workInProgressTransitions = null,
legacyErrorBoundariesThatAlreadyFailed = null,
- rootDoesHavePassiveEffects = !1,
rootWithPendingPassiveEffects = null,
pendingPassiveEffectsLanes = 0,
pendingPassiveEffectsRemainingLanes = 0,
@@ -11254,7 +11438,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) {
)),
ensureRootIsScheduled(root);
}
-function performWorkOnRoot(root, lanes, forceSync) {
+function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
if (0 !== workInProgressRootRenderLanes && null !== workInProgress) {
var yieldEndTime = now$1();
@@ -11295,23 +11479,25 @@ function performWorkOnRoot(root, lanes, forceSync) {
}
}
var exitStatus = (yieldEndTime =
- (!forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) ||
- checkIfRootIsPrerendering(root, lanes))
- ? renderRootConcurrent(root, lanes)
- : renderRootSync(root, lanes, !0);
+ (!forceSync &&
+ 0 === (lanes & 60) &&
+ 0 === (lanes & root$jscomp$0.expiredLanes)) ||
+ checkIfRootIsPrerendering(root$jscomp$0, lanes))
+ ? renderRootConcurrent(root$jscomp$0, lanes)
+ : renderRootSync(root$jscomp$0, lanes, !0);
yieldDuration = yieldEndTime;
do {
if (0 === exitStatus) {
workInProgressRootIsPrerendering &&
!yieldEndTime &&
- markRootSuspended(root, lanes, 0, !1);
+ markRootSuspended(root$jscomp$0, lanes, 0, !1);
lanes = workInProgressSuspendedReason;
yieldStartTime = now();
yieldReason = lanes;
break;
} else {
startTime = now$1();
- forceSync = root.current.alternate;
+ forceSync = root$jscomp$0.current.alternate;
if (yieldDuration && !isRenderConsistentWithExternalStores(forceSync)) {
setCurrentTrackFromLanes(lanes);
forceSync = renderStartTime;
@@ -11322,16 +11508,16 @@ function performWorkOnRoot(root, lanes, forceSync) {
(reusableLaneOptions.end = yieldDuration),
performance.measure("Teared Render", reusableLaneOptions));
finalizeRender(lanes, startTime);
- exitStatus = renderRootSync(root, lanes, !1);
+ exitStatus = renderRootSync(root$jscomp$0, lanes, !1);
yieldDuration = !1;
continue;
}
if (2 === exitStatus) {
yieldDuration = lanes;
- if (root.errorRecoveryDisabledLanes & yieldDuration)
+ if (root$jscomp$0.errorRecoveryDisabledLanes & yieldDuration)
var JSCompiler_inline_result = 0;
else
- (JSCompiler_inline_result = root.pendingLanes & -536870913),
+ (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913),
(JSCompiler_inline_result =
0 !== JSCompiler_inline_result
? JSCompiler_inline_result
@@ -11343,35 +11529,27 @@ function performWorkOnRoot(root, lanes, forceSync) {
logErroredRenderPhase(renderStartTime, startTime);
finalizeRender(lanes, startTime);
lanes = JSCompiler_inline_result;
- a: {
- exitStatus = root;
- startTime = workInProgressRootConcurrentErrors;
- var wasRootDehydrated =
- exitStatus.current.memoizedState.isDehydrated;
- wasRootDehydrated &&
- (prepareFreshStack(exitStatus, JSCompiler_inline_result).flags |=
- 256);
- JSCompiler_inline_result = renderRootSync(
- exitStatus,
- JSCompiler_inline_result,
- !1
- );
- if (2 !== JSCompiler_inline_result) {
- if (
- workInProgressRootDidAttachPingListener &&
- !wasRootDehydrated
- ) {
- exitStatus.errorRecoveryDisabledLanes |= yieldDuration;
- workInProgressRootInterleavedUpdatedLanes |= yieldDuration;
- exitStatus = 4;
- break a;
- }
- yieldDuration = workInProgressRootRecoverableErrors;
- workInProgressRootRecoverableErrors = startTime;
- null !== yieldDuration && queueRecoverableErrors(yieldDuration);
- }
- exitStatus = JSCompiler_inline_result;
- }
+ var root = root$jscomp$0;
+ startTime = workInProgressRootConcurrentErrors;
+ var wasRootDehydrated = root.current.memoizedState.isDehydrated;
+ wasRootDehydrated &&
+ (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256);
+ exitStatus = renderRootSync(root, JSCompiler_inline_result, !1);
+ 2 !== exitStatus &&
+ (workInProgressRootDidAttachPingListener && !wasRootDehydrated
+ ? ((root.errorRecoveryDisabledLanes |= yieldDuration),
+ (workInProgressRootInterleavedUpdatedLanes |= yieldDuration),
+ (exitStatus = 4))
+ : ((yieldDuration = workInProgressRootRecoverableErrors),
+ (workInProgressRootRecoverableErrors = startTime),
+ null !== yieldDuration &&
+ ((startTime = yieldDuration),
+ null === workInProgressRootRecoverableErrors
+ ? (workInProgressRootRecoverableErrors = startTime)
+ : workInProgressRootRecoverableErrors.push.apply(
+ workInProgressRootRecoverableErrors,
+ startTime
+ ))));
yieldDuration = !1;
if (2 !== exitStatus) continue;
else startTime = now$1();
@@ -11381,12 +11559,12 @@ function performWorkOnRoot(root, lanes, forceSync) {
setCurrentTrackFromLanes(lanes);
logErroredRenderPhase(renderStartTime, startTime);
finalizeRender(lanes, startTime);
- prepareFreshStack(root, 0);
- markRootSuspended(root, lanes, 0, !0);
+ prepareFreshStack(root$jscomp$0, 0);
+ markRootSuspended(root$jscomp$0, lanes, 0, !0);
break;
}
a: {
- yieldEndTime = root;
+ yieldEndTime = root$jscomp$0;
yieldDuration = exitStatus;
switch (yieldDuration) {
case 0:
@@ -11396,7 +11574,7 @@ function performWorkOnRoot(root, lanes, forceSync) {
if ((lanes & 4194176) !== lanes) break;
case 6:
setCurrentTrackFromLanes(lanes);
- logSuspendedRenderPhase(renderStartTime, startTime);
+ logSuspendedRenderPhase(renderStartTime, startTime, lanes);
finalizeRender(lanes, startTime);
forceSync = lanes;
0 !== (forceSync & 3) || 0 !== (forceSync & 60)
@@ -11475,15 +11653,7 @@ function performWorkOnRoot(root, lanes, forceSync) {
}
break;
} while (1);
- ensureRootIsScheduled(root);
-}
-function queueRecoverableErrors(errors) {
- null === workInProgressRootRecoverableErrors
- ? (workInProgressRootRecoverableErrors = errors)
- : workInProgressRootRecoverableErrors.push.apply(
- workInProgressRootRecoverableErrors,
- errors
- );
+ ensureRootIsScheduled(root$jscomp$0);
}
function commitRootWhenReady(
root,
@@ -11608,7 +11778,7 @@ function resetWorkInProgressStack() {
var interruptedWork = workInProgress.return;
else
(interruptedWork = workInProgress),
- (lastContextDependency = currentlyRenderingFiber = null),
+ (lastContextDependency = currentlyRenderingFiber$1 = null),
resetHooksOnUnwind(interruptedWork),
(thenableState = null),
(thenableIndexCounter = 0),
@@ -11638,14 +11808,22 @@ function prepareFreshStack(root, lanes) {
3 === workInProgressRootExitStatus ||
4 === workInProgressRootExitStatus
)
- logSuspendedRenderPhase(previousRenderStartTime, renderStartTime);
+ logSuspendedRenderPhase(previousRenderStartTime, renderStartTime, lanes);
else {
var endTime = renderStartTime;
supportsUserTiming &&
- ((reusableLaneDevToolDetails.color = "primary-dark"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = endTime),
- performance.measure("Interrupted Render", reusableLaneOptions));
+ performance.measure(
+ (lanes & 536870912) === lanes
+ ? "Prewarm"
+ : (lanes & 201326677) === lanes
+ ? "Interrupted Hydration"
+ : "Interrupted Render",
+ reusableLaneOptions
+ ));
}
finalizeRender(workInProgressRootRenderLanes, renderStartTime);
}
@@ -11666,7 +11844,8 @@ function prepareFreshStack(root, lanes) {
? endTime
: 0 <= previousRenderStartTime
? previousRenderStartTime
- : renderStartTime
+ : renderStartTime,
+ lanes
));
var eventType = blockingEventType,
eventIsRepeat = blockingEventIsRepeat,
@@ -11688,7 +11867,8 @@ function prepareFreshStack(root, lanes) {
reusableLaneOptions
)),
0 < previousRenderStartTime &&
- ((reusableLaneDevToolDetails.color = "primary-light"),
+ ((reusableLaneDevToolDetails.color =
+ (lanes & 738197589) === lanes ? "tertiary-light" : "primary-light"),
(reusableLaneOptions.start = previousRenderStartTime),
(reusableLaneOptions.end = renderStartTime$jscomp$0),
performance.measure("Blocked", reusableLaneOptions)));
@@ -11712,7 +11892,8 @@ function prepareFreshStack(root, lanes) {
(setCurrentTrackFromLanes(lanes),
logSuspendedWithDelayPhase(
transitionSuspendedTime,
- 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime
+ 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime,
+ lanes
));
eventIsRepeat = transitionEventType;
renderStartTime$jscomp$0 = transitionEventIsRepeat;
@@ -11792,7 +11973,7 @@ function prepareFreshStack(root, lanes) {
return previousRenderStartTime;
}
function handleThrow(root, thrownValue) {
- currentlyRenderingFiber$1 = null;
+ currentlyRenderingFiber = null;
ReactSharedInternals.H = ContextOnlyDispatcher;
thrownValue === SuspenseException || thrownValue === SuspenseActionException
? ((thrownValue = getSuspendedThenable()),
@@ -11906,12 +12087,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) {
workLoopSync();
memoizedUpdaters = workInProgressRootExitStatus;
break;
- } catch (thrownValue$185) {
- handleThrow(root, thrownValue$185);
+ } catch (thrownValue$189) {
+ handleThrow(root, thrownValue$189);
}
while (1);
lanes && root.shellSuspendCounter++;
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
executionContext = prevExecutionContext;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
@@ -12028,11 +12209,11 @@ function renderRootConcurrent(root, lanes) {
}
workLoopConcurrent();
break;
- } catch (thrownValue$187) {
- handleThrow(root, thrownValue$187);
+ } catch (thrownValue$191) {
+ handleThrow(root, thrownValue$191);
}
while (1);
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
ReactSharedInternals.H = prevDispatcher;
ReactSharedInternals.A = prevAsyncDispatcher;
executionContext = prevExecutionContext;
@@ -12104,7 +12285,7 @@ function throwAndUnwindWorkLoop(
thrownValue,
suspendedReason
) {
- lastContextDependency = currentlyRenderingFiber = null;
+ lastContextDependency = currentlyRenderingFiber$1 = null;
resetHooksOnUnwind(unitOfWork);
thenableState = null;
thenableIndexCounter = 0;
@@ -12276,14 +12457,36 @@ function commitRootImpl(
setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate);
2 === exitStatus
? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime)
- : logRenderPhase(completedRenderStartTime, completedRenderEndTime);
+ : null !== recoverableErrors
+ ? supportsUserTiming &&
+ performance.measure("Recovered", {
+ start: completedRenderStartTime,
+ end: completedRenderEndTime,
+ detail: {
+ devtools: {
+ color: "primary-dark",
+ track: reusableLaneDevToolDetails.track,
+ trackGroup: "Scheduler \u269b",
+ tooltipText:
+ null !== finishedWork &&
+ null !== finishedWork.alternate &&
+ finishedWork.alternate.memoizedState.isDehydrated &&
+ 0 !== (finishedWork.flags & 256)
+ ? "Hydration Failed"
+ : "Recovered after Error",
+ properties: []
+ }
+ }
+ })
+ : logRenderPhase(
+ completedRenderStartTime,
+ completedRenderEndTime,
+ didIncludeRenderPhaseUpdate
+ );
if (null === finishedWork) return null;
root.finishedWork = null;
root.finishedLanes = 0;
if (finishedWork === root.current) throw Error(formatProdErrorMessage(177));
- root.callbackNode = null;
- root.callbackPriority = 0;
- root.cancelPendingCommit = null;
exitStatus = finishedWork.lanes | finishedWork.childLanes;
exitStatus |= concurrentlyUpdatedLanes;
markRootFinished(
@@ -12297,19 +12500,25 @@ function commitRootImpl(
root === workInProgressRoot &&
((workInProgress = workInProgressRoot = null),
(workInProgressRootRenderLanes = 0));
- (0 === finishedWork.actualDuration &&
- 0 === (finishedWork.subtreeFlags & 10256) &&
- 0 === (finishedWork.flags & 10256)) ||
- rootDoesHavePassiveEffects ||
- ((rootDoesHavePassiveEffects = !0),
- (pendingPassiveEffectsRemainingLanes = exitStatus),
- (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
- (pendingPassiveTransitions = transitions),
- scheduleCallback$1(NormalPriority$1, function () {
- schedulerEvent = window.event;
- flushPassiveEffects(!0);
- return null;
- }));
+ spawnedLane = !1;
+ 0 !== finishedWork.actualDuration ||
+ 0 !== (finishedWork.subtreeFlags & 10256) ||
+ 0 !== (finishedWork.flags & 10256)
+ ? ((spawnedLane = !0),
+ (pendingPassiveEffectsRemainingLanes = exitStatus),
+ (pendingPassiveEffectsRenderEndTime = completedRenderEndTime),
+ (pendingPassiveTransitions = transitions),
+ (root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null),
+ scheduleCallback$1(NormalPriority$1, function () {
+ schedulerEvent = window.event;
+ flushPassiveEffects(!0);
+ return null;
+ }))
+ : ((root.callbackNode = null),
+ (root.callbackPriority = 0),
+ (root.cancelPendingCommit = null));
commitStartTime = now();
1 === suspendedCommitReason
? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime)
@@ -12319,9 +12528,9 @@ function commitRootImpl(
0 !== (finishedWork.subtreeFlags & 15990) || transitions
? ((transitions = ReactSharedInternals.T),
(ReactSharedInternals.T = null),
- (spawnedLane = ReactDOMSharedInternals.p),
+ (updatedLanes = ReactDOMSharedInternals.p),
(ReactDOMSharedInternals.p = 2),
- (updatedLanes = executionContext),
+ (suspendedRetryLanes = executionContext),
(executionContext |= 4),
commitBeforeMutationEffects(root, finishedWork),
commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate),
@@ -12331,8 +12540,8 @@ function commitRootImpl(
(root.current = finishedWork),
commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate),
requestPaint(),
- (executionContext = updatedLanes),
- (ReactDOMSharedInternals.p = spawnedLane),
+ (executionContext = suspendedRetryLanes),
+ (ReactDOMSharedInternals.p = updatedLanes),
(ReactSharedInternals.T = transitions))
: (root.current = finishedWork);
commitEndTime = now();
@@ -12340,8 +12549,8 @@ function commitRootImpl(
0 === suspendedCommitReason ? completedRenderEndTime : commitStartTime,
commitEndTime
);
- (suspendedCommitReason = rootDoesHavePassiveEffects)
- ? ((rootDoesHavePassiveEffects = !1),
+ (suspendedCommitReason = spawnedLane)
+ ? ((spawnedLane = !1),
(rootWithPendingPassiveEffects = root),
(pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate))
: releaseRootPooledCache(root, exitStatus);
@@ -12349,7 +12558,6 @@ function commitRootImpl(
0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null);
onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
isDevToolsPresent && root.memoizedUpdaters.clear();
- ensureRootIsScheduled(root);
if (null !== recoverableErrors)
for (
renderPriorityLevel = root.onRecoverableError, completedRenderEndTime = 0;
@@ -12361,6 +12569,7 @@ function commitRootImpl(
componentStack: finishedWork.stack
});
0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects();
+ ensureRootIsScheduled(root);
exitStatus = root.pendingLanes;
0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42)
? ((nestedUpdateScheduled = !0),
@@ -12381,7 +12590,7 @@ function releaseRootPooledCache(root, remainingLanes) {
}
function flushPassiveEffects(wasDelayedCommit) {
if (null !== rootWithPendingPassiveEffects) {
- var root$191 = rootWithPendingPassiveEffects,
+ var root$195 = rootWithPendingPassiveEffects,
remainingLanes = pendingPassiveEffectsRemainingLanes;
pendingPassiveEffectsRemainingLanes = 0;
var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes),
@@ -12456,7 +12665,7 @@ function flushPassiveEffects(wasDelayedCommit) {
} finally {
(ReactDOMSharedInternals.p = previousPriority),
(ReactSharedInternals.T = prevTransition),
- releaseRootPooledCache(root$191, remainingLanes);
+ releaseRootPooledCache(root$195, remainingLanes);
}
}
return !1;
@@ -12611,14 +12820,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
isFlushingWork = !0;
do {
var didPerformSomeWork = !1;
- for (var root$193 = firstScheduledRoot; null !== root$193; ) {
+ for (var root$197 = firstScheduledRoot; null !== root$197; ) {
if (!onlyLegacy)
if (0 !== syncTransitionLanes) {
- var pendingLanes = root$193.pendingLanes;
+ var pendingLanes = root$197.pendingLanes;
if (0 === pendingLanes) var JSCompiler_inline_result = 0;
else {
- var suspendedLanes = root$193.suspendedLanes,
- pingedLanes = root$193.pingedLanes;
+ var suspendedLanes = root$197.suspendedLanes,
+ pingedLanes = root$197.pingedLanes;
JSCompiler_inline_result =
(1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1;
JSCompiler_inline_result &=
@@ -12632,18 +12841,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
}
0 !== JSCompiler_inline_result &&
((didPerformSomeWork = !0),
- performSyncWorkOnRoot(root$193, JSCompiler_inline_result));
+ performSyncWorkOnRoot(root$197, JSCompiler_inline_result));
} else
(JSCompiler_inline_result = workInProgressRootRenderLanes),
(JSCompiler_inline_result = getNextLanes(
- root$193,
- root$193 === workInProgressRoot ? JSCompiler_inline_result : 0
+ root$197,
+ root$197 === workInProgressRoot ? JSCompiler_inline_result : 0
)),
0 === (JSCompiler_inline_result & 3) ||
- checkIfRootIsPrerendering(root$193, JSCompiler_inline_result) ||
+ checkIfRootIsPrerendering(root$197, JSCompiler_inline_result) ||
((didPerformSomeWork = !0),
- performSyncWorkOnRoot(root$193, JSCompiler_inline_result));
- root$193 = root$193.next;
+ performSyncWorkOnRoot(root$197, JSCompiler_inline_result));
+ root$197 = root$197.next;
}
} while (didPerformSomeWork);
isFlushingWork = !1;
@@ -12881,20 +13090,20 @@ function extractEvents$1(
}
}
for (
- var i$jscomp$inline_1536 = 0;
- i$jscomp$inline_1536 < simpleEventPluginEvents.length;
- i$jscomp$inline_1536++
+ var i$jscomp$inline_1540 = 0;
+ i$jscomp$inline_1540 < simpleEventPluginEvents.length;
+ i$jscomp$inline_1540++
) {
- var eventName$jscomp$inline_1537 =
- simpleEventPluginEvents[i$jscomp$inline_1536],
- domEventName$jscomp$inline_1538 =
- eventName$jscomp$inline_1537.toLowerCase(),
- capitalizedEvent$jscomp$inline_1539 =
- eventName$jscomp$inline_1537[0].toUpperCase() +
- eventName$jscomp$inline_1537.slice(1);
+ var eventName$jscomp$inline_1541 =
+ simpleEventPluginEvents[i$jscomp$inline_1540],
+ domEventName$jscomp$inline_1542 =
+ eventName$jscomp$inline_1541.toLowerCase(),
+ capitalizedEvent$jscomp$inline_1543 =
+ eventName$jscomp$inline_1541[0].toUpperCase() +
+ eventName$jscomp$inline_1541.slice(1);
registerSimpleEvent(
- domEventName$jscomp$inline_1538,
- "on" + capitalizedEvent$jscomp$inline_1539
+ domEventName$jscomp$inline_1542,
+ "on" + capitalizedEvent$jscomp$inline_1543
);
}
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -14077,34 +14286,34 @@ function setInitialProperties(domElement, tag, props) {
defaultChecked = null;
for (hasSrc in props)
if (props.hasOwnProperty(hasSrc)) {
- var propValue$207 = props[hasSrc];
- if (null != propValue$207)
+ var propValue$211 = props[hasSrc];
+ if (null != propValue$211)
switch (hasSrc) {
case "name":
- hasSrcSet = propValue$207;
+ hasSrcSet = propValue$211;
break;
case "type":
- propValue = propValue$207;
+ propValue = propValue$211;
break;
case "checked":
- checked = propValue$207;
+ checked = propValue$211;
break;
case "defaultChecked":
- defaultChecked = propValue$207;
+ defaultChecked = propValue$211;
break;
case "value":
- propKey = propValue$207;
+ propKey = propValue$211;
break;
case "defaultValue":
- defaultValue = propValue$207;
+ defaultValue = propValue$211;
break;
case "children":
case "dangerouslySetInnerHTML":
- if (null != propValue$207)
+ if (null != propValue$211)
throw Error(formatProdErrorMessage(137, tag));
break;
default:
- setProp(domElement, tag, hasSrc, propValue$207, props, null);
+ setProp(domElement, tag, hasSrc, propValue$211, props, null);
}
}
initInput(
@@ -14241,14 +14450,14 @@ function setInitialProperties(domElement, tag, props) {
return;
default:
if (isCustomElement(tag)) {
- for (propValue$207 in props)
- props.hasOwnProperty(propValue$207) &&
- ((hasSrc = props[propValue$207]),
+ for (propValue$211 in props)
+ props.hasOwnProperty(propValue$211) &&
+ ((hasSrc = props[propValue$211]),
void 0 !== hasSrc &&
setPropOnCustomElement(
domElement,
tag,
- propValue$207,
+ propValue$211,
hasSrc,
props,
void 0
@@ -14296,14 +14505,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(domElement, tag, propKey, null, nextProps, lastProp);
}
}
- for (var propKey$224 in nextProps) {
- var propKey = nextProps[propKey$224];
- lastProp = lastProps[propKey$224];
+ for (var propKey$228 in nextProps) {
+ var propKey = nextProps[propKey$228];
+ lastProp = lastProps[propKey$228];
if (
- nextProps.hasOwnProperty(propKey$224) &&
+ nextProps.hasOwnProperty(propKey$228) &&
(null != propKey || null != lastProp)
)
- switch (propKey$224) {
+ switch (propKey$228) {
case "type":
type = propKey;
break;
@@ -14332,7 +14541,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(
domElement,
tag,
- propKey$224,
+ propKey$228,
propKey,
nextProps,
lastProp
@@ -14351,7 +14560,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
);
return;
case "select":
- propKey = value = defaultValue = propKey$224 = null;
+ propKey = value = defaultValue = propKey$228 = null;
for (type in lastProps)
if (
((lastDefaultValue = lastProps[type]),
@@ -14382,7 +14591,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
)
switch (name) {
case "value":
- propKey$224 = type;
+ propKey$228 = type;
break;
case "defaultValue":
defaultValue = type;
@@ -14403,15 +14612,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
tag = defaultValue;
lastProps = value;
nextProps = propKey;
- null != propKey$224
- ? updateOptions(domElement, !!lastProps, propKey$224, !1)
+ null != propKey$228
+ ? updateOptions(domElement, !!lastProps, propKey$228, !1)
: !!nextProps !== !!lastProps &&
(null != tag
? updateOptions(domElement, !!lastProps, tag, !0)
: updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1));
return;
case "textarea":
- propKey = propKey$224 = null;
+ propKey = propKey$228 = null;
for (defaultValue in lastProps)
if (
((name = lastProps[defaultValue]),
@@ -14435,7 +14644,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
)
switch (value) {
case "value":
- propKey$224 = name;
+ propKey$228 = name;
break;
case "defaultValue":
propKey = name;
@@ -14449,17 +14658,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
name !== type &&
setProp(domElement, tag, value, name, nextProps, type);
}
- updateTextarea(domElement, propKey$224, propKey);
+ updateTextarea(domElement, propKey$228, propKey);
return;
case "option":
- for (var propKey$240 in lastProps)
+ for (var propKey$244 in lastProps)
if (
- ((propKey$224 = lastProps[propKey$240]),
- lastProps.hasOwnProperty(propKey$240) &&
- null != propKey$224 &&
- !nextProps.hasOwnProperty(propKey$240))
+ ((propKey$228 = lastProps[propKey$244]),
+ lastProps.hasOwnProperty(propKey$244) &&
+ null != propKey$228 &&
+ !nextProps.hasOwnProperty(propKey$244))
)
- switch (propKey$240) {
+ switch (propKey$244) {
case "selected":
domElement.selected = !1;
break;
@@ -14467,33 +14676,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
setProp(
domElement,
tag,
- propKey$240,
+ propKey$244,
null,
nextProps,
- propKey$224
+ propKey$228
);
}
for (lastDefaultValue in nextProps)
if (
- ((propKey$224 = nextProps[lastDefaultValue]),
+ ((propKey$228 = nextProps[lastDefaultValue]),
(propKey = lastProps[lastDefaultValue]),
nextProps.hasOwnProperty(lastDefaultValue) &&
- propKey$224 !== propKey &&
- (null != propKey$224 || null != propKey))
+ propKey$228 !== propKey &&
+ (null != propKey$228 || null != propKey))
)
switch (lastDefaultValue) {
case "selected":
domElement.selected =
- propKey$224 &&
- "function" !== typeof propKey$224 &&
- "symbol" !== typeof propKey$224;
+ propKey$228 &&
+ "function" !== typeof propKey$228 &&
+ "symbol" !== typeof propKey$228;
break;
default:
setProp(
domElement,
tag,
lastDefaultValue,
- propKey$224,
+ propKey$228,
nextProps,
propKey
);
@@ -14514,24 +14723,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
case "track":
case "wbr":
case "menuitem":
- for (var propKey$245 in lastProps)
- (propKey$224 = lastProps[propKey$245]),
- lastProps.hasOwnProperty(propKey$245) &&
- null != propKey$224 &&
- !nextProps.hasOwnProperty(propKey$245) &&
- setProp(domElement, tag, propKey$245, null, nextProps, propKey$224);
+ for (var propKey$249 in lastProps)
+ (propKey$228 = lastProps[propKey$249]),
+ lastProps.hasOwnProperty(propKey$249) &&
+ null != propKey$228 &&
+ !nextProps.hasOwnProperty(propKey$249) &&
+ setProp(domElement, tag, propKey$249, null, nextProps, propKey$228);
for (checked in nextProps)
if (
- ((propKey$224 = nextProps[checked]),
+ ((propKey$228 = nextProps[checked]),
(propKey = lastProps[checked]),
nextProps.hasOwnProperty(checked) &&
- propKey$224 !== propKey &&
- (null != propKey$224 || null != propKey))
+ propKey$228 !== propKey &&
+ (null != propKey$228 || null != propKey))
)
switch (checked) {
case "children":
case "dangerouslySetInnerHTML":
- if (null != propKey$224)
+ if (null != propKey$228)
throw Error(formatProdErrorMessage(137, tag));
break;
default:
@@ -14539,7 +14748,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
domElement,
tag,
checked,
- propKey$224,
+ propKey$228,
nextProps,
propKey
);
@@ -14547,49 +14756,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
return;
default:
if (isCustomElement(tag)) {
- for (var propKey$250 in lastProps)
- (propKey$224 = lastProps[propKey$250]),
- lastProps.hasOwnProperty(propKey$250) &&
- void 0 !== propKey$224 &&
- !nextProps.hasOwnProperty(propKey$250) &&
+ for (var propKey$254 in lastProps)
+ (propKey$228 = lastProps[propKey$254]),
+ lastProps.hasOwnProperty(propKey$254) &&
+ void 0 !== propKey$228 &&
+ !nextProps.hasOwnProperty(propKey$254) &&
setPropOnCustomElement(
domElement,
tag,
- propKey$250,
+ propKey$254,
void 0,
nextProps,
- propKey$224
+ propKey$228
);
for (defaultChecked in nextProps)
- (propKey$224 = nextProps[defaultChecked]),
+ (propKey$228 = nextProps[defaultChecked]),
(propKey = lastProps[defaultChecked]),
!nextProps.hasOwnProperty(defaultChecked) ||
- propKey$224 === propKey ||
- (void 0 === propKey$224 && void 0 === propKey) ||
+ propKey$228 === propKey ||
+ (void 0 === propKey$228 && void 0 === propKey) ||
setPropOnCustomElement(
domElement,
tag,
defaultChecked,
- propKey$224,
+ propKey$228,
nextProps,
propKey
);
return;
}
}
- for (var propKey$255 in lastProps)
- (propKey$224 = lastProps[propKey$255]),
- lastProps.hasOwnProperty(propKey$255) &&
- null != propKey$224 &&
- !nextProps.hasOwnProperty(propKey$255) &&
- setProp(domElement, tag, propKey$255, null, nextProps, propKey$224);
+ for (var propKey$259 in lastProps)
+ (propKey$228 = lastProps[propKey$259]),
+ lastProps.hasOwnProperty(propKey$259) &&
+ null != propKey$228 &&
+ !nextProps.hasOwnProperty(propKey$259) &&
+ setProp(domElement, tag, propKey$259, null, nextProps, propKey$228);
for (lastProp in nextProps)
- (propKey$224 = nextProps[lastProp]),
+ (propKey$228 = nextProps[lastProp]),
(propKey = lastProps[lastProp]),
!nextProps.hasOwnProperty(lastProp) ||
- propKey$224 === propKey ||
- (null == propKey$224 && null == propKey) ||
- setProp(domElement, tag, lastProp, propKey$224, nextProps, propKey);
+ propKey$228 === propKey ||
+ (null == propKey$228 && null == propKey) ||
+ setProp(domElement, tag, lastProp, propKey$228, nextProps, propKey);
}
var eventsEnabled = null,
selectionInformation = null;
@@ -15162,26 +15371,26 @@ function getResource(type, currentProps, pendingProps, currentResource) {
"string" === typeof pendingProps.precedence
) {
type = getStyleKey(pendingProps.href);
- var styles$263 = getResourcesFromRoot(
+ var styles$267 = getResourcesFromRoot(
JSCompiler_inline_result
).hoistableStyles,
- resource$264 = styles$263.get(type);
- resource$264 ||
+ resource$268 = styles$267.get(type);
+ resource$268 ||
((JSCompiler_inline_result =
JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result),
- (resource$264 = {
+ (resource$268 = {
type: "stylesheet",
instance: null,
count: 0,
state: { loading: 0, preload: null }
}),
- styles$263.set(type, resource$264),
- (styles$263 = JSCompiler_inline_result.querySelector(
+ styles$267.set(type, resource$268),
+ (styles$267 = JSCompiler_inline_result.querySelector(
getStylesheetSelectorFromKey(type)
)) &&
- !styles$263._p &&
- ((resource$264.instance = styles$263),
- (resource$264.state.loading = 5)),
+ !styles$267._p &&
+ ((resource$268.instance = styles$267),
+ (resource$268.state.loading = 5)),
preloadPropsMap.has(type) ||
((pendingProps = {
rel: "preload",
@@ -15194,16 +15403,16 @@ function getResource(type, currentProps, pendingProps, currentResource) {
referrerPolicy: pendingProps.referrerPolicy
}),
preloadPropsMap.set(type, pendingProps),
- styles$263 ||
+ styles$267 ||
preloadStylesheet(
JSCompiler_inline_result,
type,
pendingProps,
- resource$264.state
+ resource$268.state
)));
if (currentProps && null === currentResource)
throw Error(formatProdErrorMessage(528, ""));
- return resource$264;
+ return resource$268;
}
if (currentProps && null !== currentResource)
throw Error(formatProdErrorMessage(529, ""));
@@ -15300,37 +15509,37 @@ function acquireResource(hoistableRoot, resource, props) {
return (resource.instance = instance);
case "stylesheet":
styleProps = getStyleKey(props.href);
- var instance$269 = hoistableRoot.querySelector(
+ var instance$273 = hoistableRoot.querySelector(
getStylesheetSelectorFromKey(styleProps)
);
- if (instance$269)
+ if (instance$273)
return (
(resource.state.loading |= 4),
- (resource.instance = instance$269),
- markNodeAsHoistable(instance$269),
- instance$269
+ (resource.instance = instance$273),
+ markNodeAsHoistable(instance$273),
+ instance$273
);
instance = stylesheetPropsFromRawProps(props);
(styleProps = preloadPropsMap.get(styleProps)) &&
adoptPreloadPropsForStylesheet(instance, styleProps);
- instance$269 = (
+ instance$273 = (
hoistableRoot.ownerDocument || hoistableRoot
).createElement("link");
- markNodeAsHoistable(instance$269);
- var linkInstance = instance$269;
+ markNodeAsHoistable(instance$273);
+ var linkInstance = instance$273;
linkInstance._p = new Promise(function (resolve, reject) {
linkInstance.onload = resolve;
linkInstance.onerror = reject;
});
- setInitialProperties(instance$269, "link", instance);
+ setInitialProperties(instance$273, "link", instance);
resource.state.loading |= 4;
- insertStylesheet(instance$269, props.precedence, hoistableRoot);
- return (resource.instance = instance$269);
+ insertStylesheet(instance$273, props.precedence, hoistableRoot);
+ return (resource.instance = instance$273);
case "script":
- instance$269 = getScriptKey(props.src);
+ instance$273 = getScriptKey(props.src);
if (
(styleProps = hoistableRoot.querySelector(
- getScriptSelectorFromKey(instance$269)
+ getScriptSelectorFromKey(instance$273)
))
)
return (
@@ -15339,7 +15548,7 @@ function acquireResource(hoistableRoot, resource, props) {
styleProps
);
instance = props;
- if ((styleProps = preloadPropsMap.get(instance$269)))
+ if ((styleProps = preloadPropsMap.get(instance$273)))
(instance = assign({}, props)),
adoptPreloadPropsForScript(instance, styleProps);
hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -16177,8 +16386,9 @@ function attemptExplicitHydrationTarget(queuedTarget) {
queuedTarget.blockedOn = targetInst;
runWithPriority(queuedTarget.priority, function () {
if (13 === nearestMounted.tag) {
- var lane = requestUpdateLane(),
- root = enqueueConcurrentRenderForLane(nearestMounted, lane);
+ var lane = requestUpdateLane();
+ lane = getBumpedLaneForHydrationByLane(lane);
+ var root = enqueueConcurrentRenderForLane(nearestMounted, lane);
null !== root &&
scheduleUpdateOnFiber(root, nearestMounted, lane);
markRetryLaneIfNotHydrated(nearestMounted, lane);
@@ -16380,16 +16590,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
0 === i && attemptExplicitHydrationTarget(target);
}
};
-var isomorphicReactPackageVersion$jscomp$inline_1783 = React.version;
+var isomorphicReactPackageVersion$jscomp$inline_1787 = React.version;
if (
- "19.0.0-experimental-372ec00c-20241209" !==
- isomorphicReactPackageVersion$jscomp$inline_1783
+ "19.1.0-experimental-518d06d2-20241219" !==
+ isomorphicReactPackageVersion$jscomp$inline_1787
)
throw Error(
formatProdErrorMessage(
527,
- isomorphicReactPackageVersion$jscomp$inline_1783,
- "19.0.0-experimental-372ec00c-20241209"
+ isomorphicReactPackageVersion$jscomp$inline_1787,
+ "19.1.0-experimental-518d06d2-20241219"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16409,25 +16619,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
null === componentOrElement ? null : componentOrElement.stateNode;
return componentOrElement;
};
-var internals$jscomp$inline_2225 = {
+var internals$jscomp$inline_2240 = {
bundleType: 0,
- version: "19.0.0-experimental-372ec00c-20241209",
+ version: "19.1.0-experimental-518d06d2-20241219",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
- findFiberByHostInstance: getClosestInstanceFromNode,
- reconcilerVersion: "19.0.0-experimental-372ec00c-20241209"
+ reconcilerVersion: "19.1.0-experimental-518d06d2-20241219"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
- var hook$jscomp$inline_2226 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
+ var hook$jscomp$inline_2241 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
- !hook$jscomp$inline_2226.isDisabled &&
- hook$jscomp$inline_2226.supportsFiber
+ !hook$jscomp$inline_2241.isDisabled &&
+ hook$jscomp$inline_2241.supportsFiber
)
try {
- (rendererID = hook$jscomp$inline_2226.inject(
- internals$jscomp$inline_2225
+ (rendererID = hook$jscomp$inline_2241.inject(
+ internals$jscomp$inline_2240
)),
- (injectedHook = hook$jscomp$inline_2226);
+ (injectedHook = hook$jscomp$inline_2241);
} catch (err) {}
}
function noop() {}
@@ -16550,11 +16759,13 @@ exports.hydrateRoot = function (container, initialChildren, options) {
initialChildren.context = getContextForSubtree(null);
options = initialChildren.current;
isStrictMode = requestUpdateLane();
+ isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
identifierPrefix = createUpdate(isStrictMode);
identifierPrefix.callback = null;
enqueueUpdate(options, identifierPrefix, isStrictMode);
- initialChildren.current.lanes = isStrictMode;
- markRootUpdated$1(initialChildren, isStrictMode);
+ options = isStrictMode;
+ initialChildren.current.lanes = options;
+ markRootUpdated$1(initialChildren, options);
ensureRootIsScheduled(initialChildren);
container[internalContainerInstanceKey] = initialChildren.current;
listenToAllSupportedEvents(container);
@@ -16680,7 +16891,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
-exports.version = "19.0.0-experimental-372ec00c-20241209";
+exports.version = "19.1.0-experimental-518d06d2-20241219";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
index 28e492d8c272d..b098e482cc63d 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js
@@ -2132,7 +2132,7 @@
: children$jscomp$6;
Array.isArray(children$jscomp$6) && 1 < children$jscomp$6.length
? console.error(
- "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert `children` of tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.",
+ "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of tags as Text content and React expects to be able to convert `children` of tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be common to combine text nodes and value nodes. For example: hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.",
children$jscomp$6.length
)
: "function" === typeof child || "symbol" === typeof child
@@ -3999,9 +3999,6 @@
index
);
}
- function unsupportedRefresh() {
- throw Error("Cache cannot be refreshed during server rendering.");
- }
function noop$1() {}
function disabledLog() {}
function disableLogs() {
@@ -4247,7 +4244,7 @@
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
if ("function" === typeof type)
return type.prototype && type.prototype.isReactComponent
- ? ((type = describeNativeComponentFrame(type, !0)), type)
+ ? describeNativeComponentFrame(type, !0)
: describeNativeComponentFrame(type, !1);
if ("object" === typeof type && null !== type) {
switch (type.$$typeof) {
@@ -5291,7 +5288,6 @@
} else {
switch (type) {
case REACT_LEGACY_HIDDEN_TYPE:
- case REACT_DEBUG_TRACING_MODE_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_PROFILER_TYPE:
case REACT_FRAGMENT_TYPE:
@@ -7848,10 +7844,8 @@
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_SCOPE_TYPE = Symbol.for("react.scope"),
- REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
REACT_POSTPONE_TYPE = Symbol.for("react.postpone"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
ASYNC_ITERATOR = Symbol.asyncIterator,
@@ -9195,29 +9189,21 @@
);
return getServerSnapshot();
},
- useCacheRefresh: function () {
- return unsupportedRefresh;
- },
- useEffectEvent: function () {
- return throwOnUseEffectEventCall;
- },
- useMemoCache: function (size) {
- for (var data = Array(size), i = 0; i < size; i++)
- data[i] = REACT_MEMO_CACHE_SENTINEL;
- return data;
+ useOptimistic: function (passthrough) {
+ resolveCurrentlyRenderingComponent();
+ return [passthrough, unsupportedSetOptimisticState];
},
+ useActionState: useActionState,
+ useFormState: useActionState,
useHostTransitionStatus: function () {
resolveCurrentlyRenderingComponent();
return NotPending;
},
- useOptimistic: function (passthrough) {
- resolveCurrentlyRenderingComponent();
- return [passthrough, unsupportedSetOptimisticState];
+ useEffectEvent: function () {
+ return throwOnUseEffectEventCall;
}
- };
- HooksDispatcher.useFormState = useActionState;
- HooksDispatcher.useActionState = useActionState;
- var currentResumableState = null,
+ },
+ currentResumableState = null,
currentTaskInDEV = null,
DefaultAsyncDispatcher = {
getCacheForType: function () {
@@ -9295,5 +9281,5 @@
'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-experimental-372ec00c-20241209";
+ exports.version = "19.1.0-experimental-518d06d2-20241219";
})();
diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
index 47b51cb2f4593..81219fffe7971 100644
--- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
+++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js
@@ -64,10 +64,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_SCOPE_TYPE = Symbol.for("react.scope"),
- REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"),
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
REACT_POSTPONE_TYPE = Symbol.for("react.postpone"),
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
ASYNC_ITERATOR = Symbol.asyncIterator,
@@ -2668,16 +2666,16 @@ function createRenderState(resumableState, generateStaticMarkup) {
"\x3c/script>"
);
bootstrapScriptContent = idPrefix + "P:";
- var JSCompiler_object_inline_segmentPrefix_1643 = idPrefix + "S:";
+ var JSCompiler_object_inline_segmentPrefix_1640 = idPrefix + "S:";
idPrefix += "B:";
- var JSCompiler_object_inline_preconnects_1657 = new Set(),
- JSCompiler_object_inline_fontPreloads_1658 = new Set(),
- JSCompiler_object_inline_highImagePreloads_1659 = new Set(),
- JSCompiler_object_inline_styles_1660 = new Map(),
- JSCompiler_object_inline_bootstrapScripts_1661 = new Set(),
- JSCompiler_object_inline_scripts_1662 = new Set(),
- JSCompiler_object_inline_bulkPreloads_1663 = new Set(),
- JSCompiler_object_inline_preloads_1664 = {
+ var JSCompiler_object_inline_preconnects_1654 = new Set(),
+ JSCompiler_object_inline_fontPreloads_1655 = new Set(),
+ JSCompiler_object_inline_highImagePreloads_1656 = new Set(),
+ JSCompiler_object_inline_styles_1657 = new Map(),
+ JSCompiler_object_inline_bootstrapScripts_1658 = new Set(),
+ JSCompiler_object_inline_scripts_1659 = new Set(),
+ JSCompiler_object_inline_bulkPreloads_1660 = new Set(),
+ JSCompiler_object_inline_preloads_1661 = {
images: new Map(),
stylesheets: new Map(),
scripts: new Map(),
@@ -2714,7 +2712,7 @@ function createRenderState(resumableState, generateStaticMarkup) {
scriptConfig.moduleScriptResources[href] = null;
scriptConfig = [];
pushLinkImpl(scriptConfig, props);
- JSCompiler_object_inline_bootstrapScripts_1661.add(scriptConfig);
+ JSCompiler_object_inline_bootstrapScripts_1658.add(scriptConfig);
bootstrapChunks.push('