PluginProbe
Gutenberg / 22.7.0
Gutenberg v22.7.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
gutenberg / build / scripts / vendors / react-dom.js

react-dom.js in Gutenberg 22.7.0, at build/scripts/vendors/react-dom.js

21,691 lines 952.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 var ReactDOM = (() => {
3 var __getOwnPropNames = Object.getOwnPropertyNames;
4 var __commonJS = (cb, mod) => function __require() {
5 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6 };
7
8 // react-external:react
9 var require_react = __commonJS({
10 "react-external:react"(exports, module) {
11 module.exports = globalThis.React;
12 }
13 });
14
15 // node_modules/scheduler/cjs/scheduler.development.js
16 var require_scheduler_development = __commonJS({
17 "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
18 "use strict";
19 if (true) {
20 (function() {
21 "use strict";
22 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
23 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
24 }
25 var enableSchedulerDebugging = false;
26 var enableProfiling = false;
27 var frameYieldMs = 5;
28 function push(heap, node) {
29 var index = heap.length;
30 heap.push(node);
31 siftUp(heap, node, index);
32 }
33 function peek(heap) {
34 return heap.length === 0 ? null : heap[0];
35 }
36 function pop(heap) {
37 if (heap.length === 0) {
38 return null;
39 }
40 var first = heap[0];
41 var last = heap.pop();
42 if (last !== first) {
43 heap[0] = last;
44 siftDown(heap, last, 0);
45 }
46 return first;
47 }
48 function siftUp(heap, node, i) {
49 var index = i;
50 while (index > 0) {
51 var parentIndex = index - 1 >>> 1;
52 var parent = heap[parentIndex];
53 if (compare(parent, node) > 0) {
54 heap[parentIndex] = node;
55 heap[index] = parent;
56 index = parentIndex;
57 } else {
58 return;
59 }
60 }
61 }
62 function siftDown(heap, node, i) {
63 var index = i;
64 var length = heap.length;
65 var halfLength = length >>> 1;
66 while (index < halfLength) {
67 var leftIndex = (index + 1) * 2 - 1;
68 var left = heap[leftIndex];
69 var rightIndex = leftIndex + 1;
70 var right = heap[rightIndex];
71 if (compare(left, node) < 0) {
72 if (rightIndex < length && compare(right, left) < 0) {
73 heap[index] = right;
74 heap[rightIndex] = node;
75 index = rightIndex;
76 } else {
77 heap[index] = left;
78 heap[leftIndex] = node;
79 index = leftIndex;
80 }
81 } else if (rightIndex < length && compare(right, node) < 0) {
82 heap[index] = right;
83 heap[rightIndex] = node;
84 index = rightIndex;
85 } else {
86 return;
87 }
88 }
89 }
90 function compare(a, b) {
91 var diff = a.sortIndex - b.sortIndex;
92 return diff !== 0 ? diff : a.id - b.id;
93 }
94 var ImmediatePriority = 1;
95 var UserBlockingPriority = 2;
96 var NormalPriority = 3;
97 var LowPriority = 4;
98 var IdlePriority = 5;
99 function markTaskErrored(task, ms) {
100 }
101 var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
102 if (hasPerformanceNow) {
103 var localPerformance = performance;
104 exports.unstable_now = function() {
105 return localPerformance.now();
106 };
107 } else {
108 var localDate = Date;
109 var initialTime = localDate.now();
110 exports.unstable_now = function() {
111 return localDate.now() - initialTime;
112 };
113 }
114 var maxSigned31BitInt = 1073741823;
115 var IMMEDIATE_PRIORITY_TIMEOUT = -1;
116 var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
117 var NORMAL_PRIORITY_TIMEOUT = 5e3;
118 var LOW_PRIORITY_TIMEOUT = 1e4;
119 var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
120 var taskQueue = [];
121 var timerQueue = [];
122 var taskIdCounter = 1;
123 var currentTask = null;
124 var currentPriorityLevel = NormalPriority;
125 var isPerformingWork = false;
126 var isHostCallbackScheduled = false;
127 var isHostTimeoutScheduled = false;
128 var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
129 var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
130 var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
131 var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
132 function advanceTimers(currentTime) {
133 var timer = peek(timerQueue);
134 while (timer !== null) {
135 if (timer.callback === null) {
136 pop(timerQueue);
137 } else if (timer.startTime <= currentTime) {
138 pop(timerQueue);
139 timer.sortIndex = timer.expirationTime;
140 push(taskQueue, timer);
141 } else {
142 return;
143 }
144 timer = peek(timerQueue);
145 }
146 }
147 function handleTimeout(currentTime) {
148 isHostTimeoutScheduled = false;
149 advanceTimers(currentTime);
150 if (!isHostCallbackScheduled) {
151 if (peek(taskQueue) !== null) {
152 isHostCallbackScheduled = true;
153 requestHostCallback(flushWork);
154 } else {
155 var firstTimer = peek(timerQueue);
156 if (firstTimer !== null) {
157 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
158 }
159 }
160 }
161 }
162 function flushWork(hasTimeRemaining, initialTime2) {
163 isHostCallbackScheduled = false;
164 if (isHostTimeoutScheduled) {
165 isHostTimeoutScheduled = false;
166 cancelHostTimeout();
167 }
168 isPerformingWork = true;
169 var previousPriorityLevel = currentPriorityLevel;
170 try {
171 if (enableProfiling) {
172 try {
173 return workLoop(hasTimeRemaining, initialTime2);
174 } catch (error) {
175 if (currentTask !== null) {
176 var currentTime = exports.unstable_now();
177 markTaskErrored(currentTask, currentTime);
178 currentTask.isQueued = false;
179 }
180 throw error;
181 }
182 } else {
183 return workLoop(hasTimeRemaining, initialTime2);
184 }
185 } finally {
186 currentTask = null;
187 currentPriorityLevel = previousPriorityLevel;
188 isPerformingWork = false;
189 }
190 }
191 function workLoop(hasTimeRemaining, initialTime2) {
192 var currentTime = initialTime2;
193 advanceTimers(currentTime);
194 currentTask = peek(taskQueue);
195 while (currentTask !== null && !enableSchedulerDebugging) {
196 if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
197 break;
198 }
199 var callback = currentTask.callback;
200 if (typeof callback === "function") {
201 currentTask.callback = null;
202 currentPriorityLevel = currentTask.priorityLevel;
203 var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
204 var continuationCallback = callback(didUserCallbackTimeout);
205 currentTime = exports.unstable_now();
206 if (typeof continuationCallback === "function") {
207 currentTask.callback = continuationCallback;
208 } else {
209 if (currentTask === peek(taskQueue)) {
210 pop(taskQueue);
211 }
212 }
213 advanceTimers(currentTime);
214 } else {
215 pop(taskQueue);
216 }
217 currentTask = peek(taskQueue);
218 }
219 if (currentTask !== null) {
220 return true;
221 } else {
222 var firstTimer = peek(timerQueue);
223 if (firstTimer !== null) {
224 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
225 }
226 return false;
227 }
228 }
229 function unstable_runWithPriority(priorityLevel, eventHandler) {
230 switch (priorityLevel) {
231 case ImmediatePriority:
232 case UserBlockingPriority:
233 case NormalPriority:
234 case LowPriority:
235 case IdlePriority:
236 break;
237 default:
238 priorityLevel = NormalPriority;
239 }
240 var previousPriorityLevel = currentPriorityLevel;
241 currentPriorityLevel = priorityLevel;
242 try {
243 return eventHandler();
244 } finally {
245 currentPriorityLevel = previousPriorityLevel;
246 }
247 }
248 function unstable_next(eventHandler) {
249 var priorityLevel;
250 switch (currentPriorityLevel) {
251 case ImmediatePriority:
252 case UserBlockingPriority:
253 case NormalPriority:
254 priorityLevel = NormalPriority;
255 break;
256 default:
257 priorityLevel = currentPriorityLevel;
258 break;
259 }
260 var previousPriorityLevel = currentPriorityLevel;
261 currentPriorityLevel = priorityLevel;
262 try {
263 return eventHandler();
264 } finally {
265 currentPriorityLevel = previousPriorityLevel;
266 }
267 }
268 function unstable_wrapCallback(callback) {
269 var parentPriorityLevel = currentPriorityLevel;
270 return function() {
271 var previousPriorityLevel = currentPriorityLevel;
272 currentPriorityLevel = parentPriorityLevel;
273 try {
274 return callback.apply(this, arguments);
275 } finally {
276 currentPriorityLevel = previousPriorityLevel;
277 }
278 };
279 }
280 function unstable_scheduleCallback(priorityLevel, callback, options) {
281 var currentTime = exports.unstable_now();
282 var startTime2;
283 if (typeof options === "object" && options !== null) {
284 var delay = options.delay;
285 if (typeof delay === "number" && delay > 0) {
286 startTime2 = currentTime + delay;
287 } else {
288 startTime2 = currentTime;
289 }
290 } else {
291 startTime2 = currentTime;
292 }
293 var timeout;
294 switch (priorityLevel) {
295 case ImmediatePriority:
296 timeout = IMMEDIATE_PRIORITY_TIMEOUT;
297 break;
298 case UserBlockingPriority:
299 timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
300 break;
301 case IdlePriority:
302 timeout = IDLE_PRIORITY_TIMEOUT;
303 break;
304 case LowPriority:
305 timeout = LOW_PRIORITY_TIMEOUT;
306 break;
307 case NormalPriority:
308 default:
309 timeout = NORMAL_PRIORITY_TIMEOUT;
310 break;
311 }
312 var expirationTime = startTime2 + timeout;
313 var newTask = {
314 id: taskIdCounter++,
315 callback,
316 priorityLevel,
317 startTime: startTime2,
318 expirationTime,
319 sortIndex: -1
320 };
321 if (startTime2 > currentTime) {
322 newTask.sortIndex = startTime2;
323 push(timerQueue, newTask);
324 if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
325 if (isHostTimeoutScheduled) {
326 cancelHostTimeout();
327 } else {
328 isHostTimeoutScheduled = true;
329 }
330 requestHostTimeout(handleTimeout, startTime2 - currentTime);
331 }
332 } else {
333 newTask.sortIndex = expirationTime;
334 push(taskQueue, newTask);
335 if (!isHostCallbackScheduled && !isPerformingWork) {
336 isHostCallbackScheduled = true;
337 requestHostCallback(flushWork);
338 }
339 }
340 return newTask;
341 }
342 function unstable_pauseExecution() {
343 }
344 function unstable_continueExecution() {
345 if (!isHostCallbackScheduled && !isPerformingWork) {
346 isHostCallbackScheduled = true;
347 requestHostCallback(flushWork);
348 }
349 }
350 function unstable_getFirstCallbackNode() {
351 return peek(taskQueue);
352 }
353 function unstable_cancelCallback(task) {
354 task.callback = null;
355 }
356 function unstable_getCurrentPriorityLevel() {
357 return currentPriorityLevel;
358 }
359 var isMessageLoopRunning = false;
360 var scheduledHostCallback = null;
361 var taskTimeoutID = -1;
362 var frameInterval = frameYieldMs;
363 var startTime = -1;
364 function shouldYieldToHost() {
365 var timeElapsed = exports.unstable_now() - startTime;
366 if (timeElapsed < frameInterval) {
367 return false;
368 }
369 return true;
370 }
371 function requestPaint() {
372 }
373 function forceFrameRate(fps) {
374 if (fps < 0 || fps > 125) {
375 console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
376 return;
377 }
378 if (fps > 0) {
379 frameInterval = Math.floor(1e3 / fps);
380 } else {
381 frameInterval = frameYieldMs;
382 }
383 }
384 var performWorkUntilDeadline = function() {
385 if (scheduledHostCallback !== null) {
386 var currentTime = exports.unstable_now();
387 startTime = currentTime;
388 var hasTimeRemaining = true;
389 var hasMoreWork = true;
390 try {
391 hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
392 } finally {
393 if (hasMoreWork) {
394 schedulePerformWorkUntilDeadline();
395 } else {
396 isMessageLoopRunning = false;
397 scheduledHostCallback = null;
398 }
399 }
400 } else {
401 isMessageLoopRunning = false;
402 }
403 };
404 var schedulePerformWorkUntilDeadline;
405 if (typeof localSetImmediate === "function") {
406 schedulePerformWorkUntilDeadline = function() {
407 localSetImmediate(performWorkUntilDeadline);
408 };
409 } else if (typeof MessageChannel !== "undefined") {
410 var channel = new MessageChannel();
411 var port = channel.port2;
412 channel.port1.onmessage = performWorkUntilDeadline;
413 schedulePerformWorkUntilDeadline = function() {
414 port.postMessage(null);
415 };
416 } else {
417 schedulePerformWorkUntilDeadline = function() {
418 localSetTimeout(performWorkUntilDeadline, 0);
419 };
420 }
421 function requestHostCallback(callback) {
422 scheduledHostCallback = callback;
423 if (!isMessageLoopRunning) {
424 isMessageLoopRunning = true;
425 schedulePerformWorkUntilDeadline();
426 }
427 }
428 function requestHostTimeout(callback, ms) {
429 taskTimeoutID = localSetTimeout(function() {
430 callback(exports.unstable_now());
431 }, ms);
432 }
433 function cancelHostTimeout() {
434 localClearTimeout(taskTimeoutID);
435 taskTimeoutID = -1;
436 }
437 var unstable_requestPaint = requestPaint;
438 var unstable_Profiling = null;
439 exports.unstable_IdlePriority = IdlePriority;
440 exports.unstable_ImmediatePriority = ImmediatePriority;
441 exports.unstable_LowPriority = LowPriority;
442 exports.unstable_NormalPriority = NormalPriority;
443 exports.unstable_Profiling = unstable_Profiling;
444 exports.unstable_UserBlockingPriority = UserBlockingPriority;
445 exports.unstable_cancelCallback = unstable_cancelCallback;
446 exports.unstable_continueExecution = unstable_continueExecution;
447 exports.unstable_forceFrameRate = forceFrameRate;
448 exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
449 exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
450 exports.unstable_next = unstable_next;
451 exports.unstable_pauseExecution = unstable_pauseExecution;
452 exports.unstable_requestPaint = unstable_requestPaint;
453 exports.unstable_runWithPriority = unstable_runWithPriority;
454 exports.unstable_scheduleCallback = unstable_scheduleCallback;
455 exports.unstable_shouldYield = shouldYieldToHost;
456 exports.unstable_wrapCallback = unstable_wrapCallback;
457 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
458 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
459 }
460 })();
461 }
462 }
463 });
464
465 // node_modules/scheduler/index.js
466 var require_scheduler = __commonJS({
467 "node_modules/scheduler/index.js"(exports, module) {
468 "use strict";
469 if (false) {
470 module.exports = null;
471 } else {
472 module.exports = require_scheduler_development();
473 }
474 }
475 });
476
477 // node_modules/react-dom/cjs/react-dom.development.js
478 var require_react_dom_development = __commonJS({
479 "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
480 "use strict";
481 if (true) {
482 (function() {
483 "use strict";
484 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
485 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
486 }
487 var React = require_react();
488 var Scheduler = require_scheduler();
489 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
490 var suppressWarning = false;
491 function setSuppressWarning(newSuppressWarning) {
492 {
493 suppressWarning = newSuppressWarning;
494 }
495 }
496 function warn(format) {
497 {
498 if (!suppressWarning) {
499 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
500 args[_key - 1] = arguments[_key];
501 }
502 printWarning("warn", format, args);
503 }
504 }
505 }
506 function error(format) {
507 {
508 if (!suppressWarning) {
509 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
510 args[_key2 - 1] = arguments[_key2];
511 }
512 printWarning("error", format, args);
513 }
514 }
515 }
516 function printWarning(level, format, args) {
517 {
518 var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
519 var stack = ReactDebugCurrentFrame2.getStackAddendum();
520 if (stack !== "") {
521 format += "%s";
522 args = args.concat([stack]);
523 }
524 var argsWithFormat = args.map(function(item) {
525 return String(item);
526 });
527 argsWithFormat.unshift("Warning: " + format);
528 Function.prototype.apply.call(console[level], console, argsWithFormat);
529 }
530 }
531 var FunctionComponent = 0;
532 var ClassComponent = 1;
533 var IndeterminateComponent = 2;
534 var HostRoot = 3;
535 var HostPortal = 4;
536 var HostComponent = 5;
537 var HostText = 6;
538 var Fragment = 7;
539 var Mode = 8;
540 var ContextConsumer = 9;
541 var ContextProvider = 10;
542 var ForwardRef = 11;
543 var Profiler = 12;
544 var SuspenseComponent = 13;
545 var MemoComponent = 14;
546 var SimpleMemoComponent = 15;
547 var LazyComponent = 16;
548 var IncompleteClassComponent = 17;
549 var DehydratedFragment = 18;
550 var SuspenseListComponent = 19;
551 var ScopeComponent = 21;
552 var OffscreenComponent = 22;
553 var LegacyHiddenComponent = 23;
554 var CacheComponent = 24;
555 var TracingMarkerComponent = 25;
556 var enableClientRenderFallbackOnTextMismatch = true;
557 var enableNewReconciler = false;
558 var enableLazyContextPropagation = false;
559 var enableLegacyHidden = false;
560 var enableSuspenseAvoidThisFallback = false;
561 var disableCommentsAsDOMContainers = true;
562 var enableCustomElementPropertySupport = false;
563 var warnAboutStringRefs = true;
564 var enableSchedulingProfiler = true;
565 var enableProfilerTimer = true;
566 var enableProfilerCommitHooks = true;
567 var allNativeEvents = /* @__PURE__ */ new Set();
568 var registrationNameDependencies = {};
569 var possibleRegistrationNames = {};
570 function registerTwoPhaseEvent(registrationName, dependencies) {
571 registerDirectEvent(registrationName, dependencies);
572 registerDirectEvent(registrationName + "Capture", dependencies);
573 }
574 function registerDirectEvent(registrationName, dependencies) {
575 {
576 if (registrationNameDependencies[registrationName]) {
577 error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
578 }
579 }
580 registrationNameDependencies[registrationName] = dependencies;
581 {
582 var lowerCasedName = registrationName.toLowerCase();
583 possibleRegistrationNames[lowerCasedName] = registrationName;
584 if (registrationName === "onDoubleClick") {
585 possibleRegistrationNames.ondblclick = registrationName;
586 }
587 }
588 for (var i = 0; i < dependencies.length; i++) {
589 allNativeEvents.add(dependencies[i]);
590 }
591 }
592 var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
593 var hasOwnProperty = Object.prototype.hasOwnProperty;
594 function typeName(value) {
595 {
596 var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
597 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
598 return type;
599 }
600 }
601 function willCoercionThrow(value) {
602 {
603 try {
604 testStringCoercion(value);
605 return false;
606 } catch (e) {
607 return true;
608 }
609 }
610 }
611 function testStringCoercion(value) {
612 return "" + value;
613 }
614 function checkAttributeStringCoercion(value, attributeName) {
615 {
616 if (willCoercionThrow(value)) {
617 error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName(value));
618 return testStringCoercion(value);
619 }
620 }
621 }
622 function checkKeyStringCoercion(value) {
623 {
624 if (willCoercionThrow(value)) {
625 error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
626 return testStringCoercion(value);
627 }
628 }
629 }
630 function checkPropStringCoercion(value, propName) {
631 {
632 if (willCoercionThrow(value)) {
633 error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
634 return testStringCoercion(value);
635 }
636 }
637 }
638 function checkCSSPropertyStringCoercion(value, propName) {
639 {
640 if (willCoercionThrow(value)) {
641 error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName(value));
642 return testStringCoercion(value);
643 }
644 }
645 }
646 function checkHtmlStringCoercion(value) {
647 {
648 if (willCoercionThrow(value)) {
649 error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
650 return testStringCoercion(value);
651 }
652 }
653 }
654 function checkFormFieldValueStringCoercion(value) {
655 {
656 if (willCoercionThrow(value)) {
657 error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName(value));
658 return testStringCoercion(value);
659 }
660 }
661 }
662 var RESERVED = 0;
663 var STRING = 1;
664 var BOOLEANISH_STRING = 2;
665 var BOOLEAN = 3;
666 var OVERLOADED_BOOLEAN = 4;
667 var NUMERIC = 5;
668 var POSITIVE_NUMERIC = 6;
669 var ATTRIBUTE_NAME_START_CHAR = ":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";
670 var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
671 var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
672 var illegalAttributeNameCache = {};
673 var validatedAttributeNameCache = {};
674 function isAttributeNameSafe(attributeName) {
675 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
676 return true;
677 }
678 if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
679 return false;
680 }
681 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
682 validatedAttributeNameCache[attributeName] = true;
683 return true;
684 }
685 illegalAttributeNameCache[attributeName] = true;
686 {
687 error("Invalid attribute name: `%s`", attributeName);
688 }
689 return false;
690 }
691 function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
692 if (propertyInfo !== null) {
693 return propertyInfo.type === RESERVED;
694 }
695 if (isCustomComponentTag) {
696 return false;
697 }
698 if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
699 return true;
700 }
701 return false;
702 }
703 function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
704 if (propertyInfo !== null && propertyInfo.type === RESERVED) {
705 return false;
706 }
707 switch (typeof value) {
708 case "function":
709 // $FlowIssue symbol is perfectly valid here
710 case "symbol":
711 return true;
712 case "boolean": {
713 if (isCustomComponentTag) {
714 return false;
715 }
716 if (propertyInfo !== null) {
717 return !propertyInfo.acceptsBooleans;
718 } else {
719 var prefix2 = name.toLowerCase().slice(0, 5);
720 return prefix2 !== "data-" && prefix2 !== "aria-";
721 }
722 }
723 default:
724 return false;
725 }
726 }
727 function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
728 if (value === null || typeof value === "undefined") {
729 return true;
730 }
731 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
732 return true;
733 }
734 if (isCustomComponentTag) {
735 return false;
736 }
737 if (propertyInfo !== null) {
738 switch (propertyInfo.type) {
739 case BOOLEAN:
740 return !value;
741 case OVERLOADED_BOOLEAN:
742 return value === false;
743 case NUMERIC:
744 return isNaN(value);
745 case POSITIVE_NUMERIC:
746 return isNaN(value) || value < 1;
747 }
748 }
749 return false;
750 }
751 function getPropertyInfo(name) {
752 return properties.hasOwnProperty(name) ? properties[name] : null;
753 }
754 function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
755 this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
756 this.attributeName = attributeName;
757 this.attributeNamespace = attributeNamespace;
758 this.mustUseProperty = mustUseProperty;
759 this.propertyName = name;
760 this.type = type;
761 this.sanitizeURL = sanitizeURL2;
762 this.removeEmptyString = removeEmptyString;
763 }
764 var properties = {};
765 var reservedProps = [
766 "children",
767 "dangerouslySetInnerHTML",
768 // TODO: This prevents the assignment of defaultValue to regular
769 // elements (not just inputs). Now that ReactDOMInput assigns to the
770 // defaultValue property -- do we need this?
771 "defaultValue",
772 "defaultChecked",
773 "innerHTML",
774 "suppressContentEditableWarning",
775 "suppressHydrationWarning",
776 "style"
777 ];
778 reservedProps.forEach(function(name) {
779 properties[name] = new PropertyInfoRecord(
780 name,
781 RESERVED,
782 false,
783 // mustUseProperty
784 name,
785 // attributeName
786 null,
787 // attributeNamespace
788 false,
789 // sanitizeURL
790 false
791 );
792 });
793 [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
794 var name = _ref[0], attributeName = _ref[1];
795 properties[name] = new PropertyInfoRecord(
796 name,
797 STRING,
798 false,
799 // mustUseProperty
800 attributeName,
801 // attributeName
802 null,
803 // attributeNamespace
804 false,
805 // sanitizeURL
806 false
807 );
808 });
809 ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
810 properties[name] = new PropertyInfoRecord(
811 name,
812 BOOLEANISH_STRING,
813 false,
814 // mustUseProperty
815 name.toLowerCase(),
816 // attributeName
817 null,
818 // attributeNamespace
819 false,
820 // sanitizeURL
821 false
822 );
823 });
824 ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
825 properties[name] = new PropertyInfoRecord(
826 name,
827 BOOLEANISH_STRING,
828 false,
829 // mustUseProperty
830 name,
831 // attributeName
832 null,
833 // attributeNamespace
834 false,
835 // sanitizeURL
836 false
837 );
838 });
839 [
840 "allowFullScreen",
841 "async",
842 // Note: there is a special case that prevents it from being written to the DOM
843 // on the client side because the browsers are inconsistent. Instead we call focus().
844 "autoFocus",
845 "autoPlay",
846 "controls",
847 "default",
848 "defer",
849 "disabled",
850 "disablePictureInPicture",
851 "disableRemotePlayback",
852 "formNoValidate",
853 "hidden",
854 "loop",
855 "noModule",
856 "noValidate",
857 "open",
858 "playsInline",
859 "readOnly",
860 "required",
861 "reversed",
862 "scoped",
863 "seamless",
864 // Microdata
865 "itemScope"
866 ].forEach(function(name) {
867 properties[name] = new PropertyInfoRecord(
868 name,
869 BOOLEAN,
870 false,
871 // mustUseProperty
872 name.toLowerCase(),
873 // attributeName
874 null,
875 // attributeNamespace
876 false,
877 // sanitizeURL
878 false
879 );
880 });
881 [
882 "checked",
883 // Note: `option.selected` is not updated if `select.multiple` is
884 // disabled with `removeAttribute`. We have special logic for handling this.
885 "multiple",
886 "muted",
887 "selected"
888 // NOTE: if you add a camelCased prop to this list,
889 // you'll need to set attributeName to name.toLowerCase()
890 // instead in the assignment below.
891 ].forEach(function(name) {
892 properties[name] = new PropertyInfoRecord(
893 name,
894 BOOLEAN,
895 true,
896 // mustUseProperty
897 name,
898 // attributeName
899 null,
900 // attributeNamespace
901 false,
902 // sanitizeURL
903 false
904 );
905 });
906 [
907 "capture",
908 "download"
909 // NOTE: if you add a camelCased prop to this list,
910 // you'll need to set attributeName to name.toLowerCase()
911 // instead in the assignment below.
912 ].forEach(function(name) {
913 properties[name] = new PropertyInfoRecord(
914 name,
915 OVERLOADED_BOOLEAN,
916 false,
917 // mustUseProperty
918 name,
919 // attributeName
920 null,
921 // attributeNamespace
922 false,
923 // sanitizeURL
924 false
925 );
926 });
927 [
928 "cols",
929 "rows",
930 "size",
931 "span"
932 // NOTE: if you add a camelCased prop to this list,
933 // you'll need to set attributeName to name.toLowerCase()
934 // instead in the assignment below.
935 ].forEach(function(name) {
936 properties[name] = new PropertyInfoRecord(
937 name,
938 POSITIVE_NUMERIC,
939 false,
940 // mustUseProperty
941 name,
942 // attributeName
943 null,
944 // attributeNamespace
945 false,
946 // sanitizeURL
947 false
948 );
949 });
950 ["rowSpan", "start"].forEach(function(name) {
951 properties[name] = new PropertyInfoRecord(
952 name,
953 NUMERIC,
954 false,
955 // mustUseProperty
956 name.toLowerCase(),
957 // attributeName
958 null,
959 // attributeNamespace
960 false,
961 // sanitizeURL
962 false
963 );
964 });
965 var CAMELIZE = /[\-\:]([a-z])/g;
966 var capitalize = function(token) {
967 return token[1].toUpperCase();
968 };
969 [
970 "accent-height",
971 "alignment-baseline",
972 "arabic-form",
973 "baseline-shift",
974 "cap-height",
975 "clip-path",
976 "clip-rule",
977 "color-interpolation",
978 "color-interpolation-filters",
979 "color-profile",
980 "color-rendering",
981 "dominant-baseline",
982 "enable-background",
983 "fill-opacity",
984 "fill-rule",
985 "flood-color",
986 "flood-opacity",
987 "font-family",
988 "font-size",
989 "font-size-adjust",
990 "font-stretch",
991 "font-style",
992 "font-variant",
993 "font-weight",
994 "glyph-name",
995 "glyph-orientation-horizontal",
996 "glyph-orientation-vertical",
997 "horiz-adv-x",
998 "horiz-origin-x",
999 "image-rendering",
1000 "letter-spacing",
1001 "lighting-color",
1002 "marker-end",
1003 "marker-mid",
1004 "marker-start",
1005 "overline-position",
1006 "overline-thickness",
1007 "paint-order",
1008 "panose-1",
1009 "pointer-events",
1010 "rendering-intent",
1011 "shape-rendering",
1012 "stop-color",
1013 "stop-opacity",
1014 "strikethrough-position",
1015 "strikethrough-thickness",
1016 "stroke-dasharray",
1017 "stroke-dashoffset",
1018 "stroke-linecap",
1019 "stroke-linejoin",
1020 "stroke-miterlimit",
1021 "stroke-opacity",
1022 "stroke-width",
1023 "text-anchor",
1024 "text-decoration",
1025 "text-rendering",
1026 "underline-position",
1027 "underline-thickness",
1028 "unicode-bidi",
1029 "unicode-range",
1030 "units-per-em",
1031 "v-alphabetic",
1032 "v-hanging",
1033 "v-ideographic",
1034 "v-mathematical",
1035 "vector-effect",
1036 "vert-adv-y",
1037 "vert-origin-x",
1038 "vert-origin-y",
1039 "word-spacing",
1040 "writing-mode",
1041 "xmlns:xlink",
1042 "x-height"
1043 // NOTE: if you add a camelCased prop to this list,
1044 // you'll need to set attributeName to name.toLowerCase()
1045 // instead in the assignment below.
1046 ].forEach(function(attributeName) {
1047 var name = attributeName.replace(CAMELIZE, capitalize);
1048 properties[name] = new PropertyInfoRecord(
1049 name,
1050 STRING,
1051 false,
1052 // mustUseProperty
1053 attributeName,
1054 null,
1055 // attributeNamespace
1056 false,
1057 // sanitizeURL
1058 false
1059 );
1060 });
1061 [
1062 "xlink:actuate",
1063 "xlink:arcrole",
1064 "xlink:role",
1065 "xlink:show",
1066 "xlink:title",
1067 "xlink:type"
1068 // NOTE: if you add a camelCased prop to this list,
1069 // you'll need to set attributeName to name.toLowerCase()
1070 // instead in the assignment below.
1071 ].forEach(function(attributeName) {
1072 var name = attributeName.replace(CAMELIZE, capitalize);
1073 properties[name] = new PropertyInfoRecord(
1074 name,
1075 STRING,
1076 false,
1077 // mustUseProperty
1078 attributeName,
1079 "http://www.w3.org/1999/xlink",
1080 false,
1081 // sanitizeURL
1082 false
1083 );
1084 });
1085 [
1086 "xml:base",
1087 "xml:lang",
1088 "xml:space"
1089 // NOTE: if you add a camelCased prop to this list,
1090 // you'll need to set attributeName to name.toLowerCase()
1091 // instead in the assignment below.
1092 ].forEach(function(attributeName) {
1093 var name = attributeName.replace(CAMELIZE, capitalize);
1094 properties[name] = new PropertyInfoRecord(
1095 name,
1096 STRING,
1097 false,
1098 // mustUseProperty
1099 attributeName,
1100 "http://www.w3.org/XML/1998/namespace",
1101 false,
1102 // sanitizeURL
1103 false
1104 );
1105 });
1106 ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
1107 properties[attributeName] = new PropertyInfoRecord(
1108 attributeName,
1109 STRING,
1110 false,
1111 // mustUseProperty
1112 attributeName.toLowerCase(),
1113 // attributeName
1114 null,
1115 // attributeNamespace
1116 false,
1117 // sanitizeURL
1118 false
1119 );
1120 });
1121 var xlinkHref = "xlinkHref";
1122 properties[xlinkHref] = new PropertyInfoRecord(
1123 "xlinkHref",
1124 STRING,
1125 false,
1126 // mustUseProperty
1127 "xlink:href",
1128 "http://www.w3.org/1999/xlink",
1129 true,
1130 // sanitizeURL
1131 false
1132 );
1133 ["src", "href", "action", "formAction"].forEach(function(attributeName) {
1134 properties[attributeName] = new PropertyInfoRecord(
1135 attributeName,
1136 STRING,
1137 false,
1138 // mustUseProperty
1139 attributeName.toLowerCase(),
1140 // attributeName
1141 null,
1142 // attributeNamespace
1143 true,
1144 // sanitizeURL
1145 true
1146 );
1147 });
1148 var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
1149 var didWarn = false;
1150 function sanitizeURL(url) {
1151 {
1152 if (!didWarn && isJavaScriptProtocol.test(url)) {
1153 didWarn = true;
1154 error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url));
1155 }
1156 }
1157 }
1158 function getValueForProperty(node, name, expected, propertyInfo) {
1159 {
1160 if (propertyInfo.mustUseProperty) {
1161 var propertyName = propertyInfo.propertyName;
1162 return node[propertyName];
1163 } else {
1164 {
1165 checkAttributeStringCoercion(expected, name);
1166 }
1167 if (propertyInfo.sanitizeURL) {
1168 sanitizeURL("" + expected);
1169 }
1170 var attributeName = propertyInfo.attributeName;
1171 var stringValue = null;
1172 if (propertyInfo.type === OVERLOADED_BOOLEAN) {
1173 if (node.hasAttribute(attributeName)) {
1174 var value = node.getAttribute(attributeName);
1175 if (value === "") {
1176 return true;
1177 }
1178 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1179 return value;
1180 }
1181 if (value === "" + expected) {
1182 return expected;
1183 }
1184 return value;
1185 }
1186 } else if (node.hasAttribute(attributeName)) {
1187 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1188 return node.getAttribute(attributeName);
1189 }
1190 if (propertyInfo.type === BOOLEAN) {
1191 return expected;
1192 }
1193 stringValue = node.getAttribute(attributeName);
1194 }
1195 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1196 return stringValue === null ? expected : stringValue;
1197 } else if (stringValue === "" + expected) {
1198 return expected;
1199 } else {
1200 return stringValue;
1201 }
1202 }
1203 }
1204 }
1205 function getValueForAttribute(node, name, expected, isCustomComponentTag) {
1206 {
1207 if (!isAttributeNameSafe(name)) {
1208 return;
1209 }
1210 if (!node.hasAttribute(name)) {
1211 return expected === void 0 ? void 0 : null;
1212 }
1213 var value = node.getAttribute(name);
1214 {
1215 checkAttributeStringCoercion(expected, name);
1216 }
1217 if (value === "" + expected) {
1218 return expected;
1219 }
1220 return value;
1221 }
1222 }
1223 function setValueForProperty(node, name, value, isCustomComponentTag) {
1224 var propertyInfo = getPropertyInfo(name);
1225 if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
1226 return;
1227 }
1228 if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
1229 value = null;
1230 }
1231 if (isCustomComponentTag || propertyInfo === null) {
1232 if (isAttributeNameSafe(name)) {
1233 var _attributeName = name;
1234 if (value === null) {
1235 node.removeAttribute(_attributeName);
1236 } else {
1237 {
1238 checkAttributeStringCoercion(value, name);
1239 }
1240 node.setAttribute(_attributeName, "" + value);
1241 }
1242 }
1243 return;
1244 }
1245 var mustUseProperty = propertyInfo.mustUseProperty;
1246 if (mustUseProperty) {
1247 var propertyName = propertyInfo.propertyName;
1248 if (value === null) {
1249 var type = propertyInfo.type;
1250 node[propertyName] = type === BOOLEAN ? false : "";
1251 } else {
1252 node[propertyName] = value;
1253 }
1254 return;
1255 }
1256 var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
1257 if (value === null) {
1258 node.removeAttribute(attributeName);
1259 } else {
1260 var _type = propertyInfo.type;
1261 var attributeValue;
1262 if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
1263 attributeValue = "";
1264 } else {
1265 {
1266 {
1267 checkAttributeStringCoercion(value, attributeName);
1268 }
1269 attributeValue = "" + value;
1270 }
1271 if (propertyInfo.sanitizeURL) {
1272 sanitizeURL(attributeValue.toString());
1273 }
1274 }
1275 if (attributeNamespace) {
1276 node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
1277 } else {
1278 node.setAttribute(attributeName, attributeValue);
1279 }
1280 }
1281 }
1282 var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
1283 var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
1284 var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
1285 var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
1286 var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
1287 var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
1288 var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
1289 var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
1290 var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
1291 var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
1292 var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
1293 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1294 var REACT_SCOPE_TYPE = /* @__PURE__ */ Symbol.for("react.scope");
1295 var REACT_DEBUG_TRACING_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.debug_trace_mode");
1296 var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
1297 var REACT_LEGACY_HIDDEN_TYPE = /* @__PURE__ */ Symbol.for("react.legacy_hidden");
1298 var REACT_CACHE_TYPE = /* @__PURE__ */ Symbol.for("react.cache");
1299 var REACT_TRACING_MARKER_TYPE = /* @__PURE__ */ Symbol.for("react.tracing_marker");
1300 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
1301 var FAUX_ITERATOR_SYMBOL = "@@iterator";
1302 function getIteratorFn(maybeIterable) {
1303 if (maybeIterable === null || typeof maybeIterable !== "object") {
1304 return null;
1305 }
1306 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1307 if (typeof maybeIterator === "function") {
1308 return maybeIterator;
1309 }
1310 return null;
1311 }
1312 var assign = Object.assign;
1313 var disabledDepth = 0;
1314 var prevLog;
1315 var prevInfo;
1316 var prevWarn;
1317 var prevError;
1318 var prevGroup;
1319 var prevGroupCollapsed;
1320 var prevGroupEnd;
1321 function disabledLog() {
1322 }
1323 disabledLog.__reactDisabledLog = true;
1324 function disableLogs() {
1325 {
1326 if (disabledDepth === 0) {
1327 prevLog = console.log;
1328 prevInfo = console.info;
1329 prevWarn = console.warn;
1330 prevError = console.error;
1331 prevGroup = console.group;
1332 prevGroupCollapsed = console.groupCollapsed;
1333 prevGroupEnd = console.groupEnd;
1334 var props = {
1335 configurable: true,
1336 enumerable: true,
1337 value: disabledLog,
1338 writable: true
1339 };
1340 Object.defineProperties(console, {
1341 info: props,
1342 log: props,
1343 warn: props,
1344 error: props,
1345 group: props,
1346 groupCollapsed: props,
1347 groupEnd: props
1348 });
1349 }
1350 disabledDepth++;
1351 }
1352 }
1353 function reenableLogs() {
1354 {
1355 disabledDepth--;
1356 if (disabledDepth === 0) {
1357 var props = {
1358 configurable: true,
1359 enumerable: true,
1360 writable: true
1361 };
1362 Object.defineProperties(console, {
1363 log: assign({}, props, {
1364 value: prevLog
1365 }),
1366 info: assign({}, props, {
1367 value: prevInfo
1368 }),
1369 warn: assign({}, props, {
1370 value: prevWarn
1371 }),
1372 error: assign({}, props, {
1373 value: prevError
1374 }),
1375 group: assign({}, props, {
1376 value: prevGroup
1377 }),
1378 groupCollapsed: assign({}, props, {
1379 value: prevGroupCollapsed
1380 }),
1381 groupEnd: assign({}, props, {
1382 value: prevGroupEnd
1383 })
1384 });
1385 }
1386 if (disabledDepth < 0) {
1387 error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1388 }
1389 }
1390 }
1391 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
1392 var prefix;
1393 function describeBuiltInComponentFrame(name, source, ownerFn) {
1394 {
1395 if (prefix === void 0) {
1396 try {
1397 throw Error();
1398 } catch (x) {
1399 var match = x.stack.trim().match(/\n( *(at )?)/);
1400 prefix = match && match[1] || "";
1401 }
1402 }
1403 return "\n" + prefix + name;
1404 }
1405 }
1406 var reentry = false;
1407 var componentFrameCache;
1408 {
1409 var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
1410 componentFrameCache = new PossiblyWeakMap();
1411 }
1412 function describeNativeComponentFrame(fn, construct) {
1413 if (!fn || reentry) {
1414 return "";
1415 }
1416 {
1417 var frame = componentFrameCache.get(fn);
1418 if (frame !== void 0) {
1419 return frame;
1420 }
1421 }
1422 var control;
1423 reentry = true;
1424 var previousPrepareStackTrace = Error.prepareStackTrace;
1425 Error.prepareStackTrace = void 0;
1426 var previousDispatcher;
1427 {
1428 previousDispatcher = ReactCurrentDispatcher.current;
1429 ReactCurrentDispatcher.current = null;
1430 disableLogs();
1431 }
1432 try {
1433 if (construct) {
1434 var Fake = function() {
1435 throw Error();
1436 };
1437 Object.defineProperty(Fake.prototype, "props", {
1438 set: function() {
1439 throw Error();
1440 }
1441 });
1442 if (typeof Reflect === "object" && Reflect.construct) {
1443 try {
1444 Reflect.construct(Fake, []);
1445 } catch (x) {
1446 control = x;
1447 }
1448 Reflect.construct(fn, [], Fake);
1449 } else {
1450 try {
1451 Fake.call();
1452 } catch (x) {
1453 control = x;
1454 }
1455 fn.call(Fake.prototype);
1456 }
1457 } else {
1458 try {
1459 throw Error();
1460 } catch (x) {
1461 control = x;
1462 }
1463 fn();
1464 }
1465 } catch (sample) {
1466 if (sample && control && typeof sample.stack === "string") {
1467 var sampleLines = sample.stack.split("\n");
1468 var controlLines = control.stack.split("\n");
1469 var s = sampleLines.length - 1;
1470 var c = controlLines.length - 1;
1471 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1472 c--;
1473 }
1474 for (; s >= 1 && c >= 0; s--, c--) {
1475 if (sampleLines[s] !== controlLines[c]) {
1476 if (s !== 1 || c !== 1) {
1477 do {
1478 s--;
1479 c--;
1480 if (c < 0 || sampleLines[s] !== controlLines[c]) {
1481 var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
1482 if (fn.displayName && _frame.includes("<anonymous>")) {
1483 _frame = _frame.replace("<anonymous>", fn.displayName);
1484 }
1485 {
1486 if (typeof fn === "function") {
1487 componentFrameCache.set(fn, _frame);
1488 }
1489 }
1490 return _frame;
1491 }
1492 } while (s >= 1 && c >= 0);
1493 }
1494 break;
1495 }
1496 }
1497 }
1498 } finally {
1499 reentry = false;
1500 {
1501 ReactCurrentDispatcher.current = previousDispatcher;
1502 reenableLogs();
1503 }
1504 Error.prepareStackTrace = previousPrepareStackTrace;
1505 }
1506 var name = fn ? fn.displayName || fn.name : "";
1507 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
1508 {
1509 if (typeof fn === "function") {
1510 componentFrameCache.set(fn, syntheticFrame);
1511 }
1512 }
1513 return syntheticFrame;
1514 }
1515 function describeClassComponentFrame(ctor, source, ownerFn) {
1516 {
1517 return describeNativeComponentFrame(ctor, true);
1518 }
1519 }
1520 function describeFunctionComponentFrame(fn, source, ownerFn) {
1521 {
1522 return describeNativeComponentFrame(fn, false);
1523 }
1524 }
1525 function shouldConstruct(Component) {
1526 var prototype = Component.prototype;
1527 return !!(prototype && prototype.isReactComponent);
1528 }
1529 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1530 if (type == null) {
1531 return "";
1532 }
1533 if (typeof type === "function") {
1534 {
1535 return describeNativeComponentFrame(type, shouldConstruct(type));
1536 }
1537 }
1538 if (typeof type === "string") {
1539 return describeBuiltInComponentFrame(type);
1540 }
1541 switch (type) {
1542 case REACT_SUSPENSE_TYPE:
1543 return describeBuiltInComponentFrame("Suspense");
1544 case REACT_SUSPENSE_LIST_TYPE:
1545 return describeBuiltInComponentFrame("SuspenseList");
1546 }
1547 if (typeof type === "object") {
1548 switch (type.$$typeof) {
1549 case REACT_FORWARD_REF_TYPE:
1550 return describeFunctionComponentFrame(type.render);
1551 case REACT_MEMO_TYPE:
1552 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1553 case REACT_LAZY_TYPE: {
1554 var lazyComponent = type;
1555 var payload = lazyComponent._payload;
1556 var init = lazyComponent._init;
1557 try {
1558 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1559 } catch (x) {
1560 }
1561 }
1562 }
1563 }
1564 return "";
1565 }
1566 function describeFiber(fiber) {
1567 var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
1568 var source = fiber._debugSource;
1569 switch (fiber.tag) {
1570 case HostComponent:
1571 return describeBuiltInComponentFrame(fiber.type);
1572 case LazyComponent:
1573 return describeBuiltInComponentFrame("Lazy");
1574 case SuspenseComponent:
1575 return describeBuiltInComponentFrame("Suspense");
1576 case SuspenseListComponent:
1577 return describeBuiltInComponentFrame("SuspenseList");
1578 case FunctionComponent:
1579 case IndeterminateComponent:
1580 case SimpleMemoComponent:
1581 return describeFunctionComponentFrame(fiber.type);
1582 case ForwardRef:
1583 return describeFunctionComponentFrame(fiber.type.render);
1584 case ClassComponent:
1585 return describeClassComponentFrame(fiber.type);
1586 default:
1587 return "";
1588 }
1589 }
1590 function getStackByFiberInDevAndProd(workInProgress2) {
1591 try {
1592 var info = "";
1593 var node = workInProgress2;
1594 do {
1595 info += describeFiber(node);
1596 node = node.return;
1597 } while (node);
1598 return info;
1599 } catch (x) {
1600 return "\nError generating stack: " + x.message + "\n" + x.stack;
1601 }
1602 }
1603 function getWrappedName(outerType, innerType, wrapperName) {
1604 var displayName = outerType.displayName;
1605 if (displayName) {
1606 return displayName;
1607 }
1608 var functionName = innerType.displayName || innerType.name || "";
1609 return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
1610 }
1611 function getContextName(type) {
1612 return type.displayName || "Context";
1613 }
1614 function getComponentNameFromType(type) {
1615 if (type == null) {
1616 return null;
1617 }
1618 {
1619 if (typeof type.tag === "number") {
1620 error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
1621 }
1622 }
1623 if (typeof type === "function") {
1624 return type.displayName || type.name || null;
1625 }
1626 if (typeof type === "string") {
1627 return type;
1628 }
1629 switch (type) {
1630 case REACT_FRAGMENT_TYPE:
1631 return "Fragment";
1632 case REACT_PORTAL_TYPE:
1633 return "Portal";
1634 case REACT_PROFILER_TYPE:
1635 return "Profiler";
1636 case REACT_STRICT_MODE_TYPE:
1637 return "StrictMode";
1638 case REACT_SUSPENSE_TYPE:
1639 return "Suspense";
1640 case REACT_SUSPENSE_LIST_TYPE:
1641 return "SuspenseList";
1642 }
1643 if (typeof type === "object") {
1644 switch (type.$$typeof) {
1645 case REACT_CONTEXT_TYPE:
1646 var context = type;
1647 return getContextName(context) + ".Consumer";
1648 case REACT_PROVIDER_TYPE:
1649 var provider = type;
1650 return getContextName(provider._context) + ".Provider";
1651 case REACT_FORWARD_REF_TYPE:
1652 return getWrappedName(type, type.render, "ForwardRef");
1653 case REACT_MEMO_TYPE:
1654 var outerName = type.displayName || null;
1655 if (outerName !== null) {
1656 return outerName;
1657 }
1658 return getComponentNameFromType(type.type) || "Memo";
1659 case REACT_LAZY_TYPE: {
1660 var lazyComponent = type;
1661 var payload = lazyComponent._payload;
1662 var init = lazyComponent._init;
1663 try {
1664 return getComponentNameFromType(init(payload));
1665 } catch (x) {
1666 return null;
1667 }
1668 }
1669 }
1670 }
1671 return null;
1672 }
1673 function getWrappedName$1(outerType, innerType, wrapperName) {
1674 var functionName = innerType.displayName || innerType.name || "";
1675 return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
1676 }
1677 function getContextName$1(type) {
1678 return type.displayName || "Context";
1679 }
1680 function getComponentNameFromFiber(fiber) {
1681 var tag = fiber.tag, type = fiber.type;
1682 switch (tag) {
1683 case CacheComponent:
1684 return "Cache";
1685 case ContextConsumer:
1686 var context = type;
1687 return getContextName$1(context) + ".Consumer";
1688 case ContextProvider:
1689 var provider = type;
1690 return getContextName$1(provider._context) + ".Provider";
1691 case DehydratedFragment:
1692 return "DehydratedFragment";
1693 case ForwardRef:
1694 return getWrappedName$1(type, type.render, "ForwardRef");
1695 case Fragment:
1696 return "Fragment";
1697 case HostComponent:
1698 return type;
1699 case HostPortal:
1700 return "Portal";
1701 case HostRoot:
1702 return "Root";
1703 case HostText:
1704 return "Text";
1705 case LazyComponent:
1706 return getComponentNameFromType(type);
1707 case Mode:
1708 if (type === REACT_STRICT_MODE_TYPE) {
1709 return "StrictMode";
1710 }
1711 return "Mode";
1712 case OffscreenComponent:
1713 return "Offscreen";
1714 case Profiler:
1715 return "Profiler";
1716 case ScopeComponent:
1717 return "Scope";
1718 case SuspenseComponent:
1719 return "Suspense";
1720 case SuspenseListComponent:
1721 return "SuspenseList";
1722 case TracingMarkerComponent:
1723 return "TracingMarker";
1724 // The display name for this tags come from the user-provided type:
1725 case ClassComponent:
1726 case FunctionComponent:
1727 case IncompleteClassComponent:
1728 case IndeterminateComponent:
1729 case MemoComponent:
1730 case SimpleMemoComponent:
1731 if (typeof type === "function") {
1732 return type.displayName || type.name || null;
1733 }
1734 if (typeof type === "string") {
1735 return type;
1736 }
1737 break;
1738 }
1739 return null;
1740 }
1741 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1742 var current = null;
1743 var isRendering = false;
1744 function getCurrentFiberOwnerNameInDevOrNull() {
1745 {
1746 if (current === null) {
1747 return null;
1748 }
1749 var owner = current._debugOwner;
1750 if (owner !== null && typeof owner !== "undefined") {
1751 return getComponentNameFromFiber(owner);
1752 }
1753 }
1754 return null;
1755 }
1756 function getCurrentFiberStackInDev() {
1757 {
1758 if (current === null) {
1759 return "";
1760 }
1761 return getStackByFiberInDevAndProd(current);
1762 }
1763 }
1764 function resetCurrentFiber() {
1765 {
1766 ReactDebugCurrentFrame.getCurrentStack = null;
1767 current = null;
1768 isRendering = false;
1769 }
1770 }
1771 function setCurrentFiber(fiber) {
1772 {
1773 ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;
1774 current = fiber;
1775 isRendering = false;
1776 }
1777 }
1778 function getCurrentFiber() {
1779 {
1780 return current;
1781 }
1782 }
1783 function setIsRendering(rendering) {
1784 {
1785 isRendering = rendering;
1786 }
1787 }
1788 function toString(value) {
1789 return "" + value;
1790 }
1791 function getToStringValue(value) {
1792 switch (typeof value) {
1793 case "boolean":
1794 case "number":
1795 case "string":
1796 case "undefined":
1797 return value;
1798 case "object":
1799 {
1800 checkFormFieldValueStringCoercion(value);
1801 }
1802 return value;
1803 default:
1804 return "";
1805 }
1806 }
1807 var hasReadOnlyValue = {
1808 button: true,
1809 checkbox: true,
1810 image: true,
1811 hidden: true,
1812 radio: true,
1813 reset: true,
1814 submit: true
1815 };
1816 function checkControlledValueProps(tagName, props) {
1817 {
1818 if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
1819 error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.");
1820 }
1821 if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
1822 error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
1823 }
1824 }
1825 }
1826 function isCheckable(elem) {
1827 var type = elem.type;
1828 var nodeName = elem.nodeName;
1829 return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
1830 }
1831 function getTracker(node) {
1832 return node._valueTracker;
1833 }
1834 function detachTracker(node) {
1835 node._valueTracker = null;
1836 }
1837 function getValueFromNode(node) {
1838 var value = "";
1839 if (!node) {
1840 return value;
1841 }
1842 if (isCheckable(node)) {
1843 value = node.checked ? "true" : "false";
1844 } else {
1845 value = node.value;
1846 }
1847 return value;
1848 }
1849 function trackValueOnNode(node) {
1850 var valueField = isCheckable(node) ? "checked" : "value";
1851 var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
1852 {
1853 checkFormFieldValueStringCoercion(node[valueField]);
1854 }
1855 var currentValue = "" + node[valueField];
1856 if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
1857 return;
1858 }
1859 var get2 = descriptor.get, set2 = descriptor.set;
1860 Object.defineProperty(node, valueField, {
1861 configurable: true,
1862 get: function() {
1863 return get2.call(this);
1864 },
1865 set: function(value) {
1866 {
1867 checkFormFieldValueStringCoercion(value);
1868 }
1869 currentValue = "" + value;
1870 set2.call(this, value);
1871 }
1872 });
1873 Object.defineProperty(node, valueField, {
1874 enumerable: descriptor.enumerable
1875 });
1876 var tracker = {
1877 getValue: function() {
1878 return currentValue;
1879 },
1880 setValue: function(value) {
1881 {
1882 checkFormFieldValueStringCoercion(value);
1883 }
1884 currentValue = "" + value;
1885 },
1886 stopTracking: function() {
1887 detachTracker(node);
1888 delete node[valueField];
1889 }
1890 };
1891 return tracker;
1892 }
1893 function track(node) {
1894 if (getTracker(node)) {
1895 return;
1896 }
1897 node._valueTracker = trackValueOnNode(node);
1898 }
1899 function updateValueIfChanged(node) {
1900 if (!node) {
1901 return false;
1902 }
1903 var tracker = getTracker(node);
1904 if (!tracker) {
1905 return true;
1906 }
1907 var lastValue = tracker.getValue();
1908 var nextValue = getValueFromNode(node);
1909 if (nextValue !== lastValue) {
1910 tracker.setValue(nextValue);
1911 return true;
1912 }
1913 return false;
1914 }
1915 function getActiveElement(doc) {
1916 doc = doc || (typeof document !== "undefined" ? document : void 0);
1917 if (typeof doc === "undefined") {
1918 return null;
1919 }
1920 try {
1921 return doc.activeElement || doc.body;
1922 } catch (e) {
1923 return doc.body;
1924 }
1925 }
1926 var didWarnValueDefaultValue = false;
1927 var didWarnCheckedDefaultChecked = false;
1928 var didWarnControlledToUncontrolled = false;
1929 var didWarnUncontrolledToControlled = false;
1930 function isControlled(props) {
1931 var usesChecked = props.type === "checkbox" || props.type === "radio";
1932 return usesChecked ? props.checked != null : props.value != null;
1933 }
1934 function getHostProps(element, props) {
1935 var node = element;
1936 var checked = props.checked;
1937 var hostProps = assign({}, props, {
1938 defaultChecked: void 0,
1939 defaultValue: void 0,
1940 value: void 0,
1941 checked: checked != null ? checked : node._wrapperState.initialChecked
1942 });
1943 return hostProps;
1944 }
1945 function initWrapperState(element, props) {
1946 {
1947 checkControlledValueProps("input", props);
1948 if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
1949 error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
1950 didWarnCheckedDefaultChecked = true;
1951 }
1952 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
1953 error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type);
1954 didWarnValueDefaultValue = true;
1955 }
1956 }
1957 var node = element;
1958 var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
1959 node._wrapperState = {
1960 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
1961 initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
1962 controlled: isControlled(props)
1963 };
1964 }
1965 function updateChecked(element, props) {
1966 var node = element;
1967 var checked = props.checked;
1968 if (checked != null) {
1969 setValueForProperty(node, "checked", checked, false);
1970 }
1971 }
1972 function updateWrapper(element, props) {
1973 var node = element;
1974 {
1975 var controlled = isControlled(props);
1976 if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
1977 error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
1978 didWarnUncontrolledToControlled = true;
1979 }
1980 if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
1981 error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components");
1982 didWarnControlledToUncontrolled = true;
1983 }
1984 }
1985 updateChecked(element, props);
1986 var value = getToStringValue(props.value);
1987 var type = props.type;
1988 if (value != null) {
1989 if (type === "number") {
1990 if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible.
1991 // eslint-disable-next-line
1992 node.value != value) {
1993 node.value = toString(value);
1994 }
1995 } else if (node.value !== toString(value)) {
1996 node.value = toString(value);
1997 }
1998 } else if (type === "submit" || type === "reset") {
1999 node.removeAttribute("value");
2000 return;
2001 }
2002 {
2003 if (props.hasOwnProperty("value")) {
2004 setDefaultValue(node, props.type, value);
2005 } else if (props.hasOwnProperty("defaultValue")) {
2006 setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
2007 }
2008 }
2009 {
2010 if (props.checked == null && props.defaultChecked != null) {
2011 node.defaultChecked = !!props.defaultChecked;
2012 }
2013 }
2014 }
2015 function postMountWrapper(element, props, isHydrating2) {
2016 var node = element;
2017 if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
2018 var type = props.type;
2019 var isButton = type === "submit" || type === "reset";
2020 if (isButton && (props.value === void 0 || props.value === null)) {
2021 return;
2022 }
2023 var initialValue = toString(node._wrapperState.initialValue);
2024 if (!isHydrating2) {
2025 {
2026 if (initialValue !== node.value) {
2027 node.value = initialValue;
2028 }
2029 }
2030 }
2031 {
2032 node.defaultValue = initialValue;
2033 }
2034 }
2035 var name = node.name;
2036 if (name !== "") {
2037 node.name = "";
2038 }
2039 {
2040 node.defaultChecked = !node.defaultChecked;
2041 node.defaultChecked = !!node._wrapperState.initialChecked;
2042 }
2043 if (name !== "") {
2044 node.name = name;
2045 }
2046 }
2047 function restoreControlledState(element, props) {
2048 var node = element;
2049 updateWrapper(node, props);
2050 updateNamedCousins(node, props);
2051 }
2052 function updateNamedCousins(rootNode, props) {
2053 var name = props.name;
2054 if (props.type === "radio" && name != null) {
2055 var queryRoot = rootNode;
2056 while (queryRoot.parentNode) {
2057 queryRoot = queryRoot.parentNode;
2058 }
2059 {
2060 checkAttributeStringCoercion(name, "name");
2061 }
2062 var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
2063 for (var i = 0; i < group.length; i++) {
2064 var otherNode = group[i];
2065 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
2066 continue;
2067 }
2068 var otherProps = getFiberCurrentPropsFromNode(otherNode);
2069 if (!otherProps) {
2070 throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
2071 }
2072 updateValueIfChanged(otherNode);
2073 updateWrapper(otherNode, otherProps);
2074 }
2075 }
2076 }
2077 function setDefaultValue(node, type, value) {
2078 if (
2079 // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
2080 type !== "number" || getActiveElement(node.ownerDocument) !== node
2081 ) {
2082 if (value == null) {
2083 node.defaultValue = toString(node._wrapperState.initialValue);
2084 } else if (node.defaultValue !== toString(value)) {
2085 node.defaultValue = toString(value);
2086 }
2087 }
2088 }
2089 var didWarnSelectedSetOnOption = false;
2090 var didWarnInvalidChild = false;
2091 var didWarnInvalidInnerHTML = false;
2092 function validateProps(element, props) {
2093 {
2094 if (props.value == null) {
2095 if (typeof props.children === "object" && props.children !== null) {
2096 React.Children.forEach(props.children, function(child) {
2097 if (child == null) {
2098 return;
2099 }
2100 if (typeof child === "string" || typeof child === "number") {
2101 return;
2102 }
2103 if (!didWarnInvalidChild) {
2104 didWarnInvalidChild = true;
2105 error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
2106 }
2107 });
2108 } else if (props.dangerouslySetInnerHTML != null) {
2109 if (!didWarnInvalidInnerHTML) {
2110 didWarnInvalidInnerHTML = true;
2111 error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
2112 }
2113 }
2114 }
2115 if (props.selected != null && !didWarnSelectedSetOnOption) {
2116 error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
2117 didWarnSelectedSetOnOption = true;
2118 }
2119 }
2120 }
2121 function postMountWrapper$1(element, props) {
2122 if (props.value != null) {
2123 element.setAttribute("value", toString(getToStringValue(props.value)));
2124 }
2125 }
2126 var isArrayImpl = Array.isArray;
2127 function isArray(a) {
2128 return isArrayImpl(a);
2129 }
2130 var didWarnValueDefaultValue$1;
2131 {
2132 didWarnValueDefaultValue$1 = false;
2133 }
2134 function getDeclarationErrorAddendum() {
2135 var ownerName = getCurrentFiberOwnerNameInDevOrNull();
2136 if (ownerName) {
2137 return "\n\nCheck the render method of `" + ownerName + "`.";
2138 }
2139 return "";
2140 }
2141 var valuePropNames = ["value", "defaultValue"];
2142 function checkSelectPropTypes(props) {
2143 {
2144 checkControlledValueProps("select", props);
2145 for (var i = 0; i < valuePropNames.length; i++) {
2146 var propName = valuePropNames[i];
2147 if (props[propName] == null) {
2148 continue;
2149 }
2150 var propNameIsArray = isArray(props[propName]);
2151 if (props.multiple && !propNameIsArray) {
2152 error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
2153 } else if (!props.multiple && propNameIsArray) {
2154 error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
2155 }
2156 }
2157 }
2158 }
2159 function updateOptions(node, multiple, propValue, setDefaultSelected) {
2160 var options2 = node.options;
2161 if (multiple) {
2162 var selectedValues = propValue;
2163 var selectedValue = {};
2164 for (var i = 0; i < selectedValues.length; i++) {
2165 selectedValue["$" + selectedValues[i]] = true;
2166 }
2167 for (var _i = 0; _i < options2.length; _i++) {
2168 var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
2169 if (options2[_i].selected !== selected) {
2170 options2[_i].selected = selected;
2171 }
2172 if (selected && setDefaultSelected) {
2173 options2[_i].defaultSelected = true;
2174 }
2175 }
2176 } else {
2177 var _selectedValue = toString(getToStringValue(propValue));
2178 var defaultSelected = null;
2179 for (var _i2 = 0; _i2 < options2.length; _i2++) {
2180 if (options2[_i2].value === _selectedValue) {
2181 options2[_i2].selected = true;
2182 if (setDefaultSelected) {
2183 options2[_i2].defaultSelected = true;
2184 }
2185 return;
2186 }
2187 if (defaultSelected === null && !options2[_i2].disabled) {
2188 defaultSelected = options2[_i2];
2189 }
2190 }
2191 if (defaultSelected !== null) {
2192 defaultSelected.selected = true;
2193 }
2194 }
2195 }
2196 function getHostProps$1(element, props) {
2197 return assign({}, props, {
2198 value: void 0
2199 });
2200 }
2201 function initWrapperState$1(element, props) {
2202 var node = element;
2203 {
2204 checkSelectPropTypes(props);
2205 }
2206 node._wrapperState = {
2207 wasMultiple: !!props.multiple
2208 };
2209 {
2210 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
2211 error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components");
2212 didWarnValueDefaultValue$1 = true;
2213 }
2214 }
2215 }
2216 function postMountWrapper$2(element, props) {
2217 var node = element;
2218 node.multiple = !!props.multiple;
2219 var value = props.value;
2220 if (value != null) {
2221 updateOptions(node, !!props.multiple, value, false);
2222 } else if (props.defaultValue != null) {
2223 updateOptions(node, !!props.multiple, props.defaultValue, true);
2224 }
2225 }
2226 function postUpdateWrapper(element, props) {
2227 var node = element;
2228 var wasMultiple = node._wrapperState.wasMultiple;
2229 node._wrapperState.wasMultiple = !!props.multiple;
2230 var value = props.value;
2231 if (value != null) {
2232 updateOptions(node, !!props.multiple, value, false);
2233 } else if (wasMultiple !== !!props.multiple) {
2234 if (props.defaultValue != null) {
2235 updateOptions(node, !!props.multiple, props.defaultValue, true);
2236 } else {
2237 updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
2238 }
2239 }
2240 }
2241 function restoreControlledState$1(element, props) {
2242 var node = element;
2243 var value = props.value;
2244 if (value != null) {
2245 updateOptions(node, !!props.multiple, value, false);
2246 }
2247 }
2248 var didWarnValDefaultVal = false;
2249 function getHostProps$2(element, props) {
2250 var node = element;
2251 if (props.dangerouslySetInnerHTML != null) {
2252 throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
2253 }
2254 var hostProps = assign({}, props, {
2255 value: void 0,
2256 defaultValue: void 0,
2257 children: toString(node._wrapperState.initialValue)
2258 });
2259 return hostProps;
2260 }
2261 function initWrapperState$2(element, props) {
2262 var node = element;
2263 {
2264 checkControlledValueProps("textarea", props);
2265 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
2266 error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component");
2267 didWarnValDefaultVal = true;
2268 }
2269 }
2270 var initialValue = props.value;
2271 if (initialValue == null) {
2272 var children = props.children, defaultValue = props.defaultValue;
2273 if (children != null) {
2274 {
2275 error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
2276 }
2277 {
2278 if (defaultValue != null) {
2279 throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
2280 }
2281 if (isArray(children)) {
2282 if (children.length > 1) {
2283 throw new Error("<textarea> can only have at most one child.");
2284 }
2285 children = children[0];
2286 }
2287 defaultValue = children;
2288 }
2289 }
2290 if (defaultValue == null) {
2291 defaultValue = "";
2292 }
2293 initialValue = defaultValue;
2294 }
2295 node._wrapperState = {
2296 initialValue: getToStringValue(initialValue)
2297 };
2298 }
2299 function updateWrapper$1(element, props) {
2300 var node = element;
2301 var value = getToStringValue(props.value);
2302 var defaultValue = getToStringValue(props.defaultValue);
2303 if (value != null) {
2304 var newValue = toString(value);
2305 if (newValue !== node.value) {
2306 node.value = newValue;
2307 }
2308 if (props.defaultValue == null && node.defaultValue !== newValue) {
2309 node.defaultValue = newValue;
2310 }
2311 }
2312 if (defaultValue != null) {
2313 node.defaultValue = toString(defaultValue);
2314 }
2315 }
2316 function postMountWrapper$3(element, props) {
2317 var node = element;
2318 var textContent = node.textContent;
2319 if (textContent === node._wrapperState.initialValue) {
2320 if (textContent !== "" && textContent !== null) {
2321 node.value = textContent;
2322 }
2323 }
2324 }
2325 function restoreControlledState$2(element, props) {
2326 updateWrapper$1(element, props);
2327 }
2328 var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
2329 var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
2330 var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
2331 function getIntrinsicNamespace(type) {
2332 switch (type) {
2333 case "svg":
2334 return SVG_NAMESPACE;
2335 case "math":
2336 return MATH_NAMESPACE;
2337 default:
2338 return HTML_NAMESPACE;
2339 }
2340 }
2341 function getChildNamespace(parentNamespace, type) {
2342 if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
2343 return getIntrinsicNamespace(type);
2344 }
2345 if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
2346 return HTML_NAMESPACE;
2347 }
2348 return parentNamespace;
2349 }
2350 var createMicrosoftUnsafeLocalFunction = function(func) {
2351 if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
2352 return function(arg0, arg1, arg2, arg3) {
2353 MSApp.execUnsafeLocalFunction(function() {
2354 return func(arg0, arg1, arg2, arg3);
2355 });
2356 };
2357 } else {
2358 return func;
2359 }
2360 };
2361 var reusableSVGContainer;
2362 var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
2363 if (node.namespaceURI === SVG_NAMESPACE) {
2364 if (!("innerHTML" in node)) {
2365 reusableSVGContainer = reusableSVGContainer || document.createElement("div");
2366 reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
2367 var svgNode = reusableSVGContainer.firstChild;
2368 while (node.firstChild) {
2369 node.removeChild(node.firstChild);
2370 }
2371 while (svgNode.firstChild) {
2372 node.appendChild(svgNode.firstChild);
2373 }
2374 return;
2375 }
2376 }
2377 node.innerHTML = html;
2378 });
2379 var ELEMENT_NODE = 1;
2380 var TEXT_NODE = 3;
2381 var COMMENT_NODE = 8;
2382 var DOCUMENT_NODE = 9;
2383 var DOCUMENT_FRAGMENT_NODE = 11;
2384 var setTextContent = function(node, text) {
2385 if (text) {
2386 var firstChild = node.firstChild;
2387 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
2388 firstChild.nodeValue = text;
2389 return;
2390 }
2391 }
2392 node.textContent = text;
2393 };
2394 var shorthandToLonghand = {
2395 animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
2396 background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
2397 backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
2398 border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
2399 borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
2400 borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
2401 borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
2402 borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
2403 borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
2404 borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
2405 borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
2406 borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
2407 borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
2408 borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
2409 borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
2410 borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
2411 borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
2412 columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
2413 columns: ["columnCount", "columnWidth"],
2414 flex: ["flexBasis", "flexGrow", "flexShrink"],
2415 flexFlow: ["flexDirection", "flexWrap"],
2416 font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
2417 fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
2418 gap: ["columnGap", "rowGap"],
2419 grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
2420 gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
2421 gridColumn: ["gridColumnEnd", "gridColumnStart"],
2422 gridColumnGap: ["columnGap"],
2423 gridGap: ["columnGap", "rowGap"],
2424 gridRow: ["gridRowEnd", "gridRowStart"],
2425 gridRowGap: ["rowGap"],
2426 gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
2427 listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
2428 margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
2429 marker: ["markerEnd", "markerMid", "markerStart"],
2430 mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
2431 maskPosition: ["maskPositionX", "maskPositionY"],
2432 outline: ["outlineColor", "outlineStyle", "outlineWidth"],
2433 overflow: ["overflowX", "overflowY"],
2434 padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
2435 placeContent: ["alignContent", "justifyContent"],
2436 placeItems: ["alignItems", "justifyItems"],
2437 placeSelf: ["alignSelf", "justifySelf"],
2438 textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
2439 textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
2440 transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
2441 wordWrap: ["overflowWrap"]
2442 };
2443 var isUnitlessNumber = {
2444 animationIterationCount: true,
2445 aspectRatio: true,
2446 borderImageOutset: true,
2447 borderImageSlice: true,
2448 borderImageWidth: true,
2449 boxFlex: true,
2450 boxFlexGroup: true,
2451 boxOrdinalGroup: true,
2452 columnCount: true,
2453 columns: true,
2454 flex: true,
2455 flexGrow: true,
2456 flexPositive: true,
2457 flexShrink: true,
2458 flexNegative: true,
2459 flexOrder: true,
2460 gridArea: true,
2461 gridRow: true,
2462 gridRowEnd: true,
2463 gridRowSpan: true,
2464 gridRowStart: true,
2465 gridColumn: true,
2466 gridColumnEnd: true,
2467 gridColumnSpan: true,
2468 gridColumnStart: true,
2469 fontWeight: true,
2470 lineClamp: true,
2471 lineHeight: true,
2472 opacity: true,
2473 order: true,
2474 orphans: true,
2475 tabSize: true,
2476 widows: true,
2477 zIndex: true,
2478 zoom: true,
2479 // SVG-related properties
2480 fillOpacity: true,
2481 floodOpacity: true,
2482 stopOpacity: true,
2483 strokeDasharray: true,
2484 strokeDashoffset: true,
2485 strokeMiterlimit: true,
2486 strokeOpacity: true,
2487 strokeWidth: true
2488 };
2489 function prefixKey(prefix2, key) {
2490 return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
2491 }
2492 var prefixes = ["Webkit", "ms", "Moz", "O"];
2493 Object.keys(isUnitlessNumber).forEach(function(prop) {
2494 prefixes.forEach(function(prefix2) {
2495 isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
2496 });
2497 });
2498 function dangerousStyleValue(name, value, isCustomProperty) {
2499 var isEmpty = value == null || typeof value === "boolean" || value === "";
2500 if (isEmpty) {
2501 return "";
2502 }
2503 if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
2504 return value + "px";
2505 }
2506 {
2507 checkCSSPropertyStringCoercion(value, name);
2508 }
2509 return ("" + value).trim();
2510 }
2511 var uppercasePattern = /([A-Z])/g;
2512 var msPattern = /^ms-/;
2513 function hyphenateStyleName(name) {
2514 return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
2515 }
2516 var warnValidStyle = function() {
2517 };
2518 {
2519 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
2520 var msPattern$1 = /^-ms-/;
2521 var hyphenPattern = /-(.)/g;
2522 var badStyleValueWithSemicolonPattern = /;\s*$/;
2523 var warnedStyleNames = {};
2524 var warnedStyleValues = {};
2525 var warnedForNaNValue = false;
2526 var warnedForInfinityValue = false;
2527 var camelize = function(string) {
2528 return string.replace(hyphenPattern, function(_, character) {
2529 return character.toUpperCase();
2530 });
2531 };
2532 var warnHyphenatedStyleName = function(name) {
2533 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
2534 return;
2535 }
2536 warnedStyleNames[name] = true;
2537 error(
2538 "Unsupported style property %s. Did you mean %s?",
2539 name,
2540 // As Andi Smith suggests
2541 // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
2542 // is converted to lowercase `ms`.
2543 camelize(name.replace(msPattern$1, "ms-"))
2544 );
2545 };
2546 var warnBadVendoredStyleName = function(name) {
2547 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
2548 return;
2549 }
2550 warnedStyleNames[name] = true;
2551 error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
2552 };
2553 var warnStyleValueWithSemicolon = function(name, value) {
2554 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
2555 return;
2556 }
2557 warnedStyleValues[value] = true;
2558 error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
2559 };
2560 var warnStyleValueIsNaN = function(name, value) {
2561 if (warnedForNaNValue) {
2562 return;
2563 }
2564 warnedForNaNValue = true;
2565 error("`NaN` is an invalid value for the `%s` css style property.", name);
2566 };
2567 var warnStyleValueIsInfinity = function(name, value) {
2568 if (warnedForInfinityValue) {
2569 return;
2570 }
2571 warnedForInfinityValue = true;
2572 error("`Infinity` is an invalid value for the `%s` css style property.", name);
2573 };
2574 warnValidStyle = function(name, value) {
2575 if (name.indexOf("-") > -1) {
2576 warnHyphenatedStyleName(name);
2577 } else if (badVendoredStyleNamePattern.test(name)) {
2578 warnBadVendoredStyleName(name);
2579 } else if (badStyleValueWithSemicolonPattern.test(value)) {
2580 warnStyleValueWithSemicolon(name, value);
2581 }
2582 if (typeof value === "number") {
2583 if (isNaN(value)) {
2584 warnStyleValueIsNaN(name, value);
2585 } else if (!isFinite(value)) {
2586 warnStyleValueIsInfinity(name, value);
2587 }
2588 }
2589 };
2590 }
2591 var warnValidStyle$1 = warnValidStyle;
2592 function createDangerousStringForStyles(styles) {
2593 {
2594 var serialized = "";
2595 var delimiter = "";
2596 for (var styleName in styles) {
2597 if (!styles.hasOwnProperty(styleName)) {
2598 continue;
2599 }
2600 var styleValue = styles[styleName];
2601 if (styleValue != null) {
2602 var isCustomProperty = styleName.indexOf("--") === 0;
2603 serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
2604 serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
2605 delimiter = ";";
2606 }
2607 }
2608 return serialized || null;
2609 }
2610 }
2611 function setValueForStyles(node, styles) {
2612 var style2 = node.style;
2613 for (var styleName in styles) {
2614 if (!styles.hasOwnProperty(styleName)) {
2615 continue;
2616 }
2617 var isCustomProperty = styleName.indexOf("--") === 0;
2618 {
2619 if (!isCustomProperty) {
2620 warnValidStyle$1(styleName, styles[styleName]);
2621 }
2622 }
2623 var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
2624 if (styleName === "float") {
2625 styleName = "cssFloat";
2626 }
2627 if (isCustomProperty) {
2628 style2.setProperty(styleName, styleValue);
2629 } else {
2630 style2[styleName] = styleValue;
2631 }
2632 }
2633 }
2634 function isValueEmpty(value) {
2635 return value == null || typeof value === "boolean" || value === "";
2636 }
2637 function expandShorthandMap(styles) {
2638 var expanded = {};
2639 for (var key in styles) {
2640 var longhands = shorthandToLonghand[key] || [key];
2641 for (var i = 0; i < longhands.length; i++) {
2642 expanded[longhands[i]] = key;
2643 }
2644 }
2645 return expanded;
2646 }
2647 function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
2648 {
2649 if (!nextStyles) {
2650 return;
2651 }
2652 var expandedUpdates = expandShorthandMap(styleUpdates);
2653 var expandedStyles = expandShorthandMap(nextStyles);
2654 var warnedAbout = {};
2655 for (var key in expandedUpdates) {
2656 var originalKey = expandedUpdates[key];
2657 var correctOriginalKey = expandedStyles[key];
2658 if (correctOriginalKey && originalKey !== correctOriginalKey) {
2659 var warningKey = originalKey + "," + correctOriginalKey;
2660 if (warnedAbout[warningKey]) {
2661 continue;
2662 }
2663 warnedAbout[warningKey] = true;
2664 error("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", isValueEmpty(styleUpdates[originalKey]) ? "Removing" : "Updating", originalKey, correctOriginalKey);
2665 }
2666 }
2667 }
2668 }
2669 var omittedCloseTags = {
2670 area: true,
2671 base: true,
2672 br: true,
2673 col: true,
2674 embed: true,
2675 hr: true,
2676 img: true,
2677 input: true,
2678 keygen: true,
2679 link: true,
2680 meta: true,
2681 param: true,
2682 source: true,
2683 track: true,
2684 wbr: true
2685 // NOTE: menuitem's close tag should be omitted, but that causes problems.
2686 };
2687 var voidElementTags = assign({
2688 menuitem: true
2689 }, omittedCloseTags);
2690 var HTML = "__html";
2691 function assertValidProps(tag, props) {
2692 if (!props) {
2693 return;
2694 }
2695 if (voidElementTags[tag]) {
2696 if (props.children != null || props.dangerouslySetInnerHTML != null) {
2697 throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
2698 }
2699 }
2700 if (props.dangerouslySetInnerHTML != null) {
2701 if (props.children != null) {
2702 throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
2703 }
2704 if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
2705 throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
2706 }
2707 }
2708 {
2709 if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
2710 error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.");
2711 }
2712 }
2713 if (props.style != null && typeof props.style !== "object") {
2714 throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
2715 }
2716 }
2717 function isCustomComponent(tagName, props) {
2718 if (tagName.indexOf("-") === -1) {
2719 return typeof props.is === "string";
2720 }
2721 switch (tagName) {
2722 // These are reserved SVG and MathML elements.
2723 // We don't mind this list too much because we expect it to never grow.
2724 // The alternative is to track the namespace in a few places which is convoluted.
2725 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
2726 case "annotation-xml":
2727 case "color-profile":
2728 case "font-face":
2729 case "font-face-src":
2730 case "font-face-uri":
2731 case "font-face-format":
2732 case "font-face-name":
2733 case "missing-glyph":
2734 return false;
2735 default:
2736 return true;
2737 }
2738 }
2739 var possibleStandardNames = {
2740 // HTML
2741 accept: "accept",
2742 acceptcharset: "acceptCharset",
2743 "accept-charset": "acceptCharset",
2744 accesskey: "accessKey",
2745 action: "action",
2746 allowfullscreen: "allowFullScreen",
2747 alt: "alt",
2748 as: "as",
2749 async: "async",
2750 autocapitalize: "autoCapitalize",
2751 autocomplete: "autoComplete",
2752 autocorrect: "autoCorrect",
2753 autofocus: "autoFocus",
2754 autoplay: "autoPlay",
2755 autosave: "autoSave",
2756 capture: "capture",
2757 cellpadding: "cellPadding",
2758 cellspacing: "cellSpacing",
2759 challenge: "challenge",
2760 charset: "charSet",
2761 checked: "checked",
2762 children: "children",
2763 cite: "cite",
2764 class: "className",
2765 classid: "classID",
2766 classname: "className",
2767 cols: "cols",
2768 colspan: "colSpan",
2769 content: "content",
2770 contenteditable: "contentEditable",
2771 contextmenu: "contextMenu",
2772 controls: "controls",
2773 controlslist: "controlsList",
2774 coords: "coords",
2775 crossorigin: "crossOrigin",
2776 dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
2777 data: "data",
2778 datetime: "dateTime",
2779 default: "default",
2780 defaultchecked: "defaultChecked",
2781 defaultvalue: "defaultValue",
2782 defer: "defer",
2783 dir: "dir",
2784 disabled: "disabled",
2785 disablepictureinpicture: "disablePictureInPicture",
2786 disableremoteplayback: "disableRemotePlayback",
2787 download: "download",
2788 draggable: "draggable",
2789 enctype: "encType",
2790 enterkeyhint: "enterKeyHint",
2791 for: "htmlFor",
2792 form: "form",
2793 formmethod: "formMethod",
2794 formaction: "formAction",
2795 formenctype: "formEncType",
2796 formnovalidate: "formNoValidate",
2797 formtarget: "formTarget",
2798 frameborder: "frameBorder",
2799 headers: "headers",
2800 height: "height",
2801 hidden: "hidden",
2802 high: "high",
2803 href: "href",
2804 hreflang: "hrefLang",
2805 htmlfor: "htmlFor",
2806 httpequiv: "httpEquiv",
2807 "http-equiv": "httpEquiv",
2808 icon: "icon",
2809 id: "id",
2810 imagesizes: "imageSizes",
2811 imagesrcset: "imageSrcSet",
2812 innerhtml: "innerHTML",
2813 inputmode: "inputMode",
2814 integrity: "integrity",
2815 is: "is",
2816 itemid: "itemID",
2817 itemprop: "itemProp",
2818 itemref: "itemRef",
2819 itemscope: "itemScope",
2820 itemtype: "itemType",
2821 keyparams: "keyParams",
2822 keytype: "keyType",
2823 kind: "kind",
2824 label: "label",
2825 lang: "lang",
2826 list: "list",
2827 loop: "loop",
2828 low: "low",
2829 manifest: "manifest",
2830 marginwidth: "marginWidth",
2831 marginheight: "marginHeight",
2832 max: "max",
2833 maxlength: "maxLength",
2834 media: "media",
2835 mediagroup: "mediaGroup",
2836 method: "method",
2837 min: "min",
2838 minlength: "minLength",
2839 multiple: "multiple",
2840 muted: "muted",
2841 name: "name",
2842 nomodule: "noModule",
2843 nonce: "nonce",
2844 novalidate: "noValidate",
2845 open: "open",
2846 optimum: "optimum",
2847 pattern: "pattern",
2848 placeholder: "placeholder",
2849 playsinline: "playsInline",
2850 poster: "poster",
2851 preload: "preload",
2852 profile: "profile",
2853 radiogroup: "radioGroup",
2854 readonly: "readOnly",
2855 referrerpolicy: "referrerPolicy",
2856 rel: "rel",
2857 required: "required",
2858 reversed: "reversed",
2859 role: "role",
2860 rows: "rows",
2861 rowspan: "rowSpan",
2862 sandbox: "sandbox",
2863 scope: "scope",
2864 scoped: "scoped",
2865 scrolling: "scrolling",
2866 seamless: "seamless",
2867 selected: "selected",
2868 shape: "shape",
2869 size: "size",
2870 sizes: "sizes",
2871 span: "span",
2872 spellcheck: "spellCheck",
2873 src: "src",
2874 srcdoc: "srcDoc",
2875 srclang: "srcLang",
2876 srcset: "srcSet",
2877 start: "start",
2878 step: "step",
2879 style: "style",
2880 summary: "summary",
2881 tabindex: "tabIndex",
2882 target: "target",
2883 title: "title",
2884 type: "type",
2885 usemap: "useMap",
2886 value: "value",
2887 width: "width",
2888 wmode: "wmode",
2889 wrap: "wrap",
2890 // SVG
2891 about: "about",
2892 accentheight: "accentHeight",
2893 "accent-height": "accentHeight",
2894 accumulate: "accumulate",
2895 additive: "additive",
2896 alignmentbaseline: "alignmentBaseline",
2897 "alignment-baseline": "alignmentBaseline",
2898 allowreorder: "allowReorder",
2899 alphabetic: "alphabetic",
2900 amplitude: "amplitude",
2901 arabicform: "arabicForm",
2902 "arabic-form": "arabicForm",
2903 ascent: "ascent",
2904 attributename: "attributeName",
2905 attributetype: "attributeType",
2906 autoreverse: "autoReverse",
2907 azimuth: "azimuth",
2908 basefrequency: "baseFrequency",
2909 baselineshift: "baselineShift",
2910 "baseline-shift": "baselineShift",
2911 baseprofile: "baseProfile",
2912 bbox: "bbox",
2913 begin: "begin",
2914 bias: "bias",
2915 by: "by",
2916 calcmode: "calcMode",
2917 capheight: "capHeight",
2918 "cap-height": "capHeight",
2919 clip: "clip",
2920 clippath: "clipPath",
2921 "clip-path": "clipPath",
2922 clippathunits: "clipPathUnits",
2923 cliprule: "clipRule",
2924 "clip-rule": "clipRule",
2925 color: "color",
2926 colorinterpolation: "colorInterpolation",
2927 "color-interpolation": "colorInterpolation",
2928 colorinterpolationfilters: "colorInterpolationFilters",
2929 "color-interpolation-filters": "colorInterpolationFilters",
2930 colorprofile: "colorProfile",
2931 "color-profile": "colorProfile",
2932 colorrendering: "colorRendering",
2933 "color-rendering": "colorRendering",
2934 contentscripttype: "contentScriptType",
2935 contentstyletype: "contentStyleType",
2936 cursor: "cursor",
2937 cx: "cx",
2938 cy: "cy",
2939 d: "d",
2940 datatype: "datatype",
2941 decelerate: "decelerate",
2942 descent: "descent",
2943 diffuseconstant: "diffuseConstant",
2944 direction: "direction",
2945 display: "display",
2946 divisor: "divisor",
2947 dominantbaseline: "dominantBaseline",
2948 "dominant-baseline": "dominantBaseline",
2949 dur: "dur",
2950 dx: "dx",
2951 dy: "dy",
2952 edgemode: "edgeMode",
2953 elevation: "elevation",
2954 enablebackground: "enableBackground",
2955 "enable-background": "enableBackground",
2956 end: "end",
2957 exponent: "exponent",
2958 externalresourcesrequired: "externalResourcesRequired",
2959 fill: "fill",
2960 fillopacity: "fillOpacity",
2961 "fill-opacity": "fillOpacity",
2962 fillrule: "fillRule",
2963 "fill-rule": "fillRule",
2964 filter: "filter",
2965 filterres: "filterRes",
2966 filterunits: "filterUnits",
2967 floodopacity: "floodOpacity",
2968 "flood-opacity": "floodOpacity",
2969 floodcolor: "floodColor",
2970 "flood-color": "floodColor",
2971 focusable: "focusable",
2972 fontfamily: "fontFamily",
2973 "font-family": "fontFamily",
2974 fontsize: "fontSize",
2975 "font-size": "fontSize",
2976 fontsizeadjust: "fontSizeAdjust",
2977 "font-size-adjust": "fontSizeAdjust",
2978 fontstretch: "fontStretch",
2979 "font-stretch": "fontStretch",
2980 fontstyle: "fontStyle",
2981 "font-style": "fontStyle",
2982 fontvariant: "fontVariant",
2983 "font-variant": "fontVariant",
2984 fontweight: "fontWeight",
2985 "font-weight": "fontWeight",
2986 format: "format",
2987 from: "from",
2988 fx: "fx",
2989 fy: "fy",
2990 g1: "g1",
2991 g2: "g2",
2992 glyphname: "glyphName",
2993 "glyph-name": "glyphName",
2994 glyphorientationhorizontal: "glyphOrientationHorizontal",
2995 "glyph-orientation-horizontal": "glyphOrientationHorizontal",
2996 glyphorientationvertical: "glyphOrientationVertical",
2997 "glyph-orientation-vertical": "glyphOrientationVertical",
2998 glyphref: "glyphRef",
2999 gradienttransform: "gradientTransform",
3000 gradientunits: "gradientUnits",
3001 hanging: "hanging",
3002 horizadvx: "horizAdvX",
3003 "horiz-adv-x": "horizAdvX",
3004 horizoriginx: "horizOriginX",
3005 "horiz-origin-x": "horizOriginX",
3006 ideographic: "ideographic",
3007 imagerendering: "imageRendering",
3008 "image-rendering": "imageRendering",
3009 in2: "in2",
3010 in: "in",
3011 inlist: "inlist",
3012 intercept: "intercept",
3013 k1: "k1",
3014 k2: "k2",
3015 k3: "k3",
3016 k4: "k4",
3017 k: "k",
3018 kernelmatrix: "kernelMatrix",
3019 kernelunitlength: "kernelUnitLength",
3020 kerning: "kerning",
3021 keypoints: "keyPoints",
3022 keysplines: "keySplines",
3023 keytimes: "keyTimes",
3024 lengthadjust: "lengthAdjust",
3025 letterspacing: "letterSpacing",
3026 "letter-spacing": "letterSpacing",
3027 lightingcolor: "lightingColor",
3028 "lighting-color": "lightingColor",
3029 limitingconeangle: "limitingConeAngle",
3030 local: "local",
3031 markerend: "markerEnd",
3032 "marker-end": "markerEnd",
3033 markerheight: "markerHeight",
3034 markermid: "markerMid",
3035 "marker-mid": "markerMid",
3036 markerstart: "markerStart",
3037 "marker-start": "markerStart",
3038 markerunits: "markerUnits",
3039 markerwidth: "markerWidth",
3040 mask: "mask",
3041 maskcontentunits: "maskContentUnits",
3042 maskunits: "maskUnits",
3043 mathematical: "mathematical",
3044 mode: "mode",
3045 numoctaves: "numOctaves",
3046 offset: "offset",
3047 opacity: "opacity",
3048 operator: "operator",
3049 order: "order",
3050 orient: "orient",
3051 orientation: "orientation",
3052 origin: "origin",
3053 overflow: "overflow",
3054 overlineposition: "overlinePosition",
3055 "overline-position": "overlinePosition",
3056 overlinethickness: "overlineThickness",
3057 "overline-thickness": "overlineThickness",
3058 paintorder: "paintOrder",
3059 "paint-order": "paintOrder",
3060 panose1: "panose1",
3061 "panose-1": "panose1",
3062 pathlength: "pathLength",
3063 patterncontentunits: "patternContentUnits",
3064 patterntransform: "patternTransform",
3065 patternunits: "patternUnits",
3066 pointerevents: "pointerEvents",
3067 "pointer-events": "pointerEvents",
3068 points: "points",
3069 pointsatx: "pointsAtX",
3070 pointsaty: "pointsAtY",
3071 pointsatz: "pointsAtZ",
3072 prefix: "prefix",
3073 preservealpha: "preserveAlpha",
3074 preserveaspectratio: "preserveAspectRatio",
3075 primitiveunits: "primitiveUnits",
3076 property: "property",
3077 r: "r",
3078 radius: "radius",
3079 refx: "refX",
3080 refy: "refY",
3081 renderingintent: "renderingIntent",
3082 "rendering-intent": "renderingIntent",
3083 repeatcount: "repeatCount",
3084 repeatdur: "repeatDur",
3085 requiredextensions: "requiredExtensions",
3086 requiredfeatures: "requiredFeatures",
3087 resource: "resource",
3088 restart: "restart",
3089 result: "result",
3090 results: "results",
3091 rotate: "rotate",
3092 rx: "rx",
3093 ry: "ry",
3094 scale: "scale",
3095 security: "security",
3096 seed: "seed",
3097 shaperendering: "shapeRendering",
3098 "shape-rendering": "shapeRendering",
3099 slope: "slope",
3100 spacing: "spacing",
3101 specularconstant: "specularConstant",
3102 specularexponent: "specularExponent",
3103 speed: "speed",
3104 spreadmethod: "spreadMethod",
3105 startoffset: "startOffset",
3106 stddeviation: "stdDeviation",
3107 stemh: "stemh",
3108 stemv: "stemv",
3109 stitchtiles: "stitchTiles",
3110 stopcolor: "stopColor",
3111 "stop-color": "stopColor",
3112 stopopacity: "stopOpacity",
3113 "stop-opacity": "stopOpacity",
3114 strikethroughposition: "strikethroughPosition",
3115 "strikethrough-position": "strikethroughPosition",
3116 strikethroughthickness: "strikethroughThickness",
3117 "strikethrough-thickness": "strikethroughThickness",
3118 string: "string",
3119 stroke: "stroke",
3120 strokedasharray: "strokeDasharray",
3121 "stroke-dasharray": "strokeDasharray",
3122 strokedashoffset: "strokeDashoffset",
3123 "stroke-dashoffset": "strokeDashoffset",
3124 strokelinecap: "strokeLinecap",
3125 "stroke-linecap": "strokeLinecap",
3126 strokelinejoin: "strokeLinejoin",
3127 "stroke-linejoin": "strokeLinejoin",
3128 strokemiterlimit: "strokeMiterlimit",
3129 "stroke-miterlimit": "strokeMiterlimit",
3130 strokewidth: "strokeWidth",
3131 "stroke-width": "strokeWidth",
3132 strokeopacity: "strokeOpacity",
3133 "stroke-opacity": "strokeOpacity",
3134 suppresscontenteditablewarning: "suppressContentEditableWarning",
3135 suppresshydrationwarning: "suppressHydrationWarning",
3136 surfacescale: "surfaceScale",
3137 systemlanguage: "systemLanguage",
3138 tablevalues: "tableValues",
3139 targetx: "targetX",
3140 targety: "targetY",
3141 textanchor: "textAnchor",
3142 "text-anchor": "textAnchor",
3143 textdecoration: "textDecoration",
3144 "text-decoration": "textDecoration",
3145 textlength: "textLength",
3146 textrendering: "textRendering",
3147 "text-rendering": "textRendering",
3148 to: "to",
3149 transform: "transform",
3150 typeof: "typeof",
3151 u1: "u1",
3152 u2: "u2",
3153 underlineposition: "underlinePosition",
3154 "underline-position": "underlinePosition",
3155 underlinethickness: "underlineThickness",
3156 "underline-thickness": "underlineThickness",
3157 unicode: "unicode",
3158 unicodebidi: "unicodeBidi",
3159 "unicode-bidi": "unicodeBidi",
3160 unicoderange: "unicodeRange",
3161 "unicode-range": "unicodeRange",
3162 unitsperem: "unitsPerEm",
3163 "units-per-em": "unitsPerEm",
3164 unselectable: "unselectable",
3165 valphabetic: "vAlphabetic",
3166 "v-alphabetic": "vAlphabetic",
3167 values: "values",
3168 vectoreffect: "vectorEffect",
3169 "vector-effect": "vectorEffect",
3170 version: "version",
3171 vertadvy: "vertAdvY",
3172 "vert-adv-y": "vertAdvY",
3173 vertoriginx: "vertOriginX",
3174 "vert-origin-x": "vertOriginX",
3175 vertoriginy: "vertOriginY",
3176 "vert-origin-y": "vertOriginY",
3177 vhanging: "vHanging",
3178 "v-hanging": "vHanging",
3179 videographic: "vIdeographic",
3180 "v-ideographic": "vIdeographic",
3181 viewbox: "viewBox",
3182 viewtarget: "viewTarget",
3183 visibility: "visibility",
3184 vmathematical: "vMathematical",
3185 "v-mathematical": "vMathematical",
3186 vocab: "vocab",
3187 widths: "widths",
3188 wordspacing: "wordSpacing",
3189 "word-spacing": "wordSpacing",
3190 writingmode: "writingMode",
3191 "writing-mode": "writingMode",
3192 x1: "x1",
3193 x2: "x2",
3194 x: "x",
3195 xchannelselector: "xChannelSelector",
3196 xheight: "xHeight",
3197 "x-height": "xHeight",
3198 xlinkactuate: "xlinkActuate",
3199 "xlink:actuate": "xlinkActuate",
3200 xlinkarcrole: "xlinkArcrole",
3201 "xlink:arcrole": "xlinkArcrole",
3202 xlinkhref: "xlinkHref",
3203 "xlink:href": "xlinkHref",
3204 xlinkrole: "xlinkRole",
3205 "xlink:role": "xlinkRole",
3206 xlinkshow: "xlinkShow",
3207 "xlink:show": "xlinkShow",
3208 xlinktitle: "xlinkTitle",
3209 "xlink:title": "xlinkTitle",
3210 xlinktype: "xlinkType",
3211 "xlink:type": "xlinkType",
3212 xmlbase: "xmlBase",
3213 "xml:base": "xmlBase",
3214 xmllang: "xmlLang",
3215 "xml:lang": "xmlLang",
3216 xmlns: "xmlns",
3217 "xml:space": "xmlSpace",
3218 xmlnsxlink: "xmlnsXlink",
3219 "xmlns:xlink": "xmlnsXlink",
3220 xmlspace: "xmlSpace",
3221 y1: "y1",
3222 y2: "y2",
3223 y: "y",
3224 ychannelselector: "yChannelSelector",
3225 z: "z",
3226 zoomandpan: "zoomAndPan"
3227 };
3228 var ariaProperties = {
3229 "aria-current": 0,
3230 // state
3231 "aria-description": 0,
3232 "aria-details": 0,
3233 "aria-disabled": 0,
3234 // state
3235 "aria-hidden": 0,
3236 // state
3237 "aria-invalid": 0,
3238 // state
3239 "aria-keyshortcuts": 0,
3240 "aria-label": 0,
3241 "aria-roledescription": 0,
3242 // Widget Attributes
3243 "aria-autocomplete": 0,
3244 "aria-checked": 0,
3245 "aria-expanded": 0,
3246 "aria-haspopup": 0,
3247 "aria-level": 0,
3248 "aria-modal": 0,
3249 "aria-multiline": 0,
3250 "aria-multiselectable": 0,
3251 "aria-orientation": 0,
3252 "aria-placeholder": 0,
3253 "aria-pressed": 0,
3254 "aria-readonly": 0,
3255 "aria-required": 0,
3256 "aria-selected": 0,
3257 "aria-sort": 0,
3258 "aria-valuemax": 0,
3259 "aria-valuemin": 0,
3260 "aria-valuenow": 0,
3261 "aria-valuetext": 0,
3262 // Live Region Attributes
3263 "aria-atomic": 0,
3264 "aria-busy": 0,
3265 "aria-live": 0,
3266 "aria-relevant": 0,
3267 // Drag-and-Drop Attributes
3268 "aria-dropeffect": 0,
3269 "aria-grabbed": 0,
3270 // Relationship Attributes
3271 "aria-activedescendant": 0,
3272 "aria-colcount": 0,
3273 "aria-colindex": 0,
3274 "aria-colspan": 0,
3275 "aria-controls": 0,
3276 "aria-describedby": 0,
3277 "aria-errormessage": 0,
3278 "aria-flowto": 0,
3279 "aria-labelledby": 0,
3280 "aria-owns": 0,
3281 "aria-posinset": 0,
3282 "aria-rowcount": 0,
3283 "aria-rowindex": 0,
3284 "aria-rowspan": 0,
3285 "aria-setsize": 0
3286 };
3287 var warnedProperties = {};
3288 var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
3289 var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
3290 function validateProperty(tagName, name) {
3291 {
3292 if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
3293 return true;
3294 }
3295 if (rARIACamel.test(name)) {
3296 var ariaName = "aria-" + name.slice(4).toLowerCase();
3297 var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
3298 if (correctName == null) {
3299 error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
3300 warnedProperties[name] = true;
3301 return true;
3302 }
3303 if (name !== correctName) {
3304 error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
3305 warnedProperties[name] = true;
3306 return true;
3307 }
3308 }
3309 if (rARIA.test(name)) {
3310 var lowerCasedName = name.toLowerCase();
3311 var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
3312 if (standardName == null) {
3313 warnedProperties[name] = true;
3314 return false;
3315 }
3316 if (name !== standardName) {
3317 error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
3318 warnedProperties[name] = true;
3319 return true;
3320 }
3321 }
3322 }
3323 return true;
3324 }
3325 function warnInvalidARIAProps(type, props) {
3326 {
3327 var invalidProps = [];
3328 for (var key in props) {
3329 var isValid = validateProperty(type, key);
3330 if (!isValid) {
3331 invalidProps.push(key);
3332 }
3333 }
3334 var unknownPropString = invalidProps.map(function(prop) {
3335 return "`" + prop + "`";
3336 }).join(", ");
3337 if (invalidProps.length === 1) {
3338 error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
3339 } else if (invalidProps.length > 1) {
3340 error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
3341 }
3342 }
3343 }
3344 function validateProperties(type, props) {
3345 if (isCustomComponent(type, props)) {
3346 return;
3347 }
3348 warnInvalidARIAProps(type, props);
3349 }
3350 var didWarnValueNull = false;
3351 function validateProperties$1(type, props) {
3352 {
3353 if (type !== "input" && type !== "textarea" && type !== "select") {
3354 return;
3355 }
3356 if (props != null && props.value === null && !didWarnValueNull) {
3357 didWarnValueNull = true;
3358 if (type === "select" && props.multiple) {
3359 error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", type);
3360 } else {
3361 error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
3362 }
3363 }
3364 }
3365 }
3366 var validateProperty$1 = function() {
3367 };
3368 {
3369 var warnedProperties$1 = {};
3370 var EVENT_NAME_REGEX = /^on./;
3371 var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
3372 var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
3373 var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
3374 validateProperty$1 = function(tagName, name, value, eventRegistry) {
3375 if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
3376 return true;
3377 }
3378 var lowerCasedName = name.toLowerCase();
3379 if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
3380 error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.");
3381 warnedProperties$1[name] = true;
3382 return true;
3383 }
3384 if (eventRegistry != null) {
3385 var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
3386 if (registrationNameDependencies2.hasOwnProperty(name)) {
3387 return true;
3388 }
3389 var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
3390 if (registrationName != null) {
3391 error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
3392 warnedProperties$1[name] = true;
3393 return true;
3394 }
3395 if (EVENT_NAME_REGEX.test(name)) {
3396 error("Unknown event handler property `%s`. It will be ignored.", name);
3397 warnedProperties$1[name] = true;
3398 return true;
3399 }
3400 } else if (EVENT_NAME_REGEX.test(name)) {
3401 if (INVALID_EVENT_NAME_REGEX.test(name)) {
3402 error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
3403 }
3404 warnedProperties$1[name] = true;
3405 return true;
3406 }
3407 if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
3408 return true;
3409 }
3410 if (lowerCasedName === "innerhtml") {
3411 error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
3412 warnedProperties$1[name] = true;
3413 return true;
3414 }
3415 if (lowerCasedName === "aria") {
3416 error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
3417 warnedProperties$1[name] = true;
3418 return true;
3419 }
3420 if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
3421 error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
3422 warnedProperties$1[name] = true;
3423 return true;
3424 }
3425 if (typeof value === "number" && isNaN(value)) {
3426 error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
3427 warnedProperties$1[name] = true;
3428 return true;
3429 }
3430 var propertyInfo = getPropertyInfo(name);
3431 var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
3432 if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
3433 var standardName = possibleStandardNames[lowerCasedName];
3434 if (standardName !== name) {
3435 error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
3436 warnedProperties$1[name] = true;
3437 return true;
3438 }
3439 } else if (!isReserved && name !== lowerCasedName) {
3440 error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", name, lowerCasedName);
3441 warnedProperties$1[name] = true;
3442 return true;
3443 }
3444 if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
3445 if (value) {
3446 error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', value, name, name, value, name);
3447 } else {
3448 error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
3449 }
3450 warnedProperties$1[name] = true;
3451 return true;
3452 }
3453 if (isReserved) {
3454 return true;
3455 }
3456 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
3457 warnedProperties$1[name] = true;
3458 return false;
3459 }
3460 if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
3461 error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", value, name, value === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
3462 warnedProperties$1[name] = true;
3463 return true;
3464 }
3465 return true;
3466 };
3467 }
3468 var warnUnknownProperties = function(type, props, eventRegistry) {
3469 {
3470 var unknownProps = [];
3471 for (var key in props) {
3472 var isValid = validateProperty$1(type, key, props[key], eventRegistry);
3473 if (!isValid) {
3474 unknownProps.push(key);
3475 }
3476 }
3477 var unknownPropString = unknownProps.map(function(prop) {
3478 return "`" + prop + "`";
3479 }).join(", ");
3480 if (unknownProps.length === 1) {
3481 error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
3482 } else if (unknownProps.length > 1) {
3483 error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", unknownPropString, type);
3484 }
3485 }
3486 };
3487 function validateProperties$2(type, props, eventRegistry) {
3488 if (isCustomComponent(type, props)) {
3489 return;
3490 }
3491 warnUnknownProperties(type, props, eventRegistry);
3492 }
3493 var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
3494 var IS_NON_DELEGATED = 1 << 1;
3495 var IS_CAPTURE_PHASE = 1 << 2;
3496 var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
3497 var currentReplayingEvent = null;
3498 function setReplayingEvent(event) {
3499 {
3500 if (currentReplayingEvent !== null) {
3501 error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
3502 }
3503 }
3504 currentReplayingEvent = event;
3505 }
3506 function resetReplayingEvent() {
3507 {
3508 if (currentReplayingEvent === null) {
3509 error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
3510 }
3511 }
3512 currentReplayingEvent = null;
3513 }
3514 function isReplayingEvent(event) {
3515 return event === currentReplayingEvent;
3516 }
3517 function getEventTarget(nativeEvent) {
3518 var target = nativeEvent.target || nativeEvent.srcElement || window;
3519 if (target.correspondingUseElement) {
3520 target = target.correspondingUseElement;
3521 }
3522 return target.nodeType === TEXT_NODE ? target.parentNode : target;
3523 }
3524 var restoreImpl = null;
3525 var restoreTarget = null;
3526 var restoreQueue = null;
3527 function restoreStateOfTarget(target) {
3528 var internalInstance = getInstanceFromNode(target);
3529 if (!internalInstance) {
3530 return;
3531 }
3532 if (typeof restoreImpl !== "function") {
3533 throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
3534 }
3535 var stateNode = internalInstance.stateNode;
3536 if (stateNode) {
3537 var _props = getFiberCurrentPropsFromNode(stateNode);
3538 restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
3539 }
3540 }
3541 function setRestoreImplementation(impl) {
3542 restoreImpl = impl;
3543 }
3544 function enqueueStateRestore(target) {
3545 if (restoreTarget) {
3546 if (restoreQueue) {
3547 restoreQueue.push(target);
3548 } else {
3549 restoreQueue = [target];
3550 }
3551 } else {
3552 restoreTarget = target;
3553 }
3554 }
3555 function needsStateRestore() {
3556 return restoreTarget !== null || restoreQueue !== null;
3557 }
3558 function restoreStateIfNeeded() {
3559 if (!restoreTarget) {
3560 return;
3561 }
3562 var target = restoreTarget;
3563 var queuedTargets = restoreQueue;
3564 restoreTarget = null;
3565 restoreQueue = null;
3566 restoreStateOfTarget(target);
3567 if (queuedTargets) {
3568 for (var i = 0; i < queuedTargets.length; i++) {
3569 restoreStateOfTarget(queuedTargets[i]);
3570 }
3571 }
3572 }
3573 var batchedUpdatesImpl = function(fn, bookkeeping) {
3574 return fn(bookkeeping);
3575 };
3576 var flushSyncImpl = function() {
3577 };
3578 var isInsideEventHandler = false;
3579 function finishEventHandler() {
3580 var controlledComponentsHavePendingUpdates = needsStateRestore();
3581 if (controlledComponentsHavePendingUpdates) {
3582 flushSyncImpl();
3583 restoreStateIfNeeded();
3584 }
3585 }
3586 function batchedUpdates(fn, a, b) {
3587 if (isInsideEventHandler) {
3588 return fn(a, b);
3589 }
3590 isInsideEventHandler = true;
3591 try {
3592 return batchedUpdatesImpl(fn, a, b);
3593 } finally {
3594 isInsideEventHandler = false;
3595 finishEventHandler();
3596 }
3597 }
3598 function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
3599 batchedUpdatesImpl = _batchedUpdatesImpl;
3600 flushSyncImpl = _flushSyncImpl;
3601 }
3602 function isInteractive(tag) {
3603 return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
3604 }
3605 function shouldPreventMouseEvent(name, type, props) {
3606 switch (name) {
3607 case "onClick":
3608 case "onClickCapture":
3609 case "onDoubleClick":
3610 case "onDoubleClickCapture":
3611 case "onMouseDown":
3612 case "onMouseDownCapture":
3613 case "onMouseMove":
3614 case "onMouseMoveCapture":
3615 case "onMouseUp":
3616 case "onMouseUpCapture":
3617 case "onMouseEnter":
3618 return !!(props.disabled && isInteractive(type));
3619 default:
3620 return false;
3621 }
3622 }
3623 function getListener(inst, registrationName) {
3624 var stateNode = inst.stateNode;
3625 if (stateNode === null) {
3626 return null;
3627 }
3628 var props = getFiberCurrentPropsFromNode(stateNode);
3629 if (props === null) {
3630 return null;
3631 }
3632 var listener = props[registrationName];
3633 if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
3634 return null;
3635 }
3636 if (listener && typeof listener !== "function") {
3637 throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
3638 }
3639 return listener;
3640 }
3641 var passiveBrowserEventsSupported = false;
3642 if (canUseDOM) {
3643 try {
3644 var options = {};
3645 Object.defineProperty(options, "passive", {
3646 get: function() {
3647 passiveBrowserEventsSupported = true;
3648 }
3649 });
3650 window.addEventListener("test", options, options);
3651 window.removeEventListener("test", options, options);
3652 } catch (e) {
3653 passiveBrowserEventsSupported = false;
3654 }
3655 }
3656 function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
3657 var funcArgs = Array.prototype.slice.call(arguments, 3);
3658 try {
3659 func.apply(context, funcArgs);
3660 } catch (error2) {
3661 this.onError(error2);
3662 }
3663 }
3664 var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
3665 {
3666 if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
3667 var fakeNode = document.createElement("react");
3668 invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
3669 if (typeof document === "undefined" || document === null) {
3670 throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
3671 }
3672 var evt = document.createEvent("Event");
3673 var didCall = false;
3674 var didError = true;
3675 var windowEvent = window.event;
3676 var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
3677 function restoreAfterDispatch() {
3678 fakeNode.removeEventListener(evtType, callCallback2, false);
3679 if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
3680 window.event = windowEvent;
3681 }
3682 }
3683 var funcArgs = Array.prototype.slice.call(arguments, 3);
3684 function callCallback2() {
3685 didCall = true;
3686 restoreAfterDispatch();
3687 func.apply(context, funcArgs);
3688 didError = false;
3689 }
3690 var error2;
3691 var didSetError = false;
3692 var isCrossOriginError = false;
3693 function handleWindowError(event) {
3694 error2 = event.error;
3695 didSetError = true;
3696 if (error2 === null && event.colno === 0 && event.lineno === 0) {
3697 isCrossOriginError = true;
3698 }
3699 if (event.defaultPrevented) {
3700 if (error2 != null && typeof error2 === "object") {
3701 try {
3702 error2._suppressLogging = true;
3703 } catch (inner) {
3704 }
3705 }
3706 }
3707 }
3708 var evtType = "react-" + (name ? name : "invokeguardedcallback");
3709 window.addEventListener("error", handleWindowError);
3710 fakeNode.addEventListener(evtType, callCallback2, false);
3711 evt.initEvent(evtType, false, false);
3712 fakeNode.dispatchEvent(evt);
3713 if (windowEventDescriptor) {
3714 Object.defineProperty(window, "event", windowEventDescriptor);
3715 }
3716 if (didCall && didError) {
3717 if (!didSetError) {
3718 error2 = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`);
3719 } else if (isCrossOriginError) {
3720 error2 = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.");
3721 }
3722 this.onError(error2);
3723 }
3724 window.removeEventListener("error", handleWindowError);
3725 if (!didCall) {
3726 restoreAfterDispatch();
3727 return invokeGuardedCallbackProd.apply(this, arguments);
3728 }
3729 };
3730 }
3731 }
3732 var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
3733 var hasError = false;
3734 var caughtError = null;
3735 var hasRethrowError = false;
3736 var rethrowError = null;
3737 var reporter = {
3738 onError: function(error2) {
3739 hasError = true;
3740 caughtError = error2;
3741 }
3742 };
3743 function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
3744 hasError = false;
3745 caughtError = null;
3746 invokeGuardedCallbackImpl$1.apply(reporter, arguments);
3747 }
3748 function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
3749 invokeGuardedCallback.apply(this, arguments);
3750 if (hasError) {
3751 var error2 = clearCaughtError();
3752 if (!hasRethrowError) {
3753 hasRethrowError = true;
3754 rethrowError = error2;
3755 }
3756 }
3757 }
3758 function rethrowCaughtError() {
3759 if (hasRethrowError) {
3760 var error2 = rethrowError;
3761 hasRethrowError = false;
3762 rethrowError = null;
3763 throw error2;
3764 }
3765 }
3766 function hasCaughtError() {
3767 return hasError;
3768 }
3769 function clearCaughtError() {
3770 if (hasError) {
3771 var error2 = caughtError;
3772 hasError = false;
3773 caughtError = null;
3774 return error2;
3775 } else {
3776 throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
3777 }
3778 }
3779 function get(key) {
3780 return key._reactInternals;
3781 }
3782 function has(key) {
3783 return key._reactInternals !== void 0;
3784 }
3785 function set(key, value) {
3786 key._reactInternals = value;
3787 }
3788 var NoFlags = (
3789 /* */
3790 0
3791 );
3792 var PerformedWork = (
3793 /* */
3794 1
3795 );
3796 var Placement = (
3797 /* */
3798 2
3799 );
3800 var Update = (
3801 /* */
3802 4
3803 );
3804 var ChildDeletion = (
3805 /* */
3806 16
3807 );
3808 var ContentReset = (
3809 /* */
3810 32
3811 );
3812 var Callback = (
3813 /* */
3814 64
3815 );
3816 var DidCapture = (
3817 /* */
3818 128
3819 );
3820 var ForceClientRender = (
3821 /* */
3822 256
3823 );
3824 var Ref = (
3825 /* */
3826 512
3827 );
3828 var Snapshot = (
3829 /* */
3830 1024
3831 );
3832 var Passive = (
3833 /* */
3834 2048
3835 );
3836 var Hydrating = (
3837 /* */
3838 4096
3839 );
3840 var Visibility = (
3841 /* */
3842 8192
3843 );
3844 var StoreConsistency = (
3845 /* */
3846 16384
3847 );
3848 var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
3849 var HostEffectMask = (
3850 /* */
3851 32767
3852 );
3853 var Incomplete = (
3854 /* */
3855 32768
3856 );
3857 var ShouldCapture = (
3858 /* */
3859 65536
3860 );
3861 var ForceUpdateForLegacySuspense = (
3862 /* */
3863 131072
3864 );
3865 var Forked = (
3866 /* */
3867 1048576
3868 );
3869 var RefStatic = (
3870 /* */
3871 2097152
3872 );
3873 var LayoutStatic = (
3874 /* */
3875 4194304
3876 );
3877 var PassiveStatic = (
3878 /* */
3879 8388608
3880 );
3881 var MountLayoutDev = (
3882 /* */
3883 16777216
3884 );
3885 var MountPassiveDev = (
3886 /* */
3887 33554432
3888 );
3889 var BeforeMutationMask = (
3890 // TODO: Remove Update flag from before mutation phase by re-landing Visibility
3891 // flag logic (see #20043)
3892 Update | Snapshot | 0
3893 );
3894 var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility;
3895 var LayoutMask = Update | Callback | Ref | Visibility;
3896 var PassiveMask = Passive | ChildDeletion;
3897 var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
3898 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
3899 function getNearestMountedFiber(fiber) {
3900 var node = fiber;
3901 var nearestMounted = fiber;
3902 if (!fiber.alternate) {
3903 var nextNode = node;
3904 do {
3905 node = nextNode;
3906 if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
3907 nearestMounted = node.return;
3908 }
3909 nextNode = node.return;
3910 } while (nextNode);
3911 } else {
3912 while (node.return) {
3913 node = node.return;
3914 }
3915 }
3916 if (node.tag === HostRoot) {
3917 return nearestMounted;
3918 }
3919 return null;
3920 }
3921 function getSuspenseInstanceFromFiber(fiber) {
3922 if (fiber.tag === SuspenseComponent) {
3923 var suspenseState = fiber.memoizedState;
3924 if (suspenseState === null) {
3925 var current2 = fiber.alternate;
3926 if (current2 !== null) {
3927 suspenseState = current2.memoizedState;
3928 }
3929 }
3930 if (suspenseState !== null) {
3931 return suspenseState.dehydrated;
3932 }
3933 }
3934 return null;
3935 }
3936 function getContainerFromFiber(fiber) {
3937 return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
3938 }
3939 function isFiberMounted(fiber) {
3940 return getNearestMountedFiber(fiber) === fiber;
3941 }
3942 function isMounted(component) {
3943 {
3944 var owner = ReactCurrentOwner.current;
3945 if (owner !== null && owner.tag === ClassComponent) {
3946 var ownerFiber = owner;
3947 var instance = ownerFiber.stateNode;
3948 if (!instance._warnedAboutRefsInRender) {
3949 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(ownerFiber) || "A component");
3950 }
3951 instance._warnedAboutRefsInRender = true;
3952 }
3953 }
3954 var fiber = get(component);
3955 if (!fiber) {
3956 return false;
3957 }
3958 return getNearestMountedFiber(fiber) === fiber;
3959 }
3960 function assertIsMounted(fiber) {
3961 if (getNearestMountedFiber(fiber) !== fiber) {
3962 throw new Error("Unable to find node on an unmounted component.");
3963 }
3964 }
3965 function findCurrentFiberUsingSlowPath(fiber) {
3966 var alternate = fiber.alternate;
3967 if (!alternate) {
3968 var nearestMounted = getNearestMountedFiber(fiber);
3969 if (nearestMounted === null) {
3970 throw new Error("Unable to find node on an unmounted component.");
3971 }
3972 if (nearestMounted !== fiber) {
3973 return null;
3974 }
3975 return fiber;
3976 }
3977 var a = fiber;
3978 var b = alternate;
3979 while (true) {
3980 var parentA = a.return;
3981 if (parentA === null) {
3982 break;
3983 }
3984 var parentB = parentA.alternate;
3985 if (parentB === null) {
3986 var nextParent = parentA.return;
3987 if (nextParent !== null) {
3988 a = b = nextParent;
3989 continue;
3990 }
3991 break;
3992 }
3993 if (parentA.child === parentB.child) {
3994 var child = parentA.child;
3995 while (child) {
3996 if (child === a) {
3997 assertIsMounted(parentA);
3998 return fiber;
3999 }
4000 if (child === b) {
4001 assertIsMounted(parentA);
4002 return alternate;
4003 }
4004 child = child.sibling;
4005 }
4006 throw new Error("Unable to find node on an unmounted component.");
4007 }
4008 if (a.return !== b.return) {
4009 a = parentA;
4010 b = parentB;
4011 } else {
4012 var didFindChild = false;
4013 var _child = parentA.child;
4014 while (_child) {
4015 if (_child === a) {
4016 didFindChild = true;
4017 a = parentA;
4018 b = parentB;
4019 break;
4020 }
4021 if (_child === b) {
4022 didFindChild = true;
4023 b = parentA;
4024 a = parentB;
4025 break;
4026 }
4027 _child = _child.sibling;
4028 }
4029 if (!didFindChild) {
4030 _child = parentB.child;
4031 while (_child) {
4032 if (_child === a) {
4033 didFindChild = true;
4034 a = parentB;
4035 b = parentA;
4036 break;
4037 }
4038 if (_child === b) {
4039 didFindChild = true;
4040 b = parentB;
4041 a = parentA;
4042 break;
4043 }
4044 _child = _child.sibling;
4045 }
4046 if (!didFindChild) {
4047 throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
4048 }
4049 }
4050 }
4051 if (a.alternate !== b) {
4052 throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
4053 }
4054 }
4055 if (a.tag !== HostRoot) {
4056 throw new Error("Unable to find node on an unmounted component.");
4057 }
4058 if (a.stateNode.current === a) {
4059 return fiber;
4060 }
4061 return alternate;
4062 }
4063 function findCurrentHostFiber(parent) {
4064 var currentParent = findCurrentFiberUsingSlowPath(parent);
4065 return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
4066 }
4067 function findCurrentHostFiberImpl(node) {
4068 if (node.tag === HostComponent || node.tag === HostText) {
4069 return node;
4070 }
4071 var child = node.child;
4072 while (child !== null) {
4073 var match = findCurrentHostFiberImpl(child);
4074 if (match !== null) {
4075 return match;
4076 }
4077 child = child.sibling;
4078 }
4079 return null;
4080 }
4081 function findCurrentHostFiberWithNoPortals(parent) {
4082 var currentParent = findCurrentFiberUsingSlowPath(parent);
4083 return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
4084 }
4085 function findCurrentHostFiberWithNoPortalsImpl(node) {
4086 if (node.tag === HostComponent || node.tag === HostText) {
4087 return node;
4088 }
4089 var child = node.child;
4090 while (child !== null) {
4091 if (child.tag !== HostPortal) {
4092 var match = findCurrentHostFiberWithNoPortalsImpl(child);
4093 if (match !== null) {
4094 return match;
4095 }
4096 }
4097 child = child.sibling;
4098 }
4099 return null;
4100 }
4101 var scheduleCallback = Scheduler.unstable_scheduleCallback;
4102 var cancelCallback = Scheduler.unstable_cancelCallback;
4103 var shouldYield = Scheduler.unstable_shouldYield;
4104 var requestPaint = Scheduler.unstable_requestPaint;
4105 var now = Scheduler.unstable_now;
4106 var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
4107 var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
4108 var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
4109 var NormalPriority = Scheduler.unstable_NormalPriority;
4110 var LowPriority = Scheduler.unstable_LowPriority;
4111 var IdlePriority = Scheduler.unstable_IdlePriority;
4112 var unstable_yieldValue = Scheduler.unstable_yieldValue;
4113 var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
4114 var rendererID = null;
4115 var injectedHook = null;
4116 var injectedProfilingHooks = null;
4117 var hasLoggedError = false;
4118 var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
4119 function injectInternals(internals) {
4120 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
4121 return false;
4122 }
4123 var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
4124 if (hook.isDisabled) {
4125 return true;
4126 }
4127 if (!hook.supportsFiber) {
4128 {
4129 error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools");
4130 }
4131 return true;
4132 }
4133 try {
4134 if (enableSchedulingProfiler) {
4135 internals = assign({}, internals, {
4136 getLaneLabelMap,
4137 injectProfilingHooks
4138 });
4139 }
4140 rendererID = hook.inject(internals);
4141 injectedHook = hook;
4142 } catch (err) {
4143 {
4144 error("React instrumentation encountered an error: %s.", err);
4145 }
4146 }
4147 if (hook.checkDCE) {
4148 return true;
4149 } else {
4150 return false;
4151 }
4152 }
4153 function onScheduleRoot(root2, children) {
4154 {
4155 if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
4156 try {
4157 injectedHook.onScheduleFiberRoot(rendererID, root2, children);
4158 } catch (err) {
4159 if (!hasLoggedError) {
4160 hasLoggedError = true;
4161 error("React instrumentation encountered an error: %s", err);
4162 }
4163 }
4164 }
4165 }
4166 }
4167 function onCommitRoot(root2, eventPriority) {
4168 if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
4169 try {
4170 var didError = (root2.current.flags & DidCapture) === DidCapture;
4171 if (enableProfilerTimer) {
4172 var schedulerPriority;
4173 switch (eventPriority) {
4174 case DiscreteEventPriority:
4175 schedulerPriority = ImmediatePriority;
4176 break;
4177 case ContinuousEventPriority:
4178 schedulerPriority = UserBlockingPriority;
4179 break;
4180 case DefaultEventPriority:
4181 schedulerPriority = NormalPriority;
4182 break;
4183 case IdleEventPriority:
4184 schedulerPriority = IdlePriority;
4185 break;
4186 default:
4187 schedulerPriority = NormalPriority;
4188 break;
4189 }
4190 injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
4191 } else {
4192 injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
4193 }
4194 } catch (err) {
4195 {
4196 if (!hasLoggedError) {
4197 hasLoggedError = true;
4198 error("React instrumentation encountered an error: %s", err);
4199 }
4200 }
4201 }
4202 }
4203 }
4204 function onPostCommitRoot(root2) {
4205 if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
4206 try {
4207 injectedHook.onPostCommitFiberRoot(rendererID, root2);
4208 } catch (err) {
4209 {
4210 if (!hasLoggedError) {
4211 hasLoggedError = true;
4212 error("React instrumentation encountered an error: %s", err);
4213 }
4214 }
4215 }
4216 }
4217 }
4218 function onCommitUnmount(fiber) {
4219 if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
4220 try {
4221 injectedHook.onCommitFiberUnmount(rendererID, fiber);
4222 } catch (err) {
4223 {
4224 if (!hasLoggedError) {
4225 hasLoggedError = true;
4226 error("React instrumentation encountered an error: %s", err);
4227 }
4228 }
4229 }
4230 }
4231 }
4232 function setIsStrictModeForDevtools(newIsStrictMode) {
4233 {
4234 if (typeof unstable_yieldValue === "function") {
4235 unstable_setDisableYieldValue(newIsStrictMode);
4236 setSuppressWarning(newIsStrictMode);
4237 }
4238 if (injectedHook && typeof injectedHook.setStrictMode === "function") {
4239 try {
4240 injectedHook.setStrictMode(rendererID, newIsStrictMode);
4241 } catch (err) {
4242 {
4243 if (!hasLoggedError) {
4244 hasLoggedError = true;
4245 error("React instrumentation encountered an error: %s", err);
4246 }
4247 }
4248 }
4249 }
4250 }
4251 }
4252 function injectProfilingHooks(profilingHooks) {
4253 injectedProfilingHooks = profilingHooks;
4254 }
4255 function getLaneLabelMap() {
4256 {
4257 var map = /* @__PURE__ */ new Map();
4258 var lane = 1;
4259 for (var index2 = 0; index2 < TotalLanes; index2++) {
4260 var label = getLabelForLane(lane);
4261 map.set(lane, label);
4262 lane *= 2;
4263 }
4264 return map;
4265 }
4266 }
4267 function markCommitStarted(lanes) {
4268 {
4269 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
4270 injectedProfilingHooks.markCommitStarted(lanes);
4271 }
4272 }
4273 }
4274 function markCommitStopped() {
4275 {
4276 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
4277 injectedProfilingHooks.markCommitStopped();
4278 }
4279 }
4280 }
4281 function markComponentRenderStarted(fiber) {
4282 {
4283 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
4284 injectedProfilingHooks.markComponentRenderStarted(fiber);
4285 }
4286 }
4287 }
4288 function markComponentRenderStopped() {
4289 {
4290 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
4291 injectedProfilingHooks.markComponentRenderStopped();
4292 }
4293 }
4294 }
4295 function markComponentPassiveEffectMountStarted(fiber) {
4296 {
4297 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
4298 injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
4299 }
4300 }
4301 }
4302 function markComponentPassiveEffectMountStopped() {
4303 {
4304 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
4305 injectedProfilingHooks.markComponentPassiveEffectMountStopped();
4306 }
4307 }
4308 }
4309 function markComponentPassiveEffectUnmountStarted(fiber) {
4310 {
4311 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
4312 injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
4313 }
4314 }
4315 }
4316 function markComponentPassiveEffectUnmountStopped() {
4317 {
4318 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
4319 injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
4320 }
4321 }
4322 }
4323 function markComponentLayoutEffectMountStarted(fiber) {
4324 {
4325 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
4326 injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
4327 }
4328 }
4329 }
4330 function markComponentLayoutEffectMountStopped() {
4331 {
4332 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
4333 injectedProfilingHooks.markComponentLayoutEffectMountStopped();
4334 }
4335 }
4336 }
4337 function markComponentLayoutEffectUnmountStarted(fiber) {
4338 {
4339 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
4340 injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
4341 }
4342 }
4343 }
4344 function markComponentLayoutEffectUnmountStopped() {
4345 {
4346 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
4347 injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
4348 }
4349 }
4350 }
4351 function markComponentErrored(fiber, thrownValue, lanes) {
4352 {
4353 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
4354 injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
4355 }
4356 }
4357 }
4358 function markComponentSuspended(fiber, wakeable, lanes) {
4359 {
4360 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
4361 injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
4362 }
4363 }
4364 }
4365 function markLayoutEffectsStarted(lanes) {
4366 {
4367 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
4368 injectedProfilingHooks.markLayoutEffectsStarted(lanes);
4369 }
4370 }
4371 }
4372 function markLayoutEffectsStopped() {
4373 {
4374 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
4375 injectedProfilingHooks.markLayoutEffectsStopped();
4376 }
4377 }
4378 }
4379 function markPassiveEffectsStarted(lanes) {
4380 {
4381 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
4382 injectedProfilingHooks.markPassiveEffectsStarted(lanes);
4383 }
4384 }
4385 }
4386 function markPassiveEffectsStopped() {
4387 {
4388 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
4389 injectedProfilingHooks.markPassiveEffectsStopped();
4390 }
4391 }
4392 }
4393 function markRenderStarted(lanes) {
4394 {
4395 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
4396 injectedProfilingHooks.markRenderStarted(lanes);
4397 }
4398 }
4399 }
4400 function markRenderYielded() {
4401 {
4402 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
4403 injectedProfilingHooks.markRenderYielded();
4404 }
4405 }
4406 }
4407 function markRenderStopped() {
4408 {
4409 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
4410 injectedProfilingHooks.markRenderStopped();
4411 }
4412 }
4413 }
4414 function markRenderScheduled(lane) {
4415 {
4416 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
4417 injectedProfilingHooks.markRenderScheduled(lane);
4418 }
4419 }
4420 }
4421 function markForceUpdateScheduled(fiber, lane) {
4422 {
4423 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
4424 injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
4425 }
4426 }
4427 }
4428 function markStateUpdateScheduled(fiber, lane) {
4429 {
4430 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
4431 injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
4432 }
4433 }
4434 }
4435 var NoMode = (
4436 /* */
4437 0
4438 );
4439 var ConcurrentMode = (
4440 /* */
4441 1
4442 );
4443 var ProfileMode = (
4444 /* */
4445 2
4446 );
4447 var StrictLegacyMode = (
4448 /* */
4449 8
4450 );
4451 var StrictEffectsMode = (
4452 /* */
4453 16
4454 );
4455 var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
4456 var log = Math.log;
4457 var LN2 = Math.LN2;
4458 function clz32Fallback(x) {
4459 var asUint = x >>> 0;
4460 if (asUint === 0) {
4461 return 32;
4462 }
4463 return 31 - (log(asUint) / LN2 | 0) | 0;
4464 }
4465 var TotalLanes = 31;
4466 var NoLanes = (
4467 /* */
4468 0
4469 );
4470 var NoLane = (
4471 /* */
4472 0
4473 );
4474 var SyncLane = (
4475 /* */
4476 1
4477 );
4478 var InputContinuousHydrationLane = (
4479 /* */
4480 2
4481 );
4482 var InputContinuousLane = (
4483 /* */
4484 4
4485 );
4486 var DefaultHydrationLane = (
4487 /* */
4488 8
4489 );
4490 var DefaultLane = (
4491 /* */
4492 16
4493 );
4494 var TransitionHydrationLane = (
4495 /* */
4496 32
4497 );
4498 var TransitionLanes = (
4499 /* */
4500 4194240
4501 );
4502 var TransitionLane1 = (
4503 /* */
4504 64
4505 );
4506 var TransitionLane2 = (
4507 /* */
4508 128
4509 );
4510 var TransitionLane3 = (
4511 /* */
4512 256
4513 );
4514 var TransitionLane4 = (
4515 /* */
4516 512
4517 );
4518 var TransitionLane5 = (
4519 /* */
4520 1024
4521 );
4522 var TransitionLane6 = (
4523 /* */
4524 2048
4525 );
4526 var TransitionLane7 = (
4527 /* */
4528 4096
4529 );
4530 var TransitionLane8 = (
4531 /* */
4532 8192
4533 );
4534 var TransitionLane9 = (
4535 /* */
4536 16384
4537 );
4538 var TransitionLane10 = (
4539 /* */
4540 32768
4541 );
4542 var TransitionLane11 = (
4543 /* */
4544 65536
4545 );
4546 var TransitionLane12 = (
4547 /* */
4548 131072
4549 );
4550 var TransitionLane13 = (
4551 /* */
4552 262144
4553 );
4554 var TransitionLane14 = (
4555 /* */
4556 524288
4557 );
4558 var TransitionLane15 = (
4559 /* */
4560 1048576
4561 );
4562 var TransitionLane16 = (
4563 /* */
4564 2097152
4565 );
4566 var RetryLanes = (
4567 /* */
4568 130023424
4569 );
4570 var RetryLane1 = (
4571 /* */
4572 4194304
4573 );
4574 var RetryLane2 = (
4575 /* */
4576 8388608
4577 );
4578 var RetryLane3 = (
4579 /* */
4580 16777216
4581 );
4582 var RetryLane4 = (
4583 /* */
4584 33554432
4585 );
4586 var RetryLane5 = (
4587 /* */
4588 67108864
4589 );
4590 var SomeRetryLane = RetryLane1;
4591 var SelectiveHydrationLane = (
4592 /* */
4593 134217728
4594 );
4595 var NonIdleLanes = (
4596 /* */
4597 268435455
4598 );
4599 var IdleHydrationLane = (
4600 /* */
4601 268435456
4602 );
4603 var IdleLane = (
4604 /* */
4605 536870912
4606 );
4607 var OffscreenLane = (
4608 /* */
4609 1073741824
4610 );
4611 function getLabelForLane(lane) {
4612 {
4613 if (lane & SyncLane) {
4614 return "Sync";
4615 }
4616 if (lane & InputContinuousHydrationLane) {
4617 return "InputContinuousHydration";
4618 }
4619 if (lane & InputContinuousLane) {
4620 return "InputContinuous";
4621 }
4622 if (lane & DefaultHydrationLane) {
4623 return "DefaultHydration";
4624 }
4625 if (lane & DefaultLane) {
4626 return "Default";
4627 }
4628 if (lane & TransitionHydrationLane) {
4629 return "TransitionHydration";
4630 }
4631 if (lane & TransitionLanes) {
4632 return "Transition";
4633 }
4634 if (lane & RetryLanes) {
4635 return "Retry";
4636 }
4637 if (lane & SelectiveHydrationLane) {
4638 return "SelectiveHydration";
4639 }
4640 if (lane & IdleHydrationLane) {
4641 return "IdleHydration";
4642 }
4643 if (lane & IdleLane) {
4644 return "Idle";
4645 }
4646 if (lane & OffscreenLane) {
4647 return "Offscreen";
4648 }
4649 }
4650 }
4651 var NoTimestamp = -1;
4652 var nextTransitionLane = TransitionLane1;
4653 var nextRetryLane = RetryLane1;
4654 function getHighestPriorityLanes(lanes) {
4655 switch (getHighestPriorityLane(lanes)) {
4656 case SyncLane:
4657 return SyncLane;
4658 case InputContinuousHydrationLane:
4659 return InputContinuousHydrationLane;
4660 case InputContinuousLane:
4661 return InputContinuousLane;
4662 case DefaultHydrationLane:
4663 return DefaultHydrationLane;
4664 case DefaultLane:
4665 return DefaultLane;
4666 case TransitionHydrationLane:
4667 return TransitionHydrationLane;
4668 case TransitionLane1:
4669 case TransitionLane2:
4670 case TransitionLane3:
4671 case TransitionLane4:
4672 case TransitionLane5:
4673 case TransitionLane6:
4674 case TransitionLane7:
4675 case TransitionLane8:
4676 case TransitionLane9:
4677 case TransitionLane10:
4678 case TransitionLane11:
4679 case TransitionLane12:
4680 case TransitionLane13:
4681 case TransitionLane14:
4682 case TransitionLane15:
4683 case TransitionLane16:
4684 return lanes & TransitionLanes;
4685 case RetryLane1:
4686 case RetryLane2:
4687 case RetryLane3:
4688 case RetryLane4:
4689 case RetryLane5:
4690 return lanes & RetryLanes;
4691 case SelectiveHydrationLane:
4692 return SelectiveHydrationLane;
4693 case IdleHydrationLane:
4694 return IdleHydrationLane;
4695 case IdleLane:
4696 return IdleLane;
4697 case OffscreenLane:
4698 return OffscreenLane;
4699 default:
4700 {
4701 error("Should have found matching lanes. This is a bug in React.");
4702 }
4703 return lanes;
4704 }
4705 }
4706 function getNextLanes(root2, wipLanes) {
4707 var pendingLanes = root2.pendingLanes;
4708 if (pendingLanes === NoLanes) {
4709 return NoLanes;
4710 }
4711 var nextLanes = NoLanes;
4712 var suspendedLanes = root2.suspendedLanes;
4713 var pingedLanes = root2.pingedLanes;
4714 var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
4715 if (nonIdlePendingLanes !== NoLanes) {
4716 var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
4717 if (nonIdleUnblockedLanes !== NoLanes) {
4718 nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
4719 } else {
4720 var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
4721 if (nonIdlePingedLanes !== NoLanes) {
4722 nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
4723 }
4724 }
4725 } else {
4726 var unblockedLanes = pendingLanes & ~suspendedLanes;
4727 if (unblockedLanes !== NoLanes) {
4728 nextLanes = getHighestPriorityLanes(unblockedLanes);
4729 } else {
4730 if (pingedLanes !== NoLanes) {
4731 nextLanes = getHighestPriorityLanes(pingedLanes);
4732 }
4733 }
4734 }
4735 if (nextLanes === NoLanes) {
4736 return NoLanes;
4737 }
4738 if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
4739 // bother waiting until the root is complete.
4740 (wipLanes & suspendedLanes) === NoLanes) {
4741 var nextLane = getHighestPriorityLane(nextLanes);
4742 var wipLane = getHighestPriorityLane(wipLanes);
4743 if (
4744 // Tests whether the next lane is equal or lower priority than the wip
4745 // one. This works because the bits decrease in priority as you go left.
4746 nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The
4747 // only difference between default updates and transition updates is that
4748 // default updates do not support refresh transitions.
4749 nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes
4750 ) {
4751 return wipLanes;
4752 }
4753 }
4754 if ((nextLanes & InputContinuousLane) !== NoLanes) {
4755 nextLanes |= pendingLanes & DefaultLane;
4756 }
4757 var entangledLanes = root2.entangledLanes;
4758 if (entangledLanes !== NoLanes) {
4759 var entanglements = root2.entanglements;
4760 var lanes = nextLanes & entangledLanes;
4761 while (lanes > 0) {
4762 var index2 = pickArbitraryLaneIndex(lanes);
4763 var lane = 1 << index2;
4764 nextLanes |= entanglements[index2];
4765 lanes &= ~lane;
4766 }
4767 }
4768 return nextLanes;
4769 }
4770 function getMostRecentEventTime(root2, lanes) {
4771 var eventTimes = root2.eventTimes;
4772 var mostRecentEventTime = NoTimestamp;
4773 while (lanes > 0) {
4774 var index2 = pickArbitraryLaneIndex(lanes);
4775 var lane = 1 << index2;
4776 var eventTime = eventTimes[index2];
4777 if (eventTime > mostRecentEventTime) {
4778 mostRecentEventTime = eventTime;
4779 }
4780 lanes &= ~lane;
4781 }
4782 return mostRecentEventTime;
4783 }
4784 function computeExpirationTime(lane, currentTime) {
4785 switch (lane) {
4786 case SyncLane:
4787 case InputContinuousHydrationLane:
4788 case InputContinuousLane:
4789 return currentTime + 250;
4790 case DefaultHydrationLane:
4791 case DefaultLane:
4792 case TransitionHydrationLane:
4793 case TransitionLane1:
4794 case TransitionLane2:
4795 case TransitionLane3:
4796 case TransitionLane4:
4797 case TransitionLane5:
4798 case TransitionLane6:
4799 case TransitionLane7:
4800 case TransitionLane8:
4801 case TransitionLane9:
4802 case TransitionLane10:
4803 case TransitionLane11:
4804 case TransitionLane12:
4805 case TransitionLane13:
4806 case TransitionLane14:
4807 case TransitionLane15:
4808 case TransitionLane16:
4809 return currentTime + 5e3;
4810 case RetryLane1:
4811 case RetryLane2:
4812 case RetryLane3:
4813 case RetryLane4:
4814 case RetryLane5:
4815 return NoTimestamp;
4816 case SelectiveHydrationLane:
4817 case IdleHydrationLane:
4818 case IdleLane:
4819 case OffscreenLane:
4820 return NoTimestamp;
4821 default:
4822 {
4823 error("Should have found matching lanes. This is a bug in React.");
4824 }
4825 return NoTimestamp;
4826 }
4827 }
4828 function markStarvedLanesAsExpired(root2, currentTime) {
4829 var pendingLanes = root2.pendingLanes;
4830 var suspendedLanes = root2.suspendedLanes;
4831 var pingedLanes = root2.pingedLanes;
4832 var expirationTimes = root2.expirationTimes;
4833 var lanes = pendingLanes;
4834 while (lanes > 0) {
4835 var index2 = pickArbitraryLaneIndex(lanes);
4836 var lane = 1 << index2;
4837 var expirationTime = expirationTimes[index2];
4838 if (expirationTime === NoTimestamp) {
4839 if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
4840 expirationTimes[index2] = computeExpirationTime(lane, currentTime);
4841 }
4842 } else if (expirationTime <= currentTime) {
4843 root2.expiredLanes |= lane;
4844 }
4845 lanes &= ~lane;
4846 }
4847 }
4848 function getHighestPriorityPendingLanes(root2) {
4849 return getHighestPriorityLanes(root2.pendingLanes);
4850 }
4851 function getLanesToRetrySynchronouslyOnError(root2) {
4852 var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
4853 if (everythingButOffscreen !== NoLanes) {
4854 return everythingButOffscreen;
4855 }
4856 if (everythingButOffscreen & OffscreenLane) {
4857 return OffscreenLane;
4858 }
4859 return NoLanes;
4860 }
4861 function includesSyncLane(lanes) {
4862 return (lanes & SyncLane) !== NoLanes;
4863 }
4864 function includesNonIdleWork(lanes) {
4865 return (lanes & NonIdleLanes) !== NoLanes;
4866 }
4867 function includesOnlyRetries(lanes) {
4868 return (lanes & RetryLanes) === lanes;
4869 }
4870 function includesOnlyNonUrgentLanes(lanes) {
4871 var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
4872 return (lanes & UrgentLanes) === NoLanes;
4873 }
4874 function includesOnlyTransitions(lanes) {
4875 return (lanes & TransitionLanes) === lanes;
4876 }
4877 function includesBlockingLane(root2, lanes) {
4878 var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
4879 return (lanes & SyncDefaultLanes) !== NoLanes;
4880 }
4881 function includesExpiredLane(root2, lanes) {
4882 return (lanes & root2.expiredLanes) !== NoLanes;
4883 }
4884 function isTransitionLane(lane) {
4885 return (lane & TransitionLanes) !== NoLanes;
4886 }
4887 function claimNextTransitionLane() {
4888 var lane = nextTransitionLane;
4889 nextTransitionLane <<= 1;
4890 if ((nextTransitionLane & TransitionLanes) === NoLanes) {
4891 nextTransitionLane = TransitionLane1;
4892 }
4893 return lane;
4894 }
4895 function claimNextRetryLane() {
4896 var lane = nextRetryLane;
4897 nextRetryLane <<= 1;
4898 if ((nextRetryLane & RetryLanes) === NoLanes) {
4899 nextRetryLane = RetryLane1;
4900 }
4901 return lane;
4902 }
4903 function getHighestPriorityLane(lanes) {
4904 return lanes & -lanes;
4905 }
4906 function pickArbitraryLane(lanes) {
4907 return getHighestPriorityLane(lanes);
4908 }
4909 function pickArbitraryLaneIndex(lanes) {
4910 return 31 - clz32(lanes);
4911 }
4912 function laneToIndex(lane) {
4913 return pickArbitraryLaneIndex(lane);
4914 }
4915 function includesSomeLane(a, b) {
4916 return (a & b) !== NoLanes;
4917 }
4918 function isSubsetOfLanes(set2, subset) {
4919 return (set2 & subset) === subset;
4920 }
4921 function mergeLanes(a, b) {
4922 return a | b;
4923 }
4924 function removeLanes(set2, subset) {
4925 return set2 & ~subset;
4926 }
4927 function intersectLanes(a, b) {
4928 return a & b;
4929 }
4930 function laneToLanes(lane) {
4931 return lane;
4932 }
4933 function higherPriorityLane(a, b) {
4934 return a !== NoLane && a < b ? a : b;
4935 }
4936 function createLaneMap(initial) {
4937 var laneMap = [];
4938 for (var i = 0; i < TotalLanes; i++) {
4939 laneMap.push(initial);
4940 }
4941 return laneMap;
4942 }
4943 function markRootUpdated(root2, updateLane, eventTime) {
4944 root2.pendingLanes |= updateLane;
4945 if (updateLane !== IdleLane) {
4946 root2.suspendedLanes = NoLanes;
4947 root2.pingedLanes = NoLanes;
4948 }
4949 var eventTimes = root2.eventTimes;
4950 var index2 = laneToIndex(updateLane);
4951 eventTimes[index2] = eventTime;
4952 }
4953 function markRootSuspended(root2, suspendedLanes) {
4954 root2.suspendedLanes |= suspendedLanes;
4955 root2.pingedLanes &= ~suspendedLanes;
4956 var expirationTimes = root2.expirationTimes;
4957 var lanes = suspendedLanes;
4958 while (lanes > 0) {
4959 var index2 = pickArbitraryLaneIndex(lanes);
4960 var lane = 1 << index2;
4961 expirationTimes[index2] = NoTimestamp;
4962 lanes &= ~lane;
4963 }
4964 }
4965 function markRootPinged(root2, pingedLanes, eventTime) {
4966 root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
4967 }
4968 function markRootFinished(root2, remainingLanes) {
4969 var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
4970 root2.pendingLanes = remainingLanes;
4971 root2.suspendedLanes = NoLanes;
4972 root2.pingedLanes = NoLanes;
4973 root2.expiredLanes &= remainingLanes;
4974 root2.mutableReadLanes &= remainingLanes;
4975 root2.entangledLanes &= remainingLanes;
4976 var entanglements = root2.entanglements;
4977 var eventTimes = root2.eventTimes;
4978 var expirationTimes = root2.expirationTimes;
4979 var lanes = noLongerPendingLanes;
4980 while (lanes > 0) {
4981 var index2 = pickArbitraryLaneIndex(lanes);
4982 var lane = 1 << index2;
4983 entanglements[index2] = NoLanes;
4984 eventTimes[index2] = NoTimestamp;
4985 expirationTimes[index2] = NoTimestamp;
4986 lanes &= ~lane;
4987 }
4988 }
4989 function markRootEntangled(root2, entangledLanes) {
4990 var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
4991 var entanglements = root2.entanglements;
4992 var lanes = rootEntangledLanes;
4993 while (lanes) {
4994 var index2 = pickArbitraryLaneIndex(lanes);
4995 var lane = 1 << index2;
4996 if (
4997 // Is this one of the newly entangled lanes?
4998 lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?
4999 entanglements[index2] & entangledLanes
5000 ) {
5001 entanglements[index2] |= entangledLanes;
5002 }
5003 lanes &= ~lane;
5004 }
5005 }
5006 function getBumpedLaneForHydration(root2, renderLanes2) {
5007 var renderLane = getHighestPriorityLane(renderLanes2);
5008 var lane;
5009 switch (renderLane) {
5010 case InputContinuousLane:
5011 lane = InputContinuousHydrationLane;
5012 break;
5013 case DefaultLane:
5014 lane = DefaultHydrationLane;
5015 break;
5016 case TransitionLane1:
5017 case TransitionLane2:
5018 case TransitionLane3:
5019 case TransitionLane4:
5020 case TransitionLane5:
5021 case TransitionLane6:
5022 case TransitionLane7:
5023 case TransitionLane8:
5024 case TransitionLane9:
5025 case TransitionLane10:
5026 case TransitionLane11:
5027 case TransitionLane12:
5028 case TransitionLane13:
5029 case TransitionLane14:
5030 case TransitionLane15:
5031 case TransitionLane16:
5032 case RetryLane1:
5033 case RetryLane2:
5034 case RetryLane3:
5035 case RetryLane4:
5036 case RetryLane5:
5037 lane = TransitionHydrationLane;
5038 break;
5039 case IdleLane:
5040 lane = IdleHydrationLane;
5041 break;
5042 default:
5043 lane = NoLane;
5044 break;
5045 }
5046 if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
5047 return NoLane;
5048 }
5049 return lane;
5050 }
5051 function addFiberToLanesMap(root2, fiber, lanes) {
5052 if (!isDevToolsPresent) {
5053 return;
5054 }
5055 var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
5056 while (lanes > 0) {
5057 var index2 = laneToIndex(lanes);
5058 var lane = 1 << index2;
5059 var updaters = pendingUpdatersLaneMap[index2];
5060 updaters.add(fiber);
5061 lanes &= ~lane;
5062 }
5063 }
5064 function movePendingFibersToMemoized(root2, lanes) {
5065 if (!isDevToolsPresent) {
5066 return;
5067 }
5068 var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
5069 var memoizedUpdaters = root2.memoizedUpdaters;
5070 while (lanes > 0) {
5071 var index2 = laneToIndex(lanes);
5072 var lane = 1 << index2;
5073 var updaters = pendingUpdatersLaneMap[index2];
5074 if (updaters.size > 0) {
5075 updaters.forEach(function(fiber) {
5076 var alternate = fiber.alternate;
5077 if (alternate === null || !memoizedUpdaters.has(alternate)) {
5078 memoizedUpdaters.add(fiber);
5079 }
5080 });
5081 updaters.clear();
5082 }
5083 lanes &= ~lane;
5084 }
5085 }
5086 function getTransitionsForLanes(root2, lanes) {
5087 {
5088 return null;
5089 }
5090 }
5091 var DiscreteEventPriority = SyncLane;
5092 var ContinuousEventPriority = InputContinuousLane;
5093 var DefaultEventPriority = DefaultLane;
5094 var IdleEventPriority = IdleLane;
5095 var currentUpdatePriority = NoLane;
5096 function getCurrentUpdatePriority() {
5097 return currentUpdatePriority;
5098 }
5099 function setCurrentUpdatePriority(newPriority) {
5100 currentUpdatePriority = newPriority;
5101 }
5102 function runWithPriority(priority, fn) {
5103 var previousPriority = currentUpdatePriority;
5104 try {
5105 currentUpdatePriority = priority;
5106 return fn();
5107 } finally {
5108 currentUpdatePriority = previousPriority;
5109 }
5110 }
5111 function higherEventPriority(a, b) {
5112 return a !== 0 && a < b ? a : b;
5113 }
5114 function lowerEventPriority(a, b) {
5115 return a === 0 || a > b ? a : b;
5116 }
5117 function isHigherEventPriority(a, b) {
5118 return a !== 0 && a < b;
5119 }
5120 function lanesToEventPriority(lanes) {
5121 var lane = getHighestPriorityLane(lanes);
5122 if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
5123 return DiscreteEventPriority;
5124 }
5125 if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
5126 return ContinuousEventPriority;
5127 }
5128 if (includesNonIdleWork(lane)) {
5129 return DefaultEventPriority;
5130 }
5131 return IdleEventPriority;
5132 }
5133 function isRootDehydrated(root2) {
5134 var currentState = root2.current.memoizedState;
5135 return currentState.isDehydrated;
5136 }
5137 var _attemptSynchronousHydration;
5138 function setAttemptSynchronousHydration(fn) {
5139 _attemptSynchronousHydration = fn;
5140 }
5141 function attemptSynchronousHydration(fiber) {
5142 _attemptSynchronousHydration(fiber);
5143 }
5144 var attemptContinuousHydration;
5145 function setAttemptContinuousHydration(fn) {
5146 attemptContinuousHydration = fn;
5147 }
5148 var attemptHydrationAtCurrentPriority;
5149 function setAttemptHydrationAtCurrentPriority(fn) {
5150 attemptHydrationAtCurrentPriority = fn;
5151 }
5152 var getCurrentUpdatePriority$1;
5153 function setGetCurrentUpdatePriority(fn) {
5154 getCurrentUpdatePriority$1 = fn;
5155 }
5156 var attemptHydrationAtPriority;
5157 function setAttemptHydrationAtPriority(fn) {
5158 attemptHydrationAtPriority = fn;
5159 }
5160 var hasScheduledReplayAttempt = false;
5161 var queuedDiscreteEvents = [];
5162 var queuedFocus = null;
5163 var queuedDrag = null;
5164 var queuedMouse = null;
5165 var queuedPointers = /* @__PURE__ */ new Map();
5166 var queuedPointerCaptures = /* @__PURE__ */ new Map();
5167 var queuedExplicitHydrationTargets = [];
5168 var discreteReplayableEvents = [
5169 "mousedown",
5170 "mouseup",
5171 "touchcancel",
5172 "touchend",
5173 "touchstart",
5174 "auxclick",
5175 "dblclick",
5176 "pointercancel",
5177 "pointerdown",
5178 "pointerup",
5179 "dragend",
5180 "dragstart",
5181 "drop",
5182 "compositionend",
5183 "compositionstart",
5184 "keydown",
5185 "keypress",
5186 "keyup",
5187 "input",
5188 "textInput",
5189 // Intentionally camelCase
5190 "copy",
5191 "cut",
5192 "paste",
5193 "click",
5194 "change",
5195 "contextmenu",
5196 "reset",
5197 "submit"
5198 ];
5199 function isDiscreteEventThatRequiresHydration(eventType) {
5200 return discreteReplayableEvents.indexOf(eventType) > -1;
5201 }
5202 function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5203 return {
5204 blockedOn,
5205 domEventName,
5206 eventSystemFlags,
5207 nativeEvent,
5208 targetContainers: [targetContainer]
5209 };
5210 }
5211 function clearIfContinuousEvent(domEventName, nativeEvent) {
5212 switch (domEventName) {
5213 case "focusin":
5214 case "focusout":
5215 queuedFocus = null;
5216 break;
5217 case "dragenter":
5218 case "dragleave":
5219 queuedDrag = null;
5220 break;
5221 case "mouseover":
5222 case "mouseout":
5223 queuedMouse = null;
5224 break;
5225 case "pointerover":
5226 case "pointerout": {
5227 var pointerId = nativeEvent.pointerId;
5228 queuedPointers.delete(pointerId);
5229 break;
5230 }
5231 case "gotpointercapture":
5232 case "lostpointercapture": {
5233 var _pointerId = nativeEvent.pointerId;
5234 queuedPointerCaptures.delete(_pointerId);
5235 break;
5236 }
5237 }
5238 }
5239 function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5240 if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
5241 var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
5242 if (blockedOn !== null) {
5243 var _fiber2 = getInstanceFromNode(blockedOn);
5244 if (_fiber2 !== null) {
5245 attemptContinuousHydration(_fiber2);
5246 }
5247 }
5248 return queuedEvent;
5249 }
5250 existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
5251 var targetContainers = existingQueuedEvent.targetContainers;
5252 if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
5253 targetContainers.push(targetContainer);
5254 }
5255 return existingQueuedEvent;
5256 }
5257 function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5258 switch (domEventName) {
5259 case "focusin": {
5260 var focusEvent = nativeEvent;
5261 queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
5262 return true;
5263 }
5264 case "dragenter": {
5265 var dragEvent = nativeEvent;
5266 queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
5267 return true;
5268 }
5269 case "mouseover": {
5270 var mouseEvent = nativeEvent;
5271 queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
5272 return true;
5273 }
5274 case "pointerover": {
5275 var pointerEvent = nativeEvent;
5276 var pointerId = pointerEvent.pointerId;
5277 queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
5278 return true;
5279 }
5280 case "gotpointercapture": {
5281 var _pointerEvent = nativeEvent;
5282 var _pointerId2 = _pointerEvent.pointerId;
5283 queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
5284 return true;
5285 }
5286 }
5287 return false;
5288 }
5289 function attemptExplicitHydrationTarget(queuedTarget) {
5290 var targetInst = getClosestInstanceFromNode(queuedTarget.target);
5291 if (targetInst !== null) {
5292 var nearestMounted = getNearestMountedFiber(targetInst);
5293 if (nearestMounted !== null) {
5294 var tag = nearestMounted.tag;
5295 if (tag === SuspenseComponent) {
5296 var instance = getSuspenseInstanceFromFiber(nearestMounted);
5297 if (instance !== null) {
5298 queuedTarget.blockedOn = instance;
5299 attemptHydrationAtPriority(queuedTarget.priority, function() {
5300 attemptHydrationAtCurrentPriority(nearestMounted);
5301 });
5302 return;
5303 }
5304 } else if (tag === HostRoot) {
5305 var root2 = nearestMounted.stateNode;
5306 if (isRootDehydrated(root2)) {
5307 queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
5308 return;
5309 }
5310 }
5311 }
5312 }
5313 queuedTarget.blockedOn = null;
5314 }
5315 function queueExplicitHydrationTarget(target) {
5316 var updatePriority = getCurrentUpdatePriority$1();
5317 var queuedTarget = {
5318 blockedOn: null,
5319 target,
5320 priority: updatePriority
5321 };
5322 var i = 0;
5323 for (; i < queuedExplicitHydrationTargets.length; i++) {
5324 if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) {
5325 break;
5326 }
5327 }
5328 queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
5329 if (i === 0) {
5330 attemptExplicitHydrationTarget(queuedTarget);
5331 }
5332 }
5333 function attemptReplayContinuousQueuedEvent(queuedEvent) {
5334 if (queuedEvent.blockedOn !== null) {
5335 return false;
5336 }
5337 var targetContainers = queuedEvent.targetContainers;
5338 while (targetContainers.length > 0) {
5339 var targetContainer = targetContainers[0];
5340 var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
5341 if (nextBlockedOn === null) {
5342 {
5343 var nativeEvent = queuedEvent.nativeEvent;
5344 var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
5345 setReplayingEvent(nativeEventClone);
5346 nativeEvent.target.dispatchEvent(nativeEventClone);
5347 resetReplayingEvent();
5348 }
5349 } else {
5350 var _fiber3 = getInstanceFromNode(nextBlockedOn);
5351 if (_fiber3 !== null) {
5352 attemptContinuousHydration(_fiber3);
5353 }
5354 queuedEvent.blockedOn = nextBlockedOn;
5355 return false;
5356 }
5357 targetContainers.shift();
5358 }
5359 return true;
5360 }
5361 function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
5362 if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
5363 map.delete(key);
5364 }
5365 }
5366 function replayUnblockedEvents() {
5367 hasScheduledReplayAttempt = false;
5368 if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
5369 queuedFocus = null;
5370 }
5371 if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
5372 queuedDrag = null;
5373 }
5374 if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
5375 queuedMouse = null;
5376 }
5377 queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
5378 queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
5379 }
5380 function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
5381 if (queuedEvent.blockedOn === unblocked) {
5382 queuedEvent.blockedOn = null;
5383 if (!hasScheduledReplayAttempt) {
5384 hasScheduledReplayAttempt = true;
5385 Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
5386 }
5387 }
5388 }
5389 function retryIfBlockedOn(unblocked) {
5390 if (queuedDiscreteEvents.length > 0) {
5391 scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
5392 for (var i = 1; i < queuedDiscreteEvents.length; i++) {
5393 var queuedEvent = queuedDiscreteEvents[i];
5394 if (queuedEvent.blockedOn === unblocked) {
5395 queuedEvent.blockedOn = null;
5396 }
5397 }
5398 }
5399 if (queuedFocus !== null) {
5400 scheduleCallbackIfUnblocked(queuedFocus, unblocked);
5401 }
5402 if (queuedDrag !== null) {
5403 scheduleCallbackIfUnblocked(queuedDrag, unblocked);
5404 }
5405 if (queuedMouse !== null) {
5406 scheduleCallbackIfUnblocked(queuedMouse, unblocked);
5407 }
5408 var unblock = function(queuedEvent2) {
5409 return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
5410 };
5411 queuedPointers.forEach(unblock);
5412 queuedPointerCaptures.forEach(unblock);
5413 for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
5414 var queuedTarget = queuedExplicitHydrationTargets[_i];
5415 if (queuedTarget.blockedOn === unblocked) {
5416 queuedTarget.blockedOn = null;
5417 }
5418 }
5419 while (queuedExplicitHydrationTargets.length > 0) {
5420 var nextExplicitTarget = queuedExplicitHydrationTargets[0];
5421 if (nextExplicitTarget.blockedOn !== null) {
5422 break;
5423 } else {
5424 attemptExplicitHydrationTarget(nextExplicitTarget);
5425 if (nextExplicitTarget.blockedOn === null) {
5426 queuedExplicitHydrationTargets.shift();
5427 }
5428 }
5429 }
5430 }
5431 var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
5432 var _enabled = true;
5433 function setEnabled(enabled) {
5434 _enabled = !!enabled;
5435 }
5436 function isEnabled() {
5437 return _enabled;
5438 }
5439 function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
5440 var eventPriority = getEventPriority(domEventName);
5441 var listenerWrapper;
5442 switch (eventPriority) {
5443 case DiscreteEventPriority:
5444 listenerWrapper = dispatchDiscreteEvent;
5445 break;
5446 case ContinuousEventPriority:
5447 listenerWrapper = dispatchContinuousEvent;
5448 break;
5449 case DefaultEventPriority:
5450 default:
5451 listenerWrapper = dispatchEvent;
5452 break;
5453 }
5454 return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
5455 }
5456 function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
5457 var previousPriority = getCurrentUpdatePriority();
5458 var prevTransition = ReactCurrentBatchConfig.transition;
5459 ReactCurrentBatchConfig.transition = null;
5460 try {
5461 setCurrentUpdatePriority(DiscreteEventPriority);
5462 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
5463 } finally {
5464 setCurrentUpdatePriority(previousPriority);
5465 ReactCurrentBatchConfig.transition = prevTransition;
5466 }
5467 }
5468 function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
5469 var previousPriority = getCurrentUpdatePriority();
5470 var prevTransition = ReactCurrentBatchConfig.transition;
5471 ReactCurrentBatchConfig.transition = null;
5472 try {
5473 setCurrentUpdatePriority(ContinuousEventPriority);
5474 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
5475 } finally {
5476 setCurrentUpdatePriority(previousPriority);
5477 ReactCurrentBatchConfig.transition = prevTransition;
5478 }
5479 }
5480 function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5481 if (!_enabled) {
5482 return;
5483 }
5484 {
5485 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5486 }
5487 }
5488 function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5489 var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5490 if (blockedOn === null) {
5491 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
5492 clearIfContinuousEvent(domEventName, nativeEvent);
5493 return;
5494 }
5495 if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
5496 nativeEvent.stopPropagation();
5497 return;
5498 }
5499 clearIfContinuousEvent(domEventName, nativeEvent);
5500 if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
5501 while (blockedOn !== null) {
5502 var fiber = getInstanceFromNode(blockedOn);
5503 if (fiber !== null) {
5504 attemptSynchronousHydration(fiber);
5505 }
5506 var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5507 if (nextBlockedOn === null) {
5508 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
5509 }
5510 if (nextBlockedOn === blockedOn) {
5511 break;
5512 }
5513 blockedOn = nextBlockedOn;
5514 }
5515 if (blockedOn !== null) {
5516 nativeEvent.stopPropagation();
5517 }
5518 return;
5519 }
5520 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
5521 }
5522 var return_targetInst = null;
5523 function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5524 return_targetInst = null;
5525 var nativeEventTarget = getEventTarget(nativeEvent);
5526 var targetInst = getClosestInstanceFromNode(nativeEventTarget);
5527 if (targetInst !== null) {
5528 var nearestMounted = getNearestMountedFiber(targetInst);
5529 if (nearestMounted === null) {
5530 targetInst = null;
5531 } else {
5532 var tag = nearestMounted.tag;
5533 if (tag === SuspenseComponent) {
5534 var instance = getSuspenseInstanceFromFiber(nearestMounted);
5535 if (instance !== null) {
5536 return instance;
5537 }
5538 targetInst = null;
5539 } else if (tag === HostRoot) {
5540 var root2 = nearestMounted.stateNode;
5541 if (isRootDehydrated(root2)) {
5542 return getContainerFromFiber(nearestMounted);
5543 }
5544 targetInst = null;
5545 } else if (nearestMounted !== targetInst) {
5546 targetInst = null;
5547 }
5548 }
5549 }
5550 return_targetInst = targetInst;
5551 return null;
5552 }
5553 function getEventPriority(domEventName) {
5554 switch (domEventName) {
5555 // Used by SimpleEventPlugin:
5556 case "cancel":
5557 case "click":
5558 case "close":
5559 case "contextmenu":
5560 case "copy":
5561 case "cut":
5562 case "auxclick":
5563 case "dblclick":
5564 case "dragend":
5565 case "dragstart":
5566 case "drop":
5567 case "focusin":
5568 case "focusout":
5569 case "input":
5570 case "invalid":
5571 case "keydown":
5572 case "keypress":
5573 case "keyup":
5574 case "mousedown":
5575 case "mouseup":
5576 case "paste":
5577 case "pause":
5578 case "play":
5579 case "pointercancel":
5580 case "pointerdown":
5581 case "pointerup":
5582 case "ratechange":
5583 case "reset":
5584 case "resize":
5585 case "seeked":
5586 case "submit":
5587 case "touchcancel":
5588 case "touchend":
5589 case "touchstart":
5590 case "volumechange":
5591 // Used by polyfills:
5592 // eslint-disable-next-line no-fallthrough
5593 case "change":
5594 case "selectionchange":
5595 case "textInput":
5596 case "compositionstart":
5597 case "compositionend":
5598 case "compositionupdate":
5599 // Only enableCreateEventHandleAPI:
5600 // eslint-disable-next-line no-fallthrough
5601 case "beforeblur":
5602 case "afterblur":
5603 // Not used by React but could be by user code:
5604 // eslint-disable-next-line no-fallthrough
5605 case "beforeinput":
5606 case "blur":
5607 case "fullscreenchange":
5608 case "focus":
5609 case "hashchange":
5610 case "popstate":
5611 case "select":
5612 case "selectstart":
5613 return DiscreteEventPriority;
5614 case "drag":
5615 case "dragenter":
5616 case "dragexit":
5617 case "dragleave":
5618 case "dragover":
5619 case "mousemove":
5620 case "mouseout":
5621 case "mouseover":
5622 case "pointermove":
5623 case "pointerout":
5624 case "pointerover":
5625 case "scroll":
5626 case "toggle":
5627 case "touchmove":
5628 case "wheel":
5629 // Not used by React but could be by user code:
5630 // eslint-disable-next-line no-fallthrough
5631 case "mouseenter":
5632 case "mouseleave":
5633 case "pointerenter":
5634 case "pointerleave":
5635 return ContinuousEventPriority;
5636 case "message": {
5637 var schedulerPriority = getCurrentPriorityLevel();
5638 switch (schedulerPriority) {
5639 case ImmediatePriority:
5640 return DiscreteEventPriority;
5641 case UserBlockingPriority:
5642 return ContinuousEventPriority;
5643 case NormalPriority:
5644 case LowPriority:
5645 return DefaultEventPriority;
5646 case IdlePriority:
5647 return IdleEventPriority;
5648 default:
5649 return DefaultEventPriority;
5650 }
5651 }
5652 default:
5653 return DefaultEventPriority;
5654 }
5655 }
5656 function addEventBubbleListener(target, eventType, listener) {
5657 target.addEventListener(eventType, listener, false);
5658 return listener;
5659 }
5660 function addEventCaptureListener(target, eventType, listener) {
5661 target.addEventListener(eventType, listener, true);
5662 return listener;
5663 }
5664 function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
5665 target.addEventListener(eventType, listener, {
5666 capture: true,
5667 passive
5668 });
5669 return listener;
5670 }
5671 function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
5672 target.addEventListener(eventType, listener, {
5673 passive
5674 });
5675 return listener;
5676 }
5677 var root = null;
5678 var startText = null;
5679 var fallbackText = null;
5680 function initialize(nativeEventTarget) {
5681 root = nativeEventTarget;
5682 startText = getText();
5683 return true;
5684 }
5685 function reset() {
5686 root = null;
5687 startText = null;
5688 fallbackText = null;
5689 }
5690 function getData() {
5691 if (fallbackText) {
5692 return fallbackText;
5693 }
5694 var start;
5695 var startValue = startText;
5696 var startLength = startValue.length;
5697 var end;
5698 var endValue = getText();
5699 var endLength = endValue.length;
5700 for (start = 0; start < startLength; start++) {
5701 if (startValue[start] !== endValue[start]) {
5702 break;
5703 }
5704 }
5705 var minEnd = startLength - start;
5706 for (end = 1; end <= minEnd; end++) {
5707 if (startValue[startLength - end] !== endValue[endLength - end]) {
5708 break;
5709 }
5710 }
5711 var sliceTail = end > 1 ? 1 - end : void 0;
5712 fallbackText = endValue.slice(start, sliceTail);
5713 return fallbackText;
5714 }
5715 function getText() {
5716 if ("value" in root) {
5717 return root.value;
5718 }
5719 return root.textContent;
5720 }
5721 function getEventCharCode(nativeEvent) {
5722 var charCode;
5723 var keyCode = nativeEvent.keyCode;
5724 if ("charCode" in nativeEvent) {
5725 charCode = nativeEvent.charCode;
5726 if (charCode === 0 && keyCode === 13) {
5727 charCode = 13;
5728 }
5729 } else {
5730 charCode = keyCode;
5731 }
5732 if (charCode === 10) {
5733 charCode = 13;
5734 }
5735 if (charCode >= 32 || charCode === 13) {
5736 return charCode;
5737 }
5738 return 0;
5739 }
5740 function functionThatReturnsTrue() {
5741 return true;
5742 }
5743 function functionThatReturnsFalse() {
5744 return false;
5745 }
5746 function createSyntheticEvent(Interface) {
5747 function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
5748 this._reactName = reactName;
5749 this._targetInst = targetInst;
5750 this.type = reactEventType;
5751 this.nativeEvent = nativeEvent;
5752 this.target = nativeEventTarget;
5753 this.currentTarget = null;
5754 for (var _propName in Interface) {
5755 if (!Interface.hasOwnProperty(_propName)) {
5756 continue;
5757 }
5758 var normalize = Interface[_propName];
5759 if (normalize) {
5760 this[_propName] = normalize(nativeEvent);
5761 } else {
5762 this[_propName] = nativeEvent[_propName];
5763 }
5764 }
5765 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
5766 if (defaultPrevented) {
5767 this.isDefaultPrevented = functionThatReturnsTrue;
5768 } else {
5769 this.isDefaultPrevented = functionThatReturnsFalse;
5770 }
5771 this.isPropagationStopped = functionThatReturnsFalse;
5772 return this;
5773 }
5774 assign(SyntheticBaseEvent.prototype, {
5775 preventDefault: function() {
5776 this.defaultPrevented = true;
5777 var event = this.nativeEvent;
5778 if (!event) {
5779 return;
5780 }
5781 if (event.preventDefault) {
5782 event.preventDefault();
5783 } else if (typeof event.returnValue !== "unknown") {
5784 event.returnValue = false;
5785 }
5786 this.isDefaultPrevented = functionThatReturnsTrue;
5787 },
5788 stopPropagation: function() {
5789 var event = this.nativeEvent;
5790 if (!event) {
5791 return;
5792 }
5793 if (event.stopPropagation) {
5794 event.stopPropagation();
5795 } else if (typeof event.cancelBubble !== "unknown") {
5796 event.cancelBubble = true;
5797 }
5798 this.isPropagationStopped = functionThatReturnsTrue;
5799 },
5800 /**
5801 * We release all dispatched `SyntheticEvent`s after each event loop, adding
5802 * them back into the pool. This allows a way to hold onto a reference that
5803 * won't be added back into the pool.
5804 */
5805 persist: function() {
5806 },
5807 /**
5808 * Checks if this event should be released back into the pool.
5809 *
5810 * @return {boolean} True if this should not be released, false otherwise.
5811 */
5812 isPersistent: functionThatReturnsTrue
5813 });
5814 return SyntheticBaseEvent;
5815 }
5816 var EventInterface = {
5817 eventPhase: 0,
5818 bubbles: 0,
5819 cancelable: 0,
5820 timeStamp: function(event) {
5821 return event.timeStamp || Date.now();
5822 },
5823 defaultPrevented: 0,
5824 isTrusted: 0
5825 };
5826 var SyntheticEvent = createSyntheticEvent(EventInterface);
5827 var UIEventInterface = assign({}, EventInterface, {
5828 view: 0,
5829 detail: 0
5830 });
5831 var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
5832 var lastMovementX;
5833 var lastMovementY;
5834 var lastMouseEvent;
5835 function updateMouseMovementPolyfillState(event) {
5836 if (event !== lastMouseEvent) {
5837 if (lastMouseEvent && event.type === "mousemove") {
5838 lastMovementX = event.screenX - lastMouseEvent.screenX;
5839 lastMovementY = event.screenY - lastMouseEvent.screenY;
5840 } else {
5841 lastMovementX = 0;
5842 lastMovementY = 0;
5843 }
5844 lastMouseEvent = event;
5845 }
5846 }
5847 var MouseEventInterface = assign({}, UIEventInterface, {
5848 screenX: 0,
5849 screenY: 0,
5850 clientX: 0,
5851 clientY: 0,
5852 pageX: 0,
5853 pageY: 0,
5854 ctrlKey: 0,
5855 shiftKey: 0,
5856 altKey: 0,
5857 metaKey: 0,
5858 getModifierState: getEventModifierState,
5859 button: 0,
5860 buttons: 0,
5861 relatedTarget: function(event) {
5862 if (event.relatedTarget === void 0) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
5863 return event.relatedTarget;
5864 },
5865 movementX: function(event) {
5866 if ("movementX" in event) {
5867 return event.movementX;
5868 }
5869 updateMouseMovementPolyfillState(event);
5870 return lastMovementX;
5871 },
5872 movementY: function(event) {
5873 if ("movementY" in event) {
5874 return event.movementY;
5875 }
5876 return lastMovementY;
5877 }
5878 });
5879 var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
5880 var DragEventInterface = assign({}, MouseEventInterface, {
5881 dataTransfer: 0
5882 });
5883 var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
5884 var FocusEventInterface = assign({}, UIEventInterface, {
5885 relatedTarget: 0
5886 });
5887 var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
5888 var AnimationEventInterface = assign({}, EventInterface, {
5889 animationName: 0,
5890 elapsedTime: 0,
5891 pseudoElement: 0
5892 });
5893 var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
5894 var ClipboardEventInterface = assign({}, EventInterface, {
5895 clipboardData: function(event) {
5896 return "clipboardData" in event ? event.clipboardData : window.clipboardData;
5897 }
5898 });
5899 var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
5900 var CompositionEventInterface = assign({}, EventInterface, {
5901 data: 0
5902 });
5903 var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
5904 var SyntheticInputEvent = SyntheticCompositionEvent;
5905 var normalizeKey = {
5906 Esc: "Escape",
5907 Spacebar: " ",
5908 Left: "ArrowLeft",
5909 Up: "ArrowUp",
5910 Right: "ArrowRight",
5911 Down: "ArrowDown",
5912 Del: "Delete",
5913 Win: "OS",
5914 Menu: "ContextMenu",
5915 Apps: "ContextMenu",
5916 Scroll: "ScrollLock",
5917 MozPrintableKey: "Unidentified"
5918 };
5919 var translateToKey = {
5920 "8": "Backspace",
5921 "9": "Tab",
5922 "12": "Clear",
5923 "13": "Enter",
5924 "16": "Shift",
5925 "17": "Control",
5926 "18": "Alt",
5927 "19": "Pause",
5928 "20": "CapsLock",
5929 "27": "Escape",
5930 "32": " ",
5931 "33": "PageUp",
5932 "34": "PageDown",
5933 "35": "End",
5934 "36": "Home",
5935 "37": "ArrowLeft",
5936 "38": "ArrowUp",
5937 "39": "ArrowRight",
5938 "40": "ArrowDown",
5939 "45": "Insert",
5940 "46": "Delete",
5941 "112": "F1",
5942 "113": "F2",
5943 "114": "F3",
5944 "115": "F4",
5945 "116": "F5",
5946 "117": "F6",
5947 "118": "F7",
5948 "119": "F8",
5949 "120": "F9",
5950 "121": "F10",
5951 "122": "F11",
5952 "123": "F12",
5953 "144": "NumLock",
5954 "145": "ScrollLock",
5955 "224": "Meta"
5956 };
5957 function getEventKey(nativeEvent) {
5958 if (nativeEvent.key) {
5959 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
5960 if (key !== "Unidentified") {
5961 return key;
5962 }
5963 }
5964 if (nativeEvent.type === "keypress") {
5965 var charCode = getEventCharCode(nativeEvent);
5966 return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
5967 }
5968 if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
5969 return translateToKey[nativeEvent.keyCode] || "Unidentified";
5970 }
5971 return "";
5972 }
5973 var modifierKeyToProp = {
5974 Alt: "altKey",
5975 Control: "ctrlKey",
5976 Meta: "metaKey",
5977 Shift: "shiftKey"
5978 };
5979 function modifierStateGetter(keyArg) {
5980 var syntheticEvent = this;
5981 var nativeEvent = syntheticEvent.nativeEvent;
5982 if (nativeEvent.getModifierState) {
5983 return nativeEvent.getModifierState(keyArg);
5984 }
5985 var keyProp = modifierKeyToProp[keyArg];
5986 return keyProp ? !!nativeEvent[keyProp] : false;
5987 }
5988 function getEventModifierState(nativeEvent) {
5989 return modifierStateGetter;
5990 }
5991 var KeyboardEventInterface = assign({}, UIEventInterface, {
5992 key: getEventKey,
5993 code: 0,
5994 location: 0,
5995 ctrlKey: 0,
5996 shiftKey: 0,
5997 altKey: 0,
5998 metaKey: 0,
5999 repeat: 0,
6000 locale: 0,
6001 getModifierState: getEventModifierState,
6002 // Legacy Interface
6003 charCode: function(event) {
6004 if (event.type === "keypress") {
6005 return getEventCharCode(event);
6006 }
6007 return 0;
6008 },
6009 keyCode: function(event) {
6010 if (event.type === "keydown" || event.type === "keyup") {
6011 return event.keyCode;
6012 }
6013 return 0;
6014 },
6015 which: function(event) {
6016 if (event.type === "keypress") {
6017 return getEventCharCode(event);
6018 }
6019 if (event.type === "keydown" || event.type === "keyup") {
6020 return event.keyCode;
6021 }
6022 return 0;
6023 }
6024 });
6025 var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
6026 var PointerEventInterface = assign({}, MouseEventInterface, {
6027 pointerId: 0,
6028 width: 0,
6029 height: 0,
6030 pressure: 0,
6031 tangentialPressure: 0,
6032 tiltX: 0,
6033 tiltY: 0,
6034 twist: 0,
6035 pointerType: 0,
6036 isPrimary: 0
6037 });
6038 var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
6039 var TouchEventInterface = assign({}, UIEventInterface, {
6040 touches: 0,
6041 targetTouches: 0,
6042 changedTouches: 0,
6043 altKey: 0,
6044 metaKey: 0,
6045 ctrlKey: 0,
6046 shiftKey: 0,
6047 getModifierState: getEventModifierState
6048 });
6049 var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
6050 var TransitionEventInterface = assign({}, EventInterface, {
6051 propertyName: 0,
6052 elapsedTime: 0,
6053 pseudoElement: 0
6054 });
6055 var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
6056 var WheelEventInterface = assign({}, MouseEventInterface, {
6057 deltaX: function(event) {
6058 return "deltaX" in event ? event.deltaX : (
6059 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
6060 "wheelDeltaX" in event ? -event.wheelDeltaX : 0
6061 );
6062 },
6063 deltaY: function(event) {
6064 return "deltaY" in event ? event.deltaY : (
6065 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
6066 "wheelDeltaY" in event ? -event.wheelDeltaY : (
6067 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
6068 "wheelDelta" in event ? -event.wheelDelta : 0
6069 )
6070 );
6071 },
6072 deltaZ: 0,
6073 // Browsers without "deltaMode" is reporting in raw wheel delta where one
6074 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
6075 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
6076 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
6077 deltaMode: 0
6078 });
6079 var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
6080 var END_KEYCODES = [9, 13, 27, 32];
6081 var START_KEYCODE = 229;
6082 var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
6083 var documentMode = null;
6084 if (canUseDOM && "documentMode" in document) {
6085 documentMode = document.documentMode;
6086 }
6087 var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
6088 var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
6089 var SPACEBAR_CODE = 32;
6090 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
6091 function registerEvents() {
6092 registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
6093 registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6094 registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6095 registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6096 }
6097 var hasSpaceKeypress = false;
6098 function isKeypressCommand(nativeEvent) {
6099 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
6100 !(nativeEvent.ctrlKey && nativeEvent.altKey);
6101 }
6102 function getCompositionEventType(domEventName) {
6103 switch (domEventName) {
6104 case "compositionstart":
6105 return "onCompositionStart";
6106 case "compositionend":
6107 return "onCompositionEnd";
6108 case "compositionupdate":
6109 return "onCompositionUpdate";
6110 }
6111 }
6112 function isFallbackCompositionStart(domEventName, nativeEvent) {
6113 return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
6114 }
6115 function isFallbackCompositionEnd(domEventName, nativeEvent) {
6116 switch (domEventName) {
6117 case "keyup":
6118 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
6119 case "keydown":
6120 return nativeEvent.keyCode !== START_KEYCODE;
6121 case "keypress":
6122 case "mousedown":
6123 case "focusout":
6124 return true;
6125 default:
6126 return false;
6127 }
6128 }
6129 function getDataFromCustomEvent(nativeEvent) {
6130 var detail = nativeEvent.detail;
6131 if (typeof detail === "object" && "data" in detail) {
6132 return detail.data;
6133 }
6134 return null;
6135 }
6136 function isUsingKoreanIME(nativeEvent) {
6137 return nativeEvent.locale === "ko";
6138 }
6139 var isComposing = false;
6140 function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
6141 var eventType;
6142 var fallbackData;
6143 if (canUseCompositionEvent) {
6144 eventType = getCompositionEventType(domEventName);
6145 } else if (!isComposing) {
6146 if (isFallbackCompositionStart(domEventName, nativeEvent)) {
6147 eventType = "onCompositionStart";
6148 }
6149 } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
6150 eventType = "onCompositionEnd";
6151 }
6152 if (!eventType) {
6153 return null;
6154 }
6155 if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
6156 if (!isComposing && eventType === "onCompositionStart") {
6157 isComposing = initialize(nativeEventTarget);
6158 } else if (eventType === "onCompositionEnd") {
6159 if (isComposing) {
6160 fallbackData = getData();
6161 }
6162 }
6163 }
6164 var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
6165 if (listeners.length > 0) {
6166 var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
6167 dispatchQueue.push({
6168 event,
6169 listeners
6170 });
6171 if (fallbackData) {
6172 event.data = fallbackData;
6173 } else {
6174 var customData = getDataFromCustomEvent(nativeEvent);
6175 if (customData !== null) {
6176 event.data = customData;
6177 }
6178 }
6179 }
6180 }
6181 function getNativeBeforeInputChars(domEventName, nativeEvent) {
6182 switch (domEventName) {
6183 case "compositionend":
6184 return getDataFromCustomEvent(nativeEvent);
6185 case "keypress":
6186 var which = nativeEvent.which;
6187 if (which !== SPACEBAR_CODE) {
6188 return null;
6189 }
6190 hasSpaceKeypress = true;
6191 return SPACEBAR_CHAR;
6192 case "textInput":
6193 var chars = nativeEvent.data;
6194 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
6195 return null;
6196 }
6197 return chars;
6198 default:
6199 return null;
6200 }
6201 }
6202 function getFallbackBeforeInputChars(domEventName, nativeEvent) {
6203 if (isComposing) {
6204 if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
6205 var chars = getData();
6206 reset();
6207 isComposing = false;
6208 return chars;
6209 }
6210 return null;
6211 }
6212 switch (domEventName) {
6213 case "paste":
6214 return null;
6215 case "keypress":
6216 if (!isKeypressCommand(nativeEvent)) {
6217 if (nativeEvent.char && nativeEvent.char.length > 1) {
6218 return nativeEvent.char;
6219 } else if (nativeEvent.which) {
6220 return String.fromCharCode(nativeEvent.which);
6221 }
6222 }
6223 return null;
6224 case "compositionend":
6225 return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
6226 default:
6227 return null;
6228 }
6229 }
6230 function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
6231 var chars;
6232 if (canUseTextInputEvent) {
6233 chars = getNativeBeforeInputChars(domEventName, nativeEvent);
6234 } else {
6235 chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
6236 }
6237 if (!chars) {
6238 return null;
6239 }
6240 var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
6241 if (listeners.length > 0) {
6242 var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
6243 dispatchQueue.push({
6244 event,
6245 listeners
6246 });
6247 event.data = chars;
6248 }
6249 }
6250 function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6251 extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
6252 extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
6253 }
6254 var supportedInputTypes = {
6255 color: true,
6256 date: true,
6257 datetime: true,
6258 "datetime-local": true,
6259 email: true,
6260 month: true,
6261 number: true,
6262 password: true,
6263 range: true,
6264 search: true,
6265 tel: true,
6266 text: true,
6267 time: true,
6268 url: true,
6269 week: true
6270 };
6271 function isTextInputElement(elem) {
6272 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
6273 if (nodeName === "input") {
6274 return !!supportedInputTypes[elem.type];
6275 }
6276 if (nodeName === "textarea") {
6277 return true;
6278 }
6279 return false;
6280 }
6281 function isEventSupported(eventNameSuffix) {
6282 if (!canUseDOM) {
6283 return false;
6284 }
6285 var eventName = "on" + eventNameSuffix;
6286 var isSupported = eventName in document;
6287 if (!isSupported) {
6288 var element = document.createElement("div");
6289 element.setAttribute(eventName, "return;");
6290 isSupported = typeof element[eventName] === "function";
6291 }
6292 return isSupported;
6293 }
6294 function registerEvents$1() {
6295 registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
6296 }
6297 function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
6298 enqueueStateRestore(target);
6299 var listeners = accumulateTwoPhaseListeners(inst, "onChange");
6300 if (listeners.length > 0) {
6301 var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
6302 dispatchQueue.push({
6303 event,
6304 listeners
6305 });
6306 }
6307 }
6308 var activeElement = null;
6309 var activeElementInst = null;
6310 function shouldUseChangeEvent(elem) {
6311 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
6312 return nodeName === "select" || nodeName === "input" && elem.type === "file";
6313 }
6314 function manualDispatchChangeEvent(nativeEvent) {
6315 var dispatchQueue = [];
6316 createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
6317 batchedUpdates(runEventInBatch, dispatchQueue);
6318 }
6319 function runEventInBatch(dispatchQueue) {
6320 processDispatchQueue(dispatchQueue, 0);
6321 }
6322 function getInstIfValueChanged(targetInst) {
6323 var targetNode = getNodeFromInstance(targetInst);
6324 if (updateValueIfChanged(targetNode)) {
6325 return targetInst;
6326 }
6327 }
6328 function getTargetInstForChangeEvent(domEventName, targetInst) {
6329 if (domEventName === "change") {
6330 return targetInst;
6331 }
6332 }
6333 var isInputEventSupported = false;
6334 if (canUseDOM) {
6335 isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
6336 }
6337 function startWatchingForValueChange(target, targetInst) {
6338 activeElement = target;
6339 activeElementInst = targetInst;
6340 activeElement.attachEvent("onpropertychange", handlePropertyChange);
6341 }
6342 function stopWatchingForValueChange() {
6343 if (!activeElement) {
6344 return;
6345 }
6346 activeElement.detachEvent("onpropertychange", handlePropertyChange);
6347 activeElement = null;
6348 activeElementInst = null;
6349 }
6350 function handlePropertyChange(nativeEvent) {
6351 if (nativeEvent.propertyName !== "value") {
6352 return;
6353 }
6354 if (getInstIfValueChanged(activeElementInst)) {
6355 manualDispatchChangeEvent(nativeEvent);
6356 }
6357 }
6358 function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
6359 if (domEventName === "focusin") {
6360 stopWatchingForValueChange();
6361 startWatchingForValueChange(target, targetInst);
6362 } else if (domEventName === "focusout") {
6363 stopWatchingForValueChange();
6364 }
6365 }
6366 function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
6367 if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
6368 return getInstIfValueChanged(activeElementInst);
6369 }
6370 }
6371 function shouldUseClickEvent(elem) {
6372 var nodeName = elem.nodeName;
6373 return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
6374 }
6375 function getTargetInstForClickEvent(domEventName, targetInst) {
6376 if (domEventName === "click") {
6377 return getInstIfValueChanged(targetInst);
6378 }
6379 }
6380 function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
6381 if (domEventName === "input" || domEventName === "change") {
6382 return getInstIfValueChanged(targetInst);
6383 }
6384 }
6385 function handleControlledInputBlur(node) {
6386 var state = node._wrapperState;
6387 if (!state || !state.controlled || node.type !== "number") {
6388 return;
6389 }
6390 {
6391 setDefaultValue(node, "number", node.value);
6392 }
6393 }
6394 function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6395 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
6396 var getTargetInstFunc, handleEventFunc;
6397 if (shouldUseChangeEvent(targetNode)) {
6398 getTargetInstFunc = getTargetInstForChangeEvent;
6399 } else if (isTextInputElement(targetNode)) {
6400 if (isInputEventSupported) {
6401 getTargetInstFunc = getTargetInstForInputOrChangeEvent;
6402 } else {
6403 getTargetInstFunc = getTargetInstForInputEventPolyfill;
6404 handleEventFunc = handleEventsForInputEventPolyfill;
6405 }
6406 } else if (shouldUseClickEvent(targetNode)) {
6407 getTargetInstFunc = getTargetInstForClickEvent;
6408 }
6409 if (getTargetInstFunc) {
6410 var inst = getTargetInstFunc(domEventName, targetInst);
6411 if (inst) {
6412 createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
6413 return;
6414 }
6415 }
6416 if (handleEventFunc) {
6417 handleEventFunc(domEventName, targetNode, targetInst);
6418 }
6419 if (domEventName === "focusout") {
6420 handleControlledInputBlur(targetNode);
6421 }
6422 }
6423 function registerEvents$2() {
6424 registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
6425 registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
6426 registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
6427 registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
6428 }
6429 function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6430 var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
6431 var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
6432 if (isOverEvent && !isReplayingEvent(nativeEvent)) {
6433 var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
6434 if (related) {
6435 if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
6436 return;
6437 }
6438 }
6439 }
6440 if (!isOutEvent && !isOverEvent) {
6441 return;
6442 }
6443 var win;
6444 if (nativeEventTarget.window === nativeEventTarget) {
6445 win = nativeEventTarget;
6446 } else {
6447 var doc = nativeEventTarget.ownerDocument;
6448 if (doc) {
6449 win = doc.defaultView || doc.parentWindow;
6450 } else {
6451 win = window;
6452 }
6453 }
6454 var from;
6455 var to;
6456 if (isOutEvent) {
6457 var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
6458 from = targetInst;
6459 to = _related ? getClosestInstanceFromNode(_related) : null;
6460 if (to !== null) {
6461 var nearestMounted = getNearestMountedFiber(to);
6462 if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
6463 to = null;
6464 }
6465 }
6466 } else {
6467 from = null;
6468 to = targetInst;
6469 }
6470 if (from === to) {
6471 return;
6472 }
6473 var SyntheticEventCtor = SyntheticMouseEvent;
6474 var leaveEventType = "onMouseLeave";
6475 var enterEventType = "onMouseEnter";
6476 var eventTypePrefix = "mouse";
6477 if (domEventName === "pointerout" || domEventName === "pointerover") {
6478 SyntheticEventCtor = SyntheticPointerEvent;
6479 leaveEventType = "onPointerLeave";
6480 enterEventType = "onPointerEnter";
6481 eventTypePrefix = "pointer";
6482 }
6483 var fromNode = from == null ? win : getNodeFromInstance(from);
6484 var toNode = to == null ? win : getNodeFromInstance(to);
6485 var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
6486 leave.target = fromNode;
6487 leave.relatedTarget = toNode;
6488 var enter = null;
6489 var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
6490 if (nativeTargetInst === targetInst) {
6491 var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
6492 enterEvent.target = toNode;
6493 enterEvent.relatedTarget = fromNode;
6494 enter = enterEvent;
6495 }
6496 accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
6497 }
6498 function is(x, y) {
6499 return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
6500 }
6501 var objectIs = typeof Object.is === "function" ? Object.is : is;
6502 function shallowEqual(objA, objB) {
6503 if (objectIs(objA, objB)) {
6504 return true;
6505 }
6506 if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
6507 return false;
6508 }
6509 var keysA = Object.keys(objA);
6510 var keysB = Object.keys(objB);
6511 if (keysA.length !== keysB.length) {
6512 return false;
6513 }
6514 for (var i = 0; i < keysA.length; i++) {
6515 var currentKey = keysA[i];
6516 if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
6517 return false;
6518 }
6519 }
6520 return true;
6521 }
6522 function getLeafNode(node) {
6523 while (node && node.firstChild) {
6524 node = node.firstChild;
6525 }
6526 return node;
6527 }
6528 function getSiblingNode(node) {
6529 while (node) {
6530 if (node.nextSibling) {
6531 return node.nextSibling;
6532 }
6533 node = node.parentNode;
6534 }
6535 }
6536 function getNodeForCharacterOffset(root2, offset) {
6537 var node = getLeafNode(root2);
6538 var nodeStart = 0;
6539 var nodeEnd = 0;
6540 while (node) {
6541 if (node.nodeType === TEXT_NODE) {
6542 nodeEnd = nodeStart + node.textContent.length;
6543 if (nodeStart <= offset && nodeEnd >= offset) {
6544 return {
6545 node,
6546 offset: offset - nodeStart
6547 };
6548 }
6549 nodeStart = nodeEnd;
6550 }
6551 node = getLeafNode(getSiblingNode(node));
6552 }
6553 }
6554 function getOffsets(outerNode) {
6555 var ownerDocument = outerNode.ownerDocument;
6556 var win = ownerDocument && ownerDocument.defaultView || window;
6557 var selection = win.getSelection && win.getSelection();
6558 if (!selection || selection.rangeCount === 0) {
6559 return null;
6560 }
6561 var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
6562 try {
6563 anchorNode.nodeType;
6564 focusNode.nodeType;
6565 } catch (e) {
6566 return null;
6567 }
6568 return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
6569 }
6570 function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
6571 var length = 0;
6572 var start = -1;
6573 var end = -1;
6574 var indexWithinAnchor = 0;
6575 var indexWithinFocus = 0;
6576 var node = outerNode;
6577 var parentNode = null;
6578 outer: while (true) {
6579 var next = null;
6580 while (true) {
6581 if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
6582 start = length + anchorOffset;
6583 }
6584 if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
6585 end = length + focusOffset;
6586 }
6587 if (node.nodeType === TEXT_NODE) {
6588 length += node.nodeValue.length;
6589 }
6590 if ((next = node.firstChild) === null) {
6591 break;
6592 }
6593 parentNode = node;
6594 node = next;
6595 }
6596 while (true) {
6597 if (node === outerNode) {
6598 break outer;
6599 }
6600 if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
6601 start = length;
6602 }
6603 if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
6604 end = length;
6605 }
6606 if ((next = node.nextSibling) !== null) {
6607 break;
6608 }
6609 node = parentNode;
6610 parentNode = node.parentNode;
6611 }
6612 node = next;
6613 }
6614 if (start === -1 || end === -1) {
6615 return null;
6616 }
6617 return {
6618 start,
6619 end
6620 };
6621 }
6622 function setOffsets(node, offsets) {
6623 var doc = node.ownerDocument || document;
6624 var win = doc && doc.defaultView || window;
6625 if (!win.getSelection) {
6626 return;
6627 }
6628 var selection = win.getSelection();
6629 var length = node.textContent.length;
6630 var start = Math.min(offsets.start, length);
6631 var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
6632 if (!selection.extend && start > end) {
6633 var temp = end;
6634 end = start;
6635 start = temp;
6636 }
6637 var startMarker = getNodeForCharacterOffset(node, start);
6638 var endMarker = getNodeForCharacterOffset(node, end);
6639 if (startMarker && endMarker) {
6640 if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
6641 return;
6642 }
6643 var range = doc.createRange();
6644 range.setStart(startMarker.node, startMarker.offset);
6645 selection.removeAllRanges();
6646 if (start > end) {
6647 selection.addRange(range);
6648 selection.extend(endMarker.node, endMarker.offset);
6649 } else {
6650 range.setEnd(endMarker.node, endMarker.offset);
6651 selection.addRange(range);
6652 }
6653 }
6654 }
6655 function isTextNode(node) {
6656 return node && node.nodeType === TEXT_NODE;
6657 }
6658 function containsNode(outerNode, innerNode) {
6659 if (!outerNode || !innerNode) {
6660 return false;
6661 } else if (outerNode === innerNode) {
6662 return true;
6663 } else if (isTextNode(outerNode)) {
6664 return false;
6665 } else if (isTextNode(innerNode)) {
6666 return containsNode(outerNode, innerNode.parentNode);
6667 } else if ("contains" in outerNode) {
6668 return outerNode.contains(innerNode);
6669 } else if (outerNode.compareDocumentPosition) {
6670 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
6671 } else {
6672 return false;
6673 }
6674 }
6675 function isInDocument(node) {
6676 return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
6677 }
6678 function isSameOriginFrame(iframe) {
6679 try {
6680 return typeof iframe.contentWindow.location.href === "string";
6681 } catch (err) {
6682 return false;
6683 }
6684 }
6685 function getActiveElementDeep() {
6686 var win = window;
6687 var element = getActiveElement();
6688 while (element instanceof win.HTMLIFrameElement) {
6689 if (isSameOriginFrame(element)) {
6690 win = element.contentWindow;
6691 } else {
6692 return element;
6693 }
6694 element = getActiveElement(win.document);
6695 }
6696 return element;
6697 }
6698 function hasSelectionCapabilities(elem) {
6699 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
6700 return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
6701 }
6702 function getSelectionInformation() {
6703 var focusedElem = getActiveElementDeep();
6704 return {
6705 focusedElem,
6706 selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
6707 };
6708 }
6709 function restoreSelection(priorSelectionInformation) {
6710 var curFocusedElem = getActiveElementDeep();
6711 var priorFocusedElem = priorSelectionInformation.focusedElem;
6712 var priorSelectionRange = priorSelectionInformation.selectionRange;
6713 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
6714 if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
6715 setSelection(priorFocusedElem, priorSelectionRange);
6716 }
6717 var ancestors = [];
6718 var ancestor = priorFocusedElem;
6719 while (ancestor = ancestor.parentNode) {
6720 if (ancestor.nodeType === ELEMENT_NODE) {
6721 ancestors.push({
6722 element: ancestor,
6723 left: ancestor.scrollLeft,
6724 top: ancestor.scrollTop
6725 });
6726 }
6727 }
6728 if (typeof priorFocusedElem.focus === "function") {
6729 priorFocusedElem.focus();
6730 }
6731 for (var i = 0; i < ancestors.length; i++) {
6732 var info = ancestors[i];
6733 info.element.scrollLeft = info.left;
6734 info.element.scrollTop = info.top;
6735 }
6736 }
6737 }
6738 function getSelection(input) {
6739 var selection;
6740 if ("selectionStart" in input) {
6741 selection = {
6742 start: input.selectionStart,
6743 end: input.selectionEnd
6744 };
6745 } else {
6746 selection = getOffsets(input);
6747 }
6748 return selection || {
6749 start: 0,
6750 end: 0
6751 };
6752 }
6753 function setSelection(input, offsets) {
6754 var start = offsets.start;
6755 var end = offsets.end;
6756 if (end === void 0) {
6757 end = start;
6758 }
6759 if ("selectionStart" in input) {
6760 input.selectionStart = start;
6761 input.selectionEnd = Math.min(end, input.value.length);
6762 } else {
6763 setOffsets(input, offsets);
6764 }
6765 }
6766 var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
6767 function registerEvents$3() {
6768 registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
6769 }
6770 var activeElement$1 = null;
6771 var activeElementInst$1 = null;
6772 var lastSelection = null;
6773 var mouseDown = false;
6774 function getSelection$1(node) {
6775 if ("selectionStart" in node && hasSelectionCapabilities(node)) {
6776 return {
6777 start: node.selectionStart,
6778 end: node.selectionEnd
6779 };
6780 } else {
6781 var win = node.ownerDocument && node.ownerDocument.defaultView || window;
6782 var selection = win.getSelection();
6783 return {
6784 anchorNode: selection.anchorNode,
6785 anchorOffset: selection.anchorOffset,
6786 focusNode: selection.focusNode,
6787 focusOffset: selection.focusOffset
6788 };
6789 }
6790 }
6791 function getEventTargetDocument(eventTarget) {
6792 return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
6793 }
6794 function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
6795 var doc = getEventTargetDocument(nativeEventTarget);
6796 if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
6797 return;
6798 }
6799 var currentSelection = getSelection$1(activeElement$1);
6800 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
6801 lastSelection = currentSelection;
6802 var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
6803 if (listeners.length > 0) {
6804 var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
6805 dispatchQueue.push({
6806 event,
6807 listeners
6808 });
6809 event.target = activeElement$1;
6810 }
6811 }
6812 }
6813 function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6814 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
6815 switch (domEventName) {
6816 // Track the input node that has focus.
6817 case "focusin":
6818 if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
6819 activeElement$1 = targetNode;
6820 activeElementInst$1 = targetInst;
6821 lastSelection = null;
6822 }
6823 break;
6824 case "focusout":
6825 activeElement$1 = null;
6826 activeElementInst$1 = null;
6827 lastSelection = null;
6828 break;
6829 // Don't fire the event while the user is dragging. This matches the
6830 // semantics of the native select event.
6831 case "mousedown":
6832 mouseDown = true;
6833 break;
6834 case "contextmenu":
6835 case "mouseup":
6836 case "dragend":
6837 mouseDown = false;
6838 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
6839 break;
6840 // Chrome and IE fire non-standard event when selection is changed (and
6841 // sometimes when it hasn't). IE's event fires out of order with respect
6842 // to key and input events on deletion, so we discard it.
6843 //
6844 // Firefox doesn't support selectionchange, so check selection status
6845 // after each key entry. The selection changes after keydown and before
6846 // keyup, but we check on keydown as well in the case of holding down a
6847 // key, when multiple keydown events are fired but only one keyup is.
6848 // This is also our approach for IE handling, for the reason above.
6849 case "selectionchange":
6850 if (skipSelectionChangeEvent) {
6851 break;
6852 }
6853 // falls through
6854 case "keydown":
6855 case "keyup":
6856 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
6857 }
6858 }
6859 function makePrefixMap(styleProp, eventName) {
6860 var prefixes2 = {};
6861 prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
6862 prefixes2["Webkit" + styleProp] = "webkit" + eventName;
6863 prefixes2["Moz" + styleProp] = "moz" + eventName;
6864 return prefixes2;
6865 }
6866 var vendorPrefixes = {
6867 animationend: makePrefixMap("Animation", "AnimationEnd"),
6868 animationiteration: makePrefixMap("Animation", "AnimationIteration"),
6869 animationstart: makePrefixMap("Animation", "AnimationStart"),
6870 transitionend: makePrefixMap("Transition", "TransitionEnd")
6871 };
6872 var prefixedEventNames = {};
6873 var style = {};
6874 if (canUseDOM) {
6875 style = document.createElement("div").style;
6876 if (!("AnimationEvent" in window)) {
6877 delete vendorPrefixes.animationend.animation;
6878 delete vendorPrefixes.animationiteration.animation;
6879 delete vendorPrefixes.animationstart.animation;
6880 }
6881 if (!("TransitionEvent" in window)) {
6882 delete vendorPrefixes.transitionend.transition;
6883 }
6884 }
6885 function getVendorPrefixedEventName(eventName) {
6886 if (prefixedEventNames[eventName]) {
6887 return prefixedEventNames[eventName];
6888 } else if (!vendorPrefixes[eventName]) {
6889 return eventName;
6890 }
6891 var prefixMap = vendorPrefixes[eventName];
6892 for (var styleProp in prefixMap) {
6893 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
6894 return prefixedEventNames[eventName] = prefixMap[styleProp];
6895 }
6896 }
6897 return eventName;
6898 }
6899 var ANIMATION_END = getVendorPrefixedEventName("animationend");
6900 var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
6901 var ANIMATION_START = getVendorPrefixedEventName("animationstart");
6902 var TRANSITION_END = getVendorPrefixedEventName("transitionend");
6903 var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
6904 var simpleEventPluginEvents = ["abort", "auxClick", "cancel", "canPlay", "canPlayThrough", "click", "close", "contextMenu", "copy", "cut", "drag", "dragEnd", "dragEnter", "dragExit", "dragLeave", "dragOver", "dragStart", "drop", "durationChange", "emptied", "encrypted", "ended", "error", "gotPointerCapture", "input", "invalid", "keyDown", "keyPress", "keyUp", "load", "loadedData", "loadedMetadata", "loadStart", "lostPointerCapture", "mouseDown", "mouseMove", "mouseOut", "mouseOver", "mouseUp", "paste", "pause", "play", "playing", "pointerCancel", "pointerDown", "pointerMove", "pointerOut", "pointerOver", "pointerUp", "progress", "rateChange", "reset", "resize", "seeked", "seeking", "stalled", "submit", "suspend", "timeUpdate", "touchCancel", "touchEnd", "touchStart", "volumeChange", "scroll", "toggle", "touchMove", "waiting", "wheel"];
6905 function registerSimpleEvent(domEventName, reactName) {
6906 topLevelEventsToReactNames.set(domEventName, reactName);
6907 registerTwoPhaseEvent(reactName, [domEventName]);
6908 }
6909 function registerSimpleEvents() {
6910 for (var i = 0; i < simpleEventPluginEvents.length; i++) {
6911 var eventName = simpleEventPluginEvents[i];
6912 var domEventName = eventName.toLowerCase();
6913 var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
6914 registerSimpleEvent(domEventName, "on" + capitalizedEvent);
6915 }
6916 registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
6917 registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
6918 registerSimpleEvent(ANIMATION_START, "onAnimationStart");
6919 registerSimpleEvent("dblclick", "onDoubleClick");
6920 registerSimpleEvent("focusin", "onFocus");
6921 registerSimpleEvent("focusout", "onBlur");
6922 registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
6923 }
6924 function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6925 var reactName = topLevelEventsToReactNames.get(domEventName);
6926 if (reactName === void 0) {
6927 return;
6928 }
6929 var SyntheticEventCtor = SyntheticEvent;
6930 var reactEventType = domEventName;
6931 switch (domEventName) {
6932 case "keypress":
6933 if (getEventCharCode(nativeEvent) === 0) {
6934 return;
6935 }
6936 /* falls through */
6937 case "keydown":
6938 case "keyup":
6939 SyntheticEventCtor = SyntheticKeyboardEvent;
6940 break;
6941 case "focusin":
6942 reactEventType = "focus";
6943 SyntheticEventCtor = SyntheticFocusEvent;
6944 break;
6945 case "focusout":
6946 reactEventType = "blur";
6947 SyntheticEventCtor = SyntheticFocusEvent;
6948 break;
6949 case "beforeblur":
6950 case "afterblur":
6951 SyntheticEventCtor = SyntheticFocusEvent;
6952 break;
6953 case "click":
6954 if (nativeEvent.button === 2) {
6955 return;
6956 }
6957 /* falls through */
6958 case "auxclick":
6959 case "dblclick":
6960 case "mousedown":
6961 case "mousemove":
6962 case "mouseup":
6963 // TODO: Disabled elements should not respond to mouse events
6964 /* falls through */
6965 case "mouseout":
6966 case "mouseover":
6967 case "contextmenu":
6968 SyntheticEventCtor = SyntheticMouseEvent;
6969 break;
6970 case "drag":
6971 case "dragend":
6972 case "dragenter":
6973 case "dragexit":
6974 case "dragleave":
6975 case "dragover":
6976 case "dragstart":
6977 case "drop":
6978 SyntheticEventCtor = SyntheticDragEvent;
6979 break;
6980 case "touchcancel":
6981 case "touchend":
6982 case "touchmove":
6983 case "touchstart":
6984 SyntheticEventCtor = SyntheticTouchEvent;
6985 break;
6986 case ANIMATION_END:
6987 case ANIMATION_ITERATION:
6988 case ANIMATION_START:
6989 SyntheticEventCtor = SyntheticAnimationEvent;
6990 break;
6991 case TRANSITION_END:
6992 SyntheticEventCtor = SyntheticTransitionEvent;
6993 break;
6994 case "scroll":
6995 SyntheticEventCtor = SyntheticUIEvent;
6996 break;
6997 case "wheel":
6998 SyntheticEventCtor = SyntheticWheelEvent;
6999 break;
7000 case "copy":
7001 case "cut":
7002 case "paste":
7003 SyntheticEventCtor = SyntheticClipboardEvent;
7004 break;
7005 case "gotpointercapture":
7006 case "lostpointercapture":
7007 case "pointercancel":
7008 case "pointerdown":
7009 case "pointermove":
7010 case "pointerout":
7011 case "pointerover":
7012 case "pointerup":
7013 SyntheticEventCtor = SyntheticPointerEvent;
7014 break;
7015 }
7016 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
7017 {
7018 var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
7019 // nonDelegatedEvents list in DOMPluginEventSystem.
7020 // Then we can remove this special list.
7021 // This is a breaking change that can wait until React 18.
7022 domEventName === "scroll";
7023 var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
7024 if (_listeners.length > 0) {
7025 var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
7026 dispatchQueue.push({
7027 event: _event,
7028 listeners: _listeners
7029 });
7030 }
7031 }
7032 }
7033 registerSimpleEvents();
7034 registerEvents$2();
7035 registerEvents$1();
7036 registerEvents$3();
7037 registerEvents();
7038 function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
7039 extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
7040 var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
7041 if (shouldProcessPolyfillPlugins) {
7042 extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7043 extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7044 extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7045 extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7046 }
7047 }
7048 var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "resize", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"];
7049 var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
7050 function executeDispatch(event, listener, currentTarget) {
7051 var type = event.type || "unknown-event";
7052 event.currentTarget = currentTarget;
7053 invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
7054 event.currentTarget = null;
7055 }
7056 function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
7057 var previousInstance;
7058 if (inCapturePhase) {
7059 for (var i = dispatchListeners.length - 1; i >= 0; i--) {
7060 var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
7061 if (instance !== previousInstance && event.isPropagationStopped()) {
7062 return;
7063 }
7064 executeDispatch(event, listener, currentTarget);
7065 previousInstance = instance;
7066 }
7067 } else {
7068 for (var _i = 0; _i < dispatchListeners.length; _i++) {
7069 var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
7070 if (_instance !== previousInstance && event.isPropagationStopped()) {
7071 return;
7072 }
7073 executeDispatch(event, _listener, _currentTarget);
7074 previousInstance = _instance;
7075 }
7076 }
7077 }
7078 function processDispatchQueue(dispatchQueue, eventSystemFlags) {
7079 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
7080 for (var i = 0; i < dispatchQueue.length; i++) {
7081 var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
7082 processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
7083 }
7084 rethrowCaughtError();
7085 }
7086 function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
7087 var nativeEventTarget = getEventTarget(nativeEvent);
7088 var dispatchQueue = [];
7089 extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
7090 processDispatchQueue(dispatchQueue, eventSystemFlags);
7091 }
7092 function listenToNonDelegatedEvent(domEventName, targetElement) {
7093 {
7094 if (!nonDelegatedEvents.has(domEventName)) {
7095 error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
7096 }
7097 }
7098 var isCapturePhaseListener = false;
7099 var listenerSet = getEventListenerSet(targetElement);
7100 var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
7101 if (!listenerSet.has(listenerSetKey)) {
7102 addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
7103 listenerSet.add(listenerSetKey);
7104 }
7105 }
7106 function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
7107 {
7108 if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
7109 error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
7110 }
7111 }
7112 var eventSystemFlags = 0;
7113 if (isCapturePhaseListener) {
7114 eventSystemFlags |= IS_CAPTURE_PHASE;
7115 }
7116 addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
7117 }
7118 var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
7119 function listenToAllSupportedEvents(rootContainerElement) {
7120 if (!rootContainerElement[listeningMarker]) {
7121 rootContainerElement[listeningMarker] = true;
7122 allNativeEvents.forEach(function(domEventName) {
7123 if (domEventName !== "selectionchange") {
7124 if (!nonDelegatedEvents.has(domEventName)) {
7125 listenToNativeEvent(domEventName, false, rootContainerElement);
7126 }
7127 listenToNativeEvent(domEventName, true, rootContainerElement);
7128 }
7129 });
7130 var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
7131 if (ownerDocument !== null) {
7132 if (!ownerDocument[listeningMarker]) {
7133 ownerDocument[listeningMarker] = true;
7134 listenToNativeEvent("selectionchange", false, ownerDocument);
7135 }
7136 }
7137 }
7138 }
7139 function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
7140 var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
7141 var isPassiveListener = void 0;
7142 if (passiveBrowserEventsSupported) {
7143 if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
7144 isPassiveListener = true;
7145 }
7146 }
7147 targetContainer = targetContainer;
7148 var unsubscribeListener;
7149 if (isCapturePhaseListener) {
7150 if (isPassiveListener !== void 0) {
7151 unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
7152 } else {
7153 unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
7154 }
7155 } else {
7156 if (isPassiveListener !== void 0) {
7157 unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
7158 } else {
7159 unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
7160 }
7161 }
7162 }
7163 function isMatchingRootContainer(grandContainer, targetContainer) {
7164 return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
7165 }
7166 function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
7167 var ancestorInst = targetInst;
7168 if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
7169 var targetContainerNode = targetContainer;
7170 if (targetInst !== null) {
7171 var node = targetInst;
7172 mainLoop: while (true) {
7173 if (node === null) {
7174 return;
7175 }
7176 var nodeTag = node.tag;
7177 if (nodeTag === HostRoot || nodeTag === HostPortal) {
7178 var container = node.stateNode.containerInfo;
7179 if (isMatchingRootContainer(container, targetContainerNode)) {
7180 break;
7181 }
7182 if (nodeTag === HostPortal) {
7183 var grandNode = node.return;
7184 while (grandNode !== null) {
7185 var grandTag = grandNode.tag;
7186 if (grandTag === HostRoot || grandTag === HostPortal) {
7187 var grandContainer = grandNode.stateNode.containerInfo;
7188 if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
7189 return;
7190 }
7191 }
7192 grandNode = grandNode.return;
7193 }
7194 }
7195 while (container !== null) {
7196 var parentNode = getClosestInstanceFromNode(container);
7197 if (parentNode === null) {
7198 return;
7199 }
7200 var parentTag = parentNode.tag;
7201 if (parentTag === HostComponent || parentTag === HostText) {
7202 node = ancestorInst = parentNode;
7203 continue mainLoop;
7204 }
7205 container = container.parentNode;
7206 }
7207 }
7208 node = node.return;
7209 }
7210 }
7211 }
7212 batchedUpdates(function() {
7213 return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
7214 });
7215 }
7216 function createDispatchListener(instance, listener, currentTarget) {
7217 return {
7218 instance,
7219 listener,
7220 currentTarget
7221 };
7222 }
7223 function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
7224 var captureName = reactName !== null ? reactName + "Capture" : null;
7225 var reactEventName = inCapturePhase ? captureName : reactName;
7226 var listeners = [];
7227 var instance = targetFiber;
7228 var lastHostComponent = null;
7229 while (instance !== null) {
7230 var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
7231 if (tag === HostComponent && stateNode !== null) {
7232 lastHostComponent = stateNode;
7233 if (reactEventName !== null) {
7234 var listener = getListener(instance, reactEventName);
7235 if (listener != null) {
7236 listeners.push(createDispatchListener(instance, listener, lastHostComponent));
7237 }
7238 }
7239 }
7240 if (accumulateTargetOnly) {
7241 break;
7242 }
7243 instance = instance.return;
7244 }
7245 return listeners;
7246 }
7247 function accumulateTwoPhaseListeners(targetFiber, reactName) {
7248 var captureName = reactName + "Capture";
7249 var listeners = [];
7250 var instance = targetFiber;
7251 while (instance !== null) {
7252 var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
7253 if (tag === HostComponent && stateNode !== null) {
7254 var currentTarget = stateNode;
7255 var captureListener = getListener(instance, captureName);
7256 if (captureListener != null) {
7257 listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
7258 }
7259 var bubbleListener = getListener(instance, reactName);
7260 if (bubbleListener != null) {
7261 listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
7262 }
7263 }
7264 instance = instance.return;
7265 }
7266 return listeners;
7267 }
7268 function getParent(inst) {
7269 if (inst === null) {
7270 return null;
7271 }
7272 do {
7273 inst = inst.return;
7274 } while (inst && inst.tag !== HostComponent);
7275 if (inst) {
7276 return inst;
7277 }
7278 return null;
7279 }
7280 function getLowestCommonAncestor(instA, instB) {
7281 var nodeA = instA;
7282 var nodeB = instB;
7283 var depthA = 0;
7284 for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
7285 depthA++;
7286 }
7287 var depthB = 0;
7288 for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
7289 depthB++;
7290 }
7291 while (depthA - depthB > 0) {
7292 nodeA = getParent(nodeA);
7293 depthA--;
7294 }
7295 while (depthB - depthA > 0) {
7296 nodeB = getParent(nodeB);
7297 depthB--;
7298 }
7299 var depth = depthA;
7300 while (depth--) {
7301 if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
7302 return nodeA;
7303 }
7304 nodeA = getParent(nodeA);
7305 nodeB = getParent(nodeB);
7306 }
7307 return null;
7308 }
7309 function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
7310 var registrationName = event._reactName;
7311 var listeners = [];
7312 var instance = target;
7313 while (instance !== null) {
7314 if (instance === common) {
7315 break;
7316 }
7317 var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
7318 if (alternate !== null && alternate === common) {
7319 break;
7320 }
7321 if (tag === HostComponent && stateNode !== null) {
7322 var currentTarget = stateNode;
7323 if (inCapturePhase) {
7324 var captureListener = getListener(instance, registrationName);
7325 if (captureListener != null) {
7326 listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
7327 }
7328 } else if (!inCapturePhase) {
7329 var bubbleListener = getListener(instance, registrationName);
7330 if (bubbleListener != null) {
7331 listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
7332 }
7333 }
7334 }
7335 instance = instance.return;
7336 }
7337 if (listeners.length !== 0) {
7338 dispatchQueue.push({
7339 event,
7340 listeners
7341 });
7342 }
7343 }
7344 function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
7345 var common = from && to ? getLowestCommonAncestor(from, to) : null;
7346 if (from !== null) {
7347 accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
7348 }
7349 if (to !== null && enterEvent !== null) {
7350 accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
7351 }
7352 }
7353 function getListenerSetKey(domEventName, capture) {
7354 return domEventName + "__" + (capture ? "capture" : "bubble");
7355 }
7356 var didWarnInvalidHydration = false;
7357 var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
7358 var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
7359 var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
7360 var AUTOFOCUS = "autoFocus";
7361 var CHILDREN = "children";
7362 var STYLE = "style";
7363 var HTML$1 = "__html";
7364 var warnedUnknownTags;
7365 var validatePropertiesInDevelopment;
7366 var warnForPropDifference;
7367 var warnForExtraAttributes;
7368 var warnForInvalidEventListener;
7369 var canDiffStyleForHydrationWarning;
7370 var normalizeHTML;
7371 {
7372 warnedUnknownTags = {
7373 // There are working polyfills for <dialog>. Let people use it.
7374 dialog: true,
7375 // Electron ships a custom <webview> tag to display external web content in
7376 // an isolated frame and process.
7377 // This tag is not present in non Electron environments such as JSDom which
7378 // is often used for testing purposes.
7379 // @see https://electronjs.org/docs/api/webview-tag
7380 webview: true
7381 };
7382 validatePropertiesInDevelopment = function(type, props) {
7383 validateProperties(type, props);
7384 validateProperties$1(type, props);
7385 validateProperties$2(type, props, {
7386 registrationNameDependencies,
7387 possibleRegistrationNames
7388 });
7389 };
7390 canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
7391 warnForPropDifference = function(propName, serverValue, clientValue) {
7392 if (didWarnInvalidHydration) {
7393 return;
7394 }
7395 var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
7396 var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
7397 if (normalizedServerValue === normalizedClientValue) {
7398 return;
7399 }
7400 didWarnInvalidHydration = true;
7401 error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
7402 };
7403 warnForExtraAttributes = function(attributeNames) {
7404 if (didWarnInvalidHydration) {
7405 return;
7406 }
7407 didWarnInvalidHydration = true;
7408 var names = [];
7409 attributeNames.forEach(function(name) {
7410 names.push(name);
7411 });
7412 error("Extra attributes from the server: %s", names);
7413 };
7414 warnForInvalidEventListener = function(registrationName, listener) {
7415 if (listener === false) {
7416 error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", registrationName, registrationName, registrationName);
7417 } else {
7418 error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
7419 }
7420 };
7421 normalizeHTML = function(parent, html) {
7422 var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
7423 testElement.innerHTML = html;
7424 return testElement.innerHTML;
7425 };
7426 }
7427 var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
7428 var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
7429 function normalizeMarkupForTextOrAttribute(markup) {
7430 {
7431 checkHtmlStringCoercion(markup);
7432 }
7433 var markupString = typeof markup === "string" ? markup : "" + markup;
7434 return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
7435 }
7436 function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
7437 var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
7438 var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
7439 if (normalizedServerText === normalizedClientText) {
7440 return;
7441 }
7442 if (shouldWarnDev) {
7443 {
7444 if (!didWarnInvalidHydration) {
7445 didWarnInvalidHydration = true;
7446 error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
7447 }
7448 }
7449 }
7450 if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
7451 throw new Error("Text content does not match server-rendered HTML.");
7452 }
7453 }
7454 function getOwnerDocumentFromRootContainer(rootContainerElement) {
7455 return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
7456 }
7457 function noop() {
7458 }
7459 function trapClickOnNonInteractiveElement(node) {
7460 node.onclick = noop;
7461 }
7462 function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
7463 for (var propKey in nextProps) {
7464 if (!nextProps.hasOwnProperty(propKey)) {
7465 continue;
7466 }
7467 var nextProp = nextProps[propKey];
7468 if (propKey === STYLE) {
7469 {
7470 if (nextProp) {
7471 Object.freeze(nextProp);
7472 }
7473 }
7474 setValueForStyles(domElement, nextProp);
7475 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7476 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7477 if (nextHtml != null) {
7478 setInnerHTML(domElement, nextHtml);
7479 }
7480 } else if (propKey === CHILDREN) {
7481 if (typeof nextProp === "string") {
7482 var canSetTextContent = tag !== "textarea" || nextProp !== "";
7483 if (canSetTextContent) {
7484 setTextContent(domElement, nextProp);
7485 }
7486 } else if (typeof nextProp === "number") {
7487 setTextContent(domElement, "" + nextProp);
7488 }
7489 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7490 else if (propKey === AUTOFOCUS) ;
7491 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7492 if (nextProp != null) {
7493 if (typeof nextProp !== "function") {
7494 warnForInvalidEventListener(propKey, nextProp);
7495 }
7496 if (propKey === "onScroll") {
7497 listenToNonDelegatedEvent("scroll", domElement);
7498 }
7499 }
7500 } else if (nextProp != null) {
7501 setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
7502 }
7503 }
7504 }
7505 function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
7506 for (var i = 0; i < updatePayload.length; i += 2) {
7507 var propKey = updatePayload[i];
7508 var propValue = updatePayload[i + 1];
7509 if (propKey === STYLE) {
7510 setValueForStyles(domElement, propValue);
7511 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7512 setInnerHTML(domElement, propValue);
7513 } else if (propKey === CHILDREN) {
7514 setTextContent(domElement, propValue);
7515 } else {
7516 setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
7517 }
7518 }
7519 }
7520 function createElement(type, props, rootContainerElement, parentNamespace) {
7521 var isCustomComponentTag;
7522 var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
7523 var domElement;
7524 var namespaceURI = parentNamespace;
7525 if (namespaceURI === HTML_NAMESPACE) {
7526 namespaceURI = getIntrinsicNamespace(type);
7527 }
7528 if (namespaceURI === HTML_NAMESPACE) {
7529 {
7530 isCustomComponentTag = isCustomComponent(type, props);
7531 if (!isCustomComponentTag && type !== type.toLowerCase()) {
7532 error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
7533 }
7534 }
7535 if (type === "script") {
7536 var div = ownerDocument.createElement("div");
7537 div.innerHTML = "<script><\/script>";
7538 var firstChild = div.firstChild;
7539 domElement = div.removeChild(firstChild);
7540 } else if (typeof props.is === "string") {
7541 domElement = ownerDocument.createElement(type, {
7542 is: props.is
7543 });
7544 } else {
7545 domElement = ownerDocument.createElement(type);
7546 if (type === "select") {
7547 var node = domElement;
7548 if (props.multiple) {
7549 node.multiple = true;
7550 } else if (props.size) {
7551 node.size = props.size;
7552 }
7553 }
7554 }
7555 } else {
7556 domElement = ownerDocument.createElementNS(namespaceURI, type);
7557 }
7558 {
7559 if (namespaceURI === HTML_NAMESPACE) {
7560 if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) {
7561 warnedUnknownTags[type] = true;
7562 error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type);
7563 }
7564 }
7565 }
7566 return domElement;
7567 }
7568 function createTextNode(text, rootContainerElement) {
7569 return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
7570 }
7571 function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
7572 var isCustomComponentTag = isCustomComponent(tag, rawProps);
7573 {
7574 validatePropertiesInDevelopment(tag, rawProps);
7575 }
7576 var props;
7577 switch (tag) {
7578 case "dialog":
7579 listenToNonDelegatedEvent("cancel", domElement);
7580 listenToNonDelegatedEvent("close", domElement);
7581 props = rawProps;
7582 break;
7583 case "iframe":
7584 case "object":
7585 case "embed":
7586 listenToNonDelegatedEvent("load", domElement);
7587 props = rawProps;
7588 break;
7589 case "video":
7590 case "audio":
7591 for (var i = 0; i < mediaEventTypes.length; i++) {
7592 listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
7593 }
7594 props = rawProps;
7595 break;
7596 case "source":
7597 listenToNonDelegatedEvent("error", domElement);
7598 props = rawProps;
7599 break;
7600 case "img":
7601 case "image":
7602 case "link":
7603 listenToNonDelegatedEvent("error", domElement);
7604 listenToNonDelegatedEvent("load", domElement);
7605 props = rawProps;
7606 break;
7607 case "details":
7608 listenToNonDelegatedEvent("toggle", domElement);
7609 props = rawProps;
7610 break;
7611 case "input":
7612 initWrapperState(domElement, rawProps);
7613 props = getHostProps(domElement, rawProps);
7614 listenToNonDelegatedEvent("invalid", domElement);
7615 break;
7616 case "option":
7617 validateProps(domElement, rawProps);
7618 props = rawProps;
7619 break;
7620 case "select":
7621 initWrapperState$1(domElement, rawProps);
7622 props = getHostProps$1(domElement, rawProps);
7623 listenToNonDelegatedEvent("invalid", domElement);
7624 break;
7625 case "textarea":
7626 initWrapperState$2(domElement, rawProps);
7627 props = getHostProps$2(domElement, rawProps);
7628 listenToNonDelegatedEvent("invalid", domElement);
7629 break;
7630 default:
7631 props = rawProps;
7632 }
7633 assertValidProps(tag, props);
7634 setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
7635 switch (tag) {
7636 case "input":
7637 track(domElement);
7638 postMountWrapper(domElement, rawProps, false);
7639 break;
7640 case "textarea":
7641 track(domElement);
7642 postMountWrapper$3(domElement);
7643 break;
7644 case "option":
7645 postMountWrapper$1(domElement, rawProps);
7646 break;
7647 case "select":
7648 postMountWrapper$2(domElement, rawProps);
7649 break;
7650 default:
7651 if (typeof props.onClick === "function") {
7652 trapClickOnNonInteractiveElement(domElement);
7653 }
7654 break;
7655 }
7656 }
7657 function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
7658 {
7659 validatePropertiesInDevelopment(tag, nextRawProps);
7660 }
7661 var updatePayload = null;
7662 var lastProps;
7663 var nextProps;
7664 switch (tag) {
7665 case "input":
7666 lastProps = getHostProps(domElement, lastRawProps);
7667 nextProps = getHostProps(domElement, nextRawProps);
7668 updatePayload = [];
7669 break;
7670 case "select":
7671 lastProps = getHostProps$1(domElement, lastRawProps);
7672 nextProps = getHostProps$1(domElement, nextRawProps);
7673 updatePayload = [];
7674 break;
7675 case "textarea":
7676 lastProps = getHostProps$2(domElement, lastRawProps);
7677 nextProps = getHostProps$2(domElement, nextRawProps);
7678 updatePayload = [];
7679 break;
7680 default:
7681 lastProps = lastRawProps;
7682 nextProps = nextRawProps;
7683 if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
7684 trapClickOnNonInteractiveElement(domElement);
7685 }
7686 break;
7687 }
7688 assertValidProps(tag, nextProps);
7689 var propKey;
7690 var styleName;
7691 var styleUpdates = null;
7692 for (propKey in lastProps) {
7693 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
7694 continue;
7695 }
7696 if (propKey === STYLE) {
7697 var lastStyle = lastProps[propKey];
7698 for (styleName in lastStyle) {
7699 if (lastStyle.hasOwnProperty(styleName)) {
7700 if (!styleUpdates) {
7701 styleUpdates = {};
7702 }
7703 styleUpdates[styleName] = "";
7704 }
7705 }
7706 } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ;
7707 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7708 else if (propKey === AUTOFOCUS) ;
7709 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7710 if (!updatePayload) {
7711 updatePayload = [];
7712 }
7713 } else {
7714 (updatePayload = updatePayload || []).push(propKey, null);
7715 }
7716 }
7717 for (propKey in nextProps) {
7718 var nextProp = nextProps[propKey];
7719 var lastProp = lastProps != null ? lastProps[propKey] : void 0;
7720 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
7721 continue;
7722 }
7723 if (propKey === STYLE) {
7724 {
7725 if (nextProp) {
7726 Object.freeze(nextProp);
7727 }
7728 }
7729 if (lastProp) {
7730 for (styleName in lastProp) {
7731 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7732 if (!styleUpdates) {
7733 styleUpdates = {};
7734 }
7735 styleUpdates[styleName] = "";
7736 }
7737 }
7738 for (styleName in nextProp) {
7739 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7740 if (!styleUpdates) {
7741 styleUpdates = {};
7742 }
7743 styleUpdates[styleName] = nextProp[styleName];
7744 }
7745 }
7746 } else {
7747 if (!styleUpdates) {
7748 if (!updatePayload) {
7749 updatePayload = [];
7750 }
7751 updatePayload.push(propKey, styleUpdates);
7752 }
7753 styleUpdates = nextProp;
7754 }
7755 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7756 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7757 var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
7758 if (nextHtml != null) {
7759 if (lastHtml !== nextHtml) {
7760 (updatePayload = updatePayload || []).push(propKey, nextHtml);
7761 }
7762 }
7763 } else if (propKey === CHILDREN) {
7764 if (typeof nextProp === "string" || typeof nextProp === "number") {
7765 (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
7766 }
7767 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7768 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7769 if (nextProp != null) {
7770 if (typeof nextProp !== "function") {
7771 warnForInvalidEventListener(propKey, nextProp);
7772 }
7773 if (propKey === "onScroll") {
7774 listenToNonDelegatedEvent("scroll", domElement);
7775 }
7776 }
7777 if (!updatePayload && lastProp !== nextProp) {
7778 updatePayload = [];
7779 }
7780 } else {
7781 (updatePayload = updatePayload || []).push(propKey, nextProp);
7782 }
7783 }
7784 if (styleUpdates) {
7785 {
7786 validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
7787 }
7788 (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
7789 }
7790 return updatePayload;
7791 }
7792 function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
7793 if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
7794 updateChecked(domElement, nextRawProps);
7795 }
7796 var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
7797 var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
7798 updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
7799 switch (tag) {
7800 case "input":
7801 updateWrapper(domElement, nextRawProps);
7802 break;
7803 case "textarea":
7804 updateWrapper$1(domElement, nextRawProps);
7805 break;
7806 case "select":
7807 postUpdateWrapper(domElement, nextRawProps);
7808 break;
7809 }
7810 }
7811 function getPossibleStandardName(propName) {
7812 {
7813 var lowerCasedName = propName.toLowerCase();
7814 if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
7815 return null;
7816 }
7817 return possibleStandardNames[lowerCasedName] || null;
7818 }
7819 }
7820 function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {
7821 var isCustomComponentTag;
7822 var extraAttributeNames;
7823 {
7824 isCustomComponentTag = isCustomComponent(tag, rawProps);
7825 validatePropertiesInDevelopment(tag, rawProps);
7826 }
7827 switch (tag) {
7828 case "dialog":
7829 listenToNonDelegatedEvent("cancel", domElement);
7830 listenToNonDelegatedEvent("close", domElement);
7831 break;
7832 case "iframe":
7833 case "object":
7834 case "embed":
7835 listenToNonDelegatedEvent("load", domElement);
7836 break;
7837 case "video":
7838 case "audio":
7839 for (var i = 0; i < mediaEventTypes.length; i++) {
7840 listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
7841 }
7842 break;
7843 case "source":
7844 listenToNonDelegatedEvent("error", domElement);
7845 break;
7846 case "img":
7847 case "image":
7848 case "link":
7849 listenToNonDelegatedEvent("error", domElement);
7850 listenToNonDelegatedEvent("load", domElement);
7851 break;
7852 case "details":
7853 listenToNonDelegatedEvent("toggle", domElement);
7854 break;
7855 case "input":
7856 initWrapperState(domElement, rawProps);
7857 listenToNonDelegatedEvent("invalid", domElement);
7858 break;
7859 case "option":
7860 validateProps(domElement, rawProps);
7861 break;
7862 case "select":
7863 initWrapperState$1(domElement, rawProps);
7864 listenToNonDelegatedEvent("invalid", domElement);
7865 break;
7866 case "textarea":
7867 initWrapperState$2(domElement, rawProps);
7868 listenToNonDelegatedEvent("invalid", domElement);
7869 break;
7870 }
7871 assertValidProps(tag, rawProps);
7872 {
7873 extraAttributeNames = /* @__PURE__ */ new Set();
7874 var attributes = domElement.attributes;
7875 for (var _i = 0; _i < attributes.length; _i++) {
7876 var name = attributes[_i].name.toLowerCase();
7877 switch (name) {
7878 // Controlled attributes are not validated
7879 // TODO: Only ignore them on controlled tags.
7880 case "value":
7881 break;
7882 case "checked":
7883 break;
7884 case "selected":
7885 break;
7886 default:
7887 extraAttributeNames.add(attributes[_i].name);
7888 }
7889 }
7890 }
7891 var updatePayload = null;
7892 for (var propKey in rawProps) {
7893 if (!rawProps.hasOwnProperty(propKey)) {
7894 continue;
7895 }
7896 var nextProp = rawProps[propKey];
7897 if (propKey === CHILDREN) {
7898 if (typeof nextProp === "string") {
7899 if (domElement.textContent !== nextProp) {
7900 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
7901 checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
7902 }
7903 updatePayload = [CHILDREN, nextProp];
7904 }
7905 } else if (typeof nextProp === "number") {
7906 if (domElement.textContent !== "" + nextProp) {
7907 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
7908 checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
7909 }
7910 updatePayload = [CHILDREN, "" + nextProp];
7911 }
7912 }
7913 } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7914 if (nextProp != null) {
7915 if (typeof nextProp !== "function") {
7916 warnForInvalidEventListener(propKey, nextProp);
7917 }
7918 if (propKey === "onScroll") {
7919 listenToNonDelegatedEvent("scroll", domElement);
7920 }
7921 }
7922 } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.)
7923 typeof isCustomComponentTag === "boolean") {
7924 var serverValue = void 0;
7925 var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
7926 if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ;
7927 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
7928 // TODO: Only ignore them on controlled tags.
7929 propKey === "value" || propKey === "checked" || propKey === "selected") ;
7930 else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7931 var serverHTML = domElement.innerHTML;
7932 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7933 if (nextHtml != null) {
7934 var expectedHTML = normalizeHTML(domElement, nextHtml);
7935 if (expectedHTML !== serverHTML) {
7936 warnForPropDifference(propKey, serverHTML, expectedHTML);
7937 }
7938 }
7939 } else if (propKey === STYLE) {
7940 extraAttributeNames.delete(propKey);
7941 if (canDiffStyleForHydrationWarning) {
7942 var expectedStyle = createDangerousStringForStyles(nextProp);
7943 serverValue = domElement.getAttribute("style");
7944 if (expectedStyle !== serverValue) {
7945 warnForPropDifference(propKey, serverValue, expectedStyle);
7946 }
7947 }
7948 } else if (isCustomComponentTag && !enableCustomElementPropertySupport) {
7949 extraAttributeNames.delete(propKey.toLowerCase());
7950 serverValue = getValueForAttribute(domElement, propKey, nextProp);
7951 if (nextProp !== serverValue) {
7952 warnForPropDifference(propKey, serverValue, nextProp);
7953 }
7954 } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
7955 var isMismatchDueToBadCasing = false;
7956 if (propertyInfo !== null) {
7957 extraAttributeNames.delete(propertyInfo.attributeName);
7958 serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
7959 } else {
7960 var ownNamespace = parentNamespace;
7961 if (ownNamespace === HTML_NAMESPACE) {
7962 ownNamespace = getIntrinsicNamespace(tag);
7963 }
7964 if (ownNamespace === HTML_NAMESPACE) {
7965 extraAttributeNames.delete(propKey.toLowerCase());
7966 } else {
7967 var standardName = getPossibleStandardName(propKey);
7968 if (standardName !== null && standardName !== propKey) {
7969 isMismatchDueToBadCasing = true;
7970 extraAttributeNames.delete(standardName);
7971 }
7972 extraAttributeNames.delete(propKey);
7973 }
7974 serverValue = getValueForAttribute(domElement, propKey, nextProp);
7975 }
7976 var dontWarnCustomElement = enableCustomElementPropertySupport;
7977 if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
7978 warnForPropDifference(propKey, serverValue, nextProp);
7979 }
7980 }
7981 }
7982 }
7983 {
7984 if (shouldWarnDev) {
7985 if (
7986 // $FlowFixMe - Should be inferred as not undefined.
7987 extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true
7988 ) {
7989 warnForExtraAttributes(extraAttributeNames);
7990 }
7991 }
7992 }
7993 switch (tag) {
7994 case "input":
7995 track(domElement);
7996 postMountWrapper(domElement, rawProps, true);
7997 break;
7998 case "textarea":
7999 track(domElement);
8000 postMountWrapper$3(domElement);
8001 break;
8002 case "select":
8003 case "option":
8004 break;
8005 default:
8006 if (typeof rawProps.onClick === "function") {
8007 trapClickOnNonInteractiveElement(domElement);
8008 }
8009 break;
8010 }
8011 return updatePayload;
8012 }
8013 function diffHydratedText(textNode, text, isConcurrentMode) {
8014 var isDifferent = textNode.nodeValue !== text;
8015 return isDifferent;
8016 }
8017 function warnForDeletedHydratableElement(parentNode, child) {
8018 {
8019 if (didWarnInvalidHydration) {
8020 return;
8021 }
8022 didWarnInvalidHydration = true;
8023 error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
8024 }
8025 }
8026 function warnForDeletedHydratableText(parentNode, child) {
8027 {
8028 if (didWarnInvalidHydration) {
8029 return;
8030 }
8031 didWarnInvalidHydration = true;
8032 error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
8033 }
8034 }
8035 function warnForInsertedHydratedElement(parentNode, tag, props) {
8036 {
8037 if (didWarnInvalidHydration) {
8038 return;
8039 }
8040 didWarnInvalidHydration = true;
8041 error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
8042 }
8043 }
8044 function warnForInsertedHydratedText(parentNode, text) {
8045 {
8046 if (text === "") {
8047 return;
8048 }
8049 if (didWarnInvalidHydration) {
8050 return;
8051 }
8052 didWarnInvalidHydration = true;
8053 error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
8054 }
8055 }
8056 function restoreControlledState$3(domElement, tag, props) {
8057 switch (tag) {
8058 case "input":
8059 restoreControlledState(domElement, props);
8060 return;
8061 case "textarea":
8062 restoreControlledState$2(domElement, props);
8063 return;
8064 case "select":
8065 restoreControlledState$1(domElement, props);
8066 return;
8067 }
8068 }
8069 var validateDOMNesting = function() {
8070 };
8071 var updatedAncestorInfo = function() {
8072 };
8073 {
8074 var specialTags = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"];
8075 var inScopeTags = [
8076 "applet",
8077 "caption",
8078 "html",
8079 "table",
8080 "td",
8081 "th",
8082 "marquee",
8083 "object",
8084 "template",
8085 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
8086 // TODO: Distinguish by namespace here -- for <title>, including it here
8087 // errs on the side of fewer warnings
8088 "foreignObject",
8089 "desc",
8090 "title"
8091 ];
8092 var buttonScopeTags = inScopeTags.concat(["button"]);
8093 var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
8094 var emptyAncestorInfo = {
8095 current: null,
8096 formTag: null,
8097 aTagInScope: null,
8098 buttonTagInScope: null,
8099 nobrTagInScope: null,
8100 pTagInButtonScope: null,
8101 listItemTagAutoclosing: null,
8102 dlItemTagAutoclosing: null
8103 };
8104 updatedAncestorInfo = function(oldInfo, tag) {
8105 var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
8106 var info = {
8107 tag
8108 };
8109 if (inScopeTags.indexOf(tag) !== -1) {
8110 ancestorInfo.aTagInScope = null;
8111 ancestorInfo.buttonTagInScope = null;
8112 ancestorInfo.nobrTagInScope = null;
8113 }
8114 if (buttonScopeTags.indexOf(tag) !== -1) {
8115 ancestorInfo.pTagInButtonScope = null;
8116 }
8117 if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
8118 ancestorInfo.listItemTagAutoclosing = null;
8119 ancestorInfo.dlItemTagAutoclosing = null;
8120 }
8121 ancestorInfo.current = info;
8122 if (tag === "form") {
8123 ancestorInfo.formTag = info;
8124 }
8125 if (tag === "a") {
8126 ancestorInfo.aTagInScope = info;
8127 }
8128 if (tag === "button") {
8129 ancestorInfo.buttonTagInScope = info;
8130 }
8131 if (tag === "nobr") {
8132 ancestorInfo.nobrTagInScope = info;
8133 }
8134 if (tag === "p") {
8135 ancestorInfo.pTagInButtonScope = info;
8136 }
8137 if (tag === "li") {
8138 ancestorInfo.listItemTagAutoclosing = info;
8139 }
8140 if (tag === "dd" || tag === "dt") {
8141 ancestorInfo.dlItemTagAutoclosing = info;
8142 }
8143 return ancestorInfo;
8144 };
8145 var isTagValidWithParent = function(tag, parentTag) {
8146 switch (parentTag) {
8147 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
8148 case "select":
8149 return tag === "option" || tag === "optgroup" || tag === "#text";
8150 case "optgroup":
8151 return tag === "option" || tag === "#text";
8152 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
8153 // but
8154 case "option":
8155 return tag === "#text";
8156 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
8157 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
8158 // No special behavior since these rules fall back to "in body" mode for
8159 // all except special table nodes which cause bad parsing behavior anyway.
8160 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
8161 case "tr":
8162 return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
8163 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
8164 case "tbody":
8165 case "thead":
8166 case "tfoot":
8167 return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
8168 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
8169 case "colgroup":
8170 return tag === "col" || tag === "template";
8171 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
8172 case "table":
8173 return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
8174 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
8175 case "head":
8176 return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
8177 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
8178 case "html":
8179 return tag === "head" || tag === "body" || tag === "frameset";
8180 case "frameset":
8181 return tag === "frame";
8182 case "#document":
8183 return tag === "html";
8184 }
8185 switch (tag) {
8186 case "h1":
8187 case "h2":
8188 case "h3":
8189 case "h4":
8190 case "h5":
8191 case "h6":
8192 return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
8193 case "rp":
8194 case "rt":
8195 return impliedEndTags.indexOf(parentTag) === -1;
8196 case "body":
8197 case "caption":
8198 case "col":
8199 case "colgroup":
8200 case "frameset":
8201 case "frame":
8202 case "head":
8203 case "html":
8204 case "tbody":
8205 case "td":
8206 case "tfoot":
8207 case "th":
8208 case "thead":
8209 case "tr":
8210 return parentTag == null;
8211 }
8212 return true;
8213 };
8214 var findInvalidAncestorForTag = function(tag, ancestorInfo) {
8215 switch (tag) {
8216 case "address":
8217 case "article":
8218 case "aside":
8219 case "blockquote":
8220 case "center":
8221 case "details":
8222 case "dialog":
8223 case "dir":
8224 case "div":
8225 case "dl":
8226 case "fieldset":
8227 case "figcaption":
8228 case "figure":
8229 case "footer":
8230 case "header":
8231 case "hgroup":
8232 case "main":
8233 case "menu":
8234 case "nav":
8235 case "ol":
8236 case "p":
8237 case "section":
8238 case "summary":
8239 case "ul":
8240 case "pre":
8241 case "listing":
8242 case "table":
8243 case "hr":
8244 case "xmp":
8245 case "h1":
8246 case "h2":
8247 case "h3":
8248 case "h4":
8249 case "h5":
8250 case "h6":
8251 return ancestorInfo.pTagInButtonScope;
8252 case "form":
8253 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
8254 case "li":
8255 return ancestorInfo.listItemTagAutoclosing;
8256 case "dd":
8257 case "dt":
8258 return ancestorInfo.dlItemTagAutoclosing;
8259 case "button":
8260 return ancestorInfo.buttonTagInScope;
8261 case "a":
8262 return ancestorInfo.aTagInScope;
8263 case "nobr":
8264 return ancestorInfo.nobrTagInScope;
8265 }
8266 return null;
8267 };
8268 var didWarn$1 = {};
8269 validateDOMNesting = function(childTag, childText, ancestorInfo) {
8270 ancestorInfo = ancestorInfo || emptyAncestorInfo;
8271 var parentInfo = ancestorInfo.current;
8272 var parentTag = parentInfo && parentInfo.tag;
8273 if (childText != null) {
8274 if (childTag != null) {
8275 error("validateDOMNesting: when childText is passed, childTag should be null");
8276 }
8277 childTag = "#text";
8278 }
8279 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
8280 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
8281 var invalidParentOrAncestor = invalidParent || invalidAncestor;
8282 if (!invalidParentOrAncestor) {
8283 return;
8284 }
8285 var ancestorTag = invalidParentOrAncestor.tag;
8286 var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
8287 if (didWarn$1[warnKey]) {
8288 return;
8289 }
8290 didWarn$1[warnKey] = true;
8291 var tagDisplayName = childTag;
8292 var whitespaceInfo = "";
8293 if (childTag === "#text") {
8294 if (/\S/.test(childText)) {
8295 tagDisplayName = "Text nodes";
8296 } else {
8297 tagDisplayName = "Whitespace text nodes";
8298 whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
8299 }
8300 } else {
8301 tagDisplayName = "<" + childTag + ">";
8302 }
8303 if (invalidParent) {
8304 var info = "";
8305 if (ancestorTag === "table" && childTag === "tr") {
8306 info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
8307 }
8308 error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
8309 } else {
8310 error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
8311 }
8312 };
8313 }
8314 var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
8315 var SUSPENSE_START_DATA = "$";
8316 var SUSPENSE_END_DATA = "/$";
8317 var SUSPENSE_PENDING_START_DATA = "$?";
8318 var SUSPENSE_FALLBACK_START_DATA = "$!";
8319 var STYLE$1 = "style";
8320 var eventsEnabled = null;
8321 var selectionInformation = null;
8322 function getRootHostContext(rootContainerInstance) {
8323 var type;
8324 var namespace;
8325 var nodeType = rootContainerInstance.nodeType;
8326 switch (nodeType) {
8327 case DOCUMENT_NODE:
8328 case DOCUMENT_FRAGMENT_NODE: {
8329 type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
8330 var root2 = rootContainerInstance.documentElement;
8331 namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
8332 break;
8333 }
8334 default: {
8335 var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
8336 var ownNamespace = container.namespaceURI || null;
8337 type = container.tagName;
8338 namespace = getChildNamespace(ownNamespace, type);
8339 break;
8340 }
8341 }
8342 {
8343 var validatedTag = type.toLowerCase();
8344 var ancestorInfo = updatedAncestorInfo(null, validatedTag);
8345 return {
8346 namespace,
8347 ancestorInfo
8348 };
8349 }
8350 }
8351 function getChildHostContext(parentHostContext, type, rootContainerInstance) {
8352 {
8353 var parentHostContextDev = parentHostContext;
8354 var namespace = getChildNamespace(parentHostContextDev.namespace, type);
8355 var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
8356 return {
8357 namespace,
8358 ancestorInfo
8359 };
8360 }
8361 }
8362 function getPublicInstance(instance) {
8363 return instance;
8364 }
8365 function prepareForCommit(containerInfo) {
8366 eventsEnabled = isEnabled();
8367 selectionInformation = getSelectionInformation();
8368 var activeInstance = null;
8369 setEnabled(false);
8370 return activeInstance;
8371 }
8372 function resetAfterCommit(containerInfo) {
8373 restoreSelection(selectionInformation);
8374 setEnabled(eventsEnabled);
8375 eventsEnabled = null;
8376 selectionInformation = null;
8377 }
8378 function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
8379 var parentNamespace;
8380 {
8381 var hostContextDev = hostContext;
8382 validateDOMNesting(type, null, hostContextDev.ancestorInfo);
8383 if (typeof props.children === "string" || typeof props.children === "number") {
8384 var string = "" + props.children;
8385 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
8386 validateDOMNesting(null, string, ownAncestorInfo);
8387 }
8388 parentNamespace = hostContextDev.namespace;
8389 }
8390 var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
8391 precacheFiberNode(internalInstanceHandle, domElement);
8392 updateFiberProps(domElement, props);
8393 return domElement;
8394 }
8395 function appendInitialChild(parentInstance, child) {
8396 parentInstance.appendChild(child);
8397 }
8398 function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
8399 setInitialProperties(domElement, type, props, rootContainerInstance);
8400 switch (type) {
8401 case "button":
8402 case "input":
8403 case "select":
8404 case "textarea":
8405 return !!props.autoFocus;
8406 case "img":
8407 return true;
8408 default:
8409 return false;
8410 }
8411 }
8412 function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
8413 {
8414 var hostContextDev = hostContext;
8415 if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
8416 var string = "" + newProps.children;
8417 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
8418 validateDOMNesting(null, string, ownAncestorInfo);
8419 }
8420 }
8421 return diffProperties(domElement, type, oldProps, newProps);
8422 }
8423 function shouldSetTextContent(type, props) {
8424 return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
8425 }
8426 function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
8427 {
8428 var hostContextDev = hostContext;
8429 validateDOMNesting(null, text, hostContextDev.ancestorInfo);
8430 }
8431 var textNode = createTextNode(text, rootContainerInstance);
8432 precacheFiberNode(internalInstanceHandle, textNode);
8433 return textNode;
8434 }
8435 function getCurrentEventPriority() {
8436 var currentEvent = window.event;
8437 if (currentEvent === void 0) {
8438 return DefaultEventPriority;
8439 }
8440 return getEventPriority(currentEvent.type);
8441 }
8442 var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
8443 var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
8444 var noTimeout = -1;
8445 var localPromise = typeof Promise === "function" ? Promise : void 0;
8446 var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
8447 return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
8448 } : scheduleTimeout;
8449 function handleErrorInNextTick(error2) {
8450 setTimeout(function() {
8451 throw error2;
8452 });
8453 }
8454 function commitMount(domElement, type, newProps, internalInstanceHandle) {
8455 switch (type) {
8456 case "button":
8457 case "input":
8458 case "select":
8459 case "textarea":
8460 if (newProps.autoFocus) {
8461 domElement.focus();
8462 }
8463 return;
8464 case "img": {
8465 if (newProps.src) {
8466 domElement.src = newProps.src;
8467 }
8468 return;
8469 }
8470 }
8471 }
8472 function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
8473 updateProperties(domElement, updatePayload, type, oldProps, newProps);
8474 updateFiberProps(domElement, newProps);
8475 }
8476 function resetTextContent(domElement) {
8477 setTextContent(domElement, "");
8478 }
8479 function commitTextUpdate(textInstance, oldText, newText) {
8480 textInstance.nodeValue = newText;
8481 }
8482 function appendChild(parentInstance, child) {
8483 parentInstance.appendChild(child);
8484 }
8485 function appendChildToContainer(container, child) {
8486 var parentNode;
8487 if (container.nodeType === COMMENT_NODE) {
8488 parentNode = container.parentNode;
8489 parentNode.insertBefore(child, container);
8490 } else {
8491 parentNode = container;
8492 parentNode.appendChild(child);
8493 }
8494 var reactRootContainer = container._reactRootContainer;
8495 if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
8496 trapClickOnNonInteractiveElement(parentNode);
8497 }
8498 }
8499 function insertBefore(parentInstance, child, beforeChild) {
8500 parentInstance.insertBefore(child, beforeChild);
8501 }
8502 function insertInContainerBefore(container, child, beforeChild) {
8503 if (container.nodeType === COMMENT_NODE) {
8504 container.parentNode.insertBefore(child, beforeChild);
8505 } else {
8506 container.insertBefore(child, beforeChild);
8507 }
8508 }
8509 function removeChild(parentInstance, child) {
8510 parentInstance.removeChild(child);
8511 }
8512 function removeChildFromContainer(container, child) {
8513 if (container.nodeType === COMMENT_NODE) {
8514 container.parentNode.removeChild(child);
8515 } else {
8516 container.removeChild(child);
8517 }
8518 }
8519 function clearSuspenseBoundary(parentInstance, suspenseInstance) {
8520 var node = suspenseInstance;
8521 var depth = 0;
8522 do {
8523 var nextNode = node.nextSibling;
8524 parentInstance.removeChild(node);
8525 if (nextNode && nextNode.nodeType === COMMENT_NODE) {
8526 var data = nextNode.data;
8527 if (data === SUSPENSE_END_DATA) {
8528 if (depth === 0) {
8529 parentInstance.removeChild(nextNode);
8530 retryIfBlockedOn(suspenseInstance);
8531 return;
8532 } else {
8533 depth--;
8534 }
8535 } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
8536 depth++;
8537 }
8538 }
8539 node = nextNode;
8540 } while (node);
8541 retryIfBlockedOn(suspenseInstance);
8542 }
8543 function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
8544 if (container.nodeType === COMMENT_NODE) {
8545 clearSuspenseBoundary(container.parentNode, suspenseInstance);
8546 } else if (container.nodeType === ELEMENT_NODE) {
8547 clearSuspenseBoundary(container, suspenseInstance);
8548 }
8549 retryIfBlockedOn(container);
8550 }
8551 function hideInstance(instance) {
8552 instance = instance;
8553 var style2 = instance.style;
8554 if (typeof style2.setProperty === "function") {
8555 style2.setProperty("display", "none", "important");
8556 } else {
8557 style2.display = "none";
8558 }
8559 }
8560 function hideTextInstance(textInstance) {
8561 textInstance.nodeValue = "";
8562 }
8563 function unhideInstance(instance, props) {
8564 instance = instance;
8565 var styleProp = props[STYLE$1];
8566 var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
8567 instance.style.display = dangerousStyleValue("display", display);
8568 }
8569 function unhideTextInstance(textInstance, text) {
8570 textInstance.nodeValue = text;
8571 }
8572 function clearContainer(container) {
8573 if (container.nodeType === ELEMENT_NODE) {
8574 container.textContent = "";
8575 } else if (container.nodeType === DOCUMENT_NODE) {
8576 if (container.documentElement) {
8577 container.removeChild(container.documentElement);
8578 }
8579 }
8580 }
8581 function canHydrateInstance(instance, type, props) {
8582 if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
8583 return null;
8584 }
8585 return instance;
8586 }
8587 function canHydrateTextInstance(instance, text) {
8588 if (text === "" || instance.nodeType !== TEXT_NODE) {
8589 return null;
8590 }
8591 return instance;
8592 }
8593 function canHydrateSuspenseInstance(instance) {
8594 if (instance.nodeType !== COMMENT_NODE) {
8595 return null;
8596 }
8597 return instance;
8598 }
8599 function isSuspenseInstancePending(instance) {
8600 return instance.data === SUSPENSE_PENDING_START_DATA;
8601 }
8602 function isSuspenseInstanceFallback(instance) {
8603 return instance.data === SUSPENSE_FALLBACK_START_DATA;
8604 }
8605 function getSuspenseInstanceFallbackErrorDetails(instance) {
8606 var dataset = instance.nextSibling && instance.nextSibling.dataset;
8607 var digest, message, stack;
8608 if (dataset) {
8609 digest = dataset.dgst;
8610 {
8611 message = dataset.msg;
8612 stack = dataset.stck;
8613 }
8614 }
8615 {
8616 return {
8617 message,
8618 digest,
8619 stack
8620 };
8621 }
8622 }
8623 function registerSuspenseInstanceRetry(instance, callback) {
8624 instance._reactRetry = callback;
8625 }
8626 function getNextHydratable(node) {
8627 for (; node != null; node = node.nextSibling) {
8628 var nodeType = node.nodeType;
8629 if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
8630 break;
8631 }
8632 if (nodeType === COMMENT_NODE) {
8633 var nodeData = node.data;
8634 if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
8635 break;
8636 }
8637 if (nodeData === SUSPENSE_END_DATA) {
8638 return null;
8639 }
8640 }
8641 }
8642 return node;
8643 }
8644 function getNextHydratableSibling(instance) {
8645 return getNextHydratable(instance.nextSibling);
8646 }
8647 function getFirstHydratableChild(parentInstance) {
8648 return getNextHydratable(parentInstance.firstChild);
8649 }
8650 function getFirstHydratableChildWithinContainer(parentContainer) {
8651 return getNextHydratable(parentContainer.firstChild);
8652 }
8653 function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
8654 return getNextHydratable(parentInstance.nextSibling);
8655 }
8656 function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
8657 precacheFiberNode(internalInstanceHandle, instance);
8658 updateFiberProps(instance, props);
8659 var parentNamespace;
8660 {
8661 var hostContextDev = hostContext;
8662 parentNamespace = hostContextDev.namespace;
8663 }
8664 var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
8665 return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
8666 }
8667 function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {
8668 precacheFiberNode(internalInstanceHandle, textInstance);
8669 var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
8670 return diffHydratedText(textInstance, text);
8671 }
8672 function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
8673 precacheFiberNode(internalInstanceHandle, suspenseInstance);
8674 }
8675 function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
8676 var node = suspenseInstance.nextSibling;
8677 var depth = 0;
8678 while (node) {
8679 if (node.nodeType === COMMENT_NODE) {
8680 var data = node.data;
8681 if (data === SUSPENSE_END_DATA) {
8682 if (depth === 0) {
8683 return getNextHydratableSibling(node);
8684 } else {
8685 depth--;
8686 }
8687 } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
8688 depth++;
8689 }
8690 }
8691 node = node.nextSibling;
8692 }
8693 return null;
8694 }
8695 function getParentSuspenseInstance(targetInstance) {
8696 var node = targetInstance.previousSibling;
8697 var depth = 0;
8698 while (node) {
8699 if (node.nodeType === COMMENT_NODE) {
8700 var data = node.data;
8701 if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
8702 if (depth === 0) {
8703 return node;
8704 } else {
8705 depth--;
8706 }
8707 } else if (data === SUSPENSE_END_DATA) {
8708 depth++;
8709 }
8710 }
8711 node = node.previousSibling;
8712 }
8713 return null;
8714 }
8715 function commitHydratedContainer(container) {
8716 retryIfBlockedOn(container);
8717 }
8718 function commitHydratedSuspenseInstance(suspenseInstance) {
8719 retryIfBlockedOn(suspenseInstance);
8720 }
8721 function shouldDeleteUnhydratedTailInstances(parentType) {
8722 return parentType !== "head" && parentType !== "body";
8723 }
8724 function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {
8725 var shouldWarnDev = true;
8726 checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
8727 }
8728 function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {
8729 if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8730 var shouldWarnDev = true;
8731 checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
8732 }
8733 }
8734 function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
8735 {
8736 if (instance.nodeType === ELEMENT_NODE) {
8737 warnForDeletedHydratableElement(parentContainer, instance);
8738 } else if (instance.nodeType === COMMENT_NODE) ;
8739 else {
8740 warnForDeletedHydratableText(parentContainer, instance);
8741 }
8742 }
8743 }
8744 function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
8745 {
8746 var parentNode = parentInstance.parentNode;
8747 if (parentNode !== null) {
8748 if (instance.nodeType === ELEMENT_NODE) {
8749 warnForDeletedHydratableElement(parentNode, instance);
8750 } else if (instance.nodeType === COMMENT_NODE) ;
8751 else {
8752 warnForDeletedHydratableText(parentNode, instance);
8753 }
8754 }
8755 }
8756 }
8757 function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
8758 {
8759 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8760 if (instance.nodeType === ELEMENT_NODE) {
8761 warnForDeletedHydratableElement(parentInstance, instance);
8762 } else if (instance.nodeType === COMMENT_NODE) ;
8763 else {
8764 warnForDeletedHydratableText(parentInstance, instance);
8765 }
8766 }
8767 }
8768 }
8769 function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
8770 {
8771 warnForInsertedHydratedElement(parentContainer, type);
8772 }
8773 }
8774 function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {
8775 {
8776 warnForInsertedHydratedText(parentContainer, text);
8777 }
8778 }
8779 function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
8780 {
8781 var parentNode = parentInstance.parentNode;
8782 if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type);
8783 }
8784 }
8785 function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {
8786 {
8787 var parentNode = parentInstance.parentNode;
8788 if (parentNode !== null) warnForInsertedHydratedText(parentNode, text);
8789 }
8790 }
8791 function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
8792 {
8793 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8794 warnForInsertedHydratedElement(parentInstance, type);
8795 }
8796 }
8797 }
8798 function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {
8799 {
8800 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8801 warnForInsertedHydratedText(parentInstance, text);
8802 }
8803 }
8804 }
8805 function errorHydratingContainer(parentContainer) {
8806 {
8807 error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
8808 }
8809 }
8810 function preparePortalMount(portalInstance) {
8811 listenToAllSupportedEvents(portalInstance);
8812 }
8813 var randomKey = Math.random().toString(36).slice(2);
8814 var internalInstanceKey = "__reactFiber$" + randomKey;
8815 var internalPropsKey = "__reactProps$" + randomKey;
8816 var internalContainerInstanceKey = "__reactContainer$" + randomKey;
8817 var internalEventHandlersKey = "__reactEvents$" + randomKey;
8818 var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
8819 var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
8820 function detachDeletedInstance(node) {
8821 delete node[internalInstanceKey];
8822 delete node[internalPropsKey];
8823 delete node[internalEventHandlersKey];
8824 delete node[internalEventHandlerListenersKey];
8825 delete node[internalEventHandlesSetKey];
8826 }
8827 function precacheFiberNode(hostInst, node) {
8828 node[internalInstanceKey] = hostInst;
8829 }
8830 function markContainerAsRoot(hostRoot, node) {
8831 node[internalContainerInstanceKey] = hostRoot;
8832 }
8833 function unmarkContainerAsRoot(node) {
8834 node[internalContainerInstanceKey] = null;
8835 }
8836 function isContainerMarkedAsRoot(node) {
8837 return !!node[internalContainerInstanceKey];
8838 }
8839 function getClosestInstanceFromNode(targetNode) {
8840 var targetInst = targetNode[internalInstanceKey];
8841 if (targetInst) {
8842 return targetInst;
8843 }
8844 var parentNode = targetNode.parentNode;
8845 while (parentNode) {
8846 targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
8847 if (targetInst) {
8848 var alternate = targetInst.alternate;
8849 if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
8850 var suspenseInstance = getParentSuspenseInstance(targetNode);
8851 while (suspenseInstance !== null) {
8852 var targetSuspenseInst = suspenseInstance[internalInstanceKey];
8853 if (targetSuspenseInst) {
8854 return targetSuspenseInst;
8855 }
8856 suspenseInstance = getParentSuspenseInstance(suspenseInstance);
8857 }
8858 }
8859 return targetInst;
8860 }
8861 targetNode = parentNode;
8862 parentNode = targetNode.parentNode;
8863 }
8864 return null;
8865 }
8866 function getInstanceFromNode(node) {
8867 var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
8868 if (inst) {
8869 if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
8870 return inst;
8871 } else {
8872 return null;
8873 }
8874 }
8875 return null;
8876 }
8877 function getNodeFromInstance(inst) {
8878 if (inst.tag === HostComponent || inst.tag === HostText) {
8879 return inst.stateNode;
8880 }
8881 throw new Error("getNodeFromInstance: Invalid argument.");
8882 }
8883 function getFiberCurrentPropsFromNode(node) {
8884 return node[internalPropsKey] || null;
8885 }
8886 function updateFiberProps(node, props) {
8887 node[internalPropsKey] = props;
8888 }
8889 function getEventListenerSet(node) {
8890 var elementListenerSet = node[internalEventHandlersKey];
8891 if (elementListenerSet === void 0) {
8892 elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
8893 }
8894 return elementListenerSet;
8895 }
8896 var loggedTypeFailures = {};
8897 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
8898 function setCurrentlyValidatingElement(element) {
8899 {
8900 if (element) {
8901 var owner = element._owner;
8902 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
8903 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
8904 } else {
8905 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
8906 }
8907 }
8908 }
8909 function checkPropTypes(typeSpecs, values, location, componentName, element) {
8910 {
8911 var has2 = Function.call.bind(hasOwnProperty);
8912 for (var typeSpecName in typeSpecs) {
8913 if (has2(typeSpecs, typeSpecName)) {
8914 var error$1 = void 0;
8915 try {
8916 if (typeof typeSpecs[typeSpecName] !== "function") {
8917 var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
8918 err.name = "Invariant Violation";
8919 throw err;
8920 }
8921 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
8922 } catch (ex) {
8923 error$1 = ex;
8924 }
8925 if (error$1 && !(error$1 instanceof Error)) {
8926 setCurrentlyValidatingElement(element);
8927 error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
8928 setCurrentlyValidatingElement(null);
8929 }
8930 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
8931 loggedTypeFailures[error$1.message] = true;
8932 setCurrentlyValidatingElement(element);
8933 error("Failed %s type: %s", location, error$1.message);
8934 setCurrentlyValidatingElement(null);
8935 }
8936 }
8937 }
8938 }
8939 }
8940 var valueStack = [];
8941 var fiberStack;
8942 {
8943 fiberStack = [];
8944 }
8945 var index = -1;
8946 function createCursor(defaultValue) {
8947 return {
8948 current: defaultValue
8949 };
8950 }
8951 function pop(cursor, fiber) {
8952 if (index < 0) {
8953 {
8954 error("Unexpected pop.");
8955 }
8956 return;
8957 }
8958 {
8959 if (fiber !== fiberStack[index]) {
8960 error("Unexpected Fiber popped.");
8961 }
8962 }
8963 cursor.current = valueStack[index];
8964 valueStack[index] = null;
8965 {
8966 fiberStack[index] = null;
8967 }
8968 index--;
8969 }
8970 function push(cursor, value, fiber) {
8971 index++;
8972 valueStack[index] = cursor.current;
8973 {
8974 fiberStack[index] = fiber;
8975 }
8976 cursor.current = value;
8977 }
8978 var warnedAboutMissingGetChildContext;
8979 {
8980 warnedAboutMissingGetChildContext = {};
8981 }
8982 var emptyContextObject = {};
8983 {
8984 Object.freeze(emptyContextObject);
8985 }
8986 var contextStackCursor = createCursor(emptyContextObject);
8987 var didPerformWorkStackCursor = createCursor(false);
8988 var previousContext = emptyContextObject;
8989 function getUnmaskedContext(workInProgress2, Component, didPushOwnContextIfProvider) {
8990 {
8991 if (didPushOwnContextIfProvider && isContextProvider(Component)) {
8992 return previousContext;
8993 }
8994 return contextStackCursor.current;
8995 }
8996 }
8997 function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
8998 {
8999 var instance = workInProgress2.stateNode;
9000 instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
9001 instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
9002 }
9003 }
9004 function getMaskedContext(workInProgress2, unmaskedContext) {
9005 {
9006 var type = workInProgress2.type;
9007 var contextTypes = type.contextTypes;
9008 if (!contextTypes) {
9009 return emptyContextObject;
9010 }
9011 var instance = workInProgress2.stateNode;
9012 if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
9013 return instance.__reactInternalMemoizedMaskedChildContext;
9014 }
9015 var context = {};
9016 for (var key in contextTypes) {
9017 context[key] = unmaskedContext[key];
9018 }
9019 {
9020 var name = getComponentNameFromFiber(workInProgress2) || "Unknown";
9021 checkPropTypes(contextTypes, context, "context", name);
9022 }
9023 if (instance) {
9024 cacheContext(workInProgress2, unmaskedContext, context);
9025 }
9026 return context;
9027 }
9028 }
9029 function hasContextChanged() {
9030 {
9031 return didPerformWorkStackCursor.current;
9032 }
9033 }
9034 function isContextProvider(type) {
9035 {
9036 var childContextTypes = type.childContextTypes;
9037 return childContextTypes !== null && childContextTypes !== void 0;
9038 }
9039 }
9040 function popContext(fiber) {
9041 {
9042 pop(didPerformWorkStackCursor, fiber);
9043 pop(contextStackCursor, fiber);
9044 }
9045 }
9046 function popTopLevelContextObject(fiber) {
9047 {
9048 pop(didPerformWorkStackCursor, fiber);
9049 pop(contextStackCursor, fiber);
9050 }
9051 }
9052 function pushTopLevelContextObject(fiber, context, didChange) {
9053 {
9054 if (contextStackCursor.current !== emptyContextObject) {
9055 throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
9056 }
9057 push(contextStackCursor, context, fiber);
9058 push(didPerformWorkStackCursor, didChange, fiber);
9059 }
9060 }
9061 function processChildContext(fiber, type, parentContext) {
9062 {
9063 var instance = fiber.stateNode;
9064 var childContextTypes = type.childContextTypes;
9065 if (typeof instance.getChildContext !== "function") {
9066 {
9067 var componentName = getComponentNameFromFiber(fiber) || "Unknown";
9068 if (!warnedAboutMissingGetChildContext[componentName]) {
9069 warnedAboutMissingGetChildContext[componentName] = true;
9070 error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName);
9071 }
9072 }
9073 return parentContext;
9074 }
9075 var childContext = instance.getChildContext();
9076 for (var contextKey in childContext) {
9077 if (!(contextKey in childContextTypes)) {
9078 throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
9079 }
9080 }
9081 {
9082 var name = getComponentNameFromFiber(fiber) || "Unknown";
9083 checkPropTypes(childContextTypes, childContext, "child context", name);
9084 }
9085 return assign({}, parentContext, childContext);
9086 }
9087 }
9088 function pushContextProvider(workInProgress2) {
9089 {
9090 var instance = workInProgress2.stateNode;
9091 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
9092 previousContext = contextStackCursor.current;
9093 push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
9094 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
9095 return true;
9096 }
9097 }
9098 function invalidateContextProvider(workInProgress2, type, didChange) {
9099 {
9100 var instance = workInProgress2.stateNode;
9101 if (!instance) {
9102 throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
9103 }
9104 if (didChange) {
9105 var mergedContext = processChildContext(workInProgress2, type, previousContext);
9106 instance.__reactInternalMemoizedMergedChildContext = mergedContext;
9107 pop(didPerformWorkStackCursor, workInProgress2);
9108 pop(contextStackCursor, workInProgress2);
9109 push(contextStackCursor, mergedContext, workInProgress2);
9110 push(didPerformWorkStackCursor, didChange, workInProgress2);
9111 } else {
9112 pop(didPerformWorkStackCursor, workInProgress2);
9113 push(didPerformWorkStackCursor, didChange, workInProgress2);
9114 }
9115 }
9116 }
9117 function findCurrentUnmaskedContext(fiber) {
9118 {
9119 if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
9120 throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
9121 }
9122 var node = fiber;
9123 do {
9124 switch (node.tag) {
9125 case HostRoot:
9126 return node.stateNode.context;
9127 case ClassComponent: {
9128 var Component = node.type;
9129 if (isContextProvider(Component)) {
9130 return node.stateNode.__reactInternalMemoizedMergedChildContext;
9131 }
9132 break;
9133 }
9134 }
9135 node = node.return;
9136 } while (node !== null);
9137 throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
9138 }
9139 }
9140 var LegacyRoot = 0;
9141 var ConcurrentRoot = 1;
9142 var syncQueue = null;
9143 var includesLegacySyncCallbacks = false;
9144 var isFlushingSyncQueue = false;
9145 function scheduleSyncCallback(callback) {
9146 if (syncQueue === null) {
9147 syncQueue = [callback];
9148 } else {
9149 syncQueue.push(callback);
9150 }
9151 }
9152 function scheduleLegacySyncCallback(callback) {
9153 includesLegacySyncCallbacks = true;
9154 scheduleSyncCallback(callback);
9155 }
9156 function flushSyncCallbacksOnlyInLegacyMode() {
9157 if (includesLegacySyncCallbacks) {
9158 flushSyncCallbacks();
9159 }
9160 }
9161 function flushSyncCallbacks() {
9162 if (!isFlushingSyncQueue && syncQueue !== null) {
9163 isFlushingSyncQueue = true;
9164 var i = 0;
9165 var previousUpdatePriority = getCurrentUpdatePriority();
9166 try {
9167 var isSync = true;
9168 var queue = syncQueue;
9169 setCurrentUpdatePriority(DiscreteEventPriority);
9170 for (; i < queue.length; i++) {
9171 var callback = queue[i];
9172 do {
9173 callback = callback(isSync);
9174 } while (callback !== null);
9175 }
9176 syncQueue = null;
9177 includesLegacySyncCallbacks = false;
9178 } catch (error2) {
9179 if (syncQueue !== null) {
9180 syncQueue = syncQueue.slice(i + 1);
9181 }
9182 scheduleCallback(ImmediatePriority, flushSyncCallbacks);
9183 throw error2;
9184 } finally {
9185 setCurrentUpdatePriority(previousUpdatePriority);
9186 isFlushingSyncQueue = false;
9187 }
9188 }
9189 return null;
9190 }
9191 var forkStack = [];
9192 var forkStackIndex = 0;
9193 var treeForkProvider = null;
9194 var treeForkCount = 0;
9195 var idStack = [];
9196 var idStackIndex = 0;
9197 var treeContextProvider = null;
9198 var treeContextId = 1;
9199 var treeContextOverflow = "";
9200 function isForkedChild(workInProgress2) {
9201 warnIfNotHydrating();
9202 return (workInProgress2.flags & Forked) !== NoFlags;
9203 }
9204 function getForksAtLevel(workInProgress2) {
9205 warnIfNotHydrating();
9206 return treeForkCount;
9207 }
9208 function getTreeId() {
9209 var overflow = treeContextOverflow;
9210 var idWithLeadingBit = treeContextId;
9211 var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
9212 return id.toString(32) + overflow;
9213 }
9214 function pushTreeFork(workInProgress2, totalChildren) {
9215 warnIfNotHydrating();
9216 forkStack[forkStackIndex++] = treeForkCount;
9217 forkStack[forkStackIndex++] = treeForkProvider;
9218 treeForkProvider = workInProgress2;
9219 treeForkCount = totalChildren;
9220 }
9221 function pushTreeId(workInProgress2, totalChildren, index2) {
9222 warnIfNotHydrating();
9223 idStack[idStackIndex++] = treeContextId;
9224 idStack[idStackIndex++] = treeContextOverflow;
9225 idStack[idStackIndex++] = treeContextProvider;
9226 treeContextProvider = workInProgress2;
9227 var baseIdWithLeadingBit = treeContextId;
9228 var baseOverflow = treeContextOverflow;
9229 var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
9230 var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
9231 var slot = index2 + 1;
9232 var length = getBitLength(totalChildren) + baseLength;
9233 if (length > 30) {
9234 var numberOfOverflowBits = baseLength - baseLength % 5;
9235 var newOverflowBits = (1 << numberOfOverflowBits) - 1;
9236 var newOverflow = (baseId & newOverflowBits).toString(32);
9237 var restOfBaseId = baseId >> numberOfOverflowBits;
9238 var restOfBaseLength = baseLength - numberOfOverflowBits;
9239 var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
9240 var restOfNewBits = slot << restOfBaseLength;
9241 var id = restOfNewBits | restOfBaseId;
9242 var overflow = newOverflow + baseOverflow;
9243 treeContextId = 1 << restOfLength | id;
9244 treeContextOverflow = overflow;
9245 } else {
9246 var newBits = slot << baseLength;
9247 var _id = newBits | baseId;
9248 var _overflow = baseOverflow;
9249 treeContextId = 1 << length | _id;
9250 treeContextOverflow = _overflow;
9251 }
9252 }
9253 function pushMaterializedTreeId(workInProgress2) {
9254 warnIfNotHydrating();
9255 var returnFiber = workInProgress2.return;
9256 if (returnFiber !== null) {
9257 var numberOfForks = 1;
9258 var slotIndex = 0;
9259 pushTreeFork(workInProgress2, numberOfForks);
9260 pushTreeId(workInProgress2, numberOfForks, slotIndex);
9261 }
9262 }
9263 function getBitLength(number) {
9264 return 32 - clz32(number);
9265 }
9266 function getLeadingBit(id) {
9267 return 1 << getBitLength(id) - 1;
9268 }
9269 function popTreeContext(workInProgress2) {
9270 while (workInProgress2 === treeForkProvider) {
9271 treeForkProvider = forkStack[--forkStackIndex];
9272 forkStack[forkStackIndex] = null;
9273 treeForkCount = forkStack[--forkStackIndex];
9274 forkStack[forkStackIndex] = null;
9275 }
9276 while (workInProgress2 === treeContextProvider) {
9277 treeContextProvider = idStack[--idStackIndex];
9278 idStack[idStackIndex] = null;
9279 treeContextOverflow = idStack[--idStackIndex];
9280 idStack[idStackIndex] = null;
9281 treeContextId = idStack[--idStackIndex];
9282 idStack[idStackIndex] = null;
9283 }
9284 }
9285 function getSuspendedTreeContext() {
9286 warnIfNotHydrating();
9287 if (treeContextProvider !== null) {
9288 return {
9289 id: treeContextId,
9290 overflow: treeContextOverflow
9291 };
9292 } else {
9293 return null;
9294 }
9295 }
9296 function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
9297 warnIfNotHydrating();
9298 idStack[idStackIndex++] = treeContextId;
9299 idStack[idStackIndex++] = treeContextOverflow;
9300 idStack[idStackIndex++] = treeContextProvider;
9301 treeContextId = suspendedContext.id;
9302 treeContextOverflow = suspendedContext.overflow;
9303 treeContextProvider = workInProgress2;
9304 }
9305 function warnIfNotHydrating() {
9306 {
9307 if (!getIsHydrating()) {
9308 error("Expected to be hydrating. This is a bug in React. Please file an issue.");
9309 }
9310 }
9311 }
9312 var hydrationParentFiber = null;
9313 var nextHydratableInstance = null;
9314 var isHydrating = false;
9315 var didSuspendOrErrorDEV = false;
9316 var hydrationErrors = null;
9317 function warnIfHydrating() {
9318 {
9319 if (isHydrating) {
9320 error("We should not be hydrating here. This is a bug in React. Please file a bug.");
9321 }
9322 }
9323 }
9324 function markDidThrowWhileHydratingDEV() {
9325 {
9326 didSuspendOrErrorDEV = true;
9327 }
9328 }
9329 function didSuspendOrErrorWhileHydratingDEV() {
9330 {
9331 return didSuspendOrErrorDEV;
9332 }
9333 }
9334 function enterHydrationState(fiber) {
9335 var parentInstance = fiber.stateNode.containerInfo;
9336 nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
9337 hydrationParentFiber = fiber;
9338 isHydrating = true;
9339 hydrationErrors = null;
9340 didSuspendOrErrorDEV = false;
9341 return true;
9342 }
9343 function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
9344 nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
9345 hydrationParentFiber = fiber;
9346 isHydrating = true;
9347 hydrationErrors = null;
9348 didSuspendOrErrorDEV = false;
9349 if (treeContext !== null) {
9350 restoreSuspendedTreeContext(fiber, treeContext);
9351 }
9352 return true;
9353 }
9354 function warnUnhydratedInstance(returnFiber, instance) {
9355 {
9356 switch (returnFiber.tag) {
9357 case HostRoot: {
9358 didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
9359 break;
9360 }
9361 case HostComponent: {
9362 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9363 didNotHydrateInstance(
9364 returnFiber.type,
9365 returnFiber.memoizedProps,
9366 returnFiber.stateNode,
9367 instance,
9368 // TODO: Delete this argument when we remove the legacy root API.
9369 isConcurrentMode
9370 );
9371 break;
9372 }
9373 case SuspenseComponent: {
9374 var suspenseState = returnFiber.memoizedState;
9375 if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
9376 break;
9377 }
9378 }
9379 }
9380 }
9381 function deleteHydratableInstance(returnFiber, instance) {
9382 warnUnhydratedInstance(returnFiber, instance);
9383 var childToDelete = createFiberFromHostInstanceForDeletion();
9384 childToDelete.stateNode = instance;
9385 childToDelete.return = returnFiber;
9386 var deletions = returnFiber.deletions;
9387 if (deletions === null) {
9388 returnFiber.deletions = [childToDelete];
9389 returnFiber.flags |= ChildDeletion;
9390 } else {
9391 deletions.push(childToDelete);
9392 }
9393 }
9394 function warnNonhydratedInstance(returnFiber, fiber) {
9395 {
9396 if (didSuspendOrErrorDEV) {
9397 return;
9398 }
9399 switch (returnFiber.tag) {
9400 case HostRoot: {
9401 var parentContainer = returnFiber.stateNode.containerInfo;
9402 switch (fiber.tag) {
9403 case HostComponent:
9404 var type = fiber.type;
9405 var props = fiber.pendingProps;
9406 didNotFindHydratableInstanceWithinContainer(parentContainer, type);
9407 break;
9408 case HostText:
9409 var text = fiber.pendingProps;
9410 didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);
9411 break;
9412 }
9413 break;
9414 }
9415 case HostComponent: {
9416 var parentType = returnFiber.type;
9417 var parentProps = returnFiber.memoizedProps;
9418 var parentInstance = returnFiber.stateNode;
9419 switch (fiber.tag) {
9420 case HostComponent: {
9421 var _type = fiber.type;
9422 var _props = fiber.pendingProps;
9423 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9424 didNotFindHydratableInstance(
9425 parentType,
9426 parentProps,
9427 parentInstance,
9428 _type,
9429 _props,
9430 // TODO: Delete this argument when we remove the legacy root API.
9431 isConcurrentMode
9432 );
9433 break;
9434 }
9435 case HostText: {
9436 var _text = fiber.pendingProps;
9437 var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9438 didNotFindHydratableTextInstance(
9439 parentType,
9440 parentProps,
9441 parentInstance,
9442 _text,
9443 // TODO: Delete this argument when we remove the legacy root API.
9444 _isConcurrentMode
9445 );
9446 break;
9447 }
9448 }
9449 break;
9450 }
9451 case SuspenseComponent: {
9452 var suspenseState = returnFiber.memoizedState;
9453 var _parentInstance = suspenseState.dehydrated;
9454 if (_parentInstance !== null) switch (fiber.tag) {
9455 case HostComponent:
9456 var _type2 = fiber.type;
9457 var _props2 = fiber.pendingProps;
9458 didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
9459 break;
9460 case HostText:
9461 var _text2 = fiber.pendingProps;
9462 didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
9463 break;
9464 }
9465 break;
9466 }
9467 default:
9468 return;
9469 }
9470 }
9471 }
9472 function insertNonHydratedInstance(returnFiber, fiber) {
9473 fiber.flags = fiber.flags & ~Hydrating | Placement;
9474 warnNonhydratedInstance(returnFiber, fiber);
9475 }
9476 function tryHydrate(fiber, nextInstance) {
9477 switch (fiber.tag) {
9478 case HostComponent: {
9479 var type = fiber.type;
9480 var props = fiber.pendingProps;
9481 var instance = canHydrateInstance(nextInstance, type);
9482 if (instance !== null) {
9483 fiber.stateNode = instance;
9484 hydrationParentFiber = fiber;
9485 nextHydratableInstance = getFirstHydratableChild(instance);
9486 return true;
9487 }
9488 return false;
9489 }
9490 case HostText: {
9491 var text = fiber.pendingProps;
9492 var textInstance = canHydrateTextInstance(nextInstance, text);
9493 if (textInstance !== null) {
9494 fiber.stateNode = textInstance;
9495 hydrationParentFiber = fiber;
9496 nextHydratableInstance = null;
9497 return true;
9498 }
9499 return false;
9500 }
9501 case SuspenseComponent: {
9502 var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
9503 if (suspenseInstance !== null) {
9504 var suspenseState = {
9505 dehydrated: suspenseInstance,
9506 treeContext: getSuspendedTreeContext(),
9507 retryLane: OffscreenLane
9508 };
9509 fiber.memoizedState = suspenseState;
9510 var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
9511 dehydratedFragment.return = fiber;
9512 fiber.child = dehydratedFragment;
9513 hydrationParentFiber = fiber;
9514 nextHydratableInstance = null;
9515 return true;
9516 }
9517 return false;
9518 }
9519 default:
9520 return false;
9521 }
9522 }
9523 function shouldClientRenderOnMismatch(fiber) {
9524 return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
9525 }
9526 function throwOnHydrationMismatch(fiber) {
9527 throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
9528 }
9529 function tryToClaimNextHydratableInstance(fiber) {
9530 if (!isHydrating) {
9531 return;
9532 }
9533 var nextInstance = nextHydratableInstance;
9534 if (!nextInstance) {
9535 if (shouldClientRenderOnMismatch(fiber)) {
9536 warnNonhydratedInstance(hydrationParentFiber, fiber);
9537 throwOnHydrationMismatch();
9538 }
9539 insertNonHydratedInstance(hydrationParentFiber, fiber);
9540 isHydrating = false;
9541 hydrationParentFiber = fiber;
9542 return;
9543 }
9544 var firstAttemptedInstance = nextInstance;
9545 if (!tryHydrate(fiber, nextInstance)) {
9546 if (shouldClientRenderOnMismatch(fiber)) {
9547 warnNonhydratedInstance(hydrationParentFiber, fiber);
9548 throwOnHydrationMismatch();
9549 }
9550 nextInstance = getNextHydratableSibling(firstAttemptedInstance);
9551 var prevHydrationParentFiber = hydrationParentFiber;
9552 if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
9553 insertNonHydratedInstance(hydrationParentFiber, fiber);
9554 isHydrating = false;
9555 hydrationParentFiber = fiber;
9556 return;
9557 }
9558 deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
9559 }
9560 }
9561 function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
9562 var instance = fiber.stateNode;
9563 var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
9564 var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
9565 fiber.updateQueue = updatePayload;
9566 if (updatePayload !== null) {
9567 return true;
9568 }
9569 return false;
9570 }
9571 function prepareToHydrateHostTextInstance(fiber) {
9572 var textInstance = fiber.stateNode;
9573 var textContent = fiber.memoizedProps;
9574 var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
9575 if (shouldUpdate) {
9576 var returnFiber = hydrationParentFiber;
9577 if (returnFiber !== null) {
9578 switch (returnFiber.tag) {
9579 case HostRoot: {
9580 var parentContainer = returnFiber.stateNode.containerInfo;
9581 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9582 didNotMatchHydratedContainerTextInstance(
9583 parentContainer,
9584 textInstance,
9585 textContent,
9586 // TODO: Delete this argument when we remove the legacy root API.
9587 isConcurrentMode
9588 );
9589 break;
9590 }
9591 case HostComponent: {
9592 var parentType = returnFiber.type;
9593 var parentProps = returnFiber.memoizedProps;
9594 var parentInstance = returnFiber.stateNode;
9595 var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
9596 didNotMatchHydratedTextInstance(
9597 parentType,
9598 parentProps,
9599 parentInstance,
9600 textInstance,
9601 textContent,
9602 // TODO: Delete this argument when we remove the legacy root API.
9603 _isConcurrentMode2
9604 );
9605 break;
9606 }
9607 }
9608 }
9609 }
9610 return shouldUpdate;
9611 }
9612 function prepareToHydrateHostSuspenseInstance(fiber) {
9613 var suspenseState = fiber.memoizedState;
9614 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
9615 if (!suspenseInstance) {
9616 throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
9617 }
9618 hydrateSuspenseInstance(suspenseInstance, fiber);
9619 }
9620 function skipPastDehydratedSuspenseInstance(fiber) {
9621 var suspenseState = fiber.memoizedState;
9622 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
9623 if (!suspenseInstance) {
9624 throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
9625 }
9626 return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
9627 }
9628 function popToNextHostParent(fiber) {
9629 var parent = fiber.return;
9630 while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
9631 parent = parent.return;
9632 }
9633 hydrationParentFiber = parent;
9634 }
9635 function popHydrationState(fiber) {
9636 if (fiber !== hydrationParentFiber) {
9637 return false;
9638 }
9639 if (!isHydrating) {
9640 popToNextHostParent(fiber);
9641 isHydrating = true;
9642 return false;
9643 }
9644 if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
9645 var nextInstance = nextHydratableInstance;
9646 if (nextInstance) {
9647 if (shouldClientRenderOnMismatch(fiber)) {
9648 warnIfUnhydratedTailNodes(fiber);
9649 throwOnHydrationMismatch();
9650 } else {
9651 while (nextInstance) {
9652 deleteHydratableInstance(fiber, nextInstance);
9653 nextInstance = getNextHydratableSibling(nextInstance);
9654 }
9655 }
9656 }
9657 }
9658 popToNextHostParent(fiber);
9659 if (fiber.tag === SuspenseComponent) {
9660 nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
9661 } else {
9662 nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
9663 }
9664 return true;
9665 }
9666 function hasUnhydratedTailNodes() {
9667 return isHydrating && nextHydratableInstance !== null;
9668 }
9669 function warnIfUnhydratedTailNodes(fiber) {
9670 var nextInstance = nextHydratableInstance;
9671 while (nextInstance) {
9672 warnUnhydratedInstance(fiber, nextInstance);
9673 nextInstance = getNextHydratableSibling(nextInstance);
9674 }
9675 }
9676 function resetHydrationState() {
9677 hydrationParentFiber = null;
9678 nextHydratableInstance = null;
9679 isHydrating = false;
9680 didSuspendOrErrorDEV = false;
9681 }
9682 function upgradeHydrationErrorsToRecoverable() {
9683 if (hydrationErrors !== null) {
9684 queueRecoverableErrors(hydrationErrors);
9685 hydrationErrors = null;
9686 }
9687 }
9688 function getIsHydrating() {
9689 return isHydrating;
9690 }
9691 function queueHydrationError(error2) {
9692 if (hydrationErrors === null) {
9693 hydrationErrors = [error2];
9694 } else {
9695 hydrationErrors.push(error2);
9696 }
9697 }
9698 var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
9699 var NoTransition = null;
9700 function requestCurrentTransition() {
9701 return ReactCurrentBatchConfig$1.transition;
9702 }
9703 var ReactStrictModeWarnings = {
9704 recordUnsafeLifecycleWarnings: function(fiber, instance) {
9705 },
9706 flushPendingUnsafeLifecycleWarnings: function() {
9707 },
9708 recordLegacyContextWarning: function(fiber, instance) {
9709 },
9710 flushLegacyContextWarning: function() {
9711 },
9712 discardPendingWarnings: function() {
9713 }
9714 };
9715 {
9716 var findStrictRoot = function(fiber) {
9717 var maybeStrictRoot = null;
9718 var node = fiber;
9719 while (node !== null) {
9720 if (node.mode & StrictLegacyMode) {
9721 maybeStrictRoot = node;
9722 }
9723 node = node.return;
9724 }
9725 return maybeStrictRoot;
9726 };
9727 var setToSortedString = function(set2) {
9728 var array = [];
9729 set2.forEach(function(value) {
9730 array.push(value);
9731 });
9732 return array.sort().join(", ");
9733 };
9734 var pendingComponentWillMountWarnings = [];
9735 var pendingUNSAFE_ComponentWillMountWarnings = [];
9736 var pendingComponentWillReceivePropsWarnings = [];
9737 var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9738 var pendingComponentWillUpdateWarnings = [];
9739 var pendingUNSAFE_ComponentWillUpdateWarnings = [];
9740 var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
9741 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
9742 if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
9743 return;
9744 }
9745 if (typeof instance.componentWillMount === "function" && // Don't warn about react-lifecycles-compat polyfilled components.
9746 instance.componentWillMount.__suppressDeprecationWarning !== true) {
9747 pendingComponentWillMountWarnings.push(fiber);
9748 }
9749 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
9750 pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
9751 }
9752 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
9753 pendingComponentWillReceivePropsWarnings.push(fiber);
9754 }
9755 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
9756 pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
9757 }
9758 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
9759 pendingComponentWillUpdateWarnings.push(fiber);
9760 }
9761 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
9762 pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
9763 }
9764 };
9765 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
9766 var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
9767 if (pendingComponentWillMountWarnings.length > 0) {
9768 pendingComponentWillMountWarnings.forEach(function(fiber) {
9769 componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9770 didWarnAboutUnsafeLifecycles.add(fiber.type);
9771 });
9772 pendingComponentWillMountWarnings = [];
9773 }
9774 var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
9775 if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
9776 pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
9777 UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9778 didWarnAboutUnsafeLifecycles.add(fiber.type);
9779 });
9780 pendingUNSAFE_ComponentWillMountWarnings = [];
9781 }
9782 var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
9783 if (pendingComponentWillReceivePropsWarnings.length > 0) {
9784 pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
9785 componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9786 didWarnAboutUnsafeLifecycles.add(fiber.type);
9787 });
9788 pendingComponentWillReceivePropsWarnings = [];
9789 }
9790 var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
9791 if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
9792 pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
9793 UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9794 didWarnAboutUnsafeLifecycles.add(fiber.type);
9795 });
9796 pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9797 }
9798 var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
9799 if (pendingComponentWillUpdateWarnings.length > 0) {
9800 pendingComponentWillUpdateWarnings.forEach(function(fiber) {
9801 componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9802 didWarnAboutUnsafeLifecycles.add(fiber.type);
9803 });
9804 pendingComponentWillUpdateWarnings = [];
9805 }
9806 var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
9807 if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
9808 pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
9809 UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9810 didWarnAboutUnsafeLifecycles.add(fiber.type);
9811 });
9812 pendingUNSAFE_ComponentWillUpdateWarnings = [];
9813 }
9814 if (UNSAFE_componentWillMountUniqueNames.size > 0) {
9815 var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
9816 error("Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s", sortedNames);
9817 }
9818 if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
9819 var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
9820 error("Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s", _sortedNames);
9821 }
9822 if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
9823 var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
9824 error("Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s", _sortedNames2);
9825 }
9826 if (componentWillMountUniqueNames.size > 0) {
9827 var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
9828 warn("componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames3);
9829 }
9830 if (componentWillReceivePropsUniqueNames.size > 0) {
9831 var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
9832 warn("componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames4);
9833 }
9834 if (componentWillUpdateUniqueNames.size > 0) {
9835 var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
9836 warn("componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s", _sortedNames5);
9837 }
9838 };
9839 var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
9840 var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
9841 ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
9842 var strictRoot = findStrictRoot(fiber);
9843 if (strictRoot === null) {
9844 error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
9845 return;
9846 }
9847 if (didWarnAboutLegacyContext.has(fiber.type)) {
9848 return;
9849 }
9850 var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
9851 if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
9852 if (warningsForRoot === void 0) {
9853 warningsForRoot = [];
9854 pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
9855 }
9856 warningsForRoot.push(fiber);
9857 }
9858 };
9859 ReactStrictModeWarnings.flushLegacyContextWarning = function() {
9860 pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
9861 if (fiberArray.length === 0) {
9862 return;
9863 }
9864 var firstFiber = fiberArray[0];
9865 var uniqueNames = /* @__PURE__ */ new Set();
9866 fiberArray.forEach(function(fiber) {
9867 uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9868 didWarnAboutLegacyContext.add(fiber.type);
9869 });
9870 var sortedNames = setToSortedString(uniqueNames);
9871 try {
9872 setCurrentFiber(firstFiber);
9873 error("Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", sortedNames);
9874 } finally {
9875 resetCurrentFiber();
9876 }
9877 });
9878 };
9879 ReactStrictModeWarnings.discardPendingWarnings = function() {
9880 pendingComponentWillMountWarnings = [];
9881 pendingUNSAFE_ComponentWillMountWarnings = [];
9882 pendingComponentWillReceivePropsWarnings = [];
9883 pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9884 pendingComponentWillUpdateWarnings = [];
9885 pendingUNSAFE_ComponentWillUpdateWarnings = [];
9886 pendingLegacyContextWarning = /* @__PURE__ */ new Map();
9887 };
9888 }
9889 var didWarnAboutMaps;
9890 var didWarnAboutGenerators;
9891 var didWarnAboutStringRefs;
9892 var ownerHasKeyUseWarning;
9893 var ownerHasFunctionTypeWarning;
9894 var warnForMissingKey = function(child, returnFiber) {
9895 };
9896 {
9897 didWarnAboutMaps = false;
9898 didWarnAboutGenerators = false;
9899 didWarnAboutStringRefs = {};
9900 ownerHasKeyUseWarning = {};
9901 ownerHasFunctionTypeWarning = {};
9902 warnForMissingKey = function(child, returnFiber) {
9903 if (child === null || typeof child !== "object") {
9904 return;
9905 }
9906 if (!child._store || child._store.validated || child.key != null) {
9907 return;
9908 }
9909 if (typeof child._store !== "object") {
9910 throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
9911 }
9912 child._store.validated = true;
9913 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9914 if (ownerHasKeyUseWarning[componentName]) {
9915 return;
9916 }
9917 ownerHasKeyUseWarning[componentName] = true;
9918 error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
9919 };
9920 }
9921 function isReactClass(type) {
9922 return type.prototype && type.prototype.isReactComponent;
9923 }
9924 function coerceRef(returnFiber, current2, element) {
9925 var mixedRef = element.ref;
9926 if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
9927 {
9928 if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
9929 // because these cannot be automatically converted to an arrow function
9930 // using a codemod. Therefore, we don't have to warn about string refs again.
9931 !(element._owner && element._self && element._owner.stateNode !== element._self) && // Will already throw with "Function components cannot have string refs"
9932 !(element._owner && element._owner.tag !== ClassComponent) && // Will already warn with "Function components cannot be given refs"
9933 !(typeof element.type === "function" && !isReactClass(element.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set"
9934 element._owner) {
9935 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9936 if (!didWarnAboutStringRefs[componentName]) {
9937 {
9938 error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', componentName, mixedRef);
9939 }
9940 didWarnAboutStringRefs[componentName] = true;
9941 }
9942 }
9943 }
9944 if (element._owner) {
9945 var owner = element._owner;
9946 var inst;
9947 if (owner) {
9948 var ownerFiber = owner;
9949 if (ownerFiber.tag !== ClassComponent) {
9950 throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
9951 }
9952 inst = ownerFiber.stateNode;
9953 }
9954 if (!inst) {
9955 throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
9956 }
9957 var resolvedInst = inst;
9958 {
9959 checkPropStringCoercion(mixedRef, "ref");
9960 }
9961 var stringRef = "" + mixedRef;
9962 if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
9963 return current2.ref;
9964 }
9965 var ref = function(value) {
9966 var refs = resolvedInst.refs;
9967 if (value === null) {
9968 delete refs[stringRef];
9969 } else {
9970 refs[stringRef] = value;
9971 }
9972 };
9973 ref._stringRef = stringRef;
9974 return ref;
9975 } else {
9976 if (typeof mixedRef !== "string") {
9977 throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
9978 }
9979 if (!element._owner) {
9980 throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information.");
9981 }
9982 }
9983 }
9984 return mixedRef;
9985 }
9986 function throwOnInvalidObjectType(returnFiber, newChild) {
9987 var childString = Object.prototype.toString.call(newChild);
9988 throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
9989 }
9990 function warnOnFunctionType(returnFiber) {
9991 {
9992 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9993 if (ownerHasFunctionTypeWarning[componentName]) {
9994 return;
9995 }
9996 ownerHasFunctionTypeWarning[componentName] = true;
9997 error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
9998 }
9999 }
10000 function resolveLazy(lazyType) {
10001 var payload = lazyType._payload;
10002 var init = lazyType._init;
10003 return init(payload);
10004 }
10005 function ChildReconciler(shouldTrackSideEffects) {
10006 function deleteChild(returnFiber, childToDelete) {
10007 if (!shouldTrackSideEffects) {
10008 return;
10009 }
10010 var deletions = returnFiber.deletions;
10011 if (deletions === null) {
10012 returnFiber.deletions = [childToDelete];
10013 returnFiber.flags |= ChildDeletion;
10014 } else {
10015 deletions.push(childToDelete);
10016 }
10017 }
10018 function deleteRemainingChildren(returnFiber, currentFirstChild) {
10019 if (!shouldTrackSideEffects) {
10020 return null;
10021 }
10022 var childToDelete = currentFirstChild;
10023 while (childToDelete !== null) {
10024 deleteChild(returnFiber, childToDelete);
10025 childToDelete = childToDelete.sibling;
10026 }
10027 return null;
10028 }
10029 function mapRemainingChildren(returnFiber, currentFirstChild) {
10030 var existingChildren = /* @__PURE__ */ new Map();
10031 var existingChild = currentFirstChild;
10032 while (existingChild !== null) {
10033 if (existingChild.key !== null) {
10034 existingChildren.set(existingChild.key, existingChild);
10035 } else {
10036 existingChildren.set(existingChild.index, existingChild);
10037 }
10038 existingChild = existingChild.sibling;
10039 }
10040 return existingChildren;
10041 }
10042 function useFiber(fiber, pendingProps) {
10043 var clone = createWorkInProgress(fiber, pendingProps);
10044 clone.index = 0;
10045 clone.sibling = null;
10046 return clone;
10047 }
10048 function placeChild(newFiber, lastPlacedIndex, newIndex) {
10049 newFiber.index = newIndex;
10050 if (!shouldTrackSideEffects) {
10051 newFiber.flags |= Forked;
10052 return lastPlacedIndex;
10053 }
10054 var current2 = newFiber.alternate;
10055 if (current2 !== null) {
10056 var oldIndex = current2.index;
10057 if (oldIndex < lastPlacedIndex) {
10058 newFiber.flags |= Placement;
10059 return lastPlacedIndex;
10060 } else {
10061 return oldIndex;
10062 }
10063 } else {
10064 newFiber.flags |= Placement;
10065 return lastPlacedIndex;
10066 }
10067 }
10068 function placeSingleChild(newFiber) {
10069 if (shouldTrackSideEffects && newFiber.alternate === null) {
10070 newFiber.flags |= Placement;
10071 }
10072 return newFiber;
10073 }
10074 function updateTextNode(returnFiber, current2, textContent, lanes) {
10075 if (current2 === null || current2.tag !== HostText) {
10076 var created = createFiberFromText(textContent, returnFiber.mode, lanes);
10077 created.return = returnFiber;
10078 return created;
10079 } else {
10080 var existing = useFiber(current2, textContent);
10081 existing.return = returnFiber;
10082 return existing;
10083 }
10084 }
10085 function updateElement(returnFiber, current2, element, lanes) {
10086 var elementType = element.type;
10087 if (elementType === REACT_FRAGMENT_TYPE) {
10088 return updateFragment2(returnFiber, current2, element.props.children, lanes, element.key);
10089 }
10090 if (current2 !== null) {
10091 if (current2.elementType === elementType || // Keep this check inline so it only runs on the false path:
10092 isCompatibleFamilyForHotReloading(current2, element) || // Lazy types should reconcile their resolved type.
10093 // We need to do this after the Hot Reloading check above,
10094 // because hot reloading has different semantics than prod because
10095 // it doesn't resuspend. So we can't let the call below suspend.
10096 typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
10097 var existing = useFiber(current2, element.props);
10098 existing.ref = coerceRef(returnFiber, current2, element);
10099 existing.return = returnFiber;
10100 {
10101 existing._debugSource = element._source;
10102 existing._debugOwner = element._owner;
10103 }
10104 return existing;
10105 }
10106 }
10107 var created = createFiberFromElement(element, returnFiber.mode, lanes);
10108 created.ref = coerceRef(returnFiber, current2, element);
10109 created.return = returnFiber;
10110 return created;
10111 }
10112 function updatePortal(returnFiber, current2, portal, lanes) {
10113 if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
10114 var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
10115 created.return = returnFiber;
10116 return created;
10117 } else {
10118 var existing = useFiber(current2, portal.children || []);
10119 existing.return = returnFiber;
10120 return existing;
10121 }
10122 }
10123 function updateFragment2(returnFiber, current2, fragment, lanes, key) {
10124 if (current2 === null || current2.tag !== Fragment) {
10125 var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
10126 created.return = returnFiber;
10127 return created;
10128 } else {
10129 var existing = useFiber(current2, fragment);
10130 existing.return = returnFiber;
10131 return existing;
10132 }
10133 }
10134 function createChild(returnFiber, newChild, lanes) {
10135 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10136 var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
10137 created.return = returnFiber;
10138 return created;
10139 }
10140 if (typeof newChild === "object" && newChild !== null) {
10141 switch (newChild.$$typeof) {
10142 case REACT_ELEMENT_TYPE: {
10143 var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
10144 _created.ref = coerceRef(returnFiber, null, newChild);
10145 _created.return = returnFiber;
10146 return _created;
10147 }
10148 case REACT_PORTAL_TYPE: {
10149 var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
10150 _created2.return = returnFiber;
10151 return _created2;
10152 }
10153 case REACT_LAZY_TYPE: {
10154 var payload = newChild._payload;
10155 var init = newChild._init;
10156 return createChild(returnFiber, init(payload), lanes);
10157 }
10158 }
10159 if (isArray(newChild) || getIteratorFn(newChild)) {
10160 var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
10161 _created3.return = returnFiber;
10162 return _created3;
10163 }
10164 throwOnInvalidObjectType(returnFiber, newChild);
10165 }
10166 {
10167 if (typeof newChild === "function") {
10168 warnOnFunctionType(returnFiber);
10169 }
10170 }
10171 return null;
10172 }
10173 function updateSlot(returnFiber, oldFiber, newChild, lanes) {
10174 var key = oldFiber !== null ? oldFiber.key : null;
10175 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10176 if (key !== null) {
10177 return null;
10178 }
10179 return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
10180 }
10181 if (typeof newChild === "object" && newChild !== null) {
10182 switch (newChild.$$typeof) {
10183 case REACT_ELEMENT_TYPE: {
10184 if (newChild.key === key) {
10185 return updateElement(returnFiber, oldFiber, newChild, lanes);
10186 } else {
10187 return null;
10188 }
10189 }
10190 case REACT_PORTAL_TYPE: {
10191 if (newChild.key === key) {
10192 return updatePortal(returnFiber, oldFiber, newChild, lanes);
10193 } else {
10194 return null;
10195 }
10196 }
10197 case REACT_LAZY_TYPE: {
10198 var payload = newChild._payload;
10199 var init = newChild._init;
10200 return updateSlot(returnFiber, oldFiber, init(payload), lanes);
10201 }
10202 }
10203 if (isArray(newChild) || getIteratorFn(newChild)) {
10204 if (key !== null) {
10205 return null;
10206 }
10207 return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
10208 }
10209 throwOnInvalidObjectType(returnFiber, newChild);
10210 }
10211 {
10212 if (typeof newChild === "function") {
10213 warnOnFunctionType(returnFiber);
10214 }
10215 }
10216 return null;
10217 }
10218 function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
10219 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10220 var matchedFiber = existingChildren.get(newIdx) || null;
10221 return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
10222 }
10223 if (typeof newChild === "object" && newChild !== null) {
10224 switch (newChild.$$typeof) {
10225 case REACT_ELEMENT_TYPE: {
10226 var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
10227 return updateElement(returnFiber, _matchedFiber, newChild, lanes);
10228 }
10229 case REACT_PORTAL_TYPE: {
10230 var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
10231 return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
10232 }
10233 case REACT_LAZY_TYPE:
10234 var payload = newChild._payload;
10235 var init = newChild._init;
10236 return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
10237 }
10238 if (isArray(newChild) || getIteratorFn(newChild)) {
10239 var _matchedFiber3 = existingChildren.get(newIdx) || null;
10240 return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
10241 }
10242 throwOnInvalidObjectType(returnFiber, newChild);
10243 }
10244 {
10245 if (typeof newChild === "function") {
10246 warnOnFunctionType(returnFiber);
10247 }
10248 }
10249 return null;
10250 }
10251 function warnOnInvalidKey(child, knownKeys, returnFiber) {
10252 {
10253 if (typeof child !== "object" || child === null) {
10254 return knownKeys;
10255 }
10256 switch (child.$$typeof) {
10257 case REACT_ELEMENT_TYPE:
10258 case REACT_PORTAL_TYPE:
10259 warnForMissingKey(child, returnFiber);
10260 var key = child.key;
10261 if (typeof key !== "string") {
10262 break;
10263 }
10264 if (knownKeys === null) {
10265 knownKeys = /* @__PURE__ */ new Set();
10266 knownKeys.add(key);
10267 break;
10268 }
10269 if (!knownKeys.has(key)) {
10270 knownKeys.add(key);
10271 break;
10272 }
10273 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);
10274 break;
10275 case REACT_LAZY_TYPE:
10276 var payload = child._payload;
10277 var init = child._init;
10278 warnOnInvalidKey(init(payload), knownKeys, returnFiber);
10279 break;
10280 }
10281 }
10282 return knownKeys;
10283 }
10284 function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
10285 {
10286 var knownKeys = null;
10287 for (var i = 0; i < newChildren.length; i++) {
10288 var child = newChildren[i];
10289 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
10290 }
10291 }
10292 var resultingFirstChild = null;
10293 var previousNewFiber = null;
10294 var oldFiber = currentFirstChild;
10295 var lastPlacedIndex = 0;
10296 var newIdx = 0;
10297 var nextOldFiber = null;
10298 for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
10299 if (oldFiber.index > newIdx) {
10300 nextOldFiber = oldFiber;
10301 oldFiber = null;
10302 } else {
10303 nextOldFiber = oldFiber.sibling;
10304 }
10305 var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
10306 if (newFiber === null) {
10307 if (oldFiber === null) {
10308 oldFiber = nextOldFiber;
10309 }
10310 break;
10311 }
10312 if (shouldTrackSideEffects) {
10313 if (oldFiber && newFiber.alternate === null) {
10314 deleteChild(returnFiber, oldFiber);
10315 }
10316 }
10317 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
10318 if (previousNewFiber === null) {
10319 resultingFirstChild = newFiber;
10320 } else {
10321 previousNewFiber.sibling = newFiber;
10322 }
10323 previousNewFiber = newFiber;
10324 oldFiber = nextOldFiber;
10325 }
10326 if (newIdx === newChildren.length) {
10327 deleteRemainingChildren(returnFiber, oldFiber);
10328 if (getIsHydrating()) {
10329 var numberOfForks = newIdx;
10330 pushTreeFork(returnFiber, numberOfForks);
10331 }
10332 return resultingFirstChild;
10333 }
10334 if (oldFiber === null) {
10335 for (; newIdx < newChildren.length; newIdx++) {
10336 var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
10337 if (_newFiber === null) {
10338 continue;
10339 }
10340 lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
10341 if (previousNewFiber === null) {
10342 resultingFirstChild = _newFiber;
10343 } else {
10344 previousNewFiber.sibling = _newFiber;
10345 }
10346 previousNewFiber = _newFiber;
10347 }
10348 if (getIsHydrating()) {
10349 var _numberOfForks = newIdx;
10350 pushTreeFork(returnFiber, _numberOfForks);
10351 }
10352 return resultingFirstChild;
10353 }
10354 var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
10355 for (; newIdx < newChildren.length; newIdx++) {
10356 var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
10357 if (_newFiber2 !== null) {
10358 if (shouldTrackSideEffects) {
10359 if (_newFiber2.alternate !== null) {
10360 existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
10361 }
10362 }
10363 lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
10364 if (previousNewFiber === null) {
10365 resultingFirstChild = _newFiber2;
10366 } else {
10367 previousNewFiber.sibling = _newFiber2;
10368 }
10369 previousNewFiber = _newFiber2;
10370 }
10371 }
10372 if (shouldTrackSideEffects) {
10373 existingChildren.forEach(function(child2) {
10374 return deleteChild(returnFiber, child2);
10375 });
10376 }
10377 if (getIsHydrating()) {
10378 var _numberOfForks2 = newIdx;
10379 pushTreeFork(returnFiber, _numberOfForks2);
10380 }
10381 return resultingFirstChild;
10382 }
10383 function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
10384 var iteratorFn = getIteratorFn(newChildrenIterable);
10385 if (typeof iteratorFn !== "function") {
10386 throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
10387 }
10388 {
10389 if (typeof Symbol === "function" && // $FlowFixMe Flow doesn't know about toStringTag
10390 newChildrenIterable[Symbol.toStringTag] === "Generator") {
10391 if (!didWarnAboutGenerators) {
10392 error("Using Generators 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. Keep in mind you might need to polyfill these features for older browsers.");
10393 }
10394 didWarnAboutGenerators = true;
10395 }
10396 if (newChildrenIterable.entries === iteratorFn) {
10397 if (!didWarnAboutMaps) {
10398 error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
10399 }
10400 didWarnAboutMaps = true;
10401 }
10402 var _newChildren = iteratorFn.call(newChildrenIterable);
10403 if (_newChildren) {
10404 var knownKeys = null;
10405 var _step = _newChildren.next();
10406 for (; !_step.done; _step = _newChildren.next()) {
10407 var child = _step.value;
10408 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
10409 }
10410 }
10411 }
10412 var newChildren = iteratorFn.call(newChildrenIterable);
10413 if (newChildren == null) {
10414 throw new Error("An iterable object provided no iterator.");
10415 }
10416 var resultingFirstChild = null;
10417 var previousNewFiber = null;
10418 var oldFiber = currentFirstChild;
10419 var lastPlacedIndex = 0;
10420 var newIdx = 0;
10421 var nextOldFiber = null;
10422 var step = newChildren.next();
10423 for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
10424 if (oldFiber.index > newIdx) {
10425 nextOldFiber = oldFiber;
10426 oldFiber = null;
10427 } else {
10428 nextOldFiber = oldFiber.sibling;
10429 }
10430 var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
10431 if (newFiber === null) {
10432 if (oldFiber === null) {
10433 oldFiber = nextOldFiber;
10434 }
10435 break;
10436 }
10437 if (shouldTrackSideEffects) {
10438 if (oldFiber && newFiber.alternate === null) {
10439 deleteChild(returnFiber, oldFiber);
10440 }
10441 }
10442 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
10443 if (previousNewFiber === null) {
10444 resultingFirstChild = newFiber;
10445 } else {
10446 previousNewFiber.sibling = newFiber;
10447 }
10448 previousNewFiber = newFiber;
10449 oldFiber = nextOldFiber;
10450 }
10451 if (step.done) {
10452 deleteRemainingChildren(returnFiber, oldFiber);
10453 if (getIsHydrating()) {
10454 var numberOfForks = newIdx;
10455 pushTreeFork(returnFiber, numberOfForks);
10456 }
10457 return resultingFirstChild;
10458 }
10459 if (oldFiber === null) {
10460 for (; !step.done; newIdx++, step = newChildren.next()) {
10461 var _newFiber3 = createChild(returnFiber, step.value, lanes);
10462 if (_newFiber3 === null) {
10463 continue;
10464 }
10465 lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
10466 if (previousNewFiber === null) {
10467 resultingFirstChild = _newFiber3;
10468 } else {
10469 previousNewFiber.sibling = _newFiber3;
10470 }
10471 previousNewFiber = _newFiber3;
10472 }
10473 if (getIsHydrating()) {
10474 var _numberOfForks3 = newIdx;
10475 pushTreeFork(returnFiber, _numberOfForks3);
10476 }
10477 return resultingFirstChild;
10478 }
10479 var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
10480 for (; !step.done; newIdx++, step = newChildren.next()) {
10481 var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
10482 if (_newFiber4 !== null) {
10483 if (shouldTrackSideEffects) {
10484 if (_newFiber4.alternate !== null) {
10485 existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
10486 }
10487 }
10488 lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
10489 if (previousNewFiber === null) {
10490 resultingFirstChild = _newFiber4;
10491 } else {
10492 previousNewFiber.sibling = _newFiber4;
10493 }
10494 previousNewFiber = _newFiber4;
10495 }
10496 }
10497 if (shouldTrackSideEffects) {
10498 existingChildren.forEach(function(child2) {
10499 return deleteChild(returnFiber, child2);
10500 });
10501 }
10502 if (getIsHydrating()) {
10503 var _numberOfForks4 = newIdx;
10504 pushTreeFork(returnFiber, _numberOfForks4);
10505 }
10506 return resultingFirstChild;
10507 }
10508 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
10509 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
10510 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
10511 var existing = useFiber(currentFirstChild, textContent);
10512 existing.return = returnFiber;
10513 return existing;
10514 }
10515 deleteRemainingChildren(returnFiber, currentFirstChild);
10516 var created = createFiberFromText(textContent, returnFiber.mode, lanes);
10517 created.return = returnFiber;
10518 return created;
10519 }
10520 function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
10521 var key = element.key;
10522 var child = currentFirstChild;
10523 while (child !== null) {
10524 if (child.key === key) {
10525 var elementType = element.type;
10526 if (elementType === REACT_FRAGMENT_TYPE) {
10527 if (child.tag === Fragment) {
10528 deleteRemainingChildren(returnFiber, child.sibling);
10529 var existing = useFiber(child, element.props.children);
10530 existing.return = returnFiber;
10531 {
10532 existing._debugSource = element._source;
10533 existing._debugOwner = element._owner;
10534 }
10535 return existing;
10536 }
10537 } else {
10538 if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
10539 isCompatibleFamilyForHotReloading(child, element) || // Lazy types should reconcile their resolved type.
10540 // We need to do this after the Hot Reloading check above,
10541 // because hot reloading has different semantics than prod because
10542 // it doesn't resuspend. So we can't let the call below suspend.
10543 typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
10544 deleteRemainingChildren(returnFiber, child.sibling);
10545 var _existing = useFiber(child, element.props);
10546 _existing.ref = coerceRef(returnFiber, child, element);
10547 _existing.return = returnFiber;
10548 {
10549 _existing._debugSource = element._source;
10550 _existing._debugOwner = element._owner;
10551 }
10552 return _existing;
10553 }
10554 }
10555 deleteRemainingChildren(returnFiber, child);
10556 break;
10557 } else {
10558 deleteChild(returnFiber, child);
10559 }
10560 child = child.sibling;
10561 }
10562 if (element.type === REACT_FRAGMENT_TYPE) {
10563 var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
10564 created.return = returnFiber;
10565 return created;
10566 } else {
10567 var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
10568 _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
10569 _created4.return = returnFiber;
10570 return _created4;
10571 }
10572 }
10573 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
10574 var key = portal.key;
10575 var child = currentFirstChild;
10576 while (child !== null) {
10577 if (child.key === key) {
10578 if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
10579 deleteRemainingChildren(returnFiber, child.sibling);
10580 var existing = useFiber(child, portal.children || []);
10581 existing.return = returnFiber;
10582 return existing;
10583 } else {
10584 deleteRemainingChildren(returnFiber, child);
10585 break;
10586 }
10587 } else {
10588 deleteChild(returnFiber, child);
10589 }
10590 child = child.sibling;
10591 }
10592 var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
10593 created.return = returnFiber;
10594 return created;
10595 }
10596 function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
10597 var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
10598 if (isUnkeyedTopLevelFragment) {
10599 newChild = newChild.props.children;
10600 }
10601 if (typeof newChild === "object" && newChild !== null) {
10602 switch (newChild.$$typeof) {
10603 case REACT_ELEMENT_TYPE:
10604 return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
10605 case REACT_PORTAL_TYPE:
10606 return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
10607 case REACT_LAZY_TYPE:
10608 var payload = newChild._payload;
10609 var init = newChild._init;
10610 return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
10611 }
10612 if (isArray(newChild)) {
10613 return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
10614 }
10615 if (getIteratorFn(newChild)) {
10616 return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
10617 }
10618 throwOnInvalidObjectType(returnFiber, newChild);
10619 }
10620 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10621 return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
10622 }
10623 {
10624 if (typeof newChild === "function") {
10625 warnOnFunctionType(returnFiber);
10626 }
10627 }
10628 return deleteRemainingChildren(returnFiber, currentFirstChild);
10629 }
10630 return reconcileChildFibers2;
10631 }
10632 var reconcileChildFibers = ChildReconciler(true);
10633 var mountChildFibers = ChildReconciler(false);
10634 function cloneChildFibers(current2, workInProgress2) {
10635 if (current2 !== null && workInProgress2.child !== current2.child) {
10636 throw new Error("Resuming work not yet implemented.");
10637 }
10638 if (workInProgress2.child === null) {
10639 return;
10640 }
10641 var currentChild = workInProgress2.child;
10642 var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
10643 workInProgress2.child = newChild;
10644 newChild.return = workInProgress2;
10645 while (currentChild.sibling !== null) {
10646 currentChild = currentChild.sibling;
10647 newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
10648 newChild.return = workInProgress2;
10649 }
10650 newChild.sibling = null;
10651 }
10652 function resetChildFibers(workInProgress2, lanes) {
10653 var child = workInProgress2.child;
10654 while (child !== null) {
10655 resetWorkInProgress(child, lanes);
10656 child = child.sibling;
10657 }
10658 }
10659 var valueCursor = createCursor(null);
10660 var rendererSigil;
10661 {
10662 rendererSigil = {};
10663 }
10664 var currentlyRenderingFiber = null;
10665 var lastContextDependency = null;
10666 var lastFullyObservedContext = null;
10667 var isDisallowedContextReadInDEV = false;
10668 function resetContextDependencies() {
10669 currentlyRenderingFiber = null;
10670 lastContextDependency = null;
10671 lastFullyObservedContext = null;
10672 {
10673 isDisallowedContextReadInDEV = false;
10674 }
10675 }
10676 function enterDisallowedContextReadInDEV() {
10677 {
10678 isDisallowedContextReadInDEV = true;
10679 }
10680 }
10681 function exitDisallowedContextReadInDEV() {
10682 {
10683 isDisallowedContextReadInDEV = false;
10684 }
10685 }
10686 function pushProvider(providerFiber, context, nextValue) {
10687 {
10688 push(valueCursor, context._currentValue, providerFiber);
10689 context._currentValue = nextValue;
10690 {
10691 if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
10692 error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
10693 }
10694 context._currentRenderer = rendererSigil;
10695 }
10696 }
10697 }
10698 function popProvider(context, providerFiber) {
10699 var currentValue = valueCursor.current;
10700 pop(valueCursor, providerFiber);
10701 {
10702 {
10703 context._currentValue = currentValue;
10704 }
10705 }
10706 }
10707 function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
10708 var node = parent;
10709 while (node !== null) {
10710 var alternate = node.alternate;
10711 if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
10712 node.childLanes = mergeLanes(node.childLanes, renderLanes2);
10713 if (alternate !== null) {
10714 alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
10715 }
10716 } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
10717 alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
10718 }
10719 if (node === propagationRoot) {
10720 break;
10721 }
10722 node = node.return;
10723 }
10724 {
10725 if (node !== propagationRoot) {
10726 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.");
10727 }
10728 }
10729 }
10730 function propagateContextChange(workInProgress2, context, renderLanes2) {
10731 {
10732 propagateContextChange_eager(workInProgress2, context, renderLanes2);
10733 }
10734 }
10735 function propagateContextChange_eager(workInProgress2, context, renderLanes2) {
10736 var fiber = workInProgress2.child;
10737 if (fiber !== null) {
10738 fiber.return = workInProgress2;
10739 }
10740 while (fiber !== null) {
10741 var nextFiber = void 0;
10742 var list = fiber.dependencies;
10743 if (list !== null) {
10744 nextFiber = fiber.child;
10745 var dependency = list.firstContext;
10746 while (dependency !== null) {
10747 if (dependency.context === context) {
10748 if (fiber.tag === ClassComponent) {
10749 var lane = pickArbitraryLane(renderLanes2);
10750 var update = createUpdate(NoTimestamp, lane);
10751 update.tag = ForceUpdate;
10752 var updateQueue = fiber.updateQueue;
10753 if (updateQueue === null) ;
10754 else {
10755 var sharedQueue = updateQueue.shared;
10756 var pending = sharedQueue.pending;
10757 if (pending === null) {
10758 update.next = update;
10759 } else {
10760 update.next = pending.next;
10761 pending.next = update;
10762 }
10763 sharedQueue.pending = update;
10764 }
10765 }
10766 fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
10767 var alternate = fiber.alternate;
10768 if (alternate !== null) {
10769 alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
10770 }
10771 scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
10772 list.lanes = mergeLanes(list.lanes, renderLanes2);
10773 break;
10774 }
10775 dependency = dependency.next;
10776 }
10777 } else if (fiber.tag === ContextProvider) {
10778 nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
10779 } else if (fiber.tag === DehydratedFragment) {
10780 var parentSuspense = fiber.return;
10781 if (parentSuspense === null) {
10782 throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
10783 }
10784 parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
10785 var _alternate = parentSuspense.alternate;
10786 if (_alternate !== null) {
10787 _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
10788 }
10789 scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
10790 nextFiber = fiber.sibling;
10791 } else {
10792 nextFiber = fiber.child;
10793 }
10794 if (nextFiber !== null) {
10795 nextFiber.return = fiber;
10796 } else {
10797 nextFiber = fiber;
10798 while (nextFiber !== null) {
10799 if (nextFiber === workInProgress2) {
10800 nextFiber = null;
10801 break;
10802 }
10803 var sibling = nextFiber.sibling;
10804 if (sibling !== null) {
10805 sibling.return = nextFiber.return;
10806 nextFiber = sibling;
10807 break;
10808 }
10809 nextFiber = nextFiber.return;
10810 }
10811 }
10812 fiber = nextFiber;
10813 }
10814 }
10815 function prepareToReadContext(workInProgress2, renderLanes2) {
10816 currentlyRenderingFiber = workInProgress2;
10817 lastContextDependency = null;
10818 lastFullyObservedContext = null;
10819 var dependencies = workInProgress2.dependencies;
10820 if (dependencies !== null) {
10821 {
10822 var firstContext = dependencies.firstContext;
10823 if (firstContext !== null) {
10824 if (includesSomeLane(dependencies.lanes, renderLanes2)) {
10825 markWorkInProgressReceivedUpdate();
10826 }
10827 dependencies.firstContext = null;
10828 }
10829 }
10830 }
10831 }
10832 function readContext(context) {
10833 {
10834 if (isDisallowedContextReadInDEV) {
10835 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().");
10836 }
10837 }
10838 var value = context._currentValue;
10839 if (lastFullyObservedContext === context) ;
10840 else {
10841 var contextItem = {
10842 context,
10843 memoizedValue: value,
10844 next: null
10845 };
10846 if (lastContextDependency === null) {
10847 if (currentlyRenderingFiber === null) {
10848 throw new 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().");
10849 }
10850 lastContextDependency = contextItem;
10851 currentlyRenderingFiber.dependencies = {
10852 lanes: NoLanes,
10853 firstContext: contextItem
10854 };
10855 } else {
10856 lastContextDependency = lastContextDependency.next = contextItem;
10857 }
10858 }
10859 return value;
10860 }
10861 var concurrentQueues = null;
10862 function pushConcurrentUpdateQueue(queue) {
10863 if (concurrentQueues === null) {
10864 concurrentQueues = [queue];
10865 } else {
10866 concurrentQueues.push(queue);
10867 }
10868 }
10869 function finishQueueingConcurrentUpdates() {
10870 if (concurrentQueues !== null) {
10871 for (var i = 0; i < concurrentQueues.length; i++) {
10872 var queue = concurrentQueues[i];
10873 var lastInterleavedUpdate = queue.interleaved;
10874 if (lastInterleavedUpdate !== null) {
10875 queue.interleaved = null;
10876 var firstInterleavedUpdate = lastInterleavedUpdate.next;
10877 var lastPendingUpdate = queue.pending;
10878 if (lastPendingUpdate !== null) {
10879 var firstPendingUpdate = lastPendingUpdate.next;
10880 lastPendingUpdate.next = firstInterleavedUpdate;
10881 lastInterleavedUpdate.next = firstPendingUpdate;
10882 }
10883 queue.pending = lastInterleavedUpdate;
10884 }
10885 }
10886 concurrentQueues = null;
10887 }
10888 }
10889 function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
10890 var interleaved = queue.interleaved;
10891 if (interleaved === null) {
10892 update.next = update;
10893 pushConcurrentUpdateQueue(queue);
10894 } else {
10895 update.next = interleaved.next;
10896 interleaved.next = update;
10897 }
10898 queue.interleaved = update;
10899 return markUpdateLaneFromFiberToRoot(fiber, lane);
10900 }
10901 function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
10902 var interleaved = queue.interleaved;
10903 if (interleaved === null) {
10904 update.next = update;
10905 pushConcurrentUpdateQueue(queue);
10906 } else {
10907 update.next = interleaved.next;
10908 interleaved.next = update;
10909 }
10910 queue.interleaved = update;
10911 }
10912 function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
10913 var interleaved = queue.interleaved;
10914 if (interleaved === null) {
10915 update.next = update;
10916 pushConcurrentUpdateQueue(queue);
10917 } else {
10918 update.next = interleaved.next;
10919 interleaved.next = update;
10920 }
10921 queue.interleaved = update;
10922 return markUpdateLaneFromFiberToRoot(fiber, lane);
10923 }
10924 function enqueueConcurrentRenderForLane(fiber, lane) {
10925 return markUpdateLaneFromFiberToRoot(fiber, lane);
10926 }
10927 var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
10928 function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
10929 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
10930 var alternate = sourceFiber.alternate;
10931 if (alternate !== null) {
10932 alternate.lanes = mergeLanes(alternate.lanes, lane);
10933 }
10934 {
10935 if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
10936 warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
10937 }
10938 }
10939 var node = sourceFiber;
10940 var parent = sourceFiber.return;
10941 while (parent !== null) {
10942 parent.childLanes = mergeLanes(parent.childLanes, lane);
10943 alternate = parent.alternate;
10944 if (alternate !== null) {
10945 alternate.childLanes = mergeLanes(alternate.childLanes, lane);
10946 } else {
10947 {
10948 if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
10949 warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
10950 }
10951 }
10952 }
10953 node = parent;
10954 parent = parent.return;
10955 }
10956 if (node.tag === HostRoot) {
10957 var root2 = node.stateNode;
10958 return root2;
10959 } else {
10960 return null;
10961 }
10962 }
10963 var UpdateState = 0;
10964 var ReplaceState = 1;
10965 var ForceUpdate = 2;
10966 var CaptureUpdate = 3;
10967 var hasForceUpdate = false;
10968 var didWarnUpdateInsideUpdate;
10969 var currentlyProcessingQueue;
10970 {
10971 didWarnUpdateInsideUpdate = false;
10972 currentlyProcessingQueue = null;
10973 }
10974 function initializeUpdateQueue(fiber) {
10975 var queue = {
10976 baseState: fiber.memoizedState,
10977 firstBaseUpdate: null,
10978 lastBaseUpdate: null,
10979 shared: {
10980 pending: null,
10981 interleaved: null,
10982 lanes: NoLanes
10983 },
10984 effects: null
10985 };
10986 fiber.updateQueue = queue;
10987 }
10988 function cloneUpdateQueue(current2, workInProgress2) {
10989 var queue = workInProgress2.updateQueue;
10990 var currentQueue = current2.updateQueue;
10991 if (queue === currentQueue) {
10992 var clone = {
10993 baseState: currentQueue.baseState,
10994 firstBaseUpdate: currentQueue.firstBaseUpdate,
10995 lastBaseUpdate: currentQueue.lastBaseUpdate,
10996 shared: currentQueue.shared,
10997 effects: currentQueue.effects
10998 };
10999 workInProgress2.updateQueue = clone;
11000 }
11001 }
11002 function createUpdate(eventTime, lane) {
11003 var update = {
11004 eventTime,
11005 lane,
11006 tag: UpdateState,
11007 payload: null,
11008 callback: null,
11009 next: null
11010 };
11011 return update;
11012 }
11013 function enqueueUpdate(fiber, update, lane) {
11014 var updateQueue = fiber.updateQueue;
11015 if (updateQueue === null) {
11016 return null;
11017 }
11018 var sharedQueue = updateQueue.shared;
11019 {
11020 if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
11021 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.");
11022 didWarnUpdateInsideUpdate = true;
11023 }
11024 }
11025 if (isUnsafeClassRenderPhaseUpdate()) {
11026 var pending = sharedQueue.pending;
11027 if (pending === null) {
11028 update.next = update;
11029 } else {
11030 update.next = pending.next;
11031 pending.next = update;
11032 }
11033 sharedQueue.pending = update;
11034 return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
11035 } else {
11036 return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
11037 }
11038 }
11039 function entangleTransitions(root2, fiber, lane) {
11040 var updateQueue = fiber.updateQueue;
11041 if (updateQueue === null) {
11042 return;
11043 }
11044 var sharedQueue = updateQueue.shared;
11045 if (isTransitionLane(lane)) {
11046 var queueLanes = sharedQueue.lanes;
11047 queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
11048 var newQueueLanes = mergeLanes(queueLanes, lane);
11049 sharedQueue.lanes = newQueueLanes;
11050 markRootEntangled(root2, newQueueLanes);
11051 }
11052 }
11053 function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
11054 var queue = workInProgress2.updateQueue;
11055 var current2 = workInProgress2.alternate;
11056 if (current2 !== null) {
11057 var currentQueue = current2.updateQueue;
11058 if (queue === currentQueue) {
11059 var newFirst = null;
11060 var newLast = null;
11061 var firstBaseUpdate = queue.firstBaseUpdate;
11062 if (firstBaseUpdate !== null) {
11063 var update = firstBaseUpdate;
11064 do {
11065 var clone = {
11066 eventTime: update.eventTime,
11067 lane: update.lane,
11068 tag: update.tag,
11069 payload: update.payload,
11070 callback: update.callback,
11071 next: null
11072 };
11073 if (newLast === null) {
11074 newFirst = newLast = clone;
11075 } else {
11076 newLast.next = clone;
11077 newLast = clone;
11078 }
11079 update = update.next;
11080 } while (update !== null);
11081 if (newLast === null) {
11082 newFirst = newLast = capturedUpdate;
11083 } else {
11084 newLast.next = capturedUpdate;
11085 newLast = capturedUpdate;
11086 }
11087 } else {
11088 newFirst = newLast = capturedUpdate;
11089 }
11090 queue = {
11091 baseState: currentQueue.baseState,
11092 firstBaseUpdate: newFirst,
11093 lastBaseUpdate: newLast,
11094 shared: currentQueue.shared,
11095 effects: currentQueue.effects
11096 };
11097 workInProgress2.updateQueue = queue;
11098 return;
11099 }
11100 }
11101 var lastBaseUpdate = queue.lastBaseUpdate;
11102 if (lastBaseUpdate === null) {
11103 queue.firstBaseUpdate = capturedUpdate;
11104 } else {
11105 lastBaseUpdate.next = capturedUpdate;
11106 }
11107 queue.lastBaseUpdate = capturedUpdate;
11108 }
11109 function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
11110 switch (update.tag) {
11111 case ReplaceState: {
11112 var payload = update.payload;
11113 if (typeof payload === "function") {
11114 {
11115 enterDisallowedContextReadInDEV();
11116 }
11117 var nextState = payload.call(instance, prevState, nextProps);
11118 {
11119 if (workInProgress2.mode & StrictLegacyMode) {
11120 setIsStrictModeForDevtools(true);
11121 try {
11122 payload.call(instance, prevState, nextProps);
11123 } finally {
11124 setIsStrictModeForDevtools(false);
11125 }
11126 }
11127 exitDisallowedContextReadInDEV();
11128 }
11129 return nextState;
11130 }
11131 return payload;
11132 }
11133 case CaptureUpdate: {
11134 workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
11135 }
11136 // Intentional fallthrough
11137 case UpdateState: {
11138 var _payload = update.payload;
11139 var partialState;
11140 if (typeof _payload === "function") {
11141 {
11142 enterDisallowedContextReadInDEV();
11143 }
11144 partialState = _payload.call(instance, prevState, nextProps);
11145 {
11146 if (workInProgress2.mode & StrictLegacyMode) {
11147 setIsStrictModeForDevtools(true);
11148 try {
11149 _payload.call(instance, prevState, nextProps);
11150 } finally {
11151 setIsStrictModeForDevtools(false);
11152 }
11153 }
11154 exitDisallowedContextReadInDEV();
11155 }
11156 } else {
11157 partialState = _payload;
11158 }
11159 if (partialState === null || partialState === void 0) {
11160 return prevState;
11161 }
11162 return assign({}, prevState, partialState);
11163 }
11164 case ForceUpdate: {
11165 hasForceUpdate = true;
11166 return prevState;
11167 }
11168 }
11169 return prevState;
11170 }
11171 function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
11172 var queue = workInProgress2.updateQueue;
11173 hasForceUpdate = false;
11174 {
11175 currentlyProcessingQueue = queue.shared;
11176 }
11177 var firstBaseUpdate = queue.firstBaseUpdate;
11178 var lastBaseUpdate = queue.lastBaseUpdate;
11179 var pendingQueue = queue.shared.pending;
11180 if (pendingQueue !== null) {
11181 queue.shared.pending = null;
11182 var lastPendingUpdate = pendingQueue;
11183 var firstPendingUpdate = lastPendingUpdate.next;
11184 lastPendingUpdate.next = null;
11185 if (lastBaseUpdate === null) {
11186 firstBaseUpdate = firstPendingUpdate;
11187 } else {
11188 lastBaseUpdate.next = firstPendingUpdate;
11189 }
11190 lastBaseUpdate = lastPendingUpdate;
11191 var current2 = workInProgress2.alternate;
11192 if (current2 !== null) {
11193 var currentQueue = current2.updateQueue;
11194 var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
11195 if (currentLastBaseUpdate !== lastBaseUpdate) {
11196 if (currentLastBaseUpdate === null) {
11197 currentQueue.firstBaseUpdate = firstPendingUpdate;
11198 } else {
11199 currentLastBaseUpdate.next = firstPendingUpdate;
11200 }
11201 currentQueue.lastBaseUpdate = lastPendingUpdate;
11202 }
11203 }
11204 }
11205 if (firstBaseUpdate !== null) {
11206 var newState = queue.baseState;
11207 var newLanes = NoLanes;
11208 var newBaseState = null;
11209 var newFirstBaseUpdate = null;
11210 var newLastBaseUpdate = null;
11211 var update = firstBaseUpdate;
11212 do {
11213 var updateLane = update.lane;
11214 var updateEventTime = update.eventTime;
11215 if (!isSubsetOfLanes(renderLanes2, updateLane)) {
11216 var clone = {
11217 eventTime: updateEventTime,
11218 lane: updateLane,
11219 tag: update.tag,
11220 payload: update.payload,
11221 callback: update.callback,
11222 next: null
11223 };
11224 if (newLastBaseUpdate === null) {
11225 newFirstBaseUpdate = newLastBaseUpdate = clone;
11226 newBaseState = newState;
11227 } else {
11228 newLastBaseUpdate = newLastBaseUpdate.next = clone;
11229 }
11230 newLanes = mergeLanes(newLanes, updateLane);
11231 } else {
11232 if (newLastBaseUpdate !== null) {
11233 var _clone = {
11234 eventTime: updateEventTime,
11235 // This update is going to be committed so we never want uncommit
11236 // it. Using NoLane works because 0 is a subset of all bitmasks, so
11237 // this will never be skipped by the check above.
11238 lane: NoLane,
11239 tag: update.tag,
11240 payload: update.payload,
11241 callback: update.callback,
11242 next: null
11243 };
11244 newLastBaseUpdate = newLastBaseUpdate.next = _clone;
11245 }
11246 newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
11247 var callback = update.callback;
11248 if (callback !== null && // If the update was already committed, we should not queue its
11249 // callback again.
11250 update.lane !== NoLane) {
11251 workInProgress2.flags |= Callback;
11252 var effects = queue.effects;
11253 if (effects === null) {
11254 queue.effects = [update];
11255 } else {
11256 effects.push(update);
11257 }
11258 }
11259 }
11260 update = update.next;
11261 if (update === null) {
11262 pendingQueue = queue.shared.pending;
11263 if (pendingQueue === null) {
11264 break;
11265 } else {
11266 var _lastPendingUpdate = pendingQueue;
11267 var _firstPendingUpdate = _lastPendingUpdate.next;
11268 _lastPendingUpdate.next = null;
11269 update = _firstPendingUpdate;
11270 queue.lastBaseUpdate = _lastPendingUpdate;
11271 queue.shared.pending = null;
11272 }
11273 }
11274 } while (true);
11275 if (newLastBaseUpdate === null) {
11276 newBaseState = newState;
11277 }
11278 queue.baseState = newBaseState;
11279 queue.firstBaseUpdate = newFirstBaseUpdate;
11280 queue.lastBaseUpdate = newLastBaseUpdate;
11281 var lastInterleaved = queue.shared.interleaved;
11282 if (lastInterleaved !== null) {
11283 var interleaved = lastInterleaved;
11284 do {
11285 newLanes = mergeLanes(newLanes, interleaved.lane);
11286 interleaved = interleaved.next;
11287 } while (interleaved !== lastInterleaved);
11288 } else if (firstBaseUpdate === null) {
11289 queue.shared.lanes = NoLanes;
11290 }
11291 markSkippedUpdateLanes(newLanes);
11292 workInProgress2.lanes = newLanes;
11293 workInProgress2.memoizedState = newState;
11294 }
11295 {
11296 currentlyProcessingQueue = null;
11297 }
11298 }
11299 function callCallback(callback, context) {
11300 if (typeof callback !== "function") {
11301 throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
11302 }
11303 callback.call(context);
11304 }
11305 function resetHasForceUpdateBeforeProcessing() {
11306 hasForceUpdate = false;
11307 }
11308 function checkHasForceUpdateAfterProcessing() {
11309 return hasForceUpdate;
11310 }
11311 function commitUpdateQueue(finishedWork, finishedQueue, instance) {
11312 var effects = finishedQueue.effects;
11313 finishedQueue.effects = null;
11314 if (effects !== null) {
11315 for (var i = 0; i < effects.length; i++) {
11316 var effect = effects[i];
11317 var callback = effect.callback;
11318 if (callback !== null) {
11319 effect.callback = null;
11320 callCallback(callback, instance);
11321 }
11322 }
11323 }
11324 }
11325 var NO_CONTEXT = {};
11326 var contextStackCursor$1 = createCursor(NO_CONTEXT);
11327 var contextFiberStackCursor = createCursor(NO_CONTEXT);
11328 var rootInstanceStackCursor = createCursor(NO_CONTEXT);
11329 function requiredContext(c) {
11330 if (c === NO_CONTEXT) {
11331 throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
11332 }
11333 return c;
11334 }
11335 function getRootHostContainer() {
11336 var rootInstance = requiredContext(rootInstanceStackCursor.current);
11337 return rootInstance;
11338 }
11339 function pushHostContainer(fiber, nextRootInstance) {
11340 push(rootInstanceStackCursor, nextRootInstance, fiber);
11341 push(contextFiberStackCursor, fiber, fiber);
11342 push(contextStackCursor$1, NO_CONTEXT, fiber);
11343 var nextRootContext = getRootHostContext(nextRootInstance);
11344 pop(contextStackCursor$1, fiber);
11345 push(contextStackCursor$1, nextRootContext, fiber);
11346 }
11347 function popHostContainer(fiber) {
11348 pop(contextStackCursor$1, fiber);
11349 pop(contextFiberStackCursor, fiber);
11350 pop(rootInstanceStackCursor, fiber);
11351 }
11352 function getHostContext() {
11353 var context = requiredContext(contextStackCursor$1.current);
11354 return context;
11355 }
11356 function pushHostContext(fiber) {
11357 var rootInstance = requiredContext(rootInstanceStackCursor.current);
11358 var context = requiredContext(contextStackCursor$1.current);
11359 var nextContext = getChildHostContext(context, fiber.type);
11360 if (context === nextContext) {
11361 return;
11362 }
11363 push(contextFiberStackCursor, fiber, fiber);
11364 push(contextStackCursor$1, nextContext, fiber);
11365 }
11366 function popHostContext(fiber) {
11367 if (contextFiberStackCursor.current !== fiber) {
11368 return;
11369 }
11370 pop(contextStackCursor$1, fiber);
11371 pop(contextFiberStackCursor, fiber);
11372 }
11373 var DefaultSuspenseContext = 0;
11374 var SubtreeSuspenseContextMask = 1;
11375 var InvisibleParentSuspenseContext = 1;
11376 var ForceSuspenseFallback = 2;
11377 var suspenseStackCursor = createCursor(DefaultSuspenseContext);
11378 function hasSuspenseContext(parentContext, flag) {
11379 return (parentContext & flag) !== 0;
11380 }
11381 function setDefaultShallowSuspenseContext(parentContext) {
11382 return parentContext & SubtreeSuspenseContextMask;
11383 }
11384 function setShallowSuspenseContext(parentContext, shallowContext) {
11385 return parentContext & SubtreeSuspenseContextMask | shallowContext;
11386 }
11387 function addSubtreeSuspenseContext(parentContext, subtreeContext) {
11388 return parentContext | subtreeContext;
11389 }
11390 function pushSuspenseContext(fiber, newContext) {
11391 push(suspenseStackCursor, newContext, fiber);
11392 }
11393 function popSuspenseContext(fiber) {
11394 pop(suspenseStackCursor, fiber);
11395 }
11396 function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
11397 var nextState = workInProgress2.memoizedState;
11398 if (nextState !== null) {
11399 if (nextState.dehydrated !== null) {
11400 return true;
11401 }
11402 return false;
11403 }
11404 var props = workInProgress2.memoizedProps;
11405 {
11406 return true;
11407 }
11408 }
11409 function findFirstSuspended(row) {
11410 var node = row;
11411 while (node !== null) {
11412 if (node.tag === SuspenseComponent) {
11413 var state = node.memoizedState;
11414 if (state !== null) {
11415 var dehydrated = state.dehydrated;
11416 if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
11417 return node;
11418 }
11419 }
11420 } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
11421 // keep track of whether it suspended or not.
11422 node.memoizedProps.revealOrder !== void 0) {
11423 var didSuspend = (node.flags & DidCapture) !== NoFlags;
11424 if (didSuspend) {
11425 return node;
11426 }
11427 } else if (node.child !== null) {
11428 node.child.return = node;
11429 node = node.child;
11430 continue;
11431 }
11432 if (node === row) {
11433 return null;
11434 }
11435 while (node.sibling === null) {
11436 if (node.return === null || node.return === row) {
11437 return null;
11438 }
11439 node = node.return;
11440 }
11441 node.sibling.return = node.return;
11442 node = node.sibling;
11443 }
11444 return null;
11445 }
11446 var NoFlags$1 = (
11447 /* */
11448 0
11449 );
11450 var HasEffect = (
11451 /* */
11452 1
11453 );
11454 var Insertion = (
11455 /* */
11456 2
11457 );
11458 var Layout = (
11459 /* */
11460 4
11461 );
11462 var Passive$1 = (
11463 /* */
11464 8
11465 );
11466 var workInProgressSources = [];
11467 function resetWorkInProgressVersions() {
11468 for (var i = 0; i < workInProgressSources.length; i++) {
11469 var mutableSource = workInProgressSources[i];
11470 {
11471 mutableSource._workInProgressVersionPrimary = null;
11472 }
11473 }
11474 workInProgressSources.length = 0;
11475 }
11476 function registerMutableSourceForHydration(root2, mutableSource) {
11477 var getVersion = mutableSource._getVersion;
11478 var version = getVersion(mutableSource._source);
11479 if (root2.mutableSourceEagerHydrationData == null) {
11480 root2.mutableSourceEagerHydrationData = [mutableSource, version];
11481 } else {
11482 root2.mutableSourceEagerHydrationData.push(mutableSource, version);
11483 }
11484 }
11485 var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
11486 var didWarnAboutMismatchedHooksForComponent;
11487 var didWarnUncachedGetSnapshot;
11488 {
11489 didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
11490 }
11491 var renderLanes = NoLanes;
11492 var currentlyRenderingFiber$1 = null;
11493 var currentHook = null;
11494 var workInProgressHook = null;
11495 var didScheduleRenderPhaseUpdate = false;
11496 var didScheduleRenderPhaseUpdateDuringThisPass = false;
11497 var localIdCounter = 0;
11498 var globalClientIdCounter = 0;
11499 var RE_RENDER_LIMIT = 25;
11500 var currentHookNameInDev = null;
11501 var hookTypesDev = null;
11502 var hookTypesUpdateIndexDev = -1;
11503 var ignorePreviousDependencies = false;
11504 function mountHookTypesDev() {
11505 {
11506 var hookName = currentHookNameInDev;
11507 if (hookTypesDev === null) {
11508 hookTypesDev = [hookName];
11509 } else {
11510 hookTypesDev.push(hookName);
11511 }
11512 }
11513 }
11514 function updateHookTypesDev() {
11515 {
11516 var hookName = currentHookNameInDev;
11517 if (hookTypesDev !== null) {
11518 hookTypesUpdateIndexDev++;
11519 if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
11520 warnOnHookMismatchInDev(hookName);
11521 }
11522 }
11523 }
11524 }
11525 function checkDepsAreArrayDev(deps) {
11526 {
11527 if (deps !== void 0 && deps !== null && !isArray(deps)) {
11528 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);
11529 }
11530 }
11531 }
11532 function warnOnHookMismatchInDev(currentHookName) {
11533 {
11534 var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
11535 if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
11536 didWarnAboutMismatchedHooksForComponent.add(componentName);
11537 if (hookTypesDev !== null) {
11538 var table = "";
11539 var secondColumnStart = 30;
11540 for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
11541 var oldHookName = hookTypesDev[i];
11542 var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
11543 var row = i + 1 + ". " + oldHookName;
11544 while (row.length < secondColumnStart) {
11545 row += " ";
11546 }
11547 row += newHookName + "\n";
11548 table += row;
11549 }
11550 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://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", componentName, table);
11551 }
11552 }
11553 }
11554 }
11555 function throwInvalidHookError() {
11556 throw new 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
11557 }
11558 function areHookInputsEqual(nextDeps, prevDeps) {
11559 {
11560 if (ignorePreviousDependencies) {
11561 return false;
11562 }
11563 }
11564 if (prevDeps === null) {
11565 {
11566 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);
11567 }
11568 return false;
11569 }
11570 {
11571 if (nextDeps.length !== prevDeps.length) {
11572 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(", ") + "]");
11573 }
11574 }
11575 for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
11576 if (objectIs(nextDeps[i], prevDeps[i])) {
11577 continue;
11578 }
11579 return false;
11580 }
11581 return true;
11582 }
11583 function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) {
11584 renderLanes = nextRenderLanes;
11585 currentlyRenderingFiber$1 = workInProgress2;
11586 {
11587 hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
11588 hookTypesUpdateIndexDev = -1;
11589 ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
11590 }
11591 workInProgress2.memoizedState = null;
11592 workInProgress2.updateQueue = null;
11593 workInProgress2.lanes = NoLanes;
11594 {
11595 if (current2 !== null && current2.memoizedState !== null) {
11596 ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
11597 } else if (hookTypesDev !== null) {
11598 ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
11599 } else {
11600 ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
11601 }
11602 }
11603 var children = Component(props, secondArg);
11604 if (didScheduleRenderPhaseUpdateDuringThisPass) {
11605 var numberOfReRenders = 0;
11606 do {
11607 didScheduleRenderPhaseUpdateDuringThisPass = false;
11608 localIdCounter = 0;
11609 if (numberOfReRenders >= RE_RENDER_LIMIT) {
11610 throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
11611 }
11612 numberOfReRenders += 1;
11613 {
11614 ignorePreviousDependencies = false;
11615 }
11616 currentHook = null;
11617 workInProgressHook = null;
11618 workInProgress2.updateQueue = null;
11619 {
11620 hookTypesUpdateIndexDev = -1;
11621 }
11622 ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
11623 children = Component(props, secondArg);
11624 } while (didScheduleRenderPhaseUpdateDuringThisPass);
11625 }
11626 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
11627 {
11628 workInProgress2._debugHookTypes = hookTypesDev;
11629 }
11630 var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
11631 renderLanes = NoLanes;
11632 currentlyRenderingFiber$1 = null;
11633 currentHook = null;
11634 workInProgressHook = null;
11635 {
11636 currentHookNameInDev = null;
11637 hookTypesDev = null;
11638 hookTypesUpdateIndexDev = -1;
11639 if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird
11640 // and creates false positives. To make this work in legacy mode, we'd
11641 // need to mark fibers that commit in an incomplete state, somehow. For
11642 // now I'll disable the warning that most of the bugs that would trigger
11643 // it are either exclusive to concurrent mode or exist in both.
11644 (current2.mode & ConcurrentMode) !== NoMode) {
11645 error("Internal React error: Expected static flag was missing. Please notify the React team.");
11646 }
11647 }
11648 didScheduleRenderPhaseUpdate = false;
11649 if (didRenderTooFewHooks) {
11650 throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
11651 }
11652 return children;
11653 }
11654 function checkDidRenderIdHook() {
11655 var didRenderIdHook = localIdCounter !== 0;
11656 localIdCounter = 0;
11657 return didRenderIdHook;
11658 }
11659 function bailoutHooks(current2, workInProgress2, lanes) {
11660 workInProgress2.updateQueue = current2.updateQueue;
11661 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
11662 workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
11663 } else {
11664 workInProgress2.flags &= ~(Passive | Update);
11665 }
11666 current2.lanes = removeLanes(current2.lanes, lanes);
11667 }
11668 function resetHooksAfterThrow() {
11669 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
11670 if (didScheduleRenderPhaseUpdate) {
11671 var hook = currentlyRenderingFiber$1.memoizedState;
11672 while (hook !== null) {
11673 var queue = hook.queue;
11674 if (queue !== null) {
11675 queue.pending = null;
11676 }
11677 hook = hook.next;
11678 }
11679 didScheduleRenderPhaseUpdate = false;
11680 }
11681 renderLanes = NoLanes;
11682 currentlyRenderingFiber$1 = null;
11683 currentHook = null;
11684 workInProgressHook = null;
11685 {
11686 hookTypesDev = null;
11687 hookTypesUpdateIndexDev = -1;
11688 currentHookNameInDev = null;
11689 isUpdatingOpaqueValueInRenderPhase = false;
11690 }
11691 didScheduleRenderPhaseUpdateDuringThisPass = false;
11692 localIdCounter = 0;
11693 }
11694 function mountWorkInProgressHook() {
11695 var hook = {
11696 memoizedState: null,
11697 baseState: null,
11698 baseQueue: null,
11699 queue: null,
11700 next: null
11701 };
11702 if (workInProgressHook === null) {
11703 currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
11704 } else {
11705 workInProgressHook = workInProgressHook.next = hook;
11706 }
11707 return workInProgressHook;
11708 }
11709 function updateWorkInProgressHook() {
11710 var nextCurrentHook;
11711 if (currentHook === null) {
11712 var current2 = currentlyRenderingFiber$1.alternate;
11713 if (current2 !== null) {
11714 nextCurrentHook = current2.memoizedState;
11715 } else {
11716 nextCurrentHook = null;
11717 }
11718 } else {
11719 nextCurrentHook = currentHook.next;
11720 }
11721 var nextWorkInProgressHook;
11722 if (workInProgressHook === null) {
11723 nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
11724 } else {
11725 nextWorkInProgressHook = workInProgressHook.next;
11726 }
11727 if (nextWorkInProgressHook !== null) {
11728 workInProgressHook = nextWorkInProgressHook;
11729 nextWorkInProgressHook = workInProgressHook.next;
11730 currentHook = nextCurrentHook;
11731 } else {
11732 if (nextCurrentHook === null) {
11733 throw new Error("Rendered more hooks than during the previous render.");
11734 }
11735 currentHook = nextCurrentHook;
11736 var newHook = {
11737 memoizedState: currentHook.memoizedState,
11738 baseState: currentHook.baseState,
11739 baseQueue: currentHook.baseQueue,
11740 queue: currentHook.queue,
11741 next: null
11742 };
11743 if (workInProgressHook === null) {
11744 currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
11745 } else {
11746 workInProgressHook = workInProgressHook.next = newHook;
11747 }
11748 }
11749 return workInProgressHook;
11750 }
11751 function createFunctionComponentUpdateQueue() {
11752 return {
11753 lastEffect: null,
11754 stores: null
11755 };
11756 }
11757 function basicStateReducer(state, action) {
11758 return typeof action === "function" ? action(state) : action;
11759 }
11760 function mountReducer(reducer, initialArg, init) {
11761 var hook = mountWorkInProgressHook();
11762 var initialState;
11763 if (init !== void 0) {
11764 initialState = init(initialArg);
11765 } else {
11766 initialState = initialArg;
11767 }
11768 hook.memoizedState = hook.baseState = initialState;
11769 var queue = {
11770 pending: null,
11771 interleaved: null,
11772 lanes: NoLanes,
11773 dispatch: null,
11774 lastRenderedReducer: reducer,
11775 lastRenderedState: initialState
11776 };
11777 hook.queue = queue;
11778 var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
11779 return [hook.memoizedState, dispatch];
11780 }
11781 function updateReducer(reducer, initialArg, init) {
11782 var hook = updateWorkInProgressHook();
11783 var queue = hook.queue;
11784 if (queue === null) {
11785 throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
11786 }
11787 queue.lastRenderedReducer = reducer;
11788 var current2 = currentHook;
11789 var baseQueue = current2.baseQueue;
11790 var pendingQueue = queue.pending;
11791 if (pendingQueue !== null) {
11792 if (baseQueue !== null) {
11793 var baseFirst = baseQueue.next;
11794 var pendingFirst = pendingQueue.next;
11795 baseQueue.next = pendingFirst;
11796 pendingQueue.next = baseFirst;
11797 }
11798 {
11799 if (current2.baseQueue !== baseQueue) {
11800 error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
11801 }
11802 }
11803 current2.baseQueue = baseQueue = pendingQueue;
11804 queue.pending = null;
11805 }
11806 if (baseQueue !== null) {
11807 var first = baseQueue.next;
11808 var newState = current2.baseState;
11809 var newBaseState = null;
11810 var newBaseQueueFirst = null;
11811 var newBaseQueueLast = null;
11812 var update = first;
11813 do {
11814 var updateLane = update.lane;
11815 if (!isSubsetOfLanes(renderLanes, updateLane)) {
11816 var clone = {
11817 lane: updateLane,
11818 action: update.action,
11819 hasEagerState: update.hasEagerState,
11820 eagerState: update.eagerState,
11821 next: null
11822 };
11823 if (newBaseQueueLast === null) {
11824 newBaseQueueFirst = newBaseQueueLast = clone;
11825 newBaseState = newState;
11826 } else {
11827 newBaseQueueLast = newBaseQueueLast.next = clone;
11828 }
11829 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
11830 markSkippedUpdateLanes(updateLane);
11831 } else {
11832 if (newBaseQueueLast !== null) {
11833 var _clone = {
11834 // This update is going to be committed so we never want uncommit
11835 // it. Using NoLane works because 0 is a subset of all bitmasks, so
11836 // this will never be skipped by the check above.
11837 lane: NoLane,
11838 action: update.action,
11839 hasEagerState: update.hasEagerState,
11840 eagerState: update.eagerState,
11841 next: null
11842 };
11843 newBaseQueueLast = newBaseQueueLast.next = _clone;
11844 }
11845 if (update.hasEagerState) {
11846 newState = update.eagerState;
11847 } else {
11848 var action = update.action;
11849 newState = reducer(newState, action);
11850 }
11851 }
11852 update = update.next;
11853 } while (update !== null && update !== first);
11854 if (newBaseQueueLast === null) {
11855 newBaseState = newState;
11856 } else {
11857 newBaseQueueLast.next = newBaseQueueFirst;
11858 }
11859 if (!objectIs(newState, hook.memoizedState)) {
11860 markWorkInProgressReceivedUpdate();
11861 }
11862 hook.memoizedState = newState;
11863 hook.baseState = newBaseState;
11864 hook.baseQueue = newBaseQueueLast;
11865 queue.lastRenderedState = newState;
11866 }
11867 var lastInterleaved = queue.interleaved;
11868 if (lastInterleaved !== null) {
11869 var interleaved = lastInterleaved;
11870 do {
11871 var interleavedLane = interleaved.lane;
11872 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
11873 markSkippedUpdateLanes(interleavedLane);
11874 interleaved = interleaved.next;
11875 } while (interleaved !== lastInterleaved);
11876 } else if (baseQueue === null) {
11877 queue.lanes = NoLanes;
11878 }
11879 var dispatch = queue.dispatch;
11880 return [hook.memoizedState, dispatch];
11881 }
11882 function rerenderReducer(reducer, initialArg, init) {
11883 var hook = updateWorkInProgressHook();
11884 var queue = hook.queue;
11885 if (queue === null) {
11886 throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
11887 }
11888 queue.lastRenderedReducer = reducer;
11889 var dispatch = queue.dispatch;
11890 var lastRenderPhaseUpdate = queue.pending;
11891 var newState = hook.memoizedState;
11892 if (lastRenderPhaseUpdate !== null) {
11893 queue.pending = null;
11894 var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
11895 var update = firstRenderPhaseUpdate;
11896 do {
11897 var action = update.action;
11898 newState = reducer(newState, action);
11899 update = update.next;
11900 } while (update !== firstRenderPhaseUpdate);
11901 if (!objectIs(newState, hook.memoizedState)) {
11902 markWorkInProgressReceivedUpdate();
11903 }
11904 hook.memoizedState = newState;
11905 if (hook.baseQueue === null) {
11906 hook.baseState = newState;
11907 }
11908 queue.lastRenderedState = newState;
11909 }
11910 return [newState, dispatch];
11911 }
11912 function mountMutableSource(source, getSnapshot, subscribe) {
11913 {
11914 return void 0;
11915 }
11916 }
11917 function updateMutableSource(source, getSnapshot, subscribe) {
11918 {
11919 return void 0;
11920 }
11921 }
11922 function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
11923 var fiber = currentlyRenderingFiber$1;
11924 var hook = mountWorkInProgressHook();
11925 var nextSnapshot;
11926 var isHydrating2 = getIsHydrating();
11927 if (isHydrating2) {
11928 if (getServerSnapshot === void 0) {
11929 throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
11930 }
11931 nextSnapshot = getServerSnapshot();
11932 {
11933 if (!didWarnUncachedGetSnapshot) {
11934 if (nextSnapshot !== getServerSnapshot()) {
11935 error("The result of getServerSnapshot should be cached to avoid an infinite loop");
11936 didWarnUncachedGetSnapshot = true;
11937 }
11938 }
11939 }
11940 } else {
11941 nextSnapshot = getSnapshot();
11942 {
11943 if (!didWarnUncachedGetSnapshot) {
11944 var cachedSnapshot = getSnapshot();
11945 if (!objectIs(nextSnapshot, cachedSnapshot)) {
11946 error("The result of getSnapshot should be cached to avoid an infinite loop");
11947 didWarnUncachedGetSnapshot = true;
11948 }
11949 }
11950 }
11951 var root2 = getWorkInProgressRoot();
11952 if (root2 === null) {
11953 throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
11954 }
11955 if (!includesBlockingLane(root2, renderLanes)) {
11956 pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
11957 }
11958 }
11959 hook.memoizedState = nextSnapshot;
11960 var inst = {
11961 value: nextSnapshot,
11962 getSnapshot
11963 };
11964 hook.queue = inst;
11965 mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
11966 fiber.flags |= Passive;
11967 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
11968 return nextSnapshot;
11969 }
11970 function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
11971 var fiber = currentlyRenderingFiber$1;
11972 var hook = updateWorkInProgressHook();
11973 var nextSnapshot = getSnapshot();
11974 {
11975 if (!didWarnUncachedGetSnapshot) {
11976 var cachedSnapshot = getSnapshot();
11977 if (!objectIs(nextSnapshot, cachedSnapshot)) {
11978 error("The result of getSnapshot should be cached to avoid an infinite loop");
11979 didWarnUncachedGetSnapshot = true;
11980 }
11981 }
11982 }
11983 var prevSnapshot = hook.memoizedState;
11984 var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
11985 if (snapshotChanged) {
11986 hook.memoizedState = nextSnapshot;
11987 markWorkInProgressReceivedUpdate();
11988 }
11989 var inst = hook.queue;
11990 updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
11991 if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
11992 // checking whether we scheduled a subscription effect above.
11993 workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
11994 fiber.flags |= Passive;
11995 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
11996 var root2 = getWorkInProgressRoot();
11997 if (root2 === null) {
11998 throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
11999 }
12000 if (!includesBlockingLane(root2, renderLanes)) {
12001 pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
12002 }
12003 }
12004 return nextSnapshot;
12005 }
12006 function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
12007 fiber.flags |= StoreConsistency;
12008 var check = {
12009 getSnapshot,
12010 value: renderedSnapshot
12011 };
12012 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
12013 if (componentUpdateQueue === null) {
12014 componentUpdateQueue = createFunctionComponentUpdateQueue();
12015 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
12016 componentUpdateQueue.stores = [check];
12017 } else {
12018 var stores = componentUpdateQueue.stores;
12019 if (stores === null) {
12020 componentUpdateQueue.stores = [check];
12021 } else {
12022 stores.push(check);
12023 }
12024 }
12025 }
12026 function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
12027 inst.value = nextSnapshot;
12028 inst.getSnapshot = getSnapshot;
12029 if (checkIfSnapshotChanged(inst)) {
12030 forceStoreRerender(fiber);
12031 }
12032 }
12033 function subscribeToStore(fiber, inst, subscribe) {
12034 var handleStoreChange = function() {
12035 if (checkIfSnapshotChanged(inst)) {
12036 forceStoreRerender(fiber);
12037 }
12038 };
12039 return subscribe(handleStoreChange);
12040 }
12041 function checkIfSnapshotChanged(inst) {
12042 var latestGetSnapshot = inst.getSnapshot;
12043 var prevValue = inst.value;
12044 try {
12045 var nextValue = latestGetSnapshot();
12046 return !objectIs(prevValue, nextValue);
12047 } catch (error2) {
12048 return true;
12049 }
12050 }
12051 function forceStoreRerender(fiber) {
12052 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
12053 if (root2 !== null) {
12054 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
12055 }
12056 }
12057 function mountState(initialState) {
12058 var hook = mountWorkInProgressHook();
12059 if (typeof initialState === "function") {
12060 initialState = initialState();
12061 }
12062 hook.memoizedState = hook.baseState = initialState;
12063 var queue = {
12064 pending: null,
12065 interleaved: null,
12066 lanes: NoLanes,
12067 dispatch: null,
12068 lastRenderedReducer: basicStateReducer,
12069 lastRenderedState: initialState
12070 };
12071 hook.queue = queue;
12072 var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
12073 return [hook.memoizedState, dispatch];
12074 }
12075 function updateState(initialState) {
12076 return updateReducer(basicStateReducer);
12077 }
12078 function rerenderState(initialState) {
12079 return rerenderReducer(basicStateReducer);
12080 }
12081 function pushEffect(tag, create, destroy, deps) {
12082 var effect = {
12083 tag,
12084 create,
12085 destroy,
12086 deps,
12087 // Circular
12088 next: null
12089 };
12090 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
12091 if (componentUpdateQueue === null) {
12092 componentUpdateQueue = createFunctionComponentUpdateQueue();
12093 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
12094 componentUpdateQueue.lastEffect = effect.next = effect;
12095 } else {
12096 var lastEffect = componentUpdateQueue.lastEffect;
12097 if (lastEffect === null) {
12098 componentUpdateQueue.lastEffect = effect.next = effect;
12099 } else {
12100 var firstEffect = lastEffect.next;
12101 lastEffect.next = effect;
12102 effect.next = firstEffect;
12103 componentUpdateQueue.lastEffect = effect;
12104 }
12105 }
12106 return effect;
12107 }
12108 function mountRef(initialValue) {
12109 var hook = mountWorkInProgressHook();
12110 {
12111 var _ref2 = {
12112 current: initialValue
12113 };
12114 hook.memoizedState = _ref2;
12115 return _ref2;
12116 }
12117 }
12118 function updateRef(initialValue) {
12119 var hook = updateWorkInProgressHook();
12120 return hook.memoizedState;
12121 }
12122 function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
12123 var hook = mountWorkInProgressHook();
12124 var nextDeps = deps === void 0 ? null : deps;
12125 currentlyRenderingFiber$1.flags |= fiberFlags;
12126 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
12127 }
12128 function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
12129 var hook = updateWorkInProgressHook();
12130 var nextDeps = deps === void 0 ? null : deps;
12131 var destroy = void 0;
12132 if (currentHook !== null) {
12133 var prevEffect = currentHook.memoizedState;
12134 destroy = prevEffect.destroy;
12135 if (nextDeps !== null) {
12136 var prevDeps = prevEffect.deps;
12137 if (areHookInputsEqual(nextDeps, prevDeps)) {
12138 hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);
12139 return;
12140 }
12141 }
12142 }
12143 currentlyRenderingFiber$1.flags |= fiberFlags;
12144 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
12145 }
12146 function mountEffect(create, deps) {
12147 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12148 return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
12149 } else {
12150 return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
12151 }
12152 }
12153 function updateEffect(create, deps) {
12154 return updateEffectImpl(Passive, Passive$1, create, deps);
12155 }
12156 function mountInsertionEffect(create, deps) {
12157 return mountEffectImpl(Update, Insertion, create, deps);
12158 }
12159 function updateInsertionEffect(create, deps) {
12160 return updateEffectImpl(Update, Insertion, create, deps);
12161 }
12162 function mountLayoutEffect(create, deps) {
12163 var fiberFlags = Update;
12164 {
12165 fiberFlags |= LayoutStatic;
12166 }
12167 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12168 fiberFlags |= MountLayoutDev;
12169 }
12170 return mountEffectImpl(fiberFlags, Layout, create, deps);
12171 }
12172 function updateLayoutEffect(create, deps) {
12173 return updateEffectImpl(Update, Layout, create, deps);
12174 }
12175 function imperativeHandleEffect(create, ref) {
12176 if (typeof ref === "function") {
12177 var refCallback = ref;
12178 var _inst = create();
12179 refCallback(_inst);
12180 return function() {
12181 refCallback(null);
12182 };
12183 } else if (ref !== null && ref !== void 0) {
12184 var refObject = ref;
12185 {
12186 if (!refObject.hasOwnProperty("current")) {
12187 error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
12188 }
12189 }
12190 var _inst2 = create();
12191 refObject.current = _inst2;
12192 return function() {
12193 refObject.current = null;
12194 };
12195 }
12196 }
12197 function mountImperativeHandle(ref, create, deps) {
12198 {
12199 if (typeof create !== "function") {
12200 error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
12201 }
12202 }
12203 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
12204 var fiberFlags = Update;
12205 {
12206 fiberFlags |= LayoutStatic;
12207 }
12208 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12209 fiberFlags |= MountLayoutDev;
12210 }
12211 return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
12212 }
12213 function updateImperativeHandle(ref, create, deps) {
12214 {
12215 if (typeof create !== "function") {
12216 error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
12217 }
12218 }
12219 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
12220 return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
12221 }
12222 function mountDebugValue(value, formatterFn) {
12223 }
12224 var updateDebugValue = mountDebugValue;
12225 function mountCallback(callback, deps) {
12226 var hook = mountWorkInProgressHook();
12227 var nextDeps = deps === void 0 ? null : deps;
12228 hook.memoizedState = [callback, nextDeps];
12229 return callback;
12230 }
12231 function updateCallback(callback, deps) {
12232 var hook = updateWorkInProgressHook();
12233 var nextDeps = deps === void 0 ? null : deps;
12234 var prevState = hook.memoizedState;
12235 if (prevState !== null) {
12236 if (nextDeps !== null) {
12237 var prevDeps = prevState[1];
12238 if (areHookInputsEqual(nextDeps, prevDeps)) {
12239 return prevState[0];
12240 }
12241 }
12242 }
12243 hook.memoizedState = [callback, nextDeps];
12244 return callback;
12245 }
12246 function mountMemo(nextCreate, deps) {
12247 var hook = mountWorkInProgressHook();
12248 var nextDeps = deps === void 0 ? null : deps;
12249 var nextValue = nextCreate();
12250 hook.memoizedState = [nextValue, nextDeps];
12251 return nextValue;
12252 }
12253 function updateMemo(nextCreate, deps) {
12254 var hook = updateWorkInProgressHook();
12255 var nextDeps = deps === void 0 ? null : deps;
12256 var prevState = hook.memoizedState;
12257 if (prevState !== null) {
12258 if (nextDeps !== null) {
12259 var prevDeps = prevState[1];
12260 if (areHookInputsEqual(nextDeps, prevDeps)) {
12261 return prevState[0];
12262 }
12263 }
12264 }
12265 var nextValue = nextCreate();
12266 hook.memoizedState = [nextValue, nextDeps];
12267 return nextValue;
12268 }
12269 function mountDeferredValue(value) {
12270 var hook = mountWorkInProgressHook();
12271 hook.memoizedState = value;
12272 return value;
12273 }
12274 function updateDeferredValue(value) {
12275 var hook = updateWorkInProgressHook();
12276 var resolvedCurrentHook = currentHook;
12277 var prevValue = resolvedCurrentHook.memoizedState;
12278 return updateDeferredValueImpl(hook, prevValue, value);
12279 }
12280 function rerenderDeferredValue(value) {
12281 var hook = updateWorkInProgressHook();
12282 if (currentHook === null) {
12283 hook.memoizedState = value;
12284 return value;
12285 } else {
12286 var prevValue = currentHook.memoizedState;
12287 return updateDeferredValueImpl(hook, prevValue, value);
12288 }
12289 }
12290 function updateDeferredValueImpl(hook, prevValue, value) {
12291 var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
12292 if (shouldDeferValue) {
12293 if (!objectIs(value, prevValue)) {
12294 var deferredLane = claimNextTransitionLane();
12295 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
12296 markSkippedUpdateLanes(deferredLane);
12297 hook.baseState = true;
12298 }
12299 return prevValue;
12300 } else {
12301 if (hook.baseState) {
12302 hook.baseState = false;
12303 markWorkInProgressReceivedUpdate();
12304 }
12305 hook.memoizedState = value;
12306 return value;
12307 }
12308 }
12309 function startTransition(setPending, callback, options2) {
12310 var previousPriority = getCurrentUpdatePriority();
12311 setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
12312 setPending(true);
12313 var prevTransition = ReactCurrentBatchConfig$2.transition;
12314 ReactCurrentBatchConfig$2.transition = {};
12315 var currentTransition = ReactCurrentBatchConfig$2.transition;
12316 {
12317 ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
12318 }
12319 try {
12320 setPending(false);
12321 callback();
12322 } finally {
12323 setCurrentUpdatePriority(previousPriority);
12324 ReactCurrentBatchConfig$2.transition = prevTransition;
12325 {
12326 if (prevTransition === null && currentTransition._updatedFibers) {
12327 var updatedFibersCount = currentTransition._updatedFibers.size;
12328 if (updatedFibersCount > 10) {
12329 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.");
12330 }
12331 currentTransition._updatedFibers.clear();
12332 }
12333 }
12334 }
12335 }
12336 function mountTransition() {
12337 var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
12338 var start = startTransition.bind(null, setPending);
12339 var hook = mountWorkInProgressHook();
12340 hook.memoizedState = start;
12341 return [isPending, start];
12342 }
12343 function updateTransition() {
12344 var _updateState = updateState(), isPending = _updateState[0];
12345 var hook = updateWorkInProgressHook();
12346 var start = hook.memoizedState;
12347 return [isPending, start];
12348 }
12349 function rerenderTransition() {
12350 var _rerenderState = rerenderState(), isPending = _rerenderState[0];
12351 var hook = updateWorkInProgressHook();
12352 var start = hook.memoizedState;
12353 return [isPending, start];
12354 }
12355 var isUpdatingOpaqueValueInRenderPhase = false;
12356 function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
12357 {
12358 return isUpdatingOpaqueValueInRenderPhase;
12359 }
12360 }
12361 function mountId() {
12362 var hook = mountWorkInProgressHook();
12363 var root2 = getWorkInProgressRoot();
12364 var identifierPrefix = root2.identifierPrefix;
12365 var id;
12366 if (getIsHydrating()) {
12367 var treeId = getTreeId();
12368 id = ":" + identifierPrefix + "R" + treeId;
12369 var localId = localIdCounter++;
12370 if (localId > 0) {
12371 id += "H" + localId.toString(32);
12372 }
12373 id += ":";
12374 } else {
12375 var globalClientId = globalClientIdCounter++;
12376 id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
12377 }
12378 hook.memoizedState = id;
12379 return id;
12380 }
12381 function updateId() {
12382 var hook = updateWorkInProgressHook();
12383 var id = hook.memoizedState;
12384 return id;
12385 }
12386 function dispatchReducerAction(fiber, queue, action) {
12387 {
12388 if (typeof arguments[3] === "function") {
12389 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().");
12390 }
12391 }
12392 var lane = requestUpdateLane(fiber);
12393 var update = {
12394 lane,
12395 action,
12396 hasEagerState: false,
12397 eagerState: null,
12398 next: null
12399 };
12400 if (isRenderPhaseUpdate(fiber)) {
12401 enqueueRenderPhaseUpdate(queue, update);
12402 } else {
12403 var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
12404 if (root2 !== null) {
12405 var eventTime = requestEventTime();
12406 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
12407 entangleTransitionUpdate(root2, queue, lane);
12408 }
12409 }
12410 markUpdateInDevTools(fiber, lane);
12411 }
12412 function dispatchSetState(fiber, queue, action) {
12413 {
12414 if (typeof arguments[3] === "function") {
12415 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().");
12416 }
12417 }
12418 var lane = requestUpdateLane(fiber);
12419 var update = {
12420 lane,
12421 action,
12422 hasEagerState: false,
12423 eagerState: null,
12424 next: null
12425 };
12426 if (isRenderPhaseUpdate(fiber)) {
12427 enqueueRenderPhaseUpdate(queue, update);
12428 } else {
12429 var alternate = fiber.alternate;
12430 if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
12431 var lastRenderedReducer = queue.lastRenderedReducer;
12432 if (lastRenderedReducer !== null) {
12433 var prevDispatcher;
12434 {
12435 prevDispatcher = ReactCurrentDispatcher$1.current;
12436 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12437 }
12438 try {
12439 var currentState = queue.lastRenderedState;
12440 var eagerState = lastRenderedReducer(currentState, action);
12441 update.hasEagerState = true;
12442 update.eagerState = eagerState;
12443 if (objectIs(eagerState, currentState)) {
12444 enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
12445 return;
12446 }
12447 } catch (error2) {
12448 } finally {
12449 {
12450 ReactCurrentDispatcher$1.current = prevDispatcher;
12451 }
12452 }
12453 }
12454 }
12455 var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
12456 if (root2 !== null) {
12457 var eventTime = requestEventTime();
12458 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
12459 entangleTransitionUpdate(root2, queue, lane);
12460 }
12461 }
12462 markUpdateInDevTools(fiber, lane);
12463 }
12464 function isRenderPhaseUpdate(fiber) {
12465 var alternate = fiber.alternate;
12466 return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
12467 }
12468 function enqueueRenderPhaseUpdate(queue, update) {
12469 didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
12470 var pending = queue.pending;
12471 if (pending === null) {
12472 update.next = update;
12473 } else {
12474 update.next = pending.next;
12475 pending.next = update;
12476 }
12477 queue.pending = update;
12478 }
12479 function entangleTransitionUpdate(root2, queue, lane) {
12480 if (isTransitionLane(lane)) {
12481 var queueLanes = queue.lanes;
12482 queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
12483 var newQueueLanes = mergeLanes(queueLanes, lane);
12484 queue.lanes = newQueueLanes;
12485 markRootEntangled(root2, newQueueLanes);
12486 }
12487 }
12488 function markUpdateInDevTools(fiber, lane, action) {
12489 {
12490 markStateUpdateScheduled(fiber, lane);
12491 }
12492 }
12493 var ContextOnlyDispatcher = {
12494 readContext,
12495 useCallback: throwInvalidHookError,
12496 useContext: throwInvalidHookError,
12497 useEffect: throwInvalidHookError,
12498 useImperativeHandle: throwInvalidHookError,
12499 useInsertionEffect: throwInvalidHookError,
12500 useLayoutEffect: throwInvalidHookError,
12501 useMemo: throwInvalidHookError,
12502 useReducer: throwInvalidHookError,
12503 useRef: throwInvalidHookError,
12504 useState: throwInvalidHookError,
12505 useDebugValue: throwInvalidHookError,
12506 useDeferredValue: throwInvalidHookError,
12507 useTransition: throwInvalidHookError,
12508 useMutableSource: throwInvalidHookError,
12509 useSyncExternalStore: throwInvalidHookError,
12510 useId: throwInvalidHookError,
12511 unstable_isNewReconciler: enableNewReconciler
12512 };
12513 var HooksDispatcherOnMountInDEV = null;
12514 var HooksDispatcherOnMountWithHookTypesInDEV = null;
12515 var HooksDispatcherOnUpdateInDEV = null;
12516 var HooksDispatcherOnRerenderInDEV = null;
12517 var InvalidNestedHooksDispatcherOnMountInDEV = null;
12518 var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
12519 var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
12520 {
12521 var warnInvalidContextAccess = function() {
12522 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().");
12523 };
12524 var warnInvalidHookAccess = function() {
12525 error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
12526 };
12527 HooksDispatcherOnMountInDEV = {
12528 readContext: function(context) {
12529 return readContext(context);
12530 },
12531 useCallback: function(callback, deps) {
12532 currentHookNameInDev = "useCallback";
12533 mountHookTypesDev();
12534 checkDepsAreArrayDev(deps);
12535 return mountCallback(callback, deps);
12536 },
12537 useContext: function(context) {
12538 currentHookNameInDev = "useContext";
12539 mountHookTypesDev();
12540 return readContext(context);
12541 },
12542 useEffect: function(create, deps) {
12543 currentHookNameInDev = "useEffect";
12544 mountHookTypesDev();
12545 checkDepsAreArrayDev(deps);
12546 return mountEffect(create, deps);
12547 },
12548 useImperativeHandle: function(ref, create, deps) {
12549 currentHookNameInDev = "useImperativeHandle";
12550 mountHookTypesDev();
12551 checkDepsAreArrayDev(deps);
12552 return mountImperativeHandle(ref, create, deps);
12553 },
12554 useInsertionEffect: function(create, deps) {
12555 currentHookNameInDev = "useInsertionEffect";
12556 mountHookTypesDev();
12557 checkDepsAreArrayDev(deps);
12558 return mountInsertionEffect(create, deps);
12559 },
12560 useLayoutEffect: function(create, deps) {
12561 currentHookNameInDev = "useLayoutEffect";
12562 mountHookTypesDev();
12563 checkDepsAreArrayDev(deps);
12564 return mountLayoutEffect(create, deps);
12565 },
12566 useMemo: function(create, deps) {
12567 currentHookNameInDev = "useMemo";
12568 mountHookTypesDev();
12569 checkDepsAreArrayDev(deps);
12570 var prevDispatcher = ReactCurrentDispatcher$1.current;
12571 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12572 try {
12573 return mountMemo(create, deps);
12574 } finally {
12575 ReactCurrentDispatcher$1.current = prevDispatcher;
12576 }
12577 },
12578 useReducer: function(reducer, initialArg, init) {
12579 currentHookNameInDev = "useReducer";
12580 mountHookTypesDev();
12581 var prevDispatcher = ReactCurrentDispatcher$1.current;
12582 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12583 try {
12584 return mountReducer(reducer, initialArg, init);
12585 } finally {
12586 ReactCurrentDispatcher$1.current = prevDispatcher;
12587 }
12588 },
12589 useRef: function(initialValue) {
12590 currentHookNameInDev = "useRef";
12591 mountHookTypesDev();
12592 return mountRef(initialValue);
12593 },
12594 useState: function(initialState) {
12595 currentHookNameInDev = "useState";
12596 mountHookTypesDev();
12597 var prevDispatcher = ReactCurrentDispatcher$1.current;
12598 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12599 try {
12600 return mountState(initialState);
12601 } finally {
12602 ReactCurrentDispatcher$1.current = prevDispatcher;
12603 }
12604 },
12605 useDebugValue: function(value, formatterFn) {
12606 currentHookNameInDev = "useDebugValue";
12607 mountHookTypesDev();
12608 return mountDebugValue();
12609 },
12610 useDeferredValue: function(value) {
12611 currentHookNameInDev = "useDeferredValue";
12612 mountHookTypesDev();
12613 return mountDeferredValue(value);
12614 },
12615 useTransition: function() {
12616 currentHookNameInDev = "useTransition";
12617 mountHookTypesDev();
12618 return mountTransition();
12619 },
12620 useMutableSource: function(source, getSnapshot, subscribe) {
12621 currentHookNameInDev = "useMutableSource";
12622 mountHookTypesDev();
12623 return mountMutableSource();
12624 },
12625 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12626 currentHookNameInDev = "useSyncExternalStore";
12627 mountHookTypesDev();
12628 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
12629 },
12630 useId: function() {
12631 currentHookNameInDev = "useId";
12632 mountHookTypesDev();
12633 return mountId();
12634 },
12635 unstable_isNewReconciler: enableNewReconciler
12636 };
12637 HooksDispatcherOnMountWithHookTypesInDEV = {
12638 readContext: function(context) {
12639 return readContext(context);
12640 },
12641 useCallback: function(callback, deps) {
12642 currentHookNameInDev = "useCallback";
12643 updateHookTypesDev();
12644 return mountCallback(callback, deps);
12645 },
12646 useContext: function(context) {
12647 currentHookNameInDev = "useContext";
12648 updateHookTypesDev();
12649 return readContext(context);
12650 },
12651 useEffect: function(create, deps) {
12652 currentHookNameInDev = "useEffect";
12653 updateHookTypesDev();
12654 return mountEffect(create, deps);
12655 },
12656 useImperativeHandle: function(ref, create, deps) {
12657 currentHookNameInDev = "useImperativeHandle";
12658 updateHookTypesDev();
12659 return mountImperativeHandle(ref, create, deps);
12660 },
12661 useInsertionEffect: function(create, deps) {
12662 currentHookNameInDev = "useInsertionEffect";
12663 updateHookTypesDev();
12664 return mountInsertionEffect(create, deps);
12665 },
12666 useLayoutEffect: function(create, deps) {
12667 currentHookNameInDev = "useLayoutEffect";
12668 updateHookTypesDev();
12669 return mountLayoutEffect(create, deps);
12670 },
12671 useMemo: function(create, deps) {
12672 currentHookNameInDev = "useMemo";
12673 updateHookTypesDev();
12674 var prevDispatcher = ReactCurrentDispatcher$1.current;
12675 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12676 try {
12677 return mountMemo(create, deps);
12678 } finally {
12679 ReactCurrentDispatcher$1.current = prevDispatcher;
12680 }
12681 },
12682 useReducer: function(reducer, initialArg, init) {
12683 currentHookNameInDev = "useReducer";
12684 updateHookTypesDev();
12685 var prevDispatcher = ReactCurrentDispatcher$1.current;
12686 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12687 try {
12688 return mountReducer(reducer, initialArg, init);
12689 } finally {
12690 ReactCurrentDispatcher$1.current = prevDispatcher;
12691 }
12692 },
12693 useRef: function(initialValue) {
12694 currentHookNameInDev = "useRef";
12695 updateHookTypesDev();
12696 return mountRef(initialValue);
12697 },
12698 useState: function(initialState) {
12699 currentHookNameInDev = "useState";
12700 updateHookTypesDev();
12701 var prevDispatcher = ReactCurrentDispatcher$1.current;
12702 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12703 try {
12704 return mountState(initialState);
12705 } finally {
12706 ReactCurrentDispatcher$1.current = prevDispatcher;
12707 }
12708 },
12709 useDebugValue: function(value, formatterFn) {
12710 currentHookNameInDev = "useDebugValue";
12711 updateHookTypesDev();
12712 return mountDebugValue();
12713 },
12714 useDeferredValue: function(value) {
12715 currentHookNameInDev = "useDeferredValue";
12716 updateHookTypesDev();
12717 return mountDeferredValue(value);
12718 },
12719 useTransition: function() {
12720 currentHookNameInDev = "useTransition";
12721 updateHookTypesDev();
12722 return mountTransition();
12723 },
12724 useMutableSource: function(source, getSnapshot, subscribe) {
12725 currentHookNameInDev = "useMutableSource";
12726 updateHookTypesDev();
12727 return mountMutableSource();
12728 },
12729 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12730 currentHookNameInDev = "useSyncExternalStore";
12731 updateHookTypesDev();
12732 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
12733 },
12734 useId: function() {
12735 currentHookNameInDev = "useId";
12736 updateHookTypesDev();
12737 return mountId();
12738 },
12739 unstable_isNewReconciler: enableNewReconciler
12740 };
12741 HooksDispatcherOnUpdateInDEV = {
12742 readContext: function(context) {
12743 return readContext(context);
12744 },
12745 useCallback: function(callback, deps) {
12746 currentHookNameInDev = "useCallback";
12747 updateHookTypesDev();
12748 return updateCallback(callback, deps);
12749 },
12750 useContext: function(context) {
12751 currentHookNameInDev = "useContext";
12752 updateHookTypesDev();
12753 return readContext(context);
12754 },
12755 useEffect: function(create, deps) {
12756 currentHookNameInDev = "useEffect";
12757 updateHookTypesDev();
12758 return updateEffect(create, deps);
12759 },
12760 useImperativeHandle: function(ref, create, deps) {
12761 currentHookNameInDev = "useImperativeHandle";
12762 updateHookTypesDev();
12763 return updateImperativeHandle(ref, create, deps);
12764 },
12765 useInsertionEffect: function(create, deps) {
12766 currentHookNameInDev = "useInsertionEffect";
12767 updateHookTypesDev();
12768 return updateInsertionEffect(create, deps);
12769 },
12770 useLayoutEffect: function(create, deps) {
12771 currentHookNameInDev = "useLayoutEffect";
12772 updateHookTypesDev();
12773 return updateLayoutEffect(create, deps);
12774 },
12775 useMemo: function(create, deps) {
12776 currentHookNameInDev = "useMemo";
12777 updateHookTypesDev();
12778 var prevDispatcher = ReactCurrentDispatcher$1.current;
12779 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12780 try {
12781 return updateMemo(create, deps);
12782 } finally {
12783 ReactCurrentDispatcher$1.current = prevDispatcher;
12784 }
12785 },
12786 useReducer: function(reducer, initialArg, init) {
12787 currentHookNameInDev = "useReducer";
12788 updateHookTypesDev();
12789 var prevDispatcher = ReactCurrentDispatcher$1.current;
12790 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12791 try {
12792 return updateReducer(reducer, initialArg, init);
12793 } finally {
12794 ReactCurrentDispatcher$1.current = prevDispatcher;
12795 }
12796 },
12797 useRef: function(initialValue) {
12798 currentHookNameInDev = "useRef";
12799 updateHookTypesDev();
12800 return updateRef();
12801 },
12802 useState: function(initialState) {
12803 currentHookNameInDev = "useState";
12804 updateHookTypesDev();
12805 var prevDispatcher = ReactCurrentDispatcher$1.current;
12806 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12807 try {
12808 return updateState(initialState);
12809 } finally {
12810 ReactCurrentDispatcher$1.current = prevDispatcher;
12811 }
12812 },
12813 useDebugValue: function(value, formatterFn) {
12814 currentHookNameInDev = "useDebugValue";
12815 updateHookTypesDev();
12816 return updateDebugValue();
12817 },
12818 useDeferredValue: function(value) {
12819 currentHookNameInDev = "useDeferredValue";
12820 updateHookTypesDev();
12821 return updateDeferredValue(value);
12822 },
12823 useTransition: function() {
12824 currentHookNameInDev = "useTransition";
12825 updateHookTypesDev();
12826 return updateTransition();
12827 },
12828 useMutableSource: function(source, getSnapshot, subscribe) {
12829 currentHookNameInDev = "useMutableSource";
12830 updateHookTypesDev();
12831 return updateMutableSource();
12832 },
12833 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12834 currentHookNameInDev = "useSyncExternalStore";
12835 updateHookTypesDev();
12836 return updateSyncExternalStore(subscribe, getSnapshot);
12837 },
12838 useId: function() {
12839 currentHookNameInDev = "useId";
12840 updateHookTypesDev();
12841 return updateId();
12842 },
12843 unstable_isNewReconciler: enableNewReconciler
12844 };
12845 HooksDispatcherOnRerenderInDEV = {
12846 readContext: function(context) {
12847 return readContext(context);
12848 },
12849 useCallback: function(callback, deps) {
12850 currentHookNameInDev = "useCallback";
12851 updateHookTypesDev();
12852 return updateCallback(callback, deps);
12853 },
12854 useContext: function(context) {
12855 currentHookNameInDev = "useContext";
12856 updateHookTypesDev();
12857 return readContext(context);
12858 },
12859 useEffect: function(create, deps) {
12860 currentHookNameInDev = "useEffect";
12861 updateHookTypesDev();
12862 return updateEffect(create, deps);
12863 },
12864 useImperativeHandle: function(ref, create, deps) {
12865 currentHookNameInDev = "useImperativeHandle";
12866 updateHookTypesDev();
12867 return updateImperativeHandle(ref, create, deps);
12868 },
12869 useInsertionEffect: function(create, deps) {
12870 currentHookNameInDev = "useInsertionEffect";
12871 updateHookTypesDev();
12872 return updateInsertionEffect(create, deps);
12873 },
12874 useLayoutEffect: function(create, deps) {
12875 currentHookNameInDev = "useLayoutEffect";
12876 updateHookTypesDev();
12877 return updateLayoutEffect(create, deps);
12878 },
12879 useMemo: function(create, deps) {
12880 currentHookNameInDev = "useMemo";
12881 updateHookTypesDev();
12882 var prevDispatcher = ReactCurrentDispatcher$1.current;
12883 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12884 try {
12885 return updateMemo(create, deps);
12886 } finally {
12887 ReactCurrentDispatcher$1.current = prevDispatcher;
12888 }
12889 },
12890 useReducer: function(reducer, initialArg, init) {
12891 currentHookNameInDev = "useReducer";
12892 updateHookTypesDev();
12893 var prevDispatcher = ReactCurrentDispatcher$1.current;
12894 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12895 try {
12896 return rerenderReducer(reducer, initialArg, init);
12897 } finally {
12898 ReactCurrentDispatcher$1.current = prevDispatcher;
12899 }
12900 },
12901 useRef: function(initialValue) {
12902 currentHookNameInDev = "useRef";
12903 updateHookTypesDev();
12904 return updateRef();
12905 },
12906 useState: function(initialState) {
12907 currentHookNameInDev = "useState";
12908 updateHookTypesDev();
12909 var prevDispatcher = ReactCurrentDispatcher$1.current;
12910 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12911 try {
12912 return rerenderState(initialState);
12913 } finally {
12914 ReactCurrentDispatcher$1.current = prevDispatcher;
12915 }
12916 },
12917 useDebugValue: function(value, formatterFn) {
12918 currentHookNameInDev = "useDebugValue";
12919 updateHookTypesDev();
12920 return updateDebugValue();
12921 },
12922 useDeferredValue: function(value) {
12923 currentHookNameInDev = "useDeferredValue";
12924 updateHookTypesDev();
12925 return rerenderDeferredValue(value);
12926 },
12927 useTransition: function() {
12928 currentHookNameInDev = "useTransition";
12929 updateHookTypesDev();
12930 return rerenderTransition();
12931 },
12932 useMutableSource: function(source, getSnapshot, subscribe) {
12933 currentHookNameInDev = "useMutableSource";
12934 updateHookTypesDev();
12935 return updateMutableSource();
12936 },
12937 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12938 currentHookNameInDev = "useSyncExternalStore";
12939 updateHookTypesDev();
12940 return updateSyncExternalStore(subscribe, getSnapshot);
12941 },
12942 useId: function() {
12943 currentHookNameInDev = "useId";
12944 updateHookTypesDev();
12945 return updateId();
12946 },
12947 unstable_isNewReconciler: enableNewReconciler
12948 };
12949 InvalidNestedHooksDispatcherOnMountInDEV = {
12950 readContext: function(context) {
12951 warnInvalidContextAccess();
12952 return readContext(context);
12953 },
12954 useCallback: function(callback, deps) {
12955 currentHookNameInDev = "useCallback";
12956 warnInvalidHookAccess();
12957 mountHookTypesDev();
12958 return mountCallback(callback, deps);
12959 },
12960 useContext: function(context) {
12961 currentHookNameInDev = "useContext";
12962 warnInvalidHookAccess();
12963 mountHookTypesDev();
12964 return readContext(context);
12965 },
12966 useEffect: function(create, deps) {
12967 currentHookNameInDev = "useEffect";
12968 warnInvalidHookAccess();
12969 mountHookTypesDev();
12970 return mountEffect(create, deps);
12971 },
12972 useImperativeHandle: function(ref, create, deps) {
12973 currentHookNameInDev = "useImperativeHandle";
12974 warnInvalidHookAccess();
12975 mountHookTypesDev();
12976 return mountImperativeHandle(ref, create, deps);
12977 },
12978 useInsertionEffect: function(create, deps) {
12979 currentHookNameInDev = "useInsertionEffect";
12980 warnInvalidHookAccess();
12981 mountHookTypesDev();
12982 return mountInsertionEffect(create, deps);
12983 },
12984 useLayoutEffect: function(create, deps) {
12985 currentHookNameInDev = "useLayoutEffect";
12986 warnInvalidHookAccess();
12987 mountHookTypesDev();
12988 return mountLayoutEffect(create, deps);
12989 },
12990 useMemo: function(create, deps) {
12991 currentHookNameInDev = "useMemo";
12992 warnInvalidHookAccess();
12993 mountHookTypesDev();
12994 var prevDispatcher = ReactCurrentDispatcher$1.current;
12995 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12996 try {
12997 return mountMemo(create, deps);
12998 } finally {
12999 ReactCurrentDispatcher$1.current = prevDispatcher;
13000 }
13001 },
13002 useReducer: function(reducer, initialArg, init) {
13003 currentHookNameInDev = "useReducer";
13004 warnInvalidHookAccess();
13005 mountHookTypesDev();
13006 var prevDispatcher = ReactCurrentDispatcher$1.current;
13007 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
13008 try {
13009 return mountReducer(reducer, initialArg, init);
13010 } finally {
13011 ReactCurrentDispatcher$1.current = prevDispatcher;
13012 }
13013 },
13014 useRef: function(initialValue) {
13015 currentHookNameInDev = "useRef";
13016 warnInvalidHookAccess();
13017 mountHookTypesDev();
13018 return mountRef(initialValue);
13019 },
13020 useState: function(initialState) {
13021 currentHookNameInDev = "useState";
13022 warnInvalidHookAccess();
13023 mountHookTypesDev();
13024 var prevDispatcher = ReactCurrentDispatcher$1.current;
13025 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
13026 try {
13027 return mountState(initialState);
13028 } finally {
13029 ReactCurrentDispatcher$1.current = prevDispatcher;
13030 }
13031 },
13032 useDebugValue: function(value, formatterFn) {
13033 currentHookNameInDev = "useDebugValue";
13034 warnInvalidHookAccess();
13035 mountHookTypesDev();
13036 return mountDebugValue();
13037 },
13038 useDeferredValue: function(value) {
13039 currentHookNameInDev = "useDeferredValue";
13040 warnInvalidHookAccess();
13041 mountHookTypesDev();
13042 return mountDeferredValue(value);
13043 },
13044 useTransition: function() {
13045 currentHookNameInDev = "useTransition";
13046 warnInvalidHookAccess();
13047 mountHookTypesDev();
13048 return mountTransition();
13049 },
13050 useMutableSource: function(source, getSnapshot, subscribe) {
13051 currentHookNameInDev = "useMutableSource";
13052 warnInvalidHookAccess();
13053 mountHookTypesDev();
13054 return mountMutableSource();
13055 },
13056 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13057 currentHookNameInDev = "useSyncExternalStore";
13058 warnInvalidHookAccess();
13059 mountHookTypesDev();
13060 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
13061 },
13062 useId: function() {
13063 currentHookNameInDev = "useId";
13064 warnInvalidHookAccess();
13065 mountHookTypesDev();
13066 return mountId();
13067 },
13068 unstable_isNewReconciler: enableNewReconciler
13069 };
13070 InvalidNestedHooksDispatcherOnUpdateInDEV = {
13071 readContext: function(context) {
13072 warnInvalidContextAccess();
13073 return readContext(context);
13074 },
13075 useCallback: function(callback, deps) {
13076 currentHookNameInDev = "useCallback";
13077 warnInvalidHookAccess();
13078 updateHookTypesDev();
13079 return updateCallback(callback, deps);
13080 },
13081 useContext: function(context) {
13082 currentHookNameInDev = "useContext";
13083 warnInvalidHookAccess();
13084 updateHookTypesDev();
13085 return readContext(context);
13086 },
13087 useEffect: function(create, deps) {
13088 currentHookNameInDev = "useEffect";
13089 warnInvalidHookAccess();
13090 updateHookTypesDev();
13091 return updateEffect(create, deps);
13092 },
13093 useImperativeHandle: function(ref, create, deps) {
13094 currentHookNameInDev = "useImperativeHandle";
13095 warnInvalidHookAccess();
13096 updateHookTypesDev();
13097 return updateImperativeHandle(ref, create, deps);
13098 },
13099 useInsertionEffect: function(create, deps) {
13100 currentHookNameInDev = "useInsertionEffect";
13101 warnInvalidHookAccess();
13102 updateHookTypesDev();
13103 return updateInsertionEffect(create, deps);
13104 },
13105 useLayoutEffect: function(create, deps) {
13106 currentHookNameInDev = "useLayoutEffect";
13107 warnInvalidHookAccess();
13108 updateHookTypesDev();
13109 return updateLayoutEffect(create, deps);
13110 },
13111 useMemo: function(create, deps) {
13112 currentHookNameInDev = "useMemo";
13113 warnInvalidHookAccess();
13114 updateHookTypesDev();
13115 var prevDispatcher = ReactCurrentDispatcher$1.current;
13116 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13117 try {
13118 return updateMemo(create, deps);
13119 } finally {
13120 ReactCurrentDispatcher$1.current = prevDispatcher;
13121 }
13122 },
13123 useReducer: function(reducer, initialArg, init) {
13124 currentHookNameInDev = "useReducer";
13125 warnInvalidHookAccess();
13126 updateHookTypesDev();
13127 var prevDispatcher = ReactCurrentDispatcher$1.current;
13128 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13129 try {
13130 return updateReducer(reducer, initialArg, init);
13131 } finally {
13132 ReactCurrentDispatcher$1.current = prevDispatcher;
13133 }
13134 },
13135 useRef: function(initialValue) {
13136 currentHookNameInDev = "useRef";
13137 warnInvalidHookAccess();
13138 updateHookTypesDev();
13139 return updateRef();
13140 },
13141 useState: function(initialState) {
13142 currentHookNameInDev = "useState";
13143 warnInvalidHookAccess();
13144 updateHookTypesDev();
13145 var prevDispatcher = ReactCurrentDispatcher$1.current;
13146 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13147 try {
13148 return updateState(initialState);
13149 } finally {
13150 ReactCurrentDispatcher$1.current = prevDispatcher;
13151 }
13152 },
13153 useDebugValue: function(value, formatterFn) {
13154 currentHookNameInDev = "useDebugValue";
13155 warnInvalidHookAccess();
13156 updateHookTypesDev();
13157 return updateDebugValue();
13158 },
13159 useDeferredValue: function(value) {
13160 currentHookNameInDev = "useDeferredValue";
13161 warnInvalidHookAccess();
13162 updateHookTypesDev();
13163 return updateDeferredValue(value);
13164 },
13165 useTransition: function() {
13166 currentHookNameInDev = "useTransition";
13167 warnInvalidHookAccess();
13168 updateHookTypesDev();
13169 return updateTransition();
13170 },
13171 useMutableSource: function(source, getSnapshot, subscribe) {
13172 currentHookNameInDev = "useMutableSource";
13173 warnInvalidHookAccess();
13174 updateHookTypesDev();
13175 return updateMutableSource();
13176 },
13177 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13178 currentHookNameInDev = "useSyncExternalStore";
13179 warnInvalidHookAccess();
13180 updateHookTypesDev();
13181 return updateSyncExternalStore(subscribe, getSnapshot);
13182 },
13183 useId: function() {
13184 currentHookNameInDev = "useId";
13185 warnInvalidHookAccess();
13186 updateHookTypesDev();
13187 return updateId();
13188 },
13189 unstable_isNewReconciler: enableNewReconciler
13190 };
13191 InvalidNestedHooksDispatcherOnRerenderInDEV = {
13192 readContext: function(context) {
13193 warnInvalidContextAccess();
13194 return readContext(context);
13195 },
13196 useCallback: function(callback, deps) {
13197 currentHookNameInDev = "useCallback";
13198 warnInvalidHookAccess();
13199 updateHookTypesDev();
13200 return updateCallback(callback, deps);
13201 },
13202 useContext: function(context) {
13203 currentHookNameInDev = "useContext";
13204 warnInvalidHookAccess();
13205 updateHookTypesDev();
13206 return readContext(context);
13207 },
13208 useEffect: function(create, deps) {
13209 currentHookNameInDev = "useEffect";
13210 warnInvalidHookAccess();
13211 updateHookTypesDev();
13212 return updateEffect(create, deps);
13213 },
13214 useImperativeHandle: function(ref, create, deps) {
13215 currentHookNameInDev = "useImperativeHandle";
13216 warnInvalidHookAccess();
13217 updateHookTypesDev();
13218 return updateImperativeHandle(ref, create, deps);
13219 },
13220 useInsertionEffect: function(create, deps) {
13221 currentHookNameInDev = "useInsertionEffect";
13222 warnInvalidHookAccess();
13223 updateHookTypesDev();
13224 return updateInsertionEffect(create, deps);
13225 },
13226 useLayoutEffect: function(create, deps) {
13227 currentHookNameInDev = "useLayoutEffect";
13228 warnInvalidHookAccess();
13229 updateHookTypesDev();
13230 return updateLayoutEffect(create, deps);
13231 },
13232 useMemo: function(create, deps) {
13233 currentHookNameInDev = "useMemo";
13234 warnInvalidHookAccess();
13235 updateHookTypesDev();
13236 var prevDispatcher = ReactCurrentDispatcher$1.current;
13237 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13238 try {
13239 return updateMemo(create, deps);
13240 } finally {
13241 ReactCurrentDispatcher$1.current = prevDispatcher;
13242 }
13243 },
13244 useReducer: function(reducer, initialArg, init) {
13245 currentHookNameInDev = "useReducer";
13246 warnInvalidHookAccess();
13247 updateHookTypesDev();
13248 var prevDispatcher = ReactCurrentDispatcher$1.current;
13249 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13250 try {
13251 return rerenderReducer(reducer, initialArg, init);
13252 } finally {
13253 ReactCurrentDispatcher$1.current = prevDispatcher;
13254 }
13255 },
13256 useRef: function(initialValue) {
13257 currentHookNameInDev = "useRef";
13258 warnInvalidHookAccess();
13259 updateHookTypesDev();
13260 return updateRef();
13261 },
13262 useState: function(initialState) {
13263 currentHookNameInDev = "useState";
13264 warnInvalidHookAccess();
13265 updateHookTypesDev();
13266 var prevDispatcher = ReactCurrentDispatcher$1.current;
13267 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13268 try {
13269 return rerenderState(initialState);
13270 } finally {
13271 ReactCurrentDispatcher$1.current = prevDispatcher;
13272 }
13273 },
13274 useDebugValue: function(value, formatterFn) {
13275 currentHookNameInDev = "useDebugValue";
13276 warnInvalidHookAccess();
13277 updateHookTypesDev();
13278 return updateDebugValue();
13279 },
13280 useDeferredValue: function(value) {
13281 currentHookNameInDev = "useDeferredValue";
13282 warnInvalidHookAccess();
13283 updateHookTypesDev();
13284 return rerenderDeferredValue(value);
13285 },
13286 useTransition: function() {
13287 currentHookNameInDev = "useTransition";
13288 warnInvalidHookAccess();
13289 updateHookTypesDev();
13290 return rerenderTransition();
13291 },
13292 useMutableSource: function(source, getSnapshot, subscribe) {
13293 currentHookNameInDev = "useMutableSource";
13294 warnInvalidHookAccess();
13295 updateHookTypesDev();
13296 return updateMutableSource();
13297 },
13298 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13299 currentHookNameInDev = "useSyncExternalStore";
13300 warnInvalidHookAccess();
13301 updateHookTypesDev();
13302 return updateSyncExternalStore(subscribe, getSnapshot);
13303 },
13304 useId: function() {
13305 currentHookNameInDev = "useId";
13306 warnInvalidHookAccess();
13307 updateHookTypesDev();
13308 return updateId();
13309 },
13310 unstable_isNewReconciler: enableNewReconciler
13311 };
13312 }
13313 var now$1 = Scheduler.unstable_now;
13314 var commitTime = 0;
13315 var layoutEffectStartTime = -1;
13316 var profilerStartTime = -1;
13317 var passiveEffectStartTime = -1;
13318 var currentUpdateIsNested = false;
13319 var nestedUpdateScheduled = false;
13320 function isCurrentUpdateNested() {
13321 return currentUpdateIsNested;
13322 }
13323 function markNestedUpdateScheduled() {
13324 {
13325 nestedUpdateScheduled = true;
13326 }
13327 }
13328 function resetNestedUpdateFlag() {
13329 {
13330 currentUpdateIsNested = false;
13331 nestedUpdateScheduled = false;
13332 }
13333 }
13334 function syncNestedUpdateFlag() {
13335 {
13336 currentUpdateIsNested = nestedUpdateScheduled;
13337 nestedUpdateScheduled = false;
13338 }
13339 }
13340 function getCommitTime() {
13341 return commitTime;
13342 }
13343 function recordCommitTime() {
13344 commitTime = now$1();
13345 }
13346 function startProfilerTimer(fiber) {
13347 profilerStartTime = now$1();
13348 if (fiber.actualStartTime < 0) {
13349 fiber.actualStartTime = now$1();
13350 }
13351 }
13352 function stopProfilerTimerIfRunning(fiber) {
13353 profilerStartTime = -1;
13354 }
13355 function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
13356 if (profilerStartTime >= 0) {
13357 var elapsedTime = now$1() - profilerStartTime;
13358 fiber.actualDuration += elapsedTime;
13359 if (overrideBaseTime) {
13360 fiber.selfBaseDuration = elapsedTime;
13361 }
13362 profilerStartTime = -1;
13363 }
13364 }
13365 function recordLayoutEffectDuration(fiber) {
13366 if (layoutEffectStartTime >= 0) {
13367 var elapsedTime = now$1() - layoutEffectStartTime;
13368 layoutEffectStartTime = -1;
13369 var parentFiber = fiber.return;
13370 while (parentFiber !== null) {
13371 switch (parentFiber.tag) {
13372 case HostRoot:
13373 var root2 = parentFiber.stateNode;
13374 root2.effectDuration += elapsedTime;
13375 return;
13376 case Profiler:
13377 var parentStateNode = parentFiber.stateNode;
13378 parentStateNode.effectDuration += elapsedTime;
13379 return;
13380 }
13381 parentFiber = parentFiber.return;
13382 }
13383 }
13384 }
13385 function recordPassiveEffectDuration(fiber) {
13386 if (passiveEffectStartTime >= 0) {
13387 var elapsedTime = now$1() - passiveEffectStartTime;
13388 passiveEffectStartTime = -1;
13389 var parentFiber = fiber.return;
13390 while (parentFiber !== null) {
13391 switch (parentFiber.tag) {
13392 case HostRoot:
13393 var root2 = parentFiber.stateNode;
13394 if (root2 !== null) {
13395 root2.passiveEffectDuration += elapsedTime;
13396 }
13397 return;
13398 case Profiler:
13399 var parentStateNode = parentFiber.stateNode;
13400 if (parentStateNode !== null) {
13401 parentStateNode.passiveEffectDuration += elapsedTime;
13402 }
13403 return;
13404 }
13405 parentFiber = parentFiber.return;
13406 }
13407 }
13408 }
13409 function startLayoutEffectTimer() {
13410 layoutEffectStartTime = now$1();
13411 }
13412 function startPassiveEffectTimer() {
13413 passiveEffectStartTime = now$1();
13414 }
13415 function transferActualDuration(fiber) {
13416 var child = fiber.child;
13417 while (child) {
13418 fiber.actualDuration += child.actualDuration;
13419 child = child.sibling;
13420 }
13421 }
13422 function resolveDefaultProps(Component, baseProps) {
13423 if (Component && Component.defaultProps) {
13424 var props = assign({}, baseProps);
13425 var defaultProps = Component.defaultProps;
13426 for (var propName in defaultProps) {
13427 if (props[propName] === void 0) {
13428 props[propName] = defaultProps[propName];
13429 }
13430 }
13431 return props;
13432 }
13433 return baseProps;
13434 }
13435 var fakeInternalInstance = {};
13436 var didWarnAboutStateAssignmentForComponent;
13437 var didWarnAboutUninitializedState;
13438 var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
13439 var didWarnAboutLegacyLifecyclesAndDerivedState;
13440 var didWarnAboutUndefinedDerivedState;
13441 var warnOnUndefinedDerivedState;
13442 var warnOnInvalidCallback;
13443 var didWarnAboutDirectlyAssigningPropsToState;
13444 var didWarnAboutContextTypeAndContextTypes;
13445 var didWarnAboutInvalidateContextType;
13446 var didWarnAboutLegacyContext$1;
13447 {
13448 didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
13449 didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
13450 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
13451 didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
13452 didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
13453 didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
13454 didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
13455 didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
13456 didWarnAboutLegacyContext$1 = /* @__PURE__ */ new Set();
13457 var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
13458 warnOnInvalidCallback = function(callback, callerName) {
13459 if (callback === null || typeof callback === "function") {
13460 return;
13461 }
13462 var key = callerName + "_" + callback;
13463 if (!didWarnOnInvalidCallback.has(key)) {
13464 didWarnOnInvalidCallback.add(key);
13465 error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
13466 }
13467 };
13468 warnOnUndefinedDerivedState = function(type, partialState) {
13469 if (partialState === void 0) {
13470 var componentName = getComponentNameFromType(type) || "Component";
13471 if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
13472 didWarnAboutUndefinedDerivedState.add(componentName);
13473 error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
13474 }
13475 }
13476 };
13477 Object.defineProperty(fakeInternalInstance, "_processChildContext", {
13478 enumerable: false,
13479 value: function() {
13480 throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
13481 }
13482 });
13483 Object.freeze(fakeInternalInstance);
13484 }
13485 function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
13486 var prevState = workInProgress2.memoizedState;
13487 var partialState = getDerivedStateFromProps(nextProps, prevState);
13488 {
13489 if (workInProgress2.mode & StrictLegacyMode) {
13490 setIsStrictModeForDevtools(true);
13491 try {
13492 partialState = getDerivedStateFromProps(nextProps, prevState);
13493 } finally {
13494 setIsStrictModeForDevtools(false);
13495 }
13496 }
13497 warnOnUndefinedDerivedState(ctor, partialState);
13498 }
13499 var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState);
13500 workInProgress2.memoizedState = memoizedState;
13501 if (workInProgress2.lanes === NoLanes) {
13502 var updateQueue = workInProgress2.updateQueue;
13503 updateQueue.baseState = memoizedState;
13504 }
13505 }
13506 var classComponentUpdater = {
13507 isMounted,
13508 enqueueSetState: function(inst, payload, callback) {
13509 var fiber = get(inst);
13510 var eventTime = requestEventTime();
13511 var lane = requestUpdateLane(fiber);
13512 var update = createUpdate(eventTime, lane);
13513 update.payload = payload;
13514 if (callback !== void 0 && callback !== null) {
13515 {
13516 warnOnInvalidCallback(callback, "setState");
13517 }
13518 update.callback = callback;
13519 }
13520 var root2 = enqueueUpdate(fiber, update, lane);
13521 if (root2 !== null) {
13522 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13523 entangleTransitions(root2, fiber, lane);
13524 }
13525 {
13526 markStateUpdateScheduled(fiber, lane);
13527 }
13528 },
13529 enqueueReplaceState: function(inst, payload, callback) {
13530 var fiber = get(inst);
13531 var eventTime = requestEventTime();
13532 var lane = requestUpdateLane(fiber);
13533 var update = createUpdate(eventTime, lane);
13534 update.tag = ReplaceState;
13535 update.payload = payload;
13536 if (callback !== void 0 && callback !== null) {
13537 {
13538 warnOnInvalidCallback(callback, "replaceState");
13539 }
13540 update.callback = callback;
13541 }
13542 var root2 = enqueueUpdate(fiber, update, lane);
13543 if (root2 !== null) {
13544 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13545 entangleTransitions(root2, fiber, lane);
13546 }
13547 {
13548 markStateUpdateScheduled(fiber, lane);
13549 }
13550 },
13551 enqueueForceUpdate: function(inst, callback) {
13552 var fiber = get(inst);
13553 var eventTime = requestEventTime();
13554 var lane = requestUpdateLane(fiber);
13555 var update = createUpdate(eventTime, lane);
13556 update.tag = ForceUpdate;
13557 if (callback !== void 0 && callback !== null) {
13558 {
13559 warnOnInvalidCallback(callback, "forceUpdate");
13560 }
13561 update.callback = callback;
13562 }
13563 var root2 = enqueueUpdate(fiber, update, lane);
13564 if (root2 !== null) {
13565 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13566 entangleTransitions(root2, fiber, lane);
13567 }
13568 {
13569 markForceUpdateScheduled(fiber, lane);
13570 }
13571 }
13572 };
13573 function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
13574 var instance = workInProgress2.stateNode;
13575 if (typeof instance.shouldComponentUpdate === "function") {
13576 var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
13577 {
13578 if (workInProgress2.mode & StrictLegacyMode) {
13579 setIsStrictModeForDevtools(true);
13580 try {
13581 shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
13582 } finally {
13583 setIsStrictModeForDevtools(false);
13584 }
13585 }
13586 if (shouldUpdate === void 0) {
13587 error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
13588 }
13589 }
13590 return shouldUpdate;
13591 }
13592 if (ctor.prototype && ctor.prototype.isPureReactComponent) {
13593 return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
13594 }
13595 return true;
13596 }
13597 function checkClassInstance(workInProgress2, ctor, newProps) {
13598 var instance = workInProgress2.stateNode;
13599 {
13600 var name = getComponentNameFromType(ctor) || "Component";
13601 var renderPresent = instance.render;
13602 if (!renderPresent) {
13603 if (ctor.prototype && typeof ctor.prototype.render === "function") {
13604 error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
13605 } else {
13606 error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
13607 }
13608 }
13609 if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
13610 error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name);
13611 }
13612 if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
13613 error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name);
13614 }
13615 if (instance.propTypes) {
13616 error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
13617 }
13618 if (instance.contextType) {
13619 error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
13620 }
13621 {
13622 if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
13623 // this one.
13624 (workInProgress2.mode & StrictLegacyMode) === NoMode) {
13625 didWarnAboutLegacyContext$1.add(ctor);
13626 error("%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead\n\n.Learn more about this warning here: https://reactjs.org/link/legacy-context", name);
13627 }
13628 if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
13629 // this one.
13630 (workInProgress2.mode & StrictLegacyMode) === NoMode) {
13631 didWarnAboutLegacyContext$1.add(ctor);
13632 error("%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context", name);
13633 }
13634 if (instance.contextTypes) {
13635 error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
13636 }
13637 if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
13638 didWarnAboutContextTypeAndContextTypes.add(ctor);
13639 error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
13640 }
13641 }
13642 if (typeof instance.componentShouldUpdate === "function") {
13643 error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name);
13644 }
13645 if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
13646 error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component");
13647 }
13648 if (typeof instance.componentDidUnmount === "function") {
13649 error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
13650 }
13651 if (typeof instance.componentDidReceiveProps === "function") {
13652 error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name);
13653 }
13654 if (typeof instance.componentWillRecieveProps === "function") {
13655 error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
13656 }
13657 if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
13658 error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
13659 }
13660 var hasMutatedProps = instance.props !== newProps;
13661 if (instance.props !== void 0 && hasMutatedProps) {
13662 error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
13663 }
13664 if (instance.defaultProps) {
13665 error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name);
13666 }
13667 if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
13668 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
13669 error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor));
13670 }
13671 if (typeof instance.getDerivedStateFromProps === "function") {
13672 error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
13673 }
13674 if (typeof instance.getDerivedStateFromError === "function") {
13675 error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
13676 }
13677 if (typeof ctor.getSnapshotBeforeUpdate === "function") {
13678 error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
13679 }
13680 var _state = instance.state;
13681 if (_state && (typeof _state !== "object" || isArray(_state))) {
13682 error("%s.state: must be set to an object or null", name);
13683 }
13684 if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
13685 error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
13686 }
13687 }
13688 }
13689 function adoptClassInstance(workInProgress2, instance) {
13690 instance.updater = classComponentUpdater;
13691 workInProgress2.stateNode = instance;
13692 set(instance, workInProgress2);
13693 {
13694 instance._reactInternalInstance = fakeInternalInstance;
13695 }
13696 }
13697 function constructClassInstance(workInProgress2, ctor, props) {
13698 var isLegacyContextConsumer = false;
13699 var unmaskedContext = emptyContextObject;
13700 var context = emptyContextObject;
13701 var contextType = ctor.contextType;
13702 {
13703 if ("contextType" in ctor) {
13704 var isValid = (
13705 // Allow null for conditional declaration
13706 contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0
13707 );
13708 if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
13709 didWarnAboutInvalidateContextType.add(ctor);
13710 var addendum = "";
13711 if (contextType === void 0) {
13712 addendum = " 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.";
13713 } else if (typeof contextType !== "object") {
13714 addendum = " However, it is set to a " + typeof contextType + ".";
13715 } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
13716 addendum = " Did you accidentally pass the Context.Provider instead?";
13717 } else if (contextType._context !== void 0) {
13718 addendum = " Did you accidentally pass the Context.Consumer instead?";
13719 } else {
13720 addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
13721 }
13722 error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum);
13723 }
13724 }
13725 }
13726 if (typeof contextType === "object" && contextType !== null) {
13727 context = readContext(contextType);
13728 } else {
13729 unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13730 var contextTypes = ctor.contextTypes;
13731 isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
13732 context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
13733 }
13734 var instance = new ctor(props, context);
13735 {
13736 if (workInProgress2.mode & StrictLegacyMode) {
13737 setIsStrictModeForDevtools(true);
13738 try {
13739 instance = new ctor(props, context);
13740 } finally {
13741 setIsStrictModeForDevtools(false);
13742 }
13743 }
13744 }
13745 var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
13746 adoptClassInstance(workInProgress2, instance);
13747 {
13748 if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
13749 var componentName = getComponentNameFromType(ctor) || "Component";
13750 if (!didWarnAboutUninitializedState.has(componentName)) {
13751 didWarnAboutUninitializedState.add(componentName);
13752 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.", componentName, instance.state === null ? "null" : "undefined", componentName);
13753 }
13754 }
13755 if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
13756 var foundWillMountName = null;
13757 var foundWillReceivePropsName = null;
13758 var foundWillUpdateName = null;
13759 if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
13760 foundWillMountName = "componentWillMount";
13761 } else if (typeof instance.UNSAFE_componentWillMount === "function") {
13762 foundWillMountName = "UNSAFE_componentWillMount";
13763 }
13764 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
13765 foundWillReceivePropsName = "componentWillReceiveProps";
13766 } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
13767 foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
13768 }
13769 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
13770 foundWillUpdateName = "componentWillUpdate";
13771 } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
13772 foundWillUpdateName = "UNSAFE_componentWillUpdate";
13773 }
13774 if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
13775 var _componentName = getComponentNameFromType(ctor) || "Component";
13776 var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
13777 if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
13778 didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
13779 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://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : "");
13780 }
13781 }
13782 }
13783 }
13784 if (isLegacyContextConsumer) {
13785 cacheContext(workInProgress2, unmaskedContext, context);
13786 }
13787 return instance;
13788 }
13789 function callComponentWillMount(workInProgress2, instance) {
13790 var oldState = instance.state;
13791 if (typeof instance.componentWillMount === "function") {
13792 instance.componentWillMount();
13793 }
13794 if (typeof instance.UNSAFE_componentWillMount === "function") {
13795 instance.UNSAFE_componentWillMount();
13796 }
13797 if (oldState !== instance.state) {
13798 {
13799 error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress2) || "Component");
13800 }
13801 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
13802 }
13803 }
13804 function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
13805 var oldState = instance.state;
13806 if (typeof instance.componentWillReceiveProps === "function") {
13807 instance.componentWillReceiveProps(newProps, nextContext);
13808 }
13809 if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
13810 instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
13811 }
13812 if (instance.state !== oldState) {
13813 {
13814 var componentName = getComponentNameFromFiber(workInProgress2) || "Component";
13815 if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
13816 didWarnAboutStateAssignmentForComponent.add(componentName);
13817 error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
13818 }
13819 }
13820 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
13821 }
13822 }
13823 function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
13824 {
13825 checkClassInstance(workInProgress2, ctor, newProps);
13826 }
13827 var instance = workInProgress2.stateNode;
13828 instance.props = newProps;
13829 instance.state = workInProgress2.memoizedState;
13830 instance.refs = {};
13831 initializeUpdateQueue(workInProgress2);
13832 var contextType = ctor.contextType;
13833 if (typeof contextType === "object" && contextType !== null) {
13834 instance.context = readContext(contextType);
13835 } else {
13836 var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13837 instance.context = getMaskedContext(workInProgress2, unmaskedContext);
13838 }
13839 {
13840 if (instance.state === newProps) {
13841 var componentName = getComponentNameFromType(ctor) || "Component";
13842 if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
13843 didWarnAboutDirectlyAssigningPropsToState.add(componentName);
13844 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.", componentName);
13845 }
13846 }
13847 if (workInProgress2.mode & StrictLegacyMode) {
13848 ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
13849 }
13850 {
13851 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
13852 }
13853 }
13854 instance.state = workInProgress2.memoizedState;
13855 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13856 if (typeof getDerivedStateFromProps === "function") {
13857 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
13858 instance.state = workInProgress2.memoizedState;
13859 }
13860 if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
13861 callComponentWillMount(workInProgress2, instance);
13862 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13863 instance.state = workInProgress2.memoizedState;
13864 }
13865 if (typeof instance.componentDidMount === "function") {
13866 var fiberFlags = Update;
13867 {
13868 fiberFlags |= LayoutStatic;
13869 }
13870 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13871 fiberFlags |= MountLayoutDev;
13872 }
13873 workInProgress2.flags |= fiberFlags;
13874 }
13875 }
13876 function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
13877 var instance = workInProgress2.stateNode;
13878 var oldProps = workInProgress2.memoizedProps;
13879 instance.props = oldProps;
13880 var oldContext = instance.context;
13881 var contextType = ctor.contextType;
13882 var nextContext = emptyContextObject;
13883 if (typeof contextType === "object" && contextType !== null) {
13884 nextContext = readContext(contextType);
13885 } else {
13886 var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13887 nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
13888 }
13889 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13890 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
13891 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
13892 if (oldProps !== newProps || oldContext !== nextContext) {
13893 callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
13894 }
13895 }
13896 resetHasForceUpdateBeforeProcessing();
13897 var oldState = workInProgress2.memoizedState;
13898 var newState = instance.state = oldState;
13899 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13900 newState = workInProgress2.memoizedState;
13901 if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
13902 if (typeof instance.componentDidMount === "function") {
13903 var fiberFlags = Update;
13904 {
13905 fiberFlags |= LayoutStatic;
13906 }
13907 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13908 fiberFlags |= MountLayoutDev;
13909 }
13910 workInProgress2.flags |= fiberFlags;
13911 }
13912 return false;
13913 }
13914 if (typeof getDerivedStateFromProps === "function") {
13915 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
13916 newState = workInProgress2.memoizedState;
13917 }
13918 var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
13919 if (shouldUpdate) {
13920 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
13921 if (typeof instance.componentWillMount === "function") {
13922 instance.componentWillMount();
13923 }
13924 if (typeof instance.UNSAFE_componentWillMount === "function") {
13925 instance.UNSAFE_componentWillMount();
13926 }
13927 }
13928 if (typeof instance.componentDidMount === "function") {
13929 var _fiberFlags = Update;
13930 {
13931 _fiberFlags |= LayoutStatic;
13932 }
13933 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13934 _fiberFlags |= MountLayoutDev;
13935 }
13936 workInProgress2.flags |= _fiberFlags;
13937 }
13938 } else {
13939 if (typeof instance.componentDidMount === "function") {
13940 var _fiberFlags2 = Update;
13941 {
13942 _fiberFlags2 |= LayoutStatic;
13943 }
13944 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13945 _fiberFlags2 |= MountLayoutDev;
13946 }
13947 workInProgress2.flags |= _fiberFlags2;
13948 }
13949 workInProgress2.memoizedProps = newProps;
13950 workInProgress2.memoizedState = newState;
13951 }
13952 instance.props = newProps;
13953 instance.state = newState;
13954 instance.context = nextContext;
13955 return shouldUpdate;
13956 }
13957 function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
13958 var instance = workInProgress2.stateNode;
13959 cloneUpdateQueue(current2, workInProgress2);
13960 var unresolvedOldProps = workInProgress2.memoizedProps;
13961 var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
13962 instance.props = oldProps;
13963 var unresolvedNewProps = workInProgress2.pendingProps;
13964 var oldContext = instance.context;
13965 var contextType = ctor.contextType;
13966 var nextContext = emptyContextObject;
13967 if (typeof contextType === "object" && contextType !== null) {
13968 nextContext = readContext(contextType);
13969 } else {
13970 var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13971 nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
13972 }
13973 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13974 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
13975 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
13976 if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
13977 callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
13978 }
13979 }
13980 resetHasForceUpdateBeforeProcessing();
13981 var oldState = workInProgress2.memoizedState;
13982 var newState = instance.state = oldState;
13983 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13984 newState = workInProgress2.memoizedState;
13985 if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) {
13986 if (typeof instance.componentDidUpdate === "function") {
13987 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
13988 workInProgress2.flags |= Update;
13989 }
13990 }
13991 if (typeof instance.getSnapshotBeforeUpdate === "function") {
13992 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
13993 workInProgress2.flags |= Snapshot;
13994 }
13995 }
13996 return false;
13997 }
13998 if (typeof getDerivedStateFromProps === "function") {
13999 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
14000 newState = workInProgress2.memoizedState;
14001 }
14002 var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) || // TODO: In some cases, we'll end up checking if context has changed twice,
14003 // both before and after `shouldComponentUpdate` has been called. Not ideal,
14004 // but I'm loath to refactor this function. This only happens for memoized
14005 // components so it's not that common.
14006 enableLazyContextPropagation;
14007 if (shouldUpdate) {
14008 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
14009 if (typeof instance.componentWillUpdate === "function") {
14010 instance.componentWillUpdate(newProps, newState, nextContext);
14011 }
14012 if (typeof instance.UNSAFE_componentWillUpdate === "function") {
14013 instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
14014 }
14015 }
14016 if (typeof instance.componentDidUpdate === "function") {
14017 workInProgress2.flags |= Update;
14018 }
14019 if (typeof instance.getSnapshotBeforeUpdate === "function") {
14020 workInProgress2.flags |= Snapshot;
14021 }
14022 } else {
14023 if (typeof instance.componentDidUpdate === "function") {
14024 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
14025 workInProgress2.flags |= Update;
14026 }
14027 }
14028 if (typeof instance.getSnapshotBeforeUpdate === "function") {
14029 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
14030 workInProgress2.flags |= Snapshot;
14031 }
14032 }
14033 workInProgress2.memoizedProps = newProps;
14034 workInProgress2.memoizedState = newState;
14035 }
14036 instance.props = newProps;
14037 instance.state = newState;
14038 instance.context = nextContext;
14039 return shouldUpdate;
14040 }
14041 function createCapturedValueAtFiber(value, source) {
14042 return {
14043 value,
14044 source,
14045 stack: getStackByFiberInDevAndProd(source),
14046 digest: null
14047 };
14048 }
14049 function createCapturedValue(value, digest, stack) {
14050 return {
14051 value,
14052 source: null,
14053 stack: stack != null ? stack : null,
14054 digest: digest != null ? digest : null
14055 };
14056 }
14057 function showErrorDialog(boundary, errorInfo) {
14058 return true;
14059 }
14060 function logCapturedError(boundary, errorInfo) {
14061 try {
14062 var logError = showErrorDialog(boundary, errorInfo);
14063 if (logError === false) {
14064 return;
14065 }
14066 var error2 = errorInfo.value;
14067 if (true) {
14068 var source = errorInfo.source;
14069 var stack = errorInfo.stack;
14070 var componentStack = stack !== null ? stack : "";
14071 if (error2 != null && error2._suppressLogging) {
14072 if (boundary.tag === ClassComponent) {
14073 return;
14074 }
14075 console["error"](error2);
14076 }
14077 var componentName = source ? getComponentNameFromFiber(source) : null;
14078 var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
14079 var errorBoundaryMessage;
14080 if (boundary.tag === HostRoot) {
14081 errorBoundaryMessage = "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
14082 } else {
14083 var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
14084 errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
14085 }
14086 var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
14087 console["error"](combinedMessage);
14088 } else {
14089 console["error"](error2);
14090 }
14091 } catch (e) {
14092 setTimeout(function() {
14093 throw e;
14094 });
14095 }
14096 }
14097 var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
14098 function createRootErrorUpdate(fiber, errorInfo, lane) {
14099 var update = createUpdate(NoTimestamp, lane);
14100 update.tag = CaptureUpdate;
14101 update.payload = {
14102 element: null
14103 };
14104 var error2 = errorInfo.value;
14105 update.callback = function() {
14106 onUncaughtError(error2);
14107 logCapturedError(fiber, errorInfo);
14108 };
14109 return update;
14110 }
14111 function createClassErrorUpdate(fiber, errorInfo, lane) {
14112 var update = createUpdate(NoTimestamp, lane);
14113 update.tag = CaptureUpdate;
14114 var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
14115 if (typeof getDerivedStateFromError === "function") {
14116 var error$1 = errorInfo.value;
14117 update.payload = function() {
14118 return getDerivedStateFromError(error$1);
14119 };
14120 update.callback = function() {
14121 {
14122 markFailedErrorBoundaryForHotReloading(fiber);
14123 }
14124 logCapturedError(fiber, errorInfo);
14125 };
14126 }
14127 var inst = fiber.stateNode;
14128 if (inst !== null && typeof inst.componentDidCatch === "function") {
14129 update.callback = function callback() {
14130 {
14131 markFailedErrorBoundaryForHotReloading(fiber);
14132 }
14133 logCapturedError(fiber, errorInfo);
14134 if (typeof getDerivedStateFromError !== "function") {
14135 markLegacyErrorBoundaryAsFailed(this);
14136 }
14137 var error$12 = errorInfo.value;
14138 var stack = errorInfo.stack;
14139 this.componentDidCatch(error$12, {
14140 componentStack: stack !== null ? stack : ""
14141 });
14142 {
14143 if (typeof getDerivedStateFromError !== "function") {
14144 if (!includesSomeLane(fiber.lanes, SyncLane)) {
14145 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");
14146 }
14147 }
14148 }
14149 };
14150 }
14151 return update;
14152 }
14153 function attachPingListener(root2, wakeable, lanes) {
14154 var pingCache = root2.pingCache;
14155 var threadIDs;
14156 if (pingCache === null) {
14157 pingCache = root2.pingCache = new PossiblyWeakMap$1();
14158 threadIDs = /* @__PURE__ */ new Set();
14159 pingCache.set(wakeable, threadIDs);
14160 } else {
14161 threadIDs = pingCache.get(wakeable);
14162 if (threadIDs === void 0) {
14163 threadIDs = /* @__PURE__ */ new Set();
14164 pingCache.set(wakeable, threadIDs);
14165 }
14166 }
14167 if (!threadIDs.has(lanes)) {
14168 threadIDs.add(lanes);
14169 var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
14170 {
14171 if (isDevToolsPresent) {
14172 restorePendingUpdaters(root2, lanes);
14173 }
14174 }
14175 wakeable.then(ping, ping);
14176 }
14177 }
14178 function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
14179 var wakeables = suspenseBoundary.updateQueue;
14180 if (wakeables === null) {
14181 var updateQueue = /* @__PURE__ */ new Set();
14182 updateQueue.add(wakeable);
14183 suspenseBoundary.updateQueue = updateQueue;
14184 } else {
14185 wakeables.add(wakeable);
14186 }
14187 }
14188 function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
14189 var tag = sourceFiber.tag;
14190 if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
14191 var currentSource = sourceFiber.alternate;
14192 if (currentSource) {
14193 sourceFiber.updateQueue = currentSource.updateQueue;
14194 sourceFiber.memoizedState = currentSource.memoizedState;
14195 sourceFiber.lanes = currentSource.lanes;
14196 } else {
14197 sourceFiber.updateQueue = null;
14198 sourceFiber.memoizedState = null;
14199 }
14200 }
14201 }
14202 function getNearestSuspenseBoundaryToCapture(returnFiber) {
14203 var node = returnFiber;
14204 do {
14205 if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
14206 return node;
14207 }
14208 node = node.return;
14209 } while (node !== null);
14210 return null;
14211 }
14212 function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
14213 if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
14214 if (suspenseBoundary === returnFiber) {
14215 suspenseBoundary.flags |= ShouldCapture;
14216 } else {
14217 suspenseBoundary.flags |= DidCapture;
14218 sourceFiber.flags |= ForceUpdateForLegacySuspense;
14219 sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
14220 if (sourceFiber.tag === ClassComponent) {
14221 var currentSourceFiber = sourceFiber.alternate;
14222 if (currentSourceFiber === null) {
14223 sourceFiber.tag = IncompleteClassComponent;
14224 } else {
14225 var update = createUpdate(NoTimestamp, SyncLane);
14226 update.tag = ForceUpdate;
14227 enqueueUpdate(sourceFiber, update, SyncLane);
14228 }
14229 }
14230 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
14231 }
14232 return suspenseBoundary;
14233 }
14234 suspenseBoundary.flags |= ShouldCapture;
14235 suspenseBoundary.lanes = rootRenderLanes;
14236 return suspenseBoundary;
14237 }
14238 function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
14239 sourceFiber.flags |= Incomplete;
14240 {
14241 if (isDevToolsPresent) {
14242 restorePendingUpdaters(root2, rootRenderLanes);
14243 }
14244 }
14245 if (value !== null && typeof value === "object" && typeof value.then === "function") {
14246 var wakeable = value;
14247 resetSuspendedComponent(sourceFiber);
14248 {
14249 if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
14250 markDidThrowWhileHydratingDEV();
14251 }
14252 }
14253 var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
14254 if (suspenseBoundary !== null) {
14255 suspenseBoundary.flags &= ~ForceClientRender;
14256 markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
14257 if (suspenseBoundary.mode & ConcurrentMode) {
14258 attachPingListener(root2, wakeable, rootRenderLanes);
14259 }
14260 attachRetryListener(suspenseBoundary, root2, wakeable);
14261 return;
14262 } else {
14263 if (!includesSyncLane(rootRenderLanes)) {
14264 attachPingListener(root2, wakeable, rootRenderLanes);
14265 renderDidSuspendDelayIfPossible();
14266 return;
14267 }
14268 var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
14269 value = uncaughtSuspenseError;
14270 }
14271 } else {
14272 if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
14273 markDidThrowWhileHydratingDEV();
14274 var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
14275 if (_suspenseBoundary !== null) {
14276 if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
14277 _suspenseBoundary.flags |= ForceClientRender;
14278 }
14279 markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
14280 queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
14281 return;
14282 }
14283 }
14284 }
14285 value = createCapturedValueAtFiber(value, sourceFiber);
14286 renderDidError(value);
14287 var workInProgress2 = returnFiber;
14288 do {
14289 switch (workInProgress2.tag) {
14290 case HostRoot: {
14291 var _errorInfo = value;
14292 workInProgress2.flags |= ShouldCapture;
14293 var lane = pickArbitraryLane(rootRenderLanes);
14294 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
14295 var update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
14296 enqueueCapturedUpdate(workInProgress2, update);
14297 return;
14298 }
14299 case ClassComponent:
14300 var errorInfo = value;
14301 var ctor = workInProgress2.type;
14302 var instance = workInProgress2.stateNode;
14303 if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
14304 workInProgress2.flags |= ShouldCapture;
14305 var _lane = pickArbitraryLane(rootRenderLanes);
14306 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
14307 var _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
14308 enqueueCapturedUpdate(workInProgress2, _update);
14309 return;
14310 }
14311 break;
14312 }
14313 workInProgress2 = workInProgress2.return;
14314 } while (workInProgress2 !== null);
14315 }
14316 function getSuspendedCache() {
14317 {
14318 return null;
14319 }
14320 }
14321 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
14322 var didReceiveUpdate = false;
14323 var didWarnAboutBadClass;
14324 var didWarnAboutModulePatternComponent;
14325 var didWarnAboutContextTypeOnFunctionComponent;
14326 var didWarnAboutGetDerivedStateOnFunctionComponent;
14327 var didWarnAboutFunctionRefs;
14328 var didWarnAboutReassigningProps;
14329 var didWarnAboutRevealOrder;
14330 var didWarnAboutTailOptions;
14331 var didWarnAboutDefaultPropsOnFunctionComponent;
14332 {
14333 didWarnAboutBadClass = {};
14334 didWarnAboutModulePatternComponent = {};
14335 didWarnAboutContextTypeOnFunctionComponent = {};
14336 didWarnAboutGetDerivedStateOnFunctionComponent = {};
14337 didWarnAboutFunctionRefs = {};
14338 didWarnAboutReassigningProps = false;
14339 didWarnAboutRevealOrder = {};
14340 didWarnAboutTailOptions = {};
14341 didWarnAboutDefaultPropsOnFunctionComponent = {};
14342 }
14343 function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
14344 if (current2 === null) {
14345 workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14346 } else {
14347 workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
14348 }
14349 }
14350 function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
14351 workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
14352 workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14353 }
14354 function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) {
14355 {
14356 if (workInProgress2.type !== workInProgress2.elementType) {
14357 var innerPropTypes = Component.propTypes;
14358 if (innerPropTypes) {
14359 checkPropTypes(
14360 innerPropTypes,
14361 nextProps,
14362 // Resolved props
14363 "prop",
14364 getComponentNameFromType(Component)
14365 );
14366 }
14367 }
14368 }
14369 var render2 = Component.render;
14370 var ref = workInProgress2.ref;
14371 var nextChildren;
14372 var hasId;
14373 prepareToReadContext(workInProgress2, renderLanes2);
14374 {
14375 markComponentRenderStarted(workInProgress2);
14376 }
14377 {
14378 ReactCurrentOwner$1.current = workInProgress2;
14379 setIsRendering(true);
14380 nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
14381 hasId = checkDidRenderIdHook();
14382 if (workInProgress2.mode & StrictLegacyMode) {
14383 setIsStrictModeForDevtools(true);
14384 try {
14385 nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
14386 hasId = checkDidRenderIdHook();
14387 } finally {
14388 setIsStrictModeForDevtools(false);
14389 }
14390 }
14391 setIsRendering(false);
14392 }
14393 {
14394 markComponentRenderStopped();
14395 }
14396 if (current2 !== null && !didReceiveUpdate) {
14397 bailoutHooks(current2, workInProgress2, renderLanes2);
14398 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14399 }
14400 if (getIsHydrating() && hasId) {
14401 pushMaterializedTreeId(workInProgress2);
14402 }
14403 workInProgress2.flags |= PerformedWork;
14404 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14405 return workInProgress2.child;
14406 }
14407 function updateMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14408 if (current2 === null) {
14409 var type = Component.type;
14410 if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
14411 Component.defaultProps === void 0) {
14412 var resolvedType = type;
14413 {
14414 resolvedType = resolveFunctionForHotReloading(type);
14415 }
14416 workInProgress2.tag = SimpleMemoComponent;
14417 workInProgress2.type = resolvedType;
14418 {
14419 validateFunctionComponentInDev(workInProgress2, type);
14420 }
14421 return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
14422 }
14423 {
14424 var innerPropTypes = type.propTypes;
14425 if (innerPropTypes) {
14426 checkPropTypes(
14427 innerPropTypes,
14428 nextProps,
14429 // Resolved props
14430 "prop",
14431 getComponentNameFromType(type)
14432 );
14433 }
14434 if (Component.defaultProps !== void 0) {
14435 var componentName = getComponentNameFromType(type) || "Unknown";
14436 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
14437 error("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", componentName);
14438 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
14439 }
14440 }
14441 }
14442 var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
14443 child.ref = workInProgress2.ref;
14444 child.return = workInProgress2;
14445 workInProgress2.child = child;
14446 return child;
14447 }
14448 {
14449 var _type = Component.type;
14450 var _innerPropTypes = _type.propTypes;
14451 if (_innerPropTypes) {
14452 checkPropTypes(
14453 _innerPropTypes,
14454 nextProps,
14455 // Resolved props
14456 "prop",
14457 getComponentNameFromType(_type)
14458 );
14459 }
14460 }
14461 var currentChild = current2.child;
14462 var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
14463 if (!hasScheduledUpdateOrContext) {
14464 var prevProps = currentChild.memoizedProps;
14465 var compare = Component.compare;
14466 compare = compare !== null ? compare : shallowEqual;
14467 if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
14468 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14469 }
14470 }
14471 workInProgress2.flags |= PerformedWork;
14472 var newChild = createWorkInProgress(currentChild, nextProps);
14473 newChild.ref = workInProgress2.ref;
14474 newChild.return = workInProgress2;
14475 workInProgress2.child = newChild;
14476 return newChild;
14477 }
14478 function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14479 {
14480 if (workInProgress2.type !== workInProgress2.elementType) {
14481 var outerMemoType = workInProgress2.elementType;
14482 if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
14483 var lazyComponent = outerMemoType;
14484 var payload = lazyComponent._payload;
14485 var init = lazyComponent._init;
14486 try {
14487 outerMemoType = init(payload);
14488 } catch (x) {
14489 outerMemoType = null;
14490 }
14491 var outerPropTypes = outerMemoType && outerMemoType.propTypes;
14492 if (outerPropTypes) {
14493 checkPropTypes(
14494 outerPropTypes,
14495 nextProps,
14496 // Resolved (SimpleMemoComponent has no defaultProps)
14497 "prop",
14498 getComponentNameFromType(outerMemoType)
14499 );
14500 }
14501 }
14502 }
14503 }
14504 if (current2 !== null) {
14505 var prevProps = current2.memoizedProps;
14506 if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
14507 workInProgress2.type === current2.type) {
14508 didReceiveUpdate = false;
14509 workInProgress2.pendingProps = nextProps = prevProps;
14510 if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
14511 workInProgress2.lanes = current2.lanes;
14512 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14513 } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
14514 didReceiveUpdate = true;
14515 }
14516 }
14517 }
14518 return updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2);
14519 }
14520 function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
14521 var nextProps = workInProgress2.pendingProps;
14522 var nextChildren = nextProps.children;
14523 var prevState = current2 !== null ? current2.memoizedState : null;
14524 if (nextProps.mode === "hidden" || enableLegacyHidden) {
14525 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
14526 var nextState = {
14527 baseLanes: NoLanes,
14528 cachePool: null,
14529 transitions: null
14530 };
14531 workInProgress2.memoizedState = nextState;
14532 pushRenderLanes(workInProgress2, renderLanes2);
14533 } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
14534 var spawnedCachePool = null;
14535 var nextBaseLanes;
14536 if (prevState !== null) {
14537 var prevBaseLanes = prevState.baseLanes;
14538 nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
14539 } else {
14540 nextBaseLanes = renderLanes2;
14541 }
14542 workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
14543 var _nextState = {
14544 baseLanes: nextBaseLanes,
14545 cachePool: spawnedCachePool,
14546 transitions: null
14547 };
14548 workInProgress2.memoizedState = _nextState;
14549 workInProgress2.updateQueue = null;
14550 pushRenderLanes(workInProgress2, nextBaseLanes);
14551 return null;
14552 } else {
14553 var _nextState2 = {
14554 baseLanes: NoLanes,
14555 cachePool: null,
14556 transitions: null
14557 };
14558 workInProgress2.memoizedState = _nextState2;
14559 var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
14560 pushRenderLanes(workInProgress2, subtreeRenderLanes2);
14561 }
14562 } else {
14563 var _subtreeRenderLanes;
14564 if (prevState !== null) {
14565 _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
14566 workInProgress2.memoizedState = null;
14567 } else {
14568 _subtreeRenderLanes = renderLanes2;
14569 }
14570 pushRenderLanes(workInProgress2, _subtreeRenderLanes);
14571 }
14572 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14573 return workInProgress2.child;
14574 }
14575 function updateFragment(current2, workInProgress2, renderLanes2) {
14576 var nextChildren = workInProgress2.pendingProps;
14577 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14578 return workInProgress2.child;
14579 }
14580 function updateMode(current2, workInProgress2, renderLanes2) {
14581 var nextChildren = workInProgress2.pendingProps.children;
14582 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14583 return workInProgress2.child;
14584 }
14585 function updateProfiler(current2, workInProgress2, renderLanes2) {
14586 {
14587 workInProgress2.flags |= Update;
14588 {
14589 var stateNode = workInProgress2.stateNode;
14590 stateNode.effectDuration = 0;
14591 stateNode.passiveEffectDuration = 0;
14592 }
14593 }
14594 var nextProps = workInProgress2.pendingProps;
14595 var nextChildren = nextProps.children;
14596 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14597 return workInProgress2.child;
14598 }
14599 function markRef(current2, workInProgress2) {
14600 var ref = workInProgress2.ref;
14601 if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
14602 workInProgress2.flags |= Ref;
14603 {
14604 workInProgress2.flags |= RefStatic;
14605 }
14606 }
14607 }
14608 function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14609 {
14610 if (workInProgress2.type !== workInProgress2.elementType) {
14611 var innerPropTypes = Component.propTypes;
14612 if (innerPropTypes) {
14613 checkPropTypes(
14614 innerPropTypes,
14615 nextProps,
14616 // Resolved props
14617 "prop",
14618 getComponentNameFromType(Component)
14619 );
14620 }
14621 }
14622 }
14623 var context;
14624 {
14625 var unmaskedContext = getUnmaskedContext(workInProgress2, Component, true);
14626 context = getMaskedContext(workInProgress2, unmaskedContext);
14627 }
14628 var nextChildren;
14629 var hasId;
14630 prepareToReadContext(workInProgress2, renderLanes2);
14631 {
14632 markComponentRenderStarted(workInProgress2);
14633 }
14634 {
14635 ReactCurrentOwner$1.current = workInProgress2;
14636 setIsRendering(true);
14637 nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
14638 hasId = checkDidRenderIdHook();
14639 if (workInProgress2.mode & StrictLegacyMode) {
14640 setIsStrictModeForDevtools(true);
14641 try {
14642 nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
14643 hasId = checkDidRenderIdHook();
14644 } finally {
14645 setIsStrictModeForDevtools(false);
14646 }
14647 }
14648 setIsRendering(false);
14649 }
14650 {
14651 markComponentRenderStopped();
14652 }
14653 if (current2 !== null && !didReceiveUpdate) {
14654 bailoutHooks(current2, workInProgress2, renderLanes2);
14655 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14656 }
14657 if (getIsHydrating() && hasId) {
14658 pushMaterializedTreeId(workInProgress2);
14659 }
14660 workInProgress2.flags |= PerformedWork;
14661 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14662 return workInProgress2.child;
14663 }
14664 function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14665 {
14666 switch (shouldError(workInProgress2)) {
14667 case false: {
14668 var _instance = workInProgress2.stateNode;
14669 var ctor = workInProgress2.type;
14670 var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
14671 var state = tempInstance.state;
14672 _instance.updater.enqueueSetState(_instance, state, null);
14673 break;
14674 }
14675 case true: {
14676 workInProgress2.flags |= DidCapture;
14677 workInProgress2.flags |= ShouldCapture;
14678 var error$1 = new Error("Simulated error coming from DevTools");
14679 var lane = pickArbitraryLane(renderLanes2);
14680 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
14681 var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
14682 enqueueCapturedUpdate(workInProgress2, update);
14683 break;
14684 }
14685 }
14686 if (workInProgress2.type !== workInProgress2.elementType) {
14687 var innerPropTypes = Component.propTypes;
14688 if (innerPropTypes) {
14689 checkPropTypes(
14690 innerPropTypes,
14691 nextProps,
14692 // Resolved props
14693 "prop",
14694 getComponentNameFromType(Component)
14695 );
14696 }
14697 }
14698 }
14699 var hasContext;
14700 if (isContextProvider(Component)) {
14701 hasContext = true;
14702 pushContextProvider(workInProgress2);
14703 } else {
14704 hasContext = false;
14705 }
14706 prepareToReadContext(workInProgress2, renderLanes2);
14707 var instance = workInProgress2.stateNode;
14708 var shouldUpdate;
14709 if (instance === null) {
14710 resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
14711 constructClassInstance(workInProgress2, Component, nextProps);
14712 mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14713 shouldUpdate = true;
14714 } else if (current2 === null) {
14715 shouldUpdate = resumeMountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14716 } else {
14717 shouldUpdate = updateClassInstance(current2, workInProgress2, Component, nextProps, renderLanes2);
14718 }
14719 var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2);
14720 {
14721 var inst = workInProgress2.stateNode;
14722 if (shouldUpdate && inst.props !== nextProps) {
14723 if (!didWarnAboutReassigningProps) {
14724 error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromFiber(workInProgress2) || "a component");
14725 }
14726 didWarnAboutReassigningProps = true;
14727 }
14728 }
14729 return nextUnitOfWork;
14730 }
14731 function finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2) {
14732 markRef(current2, workInProgress2);
14733 var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
14734 if (!shouldUpdate && !didCaptureError) {
14735 if (hasContext) {
14736 invalidateContextProvider(workInProgress2, Component, false);
14737 }
14738 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14739 }
14740 var instance = workInProgress2.stateNode;
14741 ReactCurrentOwner$1.current = workInProgress2;
14742 var nextChildren;
14743 if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") {
14744 nextChildren = null;
14745 {
14746 stopProfilerTimerIfRunning();
14747 }
14748 } else {
14749 {
14750 markComponentRenderStarted(workInProgress2);
14751 }
14752 {
14753 setIsRendering(true);
14754 nextChildren = instance.render();
14755 if (workInProgress2.mode & StrictLegacyMode) {
14756 setIsStrictModeForDevtools(true);
14757 try {
14758 instance.render();
14759 } finally {
14760 setIsStrictModeForDevtools(false);
14761 }
14762 }
14763 setIsRendering(false);
14764 }
14765 {
14766 markComponentRenderStopped();
14767 }
14768 }
14769 workInProgress2.flags |= PerformedWork;
14770 if (current2 !== null && didCaptureError) {
14771 forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
14772 } else {
14773 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14774 }
14775 workInProgress2.memoizedState = instance.state;
14776 if (hasContext) {
14777 invalidateContextProvider(workInProgress2, Component, true);
14778 }
14779 return workInProgress2.child;
14780 }
14781 function pushHostRootContext(workInProgress2) {
14782 var root2 = workInProgress2.stateNode;
14783 if (root2.pendingContext) {
14784 pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
14785 } else if (root2.context) {
14786 pushTopLevelContextObject(workInProgress2, root2.context, false);
14787 }
14788 pushHostContainer(workInProgress2, root2.containerInfo);
14789 }
14790 function updateHostRoot(current2, workInProgress2, renderLanes2) {
14791 pushHostRootContext(workInProgress2);
14792 if (current2 === null) {
14793 throw new Error("Should have a current fiber. This is a bug in React.");
14794 }
14795 var nextProps = workInProgress2.pendingProps;
14796 var prevState = workInProgress2.memoizedState;
14797 var prevChildren = prevState.element;
14798 cloneUpdateQueue(current2, workInProgress2);
14799 processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
14800 var nextState = workInProgress2.memoizedState;
14801 var root2 = workInProgress2.stateNode;
14802 var nextChildren = nextState.element;
14803 if (prevState.isDehydrated) {
14804 var overrideState = {
14805 element: nextChildren,
14806 isDehydrated: false,
14807 cache: nextState.cache,
14808 pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
14809 transitions: nextState.transitions
14810 };
14811 var updateQueue = workInProgress2.updateQueue;
14812 updateQueue.baseState = overrideState;
14813 workInProgress2.memoizedState = overrideState;
14814 if (workInProgress2.flags & ForceClientRender) {
14815 var recoverableError = createCapturedValueAtFiber(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress2);
14816 return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
14817 } else if (nextChildren !== prevChildren) {
14818 var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
14819 return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
14820 } else {
14821 enterHydrationState(workInProgress2);
14822 var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14823 workInProgress2.child = child;
14824 var node = child;
14825 while (node) {
14826 node.flags = node.flags & ~Placement | Hydrating;
14827 node = node.sibling;
14828 }
14829 }
14830 } else {
14831 resetHydrationState();
14832 if (nextChildren === prevChildren) {
14833 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14834 }
14835 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14836 }
14837 return workInProgress2.child;
14838 }
14839 function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
14840 resetHydrationState();
14841 queueHydrationError(recoverableError);
14842 workInProgress2.flags |= ForceClientRender;
14843 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14844 return workInProgress2.child;
14845 }
14846 function updateHostComponent(current2, workInProgress2, renderLanes2) {
14847 pushHostContext(workInProgress2);
14848 if (current2 === null) {
14849 tryToClaimNextHydratableInstance(workInProgress2);
14850 }
14851 var type = workInProgress2.type;
14852 var nextProps = workInProgress2.pendingProps;
14853 var prevProps = current2 !== null ? current2.memoizedProps : null;
14854 var nextChildren = nextProps.children;
14855 var isDirectTextChild = shouldSetTextContent(type, nextProps);
14856 if (isDirectTextChild) {
14857 nextChildren = null;
14858 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
14859 workInProgress2.flags |= ContentReset;
14860 }
14861 markRef(current2, workInProgress2);
14862 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14863 return workInProgress2.child;
14864 }
14865 function updateHostText(current2, workInProgress2) {
14866 if (current2 === null) {
14867 tryToClaimNextHydratableInstance(workInProgress2);
14868 }
14869 return null;
14870 }
14871 function mountLazyComponent(_current, workInProgress2, elementType, renderLanes2) {
14872 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14873 var props = workInProgress2.pendingProps;
14874 var lazyComponent = elementType;
14875 var payload = lazyComponent._payload;
14876 var init = lazyComponent._init;
14877 var Component = init(payload);
14878 workInProgress2.type = Component;
14879 var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component);
14880 var resolvedProps = resolveDefaultProps(Component, props);
14881 var child;
14882 switch (resolvedTag) {
14883 case FunctionComponent: {
14884 {
14885 validateFunctionComponentInDev(workInProgress2, Component);
14886 workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
14887 }
14888 child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
14889 return child;
14890 }
14891 case ClassComponent: {
14892 {
14893 workInProgress2.type = Component = resolveClassForHotReloading(Component);
14894 }
14895 child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
14896 return child;
14897 }
14898 case ForwardRef: {
14899 {
14900 workInProgress2.type = Component = resolveForwardRefForHotReloading(Component);
14901 }
14902 child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2);
14903 return child;
14904 }
14905 case MemoComponent: {
14906 {
14907 if (workInProgress2.type !== workInProgress2.elementType) {
14908 var outerPropTypes = Component.propTypes;
14909 if (outerPropTypes) {
14910 checkPropTypes(
14911 outerPropTypes,
14912 resolvedProps,
14913 // Resolved for outer only
14914 "prop",
14915 getComponentNameFromType(Component)
14916 );
14917 }
14918 }
14919 }
14920 child = updateMemoComponent(
14921 null,
14922 workInProgress2,
14923 Component,
14924 resolveDefaultProps(Component.type, resolvedProps),
14925 // The inner type can have defaults too
14926 renderLanes2
14927 );
14928 return child;
14929 }
14930 }
14931 var hint = "";
14932 {
14933 if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) {
14934 hint = " Did you wrap a component in React.lazy() more than once?";
14935 }
14936 }
14937 throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint));
14938 }
14939 function mountIncompleteClassComponent(_current, workInProgress2, Component, nextProps, renderLanes2) {
14940 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14941 workInProgress2.tag = ClassComponent;
14942 var hasContext;
14943 if (isContextProvider(Component)) {
14944 hasContext = true;
14945 pushContextProvider(workInProgress2);
14946 } else {
14947 hasContext = false;
14948 }
14949 prepareToReadContext(workInProgress2, renderLanes2);
14950 constructClassInstance(workInProgress2, Component, nextProps);
14951 mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14952 return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
14953 }
14954 function mountIndeterminateComponent(_current, workInProgress2, Component, renderLanes2) {
14955 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14956 var props = workInProgress2.pendingProps;
14957 var context;
14958 {
14959 var unmaskedContext = getUnmaskedContext(workInProgress2, Component, false);
14960 context = getMaskedContext(workInProgress2, unmaskedContext);
14961 }
14962 prepareToReadContext(workInProgress2, renderLanes2);
14963 var value;
14964 var hasId;
14965 {
14966 markComponentRenderStarted(workInProgress2);
14967 }
14968 {
14969 if (Component.prototype && typeof Component.prototype.render === "function") {
14970 var componentName = getComponentNameFromType(Component) || "Unknown";
14971 if (!didWarnAboutBadClass[componentName]) {
14972 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);
14973 didWarnAboutBadClass[componentName] = true;
14974 }
14975 }
14976 if (workInProgress2.mode & StrictLegacyMode) {
14977 ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
14978 }
14979 setIsRendering(true);
14980 ReactCurrentOwner$1.current = workInProgress2;
14981 value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
14982 hasId = checkDidRenderIdHook();
14983 setIsRendering(false);
14984 }
14985 {
14986 markComponentRenderStopped();
14987 }
14988 workInProgress2.flags |= PerformedWork;
14989 {
14990 if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
14991 var _componentName = getComponentNameFromType(Component) || "Unknown";
14992 if (!didWarnAboutModulePatternComponent[_componentName]) {
14993 error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName);
14994 didWarnAboutModulePatternComponent[_componentName] = true;
14995 }
14996 }
14997 }
14998 if (
14999 // Run these checks in production only if the flag is off.
15000 // Eventually we'll delete this branch altogether.
15001 typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
15002 ) {
15003 {
15004 var _componentName2 = getComponentNameFromType(Component) || "Unknown";
15005 if (!didWarnAboutModulePatternComponent[_componentName2]) {
15006 error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2);
15007 didWarnAboutModulePatternComponent[_componentName2] = true;
15008 }
15009 }
15010 workInProgress2.tag = ClassComponent;
15011 workInProgress2.memoizedState = null;
15012 workInProgress2.updateQueue = null;
15013 var hasContext = false;
15014 if (isContextProvider(Component)) {
15015 hasContext = true;
15016 pushContextProvider(workInProgress2);
15017 } else {
15018 hasContext = false;
15019 }
15020 workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
15021 initializeUpdateQueue(workInProgress2);
15022 adoptClassInstance(workInProgress2, value);
15023 mountClassInstance(workInProgress2, Component, props, renderLanes2);
15024 return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
15025 } else {
15026 workInProgress2.tag = FunctionComponent;
15027 {
15028 if (workInProgress2.mode & StrictLegacyMode) {
15029 setIsStrictModeForDevtools(true);
15030 try {
15031 value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
15032 hasId = checkDidRenderIdHook();
15033 } finally {
15034 setIsStrictModeForDevtools(false);
15035 }
15036 }
15037 }
15038 if (getIsHydrating() && hasId) {
15039 pushMaterializedTreeId(workInProgress2);
15040 }
15041 reconcileChildren(null, workInProgress2, value, renderLanes2);
15042 {
15043 validateFunctionComponentInDev(workInProgress2, Component);
15044 }
15045 return workInProgress2.child;
15046 }
15047 }
15048 function validateFunctionComponentInDev(workInProgress2, Component) {
15049 {
15050 if (Component) {
15051 if (Component.childContextTypes) {
15052 error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component");
15053 }
15054 }
15055 if (workInProgress2.ref !== null) {
15056 var info = "";
15057 var ownerName = getCurrentFiberOwnerNameInDevOrNull();
15058 if (ownerName) {
15059 info += "\n\nCheck the render method of `" + ownerName + "`.";
15060 }
15061 var warningKey = ownerName || "";
15062 var debugSource = workInProgress2._debugSource;
15063 if (debugSource) {
15064 warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
15065 }
15066 if (!didWarnAboutFunctionRefs[warningKey]) {
15067 didWarnAboutFunctionRefs[warningKey] = true;
15068 error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
15069 }
15070 }
15071 if (Component.defaultProps !== void 0) {
15072 var componentName = getComponentNameFromType(Component) || "Unknown";
15073 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
15074 error("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", componentName);
15075 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
15076 }
15077 }
15078 if (typeof Component.getDerivedStateFromProps === "function") {
15079 var _componentName3 = getComponentNameFromType(Component) || "Unknown";
15080 if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
15081 error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
15082 didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
15083 }
15084 }
15085 if (typeof Component.contextType === "object" && Component.contextType !== null) {
15086 var _componentName4 = getComponentNameFromType(Component) || "Unknown";
15087 if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
15088 error("%s: Function components do not support contextType.", _componentName4);
15089 didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
15090 }
15091 }
15092 }
15093 }
15094 var SUSPENDED_MARKER = {
15095 dehydrated: null,
15096 treeContext: null,
15097 retryLane: NoLane
15098 };
15099 function mountSuspenseOffscreenState(renderLanes2) {
15100 return {
15101 baseLanes: renderLanes2,
15102 cachePool: getSuspendedCache(),
15103 transitions: null
15104 };
15105 }
15106 function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
15107 var cachePool = null;
15108 return {
15109 baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
15110 cachePool,
15111 transitions: prevOffscreenState.transitions
15112 };
15113 }
15114 function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
15115 if (current2 !== null) {
15116 var suspenseState = current2.memoizedState;
15117 if (suspenseState === null) {
15118 return false;
15119 }
15120 }
15121 return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
15122 }
15123 function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
15124 return removeLanes(current2.childLanes, renderLanes2);
15125 }
15126 function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
15127 var nextProps = workInProgress2.pendingProps;
15128 {
15129 if (shouldSuspend(workInProgress2)) {
15130 workInProgress2.flags |= DidCapture;
15131 }
15132 }
15133 var suspenseContext = suspenseStackCursor.current;
15134 var showFallback = false;
15135 var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
15136 if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
15137 showFallback = true;
15138 workInProgress2.flags &= ~DidCapture;
15139 } else {
15140 if (current2 === null || current2.memoizedState !== null) {
15141 {
15142 suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
15143 }
15144 }
15145 }
15146 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
15147 pushSuspenseContext(workInProgress2, suspenseContext);
15148 if (current2 === null) {
15149 tryToClaimNextHydratableInstance(workInProgress2);
15150 var suspenseState = workInProgress2.memoizedState;
15151 if (suspenseState !== null) {
15152 var dehydrated = suspenseState.dehydrated;
15153 if (dehydrated !== null) {
15154 return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
15155 }
15156 }
15157 var nextPrimaryChildren = nextProps.children;
15158 var nextFallbackChildren = nextProps.fallback;
15159 if (showFallback) {
15160 var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
15161 var primaryChildFragment = workInProgress2.child;
15162 primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
15163 workInProgress2.memoizedState = SUSPENDED_MARKER;
15164 return fallbackFragment;
15165 } else {
15166 return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
15167 }
15168 } else {
15169 var prevState = current2.memoizedState;
15170 if (prevState !== null) {
15171 var _dehydrated = prevState.dehydrated;
15172 if (_dehydrated !== null) {
15173 return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
15174 }
15175 }
15176 if (showFallback) {
15177 var _nextFallbackChildren = nextProps.fallback;
15178 var _nextPrimaryChildren = nextProps.children;
15179 var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
15180 var _primaryChildFragment2 = workInProgress2.child;
15181 var prevOffscreenState = current2.child.memoizedState;
15182 _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
15183 _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
15184 workInProgress2.memoizedState = SUSPENDED_MARKER;
15185 return fallbackChildFragment;
15186 } else {
15187 var _nextPrimaryChildren2 = nextProps.children;
15188 var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
15189 workInProgress2.memoizedState = null;
15190 return _primaryChildFragment3;
15191 }
15192 }
15193 }
15194 function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
15195 var mode = workInProgress2.mode;
15196 var primaryChildProps = {
15197 mode: "visible",
15198 children: primaryChildren
15199 };
15200 var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
15201 primaryChildFragment.return = workInProgress2;
15202 workInProgress2.child = primaryChildFragment;
15203 return primaryChildFragment;
15204 }
15205 function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15206 var mode = workInProgress2.mode;
15207 var progressedPrimaryFragment = workInProgress2.child;
15208 var primaryChildProps = {
15209 mode: "hidden",
15210 children: primaryChildren
15211 };
15212 var primaryChildFragment;
15213 var fallbackChildFragment;
15214 if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
15215 primaryChildFragment = progressedPrimaryFragment;
15216 primaryChildFragment.childLanes = NoLanes;
15217 primaryChildFragment.pendingProps = primaryChildProps;
15218 if (workInProgress2.mode & ProfileMode) {
15219 primaryChildFragment.actualDuration = 0;
15220 primaryChildFragment.actualStartTime = -1;
15221 primaryChildFragment.selfBaseDuration = 0;
15222 primaryChildFragment.treeBaseDuration = 0;
15223 }
15224 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15225 } else {
15226 primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
15227 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15228 }
15229 primaryChildFragment.return = workInProgress2;
15230 fallbackChildFragment.return = workInProgress2;
15231 primaryChildFragment.sibling = fallbackChildFragment;
15232 workInProgress2.child = primaryChildFragment;
15233 return fallbackChildFragment;
15234 }
15235 function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
15236 return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
15237 }
15238 function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
15239 return createWorkInProgress(current2, offscreenProps);
15240 }
15241 function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
15242 var currentPrimaryChildFragment = current2.child;
15243 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
15244 var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
15245 mode: "visible",
15246 children: primaryChildren
15247 });
15248 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15249 primaryChildFragment.lanes = renderLanes2;
15250 }
15251 primaryChildFragment.return = workInProgress2;
15252 primaryChildFragment.sibling = null;
15253 if (currentFallbackChildFragment !== null) {
15254 var deletions = workInProgress2.deletions;
15255 if (deletions === null) {
15256 workInProgress2.deletions = [currentFallbackChildFragment];
15257 workInProgress2.flags |= ChildDeletion;
15258 } else {
15259 deletions.push(currentFallbackChildFragment);
15260 }
15261 }
15262 workInProgress2.child = primaryChildFragment;
15263 return primaryChildFragment;
15264 }
15265 function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15266 var mode = workInProgress2.mode;
15267 var currentPrimaryChildFragment = current2.child;
15268 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
15269 var primaryChildProps = {
15270 mode: "hidden",
15271 children: primaryChildren
15272 };
15273 var primaryChildFragment;
15274 if (
15275 // In legacy mode, we commit the primary tree as if it successfully
15276 // completed, even though it's in an inconsistent state.
15277 (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
15278 // already cloned. In legacy mode, the only case where this isn't true is
15279 // when DevTools forces us to display a fallback; we skip the first render
15280 // pass entirely and go straight to rendering the fallback. (In Concurrent
15281 // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
15282 // only codepath.)
15283 workInProgress2.child !== currentPrimaryChildFragment
15284 ) {
15285 var progressedPrimaryFragment = workInProgress2.child;
15286 primaryChildFragment = progressedPrimaryFragment;
15287 primaryChildFragment.childLanes = NoLanes;
15288 primaryChildFragment.pendingProps = primaryChildProps;
15289 if (workInProgress2.mode & ProfileMode) {
15290 primaryChildFragment.actualDuration = 0;
15291 primaryChildFragment.actualStartTime = -1;
15292 primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
15293 primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
15294 }
15295 workInProgress2.deletions = null;
15296 } else {
15297 primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
15298 primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
15299 }
15300 var fallbackChildFragment;
15301 if (currentFallbackChildFragment !== null) {
15302 fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
15303 } else {
15304 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15305 fallbackChildFragment.flags |= Placement;
15306 }
15307 fallbackChildFragment.return = workInProgress2;
15308 primaryChildFragment.return = workInProgress2;
15309 primaryChildFragment.sibling = fallbackChildFragment;
15310 workInProgress2.child = primaryChildFragment;
15311 return fallbackChildFragment;
15312 }
15313 function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
15314 if (recoverableError !== null) {
15315 queueHydrationError(recoverableError);
15316 }
15317 reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
15318 var nextProps = workInProgress2.pendingProps;
15319 var primaryChildren = nextProps.children;
15320 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
15321 primaryChildFragment.flags |= Placement;
15322 workInProgress2.memoizedState = null;
15323 return primaryChildFragment;
15324 }
15325 function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15326 var fiberMode = workInProgress2.mode;
15327 var primaryChildProps = {
15328 mode: "visible",
15329 children: primaryChildren
15330 };
15331 var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
15332 var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
15333 fallbackChildFragment.flags |= Placement;
15334 primaryChildFragment.return = workInProgress2;
15335 fallbackChildFragment.return = workInProgress2;
15336 primaryChildFragment.sibling = fallbackChildFragment;
15337 workInProgress2.child = primaryChildFragment;
15338 if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
15339 reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
15340 }
15341 return fallbackChildFragment;
15342 }
15343 function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
15344 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15345 {
15346 error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
15347 }
15348 workInProgress2.lanes = laneToLanes(SyncLane);
15349 } else if (isSuspenseInstanceFallback(suspenseInstance)) {
15350 workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
15351 } else {
15352 workInProgress2.lanes = laneToLanes(OffscreenLane);
15353 }
15354 return null;
15355 }
15356 function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
15357 if (!didSuspend) {
15358 warnIfHydrating();
15359 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15360 return retrySuspenseComponentWithoutHydrating(
15361 current2,
15362 workInProgress2,
15363 renderLanes2,
15364 // TODO: When we delete legacy mode, we should make this error argument
15365 // required — every concurrent mode path that causes hydration to
15366 // de-opt to client rendering should have an error message.
15367 null
15368 );
15369 }
15370 if (isSuspenseInstanceFallback(suspenseInstance)) {
15371 var digest, message, stack;
15372 {
15373 var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
15374 digest = _getSuspenseInstanceF.digest;
15375 message = _getSuspenseInstanceF.message;
15376 stack = _getSuspenseInstanceF.stack;
15377 }
15378 var error2;
15379 if (message) {
15380 error2 = new Error(message);
15381 } else {
15382 error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
15383 }
15384 var capturedValue = createCapturedValue(error2, digest, stack);
15385 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
15386 }
15387 var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
15388 if (didReceiveUpdate || hasContextChanged2) {
15389 var root2 = getWorkInProgressRoot();
15390 if (root2 !== null) {
15391 var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
15392 if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
15393 suspenseState.retryLane = attemptHydrationAtLane;
15394 var eventTime = NoTimestamp;
15395 enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
15396 scheduleUpdateOnFiber(root2, current2, attemptHydrationAtLane, eventTime);
15397 }
15398 }
15399 renderDidSuspendDelayIfPossible();
15400 var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
15401 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
15402 } else if (isSuspenseInstancePending(suspenseInstance)) {
15403 workInProgress2.flags |= DidCapture;
15404 workInProgress2.child = current2.child;
15405 var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
15406 registerSuspenseInstanceRetry(suspenseInstance, retry);
15407 return null;
15408 } else {
15409 reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
15410 var primaryChildren = nextProps.children;
15411 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
15412 primaryChildFragment.flags |= Hydrating;
15413 return primaryChildFragment;
15414 }
15415 } else {
15416 if (workInProgress2.flags & ForceClientRender) {
15417 workInProgress2.flags &= ~ForceClientRender;
15418 var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
15419 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
15420 } else if (workInProgress2.memoizedState !== null) {
15421 workInProgress2.child = current2.child;
15422 workInProgress2.flags |= DidCapture;
15423 return null;
15424 } else {
15425 var nextPrimaryChildren = nextProps.children;
15426 var nextFallbackChildren = nextProps.fallback;
15427 var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
15428 var _primaryChildFragment4 = workInProgress2.child;
15429 _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
15430 workInProgress2.memoizedState = SUSPENDED_MARKER;
15431 return fallbackChildFragment;
15432 }
15433 }
15434 }
15435 function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
15436 fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
15437 var alternate = fiber.alternate;
15438 if (alternate !== null) {
15439 alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
15440 }
15441 scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
15442 }
15443 function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
15444 var node = firstChild;
15445 while (node !== null) {
15446 if (node.tag === SuspenseComponent) {
15447 var state = node.memoizedState;
15448 if (state !== null) {
15449 scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
15450 }
15451 } else if (node.tag === SuspenseListComponent) {
15452 scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
15453 } else if (node.child !== null) {
15454 node.child.return = node;
15455 node = node.child;
15456 continue;
15457 }
15458 if (node === workInProgress2) {
15459 return;
15460 }
15461 while (node.sibling === null) {
15462 if (node.return === null || node.return === workInProgress2) {
15463 return;
15464 }
15465 node = node.return;
15466 }
15467 node.sibling.return = node.return;
15468 node = node.sibling;
15469 }
15470 }
15471 function findLastContentRow(firstChild) {
15472 var row = firstChild;
15473 var lastContentRow = null;
15474 while (row !== null) {
15475 var currentRow = row.alternate;
15476 if (currentRow !== null && findFirstSuspended(currentRow) === null) {
15477 lastContentRow = row;
15478 }
15479 row = row.sibling;
15480 }
15481 return lastContentRow;
15482 }
15483 function validateRevealOrder(revealOrder) {
15484 {
15485 if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
15486 didWarnAboutRevealOrder[revealOrder] = true;
15487 if (typeof revealOrder === "string") {
15488 switch (revealOrder.toLowerCase()) {
15489 case "together":
15490 case "forwards":
15491 case "backwards": {
15492 error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
15493 break;
15494 }
15495 case "forward":
15496 case "backward": {
15497 error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
15498 break;
15499 }
15500 default:
15501 error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
15502 break;
15503 }
15504 } else {
15505 error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
15506 }
15507 }
15508 }
15509 }
15510 function validateTailOptions(tailMode, revealOrder) {
15511 {
15512 if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
15513 if (tailMode !== "collapsed" && tailMode !== "hidden") {
15514 didWarnAboutTailOptions[tailMode] = true;
15515 error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
15516 } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
15517 didWarnAboutTailOptions[tailMode] = true;
15518 error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
15519 }
15520 }
15521 }
15522 }
15523 function validateSuspenseListNestedChild(childSlot, index2) {
15524 {
15525 var isAnArray = isArray(childSlot);
15526 var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
15527 if (isAnArray || isIterable) {
15528 var type = isAnArray ? "array" : "iterable";
15529 error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", type, index2, type);
15530 return false;
15531 }
15532 }
15533 return true;
15534 }
15535 function validateSuspenseListChildren(children, revealOrder) {
15536 {
15537 if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
15538 if (isArray(children)) {
15539 for (var i = 0; i < children.length; i++) {
15540 if (!validateSuspenseListNestedChild(children[i], i)) {
15541 return;
15542 }
15543 }
15544 } else {
15545 var iteratorFn = getIteratorFn(children);
15546 if (typeof iteratorFn === "function") {
15547 var childrenIterator = iteratorFn.call(children);
15548 if (childrenIterator) {
15549 var step = childrenIterator.next();
15550 var _i = 0;
15551 for (; !step.done; step = childrenIterator.next()) {
15552 if (!validateSuspenseListNestedChild(step.value, _i)) {
15553 return;
15554 }
15555 _i++;
15556 }
15557 }
15558 } else {
15559 error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', revealOrder);
15560 }
15561 }
15562 }
15563 }
15564 }
15565 function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
15566 var renderState = workInProgress2.memoizedState;
15567 if (renderState === null) {
15568 workInProgress2.memoizedState = {
15569 isBackwards,
15570 rendering: null,
15571 renderingStartTime: 0,
15572 last: lastContentRow,
15573 tail,
15574 tailMode
15575 };
15576 } else {
15577 renderState.isBackwards = isBackwards;
15578 renderState.rendering = null;
15579 renderState.renderingStartTime = 0;
15580 renderState.last = lastContentRow;
15581 renderState.tail = tail;
15582 renderState.tailMode = tailMode;
15583 }
15584 }
15585 function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
15586 var nextProps = workInProgress2.pendingProps;
15587 var revealOrder = nextProps.revealOrder;
15588 var tailMode = nextProps.tail;
15589 var newChildren = nextProps.children;
15590 validateRevealOrder(revealOrder);
15591 validateTailOptions(tailMode, revealOrder);
15592 validateSuspenseListChildren(newChildren, revealOrder);
15593 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15594 var suspenseContext = suspenseStackCursor.current;
15595 var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
15596 if (shouldForceFallback) {
15597 suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
15598 workInProgress2.flags |= DidCapture;
15599 } else {
15600 var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
15601 if (didSuspendBefore) {
15602 propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
15603 }
15604 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
15605 }
15606 pushSuspenseContext(workInProgress2, suspenseContext);
15607 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15608 workInProgress2.memoizedState = null;
15609 } else {
15610 switch (revealOrder) {
15611 case "forwards": {
15612 var lastContentRow = findLastContentRow(workInProgress2.child);
15613 var tail;
15614 if (lastContentRow === null) {
15615 tail = workInProgress2.child;
15616 workInProgress2.child = null;
15617 } else {
15618 tail = lastContentRow.sibling;
15619 lastContentRow.sibling = null;
15620 }
15621 initSuspenseListRenderState(
15622 workInProgress2,
15623 false,
15624 // isBackwards
15625 tail,
15626 lastContentRow,
15627 tailMode
15628 );
15629 break;
15630 }
15631 case "backwards": {
15632 var _tail = null;
15633 var row = workInProgress2.child;
15634 workInProgress2.child = null;
15635 while (row !== null) {
15636 var currentRow = row.alternate;
15637 if (currentRow !== null && findFirstSuspended(currentRow) === null) {
15638 workInProgress2.child = row;
15639 break;
15640 }
15641 var nextRow = row.sibling;
15642 row.sibling = _tail;
15643 _tail = row;
15644 row = nextRow;
15645 }
15646 initSuspenseListRenderState(
15647 workInProgress2,
15648 true,
15649 // isBackwards
15650 _tail,
15651 null,
15652 // last
15653 tailMode
15654 );
15655 break;
15656 }
15657 case "together": {
15658 initSuspenseListRenderState(
15659 workInProgress2,
15660 false,
15661 // isBackwards
15662 null,
15663 // tail
15664 null,
15665 // last
15666 void 0
15667 );
15668 break;
15669 }
15670 default: {
15671 workInProgress2.memoizedState = null;
15672 }
15673 }
15674 }
15675 return workInProgress2.child;
15676 }
15677 function updatePortalComponent(current2, workInProgress2, renderLanes2) {
15678 pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
15679 var nextChildren = workInProgress2.pendingProps;
15680 if (current2 === null) {
15681 workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
15682 } else {
15683 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
15684 }
15685 return workInProgress2.child;
15686 }
15687 var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
15688 function updateContextProvider(current2, workInProgress2, renderLanes2) {
15689 var providerType = workInProgress2.type;
15690 var context = providerType._context;
15691 var newProps = workInProgress2.pendingProps;
15692 var oldProps = workInProgress2.memoizedProps;
15693 var newValue = newProps.value;
15694 {
15695 if (!("value" in newProps)) {
15696 if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
15697 hasWarnedAboutUsingNoValuePropOnContextProvider = true;
15698 error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
15699 }
15700 }
15701 var providerPropTypes = workInProgress2.type.propTypes;
15702 if (providerPropTypes) {
15703 checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
15704 }
15705 }
15706 pushProvider(workInProgress2, context, newValue);
15707 {
15708 if (oldProps !== null) {
15709 var oldValue = oldProps.value;
15710 if (objectIs(oldValue, newValue)) {
15711 if (oldProps.children === newProps.children && !hasContextChanged()) {
15712 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15713 }
15714 } else {
15715 propagateContextChange(workInProgress2, context, renderLanes2);
15716 }
15717 }
15718 }
15719 var newChildren = newProps.children;
15720 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15721 return workInProgress2.child;
15722 }
15723 var hasWarnedAboutUsingContextAsConsumer = false;
15724 function updateContextConsumer(current2, workInProgress2, renderLanes2) {
15725 var context = workInProgress2.type;
15726 {
15727 if (context._context === void 0) {
15728 if (context !== context.Consumer) {
15729 if (!hasWarnedAboutUsingContextAsConsumer) {
15730 hasWarnedAboutUsingContextAsConsumer = true;
15731 error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
15732 }
15733 }
15734 } else {
15735 context = context._context;
15736 }
15737 }
15738 var newProps = workInProgress2.pendingProps;
15739 var render2 = newProps.children;
15740 {
15741 if (typeof render2 !== "function") {
15742 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.");
15743 }
15744 }
15745 prepareToReadContext(workInProgress2, renderLanes2);
15746 var newValue = readContext(context);
15747 {
15748 markComponentRenderStarted(workInProgress2);
15749 }
15750 var newChildren;
15751 {
15752 ReactCurrentOwner$1.current = workInProgress2;
15753 setIsRendering(true);
15754 newChildren = render2(newValue);
15755 setIsRendering(false);
15756 }
15757 {
15758 markComponentRenderStopped();
15759 }
15760 workInProgress2.flags |= PerformedWork;
15761 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15762 return workInProgress2.child;
15763 }
15764 function markWorkInProgressReceivedUpdate() {
15765 didReceiveUpdate = true;
15766 }
15767 function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
15768 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15769 if (current2 !== null) {
15770 current2.alternate = null;
15771 workInProgress2.alternate = null;
15772 workInProgress2.flags |= Placement;
15773 }
15774 }
15775 }
15776 function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
15777 if (current2 !== null) {
15778 workInProgress2.dependencies = current2.dependencies;
15779 }
15780 {
15781 stopProfilerTimerIfRunning();
15782 }
15783 markSkippedUpdateLanes(workInProgress2.lanes);
15784 if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
15785 {
15786 return null;
15787 }
15788 }
15789 cloneChildFibers(current2, workInProgress2);
15790 return workInProgress2.child;
15791 }
15792 function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
15793 {
15794 var returnFiber = oldWorkInProgress.return;
15795 if (returnFiber === null) {
15796 throw new Error("Cannot swap the root fiber.");
15797 }
15798 current2.alternate = null;
15799 oldWorkInProgress.alternate = null;
15800 newWorkInProgress.index = oldWorkInProgress.index;
15801 newWorkInProgress.sibling = oldWorkInProgress.sibling;
15802 newWorkInProgress.return = oldWorkInProgress.return;
15803 newWorkInProgress.ref = oldWorkInProgress.ref;
15804 if (oldWorkInProgress === returnFiber.child) {
15805 returnFiber.child = newWorkInProgress;
15806 } else {
15807 var prevSibling = returnFiber.child;
15808 if (prevSibling === null) {
15809 throw new Error("Expected parent to have a child.");
15810 }
15811 while (prevSibling.sibling !== oldWorkInProgress) {
15812 prevSibling = prevSibling.sibling;
15813 if (prevSibling === null) {
15814 throw new Error("Expected to find the previous sibling.");
15815 }
15816 }
15817 prevSibling.sibling = newWorkInProgress;
15818 }
15819 var deletions = returnFiber.deletions;
15820 if (deletions === null) {
15821 returnFiber.deletions = [current2];
15822 returnFiber.flags |= ChildDeletion;
15823 } else {
15824 deletions.push(current2);
15825 }
15826 newWorkInProgress.flags |= Placement;
15827 return newWorkInProgress;
15828 }
15829 }
15830 function checkScheduledUpdateOrContext(current2, renderLanes2) {
15831 var updateLanes = current2.lanes;
15832 if (includesSomeLane(updateLanes, renderLanes2)) {
15833 return true;
15834 }
15835 return false;
15836 }
15837 function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
15838 switch (workInProgress2.tag) {
15839 case HostRoot:
15840 pushHostRootContext(workInProgress2);
15841 var root2 = workInProgress2.stateNode;
15842 resetHydrationState();
15843 break;
15844 case HostComponent:
15845 pushHostContext(workInProgress2);
15846 break;
15847 case ClassComponent: {
15848 var Component = workInProgress2.type;
15849 if (isContextProvider(Component)) {
15850 pushContextProvider(workInProgress2);
15851 }
15852 break;
15853 }
15854 case HostPortal:
15855 pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
15856 break;
15857 case ContextProvider: {
15858 var newValue = workInProgress2.memoizedProps.value;
15859 var context = workInProgress2.type._context;
15860 pushProvider(workInProgress2, context, newValue);
15861 break;
15862 }
15863 case Profiler:
15864 {
15865 var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
15866 if (hasChildWork) {
15867 workInProgress2.flags |= Update;
15868 }
15869 {
15870 var stateNode = workInProgress2.stateNode;
15871 stateNode.effectDuration = 0;
15872 stateNode.passiveEffectDuration = 0;
15873 }
15874 }
15875 break;
15876 case SuspenseComponent: {
15877 var state = workInProgress2.memoizedState;
15878 if (state !== null) {
15879 if (state.dehydrated !== null) {
15880 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15881 workInProgress2.flags |= DidCapture;
15882 return null;
15883 }
15884 var primaryChildFragment = workInProgress2.child;
15885 var primaryChildLanes = primaryChildFragment.childLanes;
15886 if (includesSomeLane(renderLanes2, primaryChildLanes)) {
15887 return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
15888 } else {
15889 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15890 var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15891 if (child !== null) {
15892 return child.sibling;
15893 } else {
15894 return null;
15895 }
15896 }
15897 } else {
15898 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15899 }
15900 break;
15901 }
15902 case SuspenseListComponent: {
15903 var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
15904 var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
15905 if (didSuspendBefore) {
15906 if (_hasChildWork) {
15907 return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
15908 }
15909 workInProgress2.flags |= DidCapture;
15910 }
15911 var renderState = workInProgress2.memoizedState;
15912 if (renderState !== null) {
15913 renderState.rendering = null;
15914 renderState.tail = null;
15915 renderState.lastEffect = null;
15916 }
15917 pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
15918 if (_hasChildWork) {
15919 break;
15920 } else {
15921 return null;
15922 }
15923 }
15924 case OffscreenComponent:
15925 case LegacyHiddenComponent: {
15926 workInProgress2.lanes = NoLanes;
15927 return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
15928 }
15929 }
15930 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15931 }
15932 function beginWork(current2, workInProgress2, renderLanes2) {
15933 {
15934 if (workInProgress2._debugNeedsRemount && current2 !== null) {
15935 return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
15936 }
15937 }
15938 if (current2 !== null) {
15939 var oldProps = current2.memoizedProps;
15940 var newProps = workInProgress2.pendingProps;
15941 if (oldProps !== newProps || hasContextChanged() || // Force a re-render if the implementation changed due to hot reload:
15942 workInProgress2.type !== current2.type) {
15943 didReceiveUpdate = true;
15944 } else {
15945 var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
15946 if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there
15947 // may not be work scheduled on `current`, so we check for this flag.
15948 (workInProgress2.flags & DidCapture) === NoFlags) {
15949 didReceiveUpdate = false;
15950 return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
15951 }
15952 if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
15953 didReceiveUpdate = true;
15954 } else {
15955 didReceiveUpdate = false;
15956 }
15957 }
15958 } else {
15959 didReceiveUpdate = false;
15960 if (getIsHydrating() && isForkedChild(workInProgress2)) {
15961 var slotIndex = workInProgress2.index;
15962 var numberOfForks = getForksAtLevel();
15963 pushTreeId(workInProgress2, numberOfForks, slotIndex);
15964 }
15965 }
15966 workInProgress2.lanes = NoLanes;
15967 switch (workInProgress2.tag) {
15968 case IndeterminateComponent: {
15969 return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
15970 }
15971 case LazyComponent: {
15972 var elementType = workInProgress2.elementType;
15973 return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
15974 }
15975 case FunctionComponent: {
15976 var Component = workInProgress2.type;
15977 var unresolvedProps = workInProgress2.pendingProps;
15978 var resolvedProps = workInProgress2.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps);
15979 return updateFunctionComponent(current2, workInProgress2, Component, resolvedProps, renderLanes2);
15980 }
15981 case ClassComponent: {
15982 var _Component = workInProgress2.type;
15983 var _unresolvedProps = workInProgress2.pendingProps;
15984 var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
15985 return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
15986 }
15987 case HostRoot:
15988 return updateHostRoot(current2, workInProgress2, renderLanes2);
15989 case HostComponent:
15990 return updateHostComponent(current2, workInProgress2, renderLanes2);
15991 case HostText:
15992 return updateHostText(current2, workInProgress2);
15993 case SuspenseComponent:
15994 return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
15995 case HostPortal:
15996 return updatePortalComponent(current2, workInProgress2, renderLanes2);
15997 case ForwardRef: {
15998 var type = workInProgress2.type;
15999 var _unresolvedProps2 = workInProgress2.pendingProps;
16000 var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
16001 return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
16002 }
16003 case Fragment:
16004 return updateFragment(current2, workInProgress2, renderLanes2);
16005 case Mode:
16006 return updateMode(current2, workInProgress2, renderLanes2);
16007 case Profiler:
16008 return updateProfiler(current2, workInProgress2, renderLanes2);
16009 case ContextProvider:
16010 return updateContextProvider(current2, workInProgress2, renderLanes2);
16011 case ContextConsumer:
16012 return updateContextConsumer(current2, workInProgress2, renderLanes2);
16013 case MemoComponent: {
16014 var _type2 = workInProgress2.type;
16015 var _unresolvedProps3 = workInProgress2.pendingProps;
16016 var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
16017 {
16018 if (workInProgress2.type !== workInProgress2.elementType) {
16019 var outerPropTypes = _type2.propTypes;
16020 if (outerPropTypes) {
16021 checkPropTypes(
16022 outerPropTypes,
16023 _resolvedProps3,
16024 // Resolved for outer only
16025 "prop",
16026 getComponentNameFromType(_type2)
16027 );
16028 }
16029 }
16030 }
16031 _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
16032 return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
16033 }
16034 case SimpleMemoComponent: {
16035 return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
16036 }
16037 case IncompleteClassComponent: {
16038 var _Component2 = workInProgress2.type;
16039 var _unresolvedProps4 = workInProgress2.pendingProps;
16040 var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
16041 return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
16042 }
16043 case SuspenseListComponent: {
16044 return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
16045 }
16046 case ScopeComponent: {
16047 break;
16048 }
16049 case OffscreenComponent: {
16050 return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
16051 }
16052 }
16053 throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
16054 }
16055 function markUpdate(workInProgress2) {
16056 workInProgress2.flags |= Update;
16057 }
16058 function markRef$1(workInProgress2) {
16059 workInProgress2.flags |= Ref;
16060 {
16061 workInProgress2.flags |= RefStatic;
16062 }
16063 }
16064 var appendAllChildren;
16065 var updateHostContainer;
16066 var updateHostComponent$1;
16067 var updateHostText$1;
16068 {
16069 appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
16070 var node = workInProgress2.child;
16071 while (node !== null) {
16072 if (node.tag === HostComponent || node.tag === HostText) {
16073 appendInitialChild(parent, node.stateNode);
16074 } else if (node.tag === HostPortal) ;
16075 else if (node.child !== null) {
16076 node.child.return = node;
16077 node = node.child;
16078 continue;
16079 }
16080 if (node === workInProgress2) {
16081 return;
16082 }
16083 while (node.sibling === null) {
16084 if (node.return === null || node.return === workInProgress2) {
16085 return;
16086 }
16087 node = node.return;
16088 }
16089 node.sibling.return = node.return;
16090 node = node.sibling;
16091 }
16092 };
16093 updateHostContainer = function(current2, workInProgress2) {
16094 };
16095 updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
16096 var oldProps = current2.memoizedProps;
16097 if (oldProps === newProps) {
16098 return;
16099 }
16100 var instance = workInProgress2.stateNode;
16101 var currentHostContext = getHostContext();
16102 var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
16103 workInProgress2.updateQueue = updatePayload;
16104 if (updatePayload) {
16105 markUpdate(workInProgress2);
16106 }
16107 };
16108 updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
16109 if (oldText !== newText) {
16110 markUpdate(workInProgress2);
16111 }
16112 };
16113 }
16114 function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
16115 if (getIsHydrating()) {
16116 return;
16117 }
16118 switch (renderState.tailMode) {
16119 case "hidden": {
16120 var tailNode = renderState.tail;
16121 var lastTailNode = null;
16122 while (tailNode !== null) {
16123 if (tailNode.alternate !== null) {
16124 lastTailNode = tailNode;
16125 }
16126 tailNode = tailNode.sibling;
16127 }
16128 if (lastTailNode === null) {
16129 renderState.tail = null;
16130 } else {
16131 lastTailNode.sibling = null;
16132 }
16133 break;
16134 }
16135 case "collapsed": {
16136 var _tailNode = renderState.tail;
16137 var _lastTailNode = null;
16138 while (_tailNode !== null) {
16139 if (_tailNode.alternate !== null) {
16140 _lastTailNode = _tailNode;
16141 }
16142 _tailNode = _tailNode.sibling;
16143 }
16144 if (_lastTailNode === null) {
16145 if (!hasRenderedATailFallback && renderState.tail !== null) {
16146 renderState.tail.sibling = null;
16147 } else {
16148 renderState.tail = null;
16149 }
16150 } else {
16151 _lastTailNode.sibling = null;
16152 }
16153 break;
16154 }
16155 }
16156 }
16157 function bubbleProperties(completedWork) {
16158 var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
16159 var newChildLanes = NoLanes;
16160 var subtreeFlags = NoFlags;
16161 if (!didBailout) {
16162 if ((completedWork.mode & ProfileMode) !== NoMode) {
16163 var actualDuration = completedWork.actualDuration;
16164 var treeBaseDuration = completedWork.selfBaseDuration;
16165 var child = completedWork.child;
16166 while (child !== null) {
16167 newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
16168 subtreeFlags |= child.subtreeFlags;
16169 subtreeFlags |= child.flags;
16170 actualDuration += child.actualDuration;
16171 treeBaseDuration += child.treeBaseDuration;
16172 child = child.sibling;
16173 }
16174 completedWork.actualDuration = actualDuration;
16175 completedWork.treeBaseDuration = treeBaseDuration;
16176 } else {
16177 var _child = completedWork.child;
16178 while (_child !== null) {
16179 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
16180 subtreeFlags |= _child.subtreeFlags;
16181 subtreeFlags |= _child.flags;
16182 _child.return = completedWork;
16183 _child = _child.sibling;
16184 }
16185 }
16186 completedWork.subtreeFlags |= subtreeFlags;
16187 } else {
16188 if ((completedWork.mode & ProfileMode) !== NoMode) {
16189 var _treeBaseDuration = completedWork.selfBaseDuration;
16190 var _child2 = completedWork.child;
16191 while (_child2 !== null) {
16192 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
16193 subtreeFlags |= _child2.subtreeFlags & StaticMask;
16194 subtreeFlags |= _child2.flags & StaticMask;
16195 _treeBaseDuration += _child2.treeBaseDuration;
16196 _child2 = _child2.sibling;
16197 }
16198 completedWork.treeBaseDuration = _treeBaseDuration;
16199 } else {
16200 var _child3 = completedWork.child;
16201 while (_child3 !== null) {
16202 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
16203 subtreeFlags |= _child3.subtreeFlags & StaticMask;
16204 subtreeFlags |= _child3.flags & StaticMask;
16205 _child3.return = completedWork;
16206 _child3 = _child3.sibling;
16207 }
16208 }
16209 completedWork.subtreeFlags |= subtreeFlags;
16210 }
16211 completedWork.childLanes = newChildLanes;
16212 return didBailout;
16213 }
16214 function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
16215 if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
16216 warnIfUnhydratedTailNodes(workInProgress2);
16217 resetHydrationState();
16218 workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
16219 return false;
16220 }
16221 var wasHydrated = popHydrationState(workInProgress2);
16222 if (nextState !== null && nextState.dehydrated !== null) {
16223 if (current2 === null) {
16224 if (!wasHydrated) {
16225 throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
16226 }
16227 prepareToHydrateHostSuspenseInstance(workInProgress2);
16228 bubbleProperties(workInProgress2);
16229 {
16230 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16231 var isTimedOutSuspense = nextState !== null;
16232 if (isTimedOutSuspense) {
16233 var primaryChildFragment = workInProgress2.child;
16234 if (primaryChildFragment !== null) {
16235 workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
16236 }
16237 }
16238 }
16239 }
16240 return false;
16241 } else {
16242 resetHydrationState();
16243 if ((workInProgress2.flags & DidCapture) === NoFlags) {
16244 workInProgress2.memoizedState = null;
16245 }
16246 workInProgress2.flags |= Update;
16247 bubbleProperties(workInProgress2);
16248 {
16249 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16250 var _isTimedOutSuspense = nextState !== null;
16251 if (_isTimedOutSuspense) {
16252 var _primaryChildFragment = workInProgress2.child;
16253 if (_primaryChildFragment !== null) {
16254 workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
16255 }
16256 }
16257 }
16258 }
16259 return false;
16260 }
16261 } else {
16262 upgradeHydrationErrorsToRecoverable();
16263 return true;
16264 }
16265 }
16266 function completeWork(current2, workInProgress2, renderLanes2) {
16267 var newProps = workInProgress2.pendingProps;
16268 popTreeContext(workInProgress2);
16269 switch (workInProgress2.tag) {
16270 case IndeterminateComponent:
16271 case LazyComponent:
16272 case SimpleMemoComponent:
16273 case FunctionComponent:
16274 case ForwardRef:
16275 case Fragment:
16276 case Mode:
16277 case Profiler:
16278 case ContextConsumer:
16279 case MemoComponent:
16280 bubbleProperties(workInProgress2);
16281 return null;
16282 case ClassComponent: {
16283 var Component = workInProgress2.type;
16284 if (isContextProvider(Component)) {
16285 popContext(workInProgress2);
16286 }
16287 bubbleProperties(workInProgress2);
16288 return null;
16289 }
16290 case HostRoot: {
16291 var fiberRoot = workInProgress2.stateNode;
16292 popHostContainer(workInProgress2);
16293 popTopLevelContextObject(workInProgress2);
16294 resetWorkInProgressVersions();
16295 if (fiberRoot.pendingContext) {
16296 fiberRoot.context = fiberRoot.pendingContext;
16297 fiberRoot.pendingContext = null;
16298 }
16299 if (current2 === null || current2.child === null) {
16300 var wasHydrated = popHydrationState(workInProgress2);
16301 if (wasHydrated) {
16302 markUpdate(workInProgress2);
16303 } else {
16304 if (current2 !== null) {
16305 var prevState = current2.memoizedState;
16306 if (
16307 // Check if this is a client root
16308 !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
16309 (workInProgress2.flags & ForceClientRender) !== NoFlags
16310 ) {
16311 workInProgress2.flags |= Snapshot;
16312 upgradeHydrationErrorsToRecoverable();
16313 }
16314 }
16315 }
16316 }
16317 updateHostContainer(current2, workInProgress2);
16318 bubbleProperties(workInProgress2);
16319 return null;
16320 }
16321 case HostComponent: {
16322 popHostContext(workInProgress2);
16323 var rootContainerInstance = getRootHostContainer();
16324 var type = workInProgress2.type;
16325 if (current2 !== null && workInProgress2.stateNode != null) {
16326 updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
16327 if (current2.ref !== workInProgress2.ref) {
16328 markRef$1(workInProgress2);
16329 }
16330 } else {
16331 if (!newProps) {
16332 if (workInProgress2.stateNode === null) {
16333 throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
16334 }
16335 bubbleProperties(workInProgress2);
16336 return null;
16337 }
16338 var currentHostContext = getHostContext();
16339 var _wasHydrated = popHydrationState(workInProgress2);
16340 if (_wasHydrated) {
16341 if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
16342 markUpdate(workInProgress2);
16343 }
16344 } else {
16345 var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
16346 appendAllChildren(instance, workInProgress2, false, false);
16347 workInProgress2.stateNode = instance;
16348 if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
16349 markUpdate(workInProgress2);
16350 }
16351 }
16352 if (workInProgress2.ref !== null) {
16353 markRef$1(workInProgress2);
16354 }
16355 }
16356 bubbleProperties(workInProgress2);
16357 return null;
16358 }
16359 case HostText: {
16360 var newText = newProps;
16361 if (current2 && workInProgress2.stateNode != null) {
16362 var oldText = current2.memoizedProps;
16363 updateHostText$1(current2, workInProgress2, oldText, newText);
16364 } else {
16365 if (typeof newText !== "string") {
16366 if (workInProgress2.stateNode === null) {
16367 throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
16368 }
16369 }
16370 var _rootContainerInstance = getRootHostContainer();
16371 var _currentHostContext = getHostContext();
16372 var _wasHydrated2 = popHydrationState(workInProgress2);
16373 if (_wasHydrated2) {
16374 if (prepareToHydrateHostTextInstance(workInProgress2)) {
16375 markUpdate(workInProgress2);
16376 }
16377 } else {
16378 workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
16379 }
16380 }
16381 bubbleProperties(workInProgress2);
16382 return null;
16383 }
16384 case SuspenseComponent: {
16385 popSuspenseContext(workInProgress2);
16386 var nextState = workInProgress2.memoizedState;
16387 if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
16388 var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
16389 if (!fallthroughToNormalSuspensePath) {
16390 if (workInProgress2.flags & ShouldCapture) {
16391 return workInProgress2;
16392 } else {
16393 return null;
16394 }
16395 }
16396 }
16397 if ((workInProgress2.flags & DidCapture) !== NoFlags) {
16398 workInProgress2.lanes = renderLanes2;
16399 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16400 transferActualDuration(workInProgress2);
16401 }
16402 return workInProgress2;
16403 }
16404 var nextDidTimeout = nextState !== null;
16405 var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
16406 if (nextDidTimeout !== prevDidTimeout) {
16407 if (nextDidTimeout) {
16408 var _offscreenFiber2 = workInProgress2.child;
16409 _offscreenFiber2.flags |= Visibility;
16410 if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
16411 var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
16412 if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
16413 renderDidSuspend();
16414 } else {
16415 renderDidSuspendDelayIfPossible();
16416 }
16417 }
16418 }
16419 }
16420 var wakeables = workInProgress2.updateQueue;
16421 if (wakeables !== null) {
16422 workInProgress2.flags |= Update;
16423 }
16424 bubbleProperties(workInProgress2);
16425 {
16426 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16427 if (nextDidTimeout) {
16428 var primaryChildFragment = workInProgress2.child;
16429 if (primaryChildFragment !== null) {
16430 workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
16431 }
16432 }
16433 }
16434 }
16435 return null;
16436 }
16437 case HostPortal:
16438 popHostContainer(workInProgress2);
16439 updateHostContainer(current2, workInProgress2);
16440 if (current2 === null) {
16441 preparePortalMount(workInProgress2.stateNode.containerInfo);
16442 }
16443 bubbleProperties(workInProgress2);
16444 return null;
16445 case ContextProvider:
16446 var context = workInProgress2.type._context;
16447 popProvider(context, workInProgress2);
16448 bubbleProperties(workInProgress2);
16449 return null;
16450 case IncompleteClassComponent: {
16451 var _Component = workInProgress2.type;
16452 if (isContextProvider(_Component)) {
16453 popContext(workInProgress2);
16454 }
16455 bubbleProperties(workInProgress2);
16456 return null;
16457 }
16458 case SuspenseListComponent: {
16459 popSuspenseContext(workInProgress2);
16460 var renderState = workInProgress2.memoizedState;
16461 if (renderState === null) {
16462 bubbleProperties(workInProgress2);
16463 return null;
16464 }
16465 var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
16466 var renderedTail = renderState.rendering;
16467 if (renderedTail === null) {
16468 if (!didSuspendAlready) {
16469 var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
16470 if (!cannotBeSuspended) {
16471 var row = workInProgress2.child;
16472 while (row !== null) {
16473 var suspended = findFirstSuspended(row);
16474 if (suspended !== null) {
16475 didSuspendAlready = true;
16476 workInProgress2.flags |= DidCapture;
16477 cutOffTailIfNeeded(renderState, false);
16478 var newThenables = suspended.updateQueue;
16479 if (newThenables !== null) {
16480 workInProgress2.updateQueue = newThenables;
16481 workInProgress2.flags |= Update;
16482 }
16483 workInProgress2.subtreeFlags = NoFlags;
16484 resetChildFibers(workInProgress2, renderLanes2);
16485 pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
16486 return workInProgress2.child;
16487 }
16488 row = row.sibling;
16489 }
16490 }
16491 if (renderState.tail !== null && now() > getRenderTargetTime()) {
16492 workInProgress2.flags |= DidCapture;
16493 didSuspendAlready = true;
16494 cutOffTailIfNeeded(renderState, false);
16495 workInProgress2.lanes = SomeRetryLane;
16496 }
16497 } else {
16498 cutOffTailIfNeeded(renderState, false);
16499 }
16500 } else {
16501 if (!didSuspendAlready) {
16502 var _suspended = findFirstSuspended(renderedTail);
16503 if (_suspended !== null) {
16504 workInProgress2.flags |= DidCapture;
16505 didSuspendAlready = true;
16506 var _newThenables = _suspended.updateQueue;
16507 if (_newThenables !== null) {
16508 workInProgress2.updateQueue = _newThenables;
16509 workInProgress2.flags |= Update;
16510 }
16511 cutOffTailIfNeeded(renderState, true);
16512 if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
16513 bubbleProperties(workInProgress2);
16514 return null;
16515 }
16516 } else if (
16517 // The time it took to render last row is greater than the remaining
16518 // time we have to render. So rendering one more row would likely
16519 // exceed it.
16520 now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
16521 ) {
16522 workInProgress2.flags |= DidCapture;
16523 didSuspendAlready = true;
16524 cutOffTailIfNeeded(renderState, false);
16525 workInProgress2.lanes = SomeRetryLane;
16526 }
16527 }
16528 if (renderState.isBackwards) {
16529 renderedTail.sibling = workInProgress2.child;
16530 workInProgress2.child = renderedTail;
16531 } else {
16532 var previousSibling = renderState.last;
16533 if (previousSibling !== null) {
16534 previousSibling.sibling = renderedTail;
16535 } else {
16536 workInProgress2.child = renderedTail;
16537 }
16538 renderState.last = renderedTail;
16539 }
16540 }
16541 if (renderState.tail !== null) {
16542 var next = renderState.tail;
16543 renderState.rendering = next;
16544 renderState.tail = next.sibling;
16545 renderState.renderingStartTime = now();
16546 next.sibling = null;
16547 var suspenseContext = suspenseStackCursor.current;
16548 if (didSuspendAlready) {
16549 suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
16550 } else {
16551 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
16552 }
16553 pushSuspenseContext(workInProgress2, suspenseContext);
16554 return next;
16555 }
16556 bubbleProperties(workInProgress2);
16557 return null;
16558 }
16559 case ScopeComponent: {
16560 break;
16561 }
16562 case OffscreenComponent:
16563 case LegacyHiddenComponent: {
16564 popRenderLanes(workInProgress2);
16565 var _nextState = workInProgress2.memoizedState;
16566 var nextIsHidden = _nextState !== null;
16567 if (current2 !== null) {
16568 var _prevState = current2.memoizedState;
16569 var prevIsHidden = _prevState !== null;
16570 if (prevIsHidden !== nextIsHidden && // LegacyHidden doesn't do any hiding — it only pre-renders.
16571 !enableLegacyHidden) {
16572 workInProgress2.flags |= Visibility;
16573 }
16574 }
16575 if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
16576 bubbleProperties(workInProgress2);
16577 } else {
16578 if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
16579 bubbleProperties(workInProgress2);
16580 {
16581 if (workInProgress2.subtreeFlags & (Placement | Update)) {
16582 workInProgress2.flags |= Visibility;
16583 }
16584 }
16585 }
16586 }
16587 return null;
16588 }
16589 case CacheComponent: {
16590 return null;
16591 }
16592 case TracingMarkerComponent: {
16593 return null;
16594 }
16595 }
16596 throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
16597 }
16598 function unwindWork(current2, workInProgress2, renderLanes2) {
16599 popTreeContext(workInProgress2);
16600 switch (workInProgress2.tag) {
16601 case ClassComponent: {
16602 var Component = workInProgress2.type;
16603 if (isContextProvider(Component)) {
16604 popContext(workInProgress2);
16605 }
16606 var flags = workInProgress2.flags;
16607 if (flags & ShouldCapture) {
16608 workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
16609 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16610 transferActualDuration(workInProgress2);
16611 }
16612 return workInProgress2;
16613 }
16614 return null;
16615 }
16616 case HostRoot: {
16617 var root2 = workInProgress2.stateNode;
16618 popHostContainer(workInProgress2);
16619 popTopLevelContextObject(workInProgress2);
16620 resetWorkInProgressVersions();
16621 var _flags = workInProgress2.flags;
16622 if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
16623 workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
16624 return workInProgress2;
16625 }
16626 return null;
16627 }
16628 case HostComponent: {
16629 popHostContext(workInProgress2);
16630 return null;
16631 }
16632 case SuspenseComponent: {
16633 popSuspenseContext(workInProgress2);
16634 var suspenseState = workInProgress2.memoizedState;
16635 if (suspenseState !== null && suspenseState.dehydrated !== null) {
16636 if (workInProgress2.alternate === null) {
16637 throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
16638 }
16639 resetHydrationState();
16640 }
16641 var _flags2 = workInProgress2.flags;
16642 if (_flags2 & ShouldCapture) {
16643 workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
16644 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16645 transferActualDuration(workInProgress2);
16646 }
16647 return workInProgress2;
16648 }
16649 return null;
16650 }
16651 case SuspenseListComponent: {
16652 popSuspenseContext(workInProgress2);
16653 return null;
16654 }
16655 case HostPortal:
16656 popHostContainer(workInProgress2);
16657 return null;
16658 case ContextProvider:
16659 var context = workInProgress2.type._context;
16660 popProvider(context, workInProgress2);
16661 return null;
16662 case OffscreenComponent:
16663 case LegacyHiddenComponent:
16664 popRenderLanes(workInProgress2);
16665 return null;
16666 case CacheComponent:
16667 return null;
16668 default:
16669 return null;
16670 }
16671 }
16672 function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
16673 popTreeContext(interruptedWork);
16674 switch (interruptedWork.tag) {
16675 case ClassComponent: {
16676 var childContextTypes = interruptedWork.type.childContextTypes;
16677 if (childContextTypes !== null && childContextTypes !== void 0) {
16678 popContext(interruptedWork);
16679 }
16680 break;
16681 }
16682 case HostRoot: {
16683 var root2 = interruptedWork.stateNode;
16684 popHostContainer(interruptedWork);
16685 popTopLevelContextObject(interruptedWork);
16686 resetWorkInProgressVersions();
16687 break;
16688 }
16689 case HostComponent: {
16690 popHostContext(interruptedWork);
16691 break;
16692 }
16693 case HostPortal:
16694 popHostContainer(interruptedWork);
16695 break;
16696 case SuspenseComponent:
16697 popSuspenseContext(interruptedWork);
16698 break;
16699 case SuspenseListComponent:
16700 popSuspenseContext(interruptedWork);
16701 break;
16702 case ContextProvider:
16703 var context = interruptedWork.type._context;
16704 popProvider(context, interruptedWork);
16705 break;
16706 case OffscreenComponent:
16707 case LegacyHiddenComponent:
16708 popRenderLanes(interruptedWork);
16709 break;
16710 }
16711 }
16712 var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
16713 {
16714 didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
16715 }
16716 var offscreenSubtreeIsHidden = false;
16717 var offscreenSubtreeWasHidden = false;
16718 var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
16719 var nextEffect = null;
16720 var inProgressLanes = null;
16721 var inProgressRoot = null;
16722 function reportUncaughtErrorInDEV(error2) {
16723 {
16724 invokeGuardedCallback(null, function() {
16725 throw error2;
16726 });
16727 clearCaughtError();
16728 }
16729 }
16730 var callComponentWillUnmountWithTimer = function(current2, instance) {
16731 instance.props = current2.memoizedProps;
16732 instance.state = current2.memoizedState;
16733 if (current2.mode & ProfileMode) {
16734 try {
16735 startLayoutEffectTimer();
16736 instance.componentWillUnmount();
16737 } finally {
16738 recordLayoutEffectDuration(current2);
16739 }
16740 } else {
16741 instance.componentWillUnmount();
16742 }
16743 };
16744 function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
16745 try {
16746 commitHookEffectListMount(Layout, current2);
16747 } catch (error2) {
16748 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16749 }
16750 }
16751 function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
16752 try {
16753 callComponentWillUnmountWithTimer(current2, instance);
16754 } catch (error2) {
16755 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16756 }
16757 }
16758 function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
16759 try {
16760 instance.componentDidMount();
16761 } catch (error2) {
16762 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16763 }
16764 }
16765 function safelyAttachRef(current2, nearestMountedAncestor) {
16766 try {
16767 commitAttachRef(current2);
16768 } catch (error2) {
16769 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16770 }
16771 }
16772 function safelyDetachRef(current2, nearestMountedAncestor) {
16773 var ref = current2.ref;
16774 if (ref !== null) {
16775 if (typeof ref === "function") {
16776 var retVal;
16777 try {
16778 if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
16779 try {
16780 startLayoutEffectTimer();
16781 retVal = ref(null);
16782 } finally {
16783 recordLayoutEffectDuration(current2);
16784 }
16785 } else {
16786 retVal = ref(null);
16787 }
16788 } catch (error2) {
16789 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16790 }
16791 {
16792 if (typeof retVal === "function") {
16793 error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
16794 }
16795 }
16796 } else {
16797 ref.current = null;
16798 }
16799 }
16800 }
16801 function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
16802 try {
16803 destroy();
16804 } catch (error2) {
16805 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16806 }
16807 }
16808 var focusedInstanceHandle = null;
16809 var shouldFireAfterActiveInstanceBlur = false;
16810 function commitBeforeMutationEffects(root2, firstChild) {
16811 focusedInstanceHandle = prepareForCommit(root2.containerInfo);
16812 nextEffect = firstChild;
16813 commitBeforeMutationEffects_begin();
16814 var shouldFire = shouldFireAfterActiveInstanceBlur;
16815 shouldFireAfterActiveInstanceBlur = false;
16816 focusedInstanceHandle = null;
16817 return shouldFire;
16818 }
16819 function commitBeforeMutationEffects_begin() {
16820 while (nextEffect !== null) {
16821 var fiber = nextEffect;
16822 var child = fiber.child;
16823 if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
16824 child.return = fiber;
16825 nextEffect = child;
16826 } else {
16827 commitBeforeMutationEffects_complete();
16828 }
16829 }
16830 }
16831 function commitBeforeMutationEffects_complete() {
16832 while (nextEffect !== null) {
16833 var fiber = nextEffect;
16834 setCurrentFiber(fiber);
16835 try {
16836 commitBeforeMutationEffectsOnFiber(fiber);
16837 } catch (error2) {
16838 captureCommitPhaseError(fiber, fiber.return, error2);
16839 }
16840 resetCurrentFiber();
16841 var sibling = fiber.sibling;
16842 if (sibling !== null) {
16843 sibling.return = fiber.return;
16844 nextEffect = sibling;
16845 return;
16846 }
16847 nextEffect = fiber.return;
16848 }
16849 }
16850 function commitBeforeMutationEffectsOnFiber(finishedWork) {
16851 var current2 = finishedWork.alternate;
16852 var flags = finishedWork.flags;
16853 if ((flags & Snapshot) !== NoFlags) {
16854 setCurrentFiber(finishedWork);
16855 switch (finishedWork.tag) {
16856 case FunctionComponent:
16857 case ForwardRef:
16858 case SimpleMemoComponent: {
16859 break;
16860 }
16861 case ClassComponent: {
16862 if (current2 !== null) {
16863 var prevProps = current2.memoizedProps;
16864 var prevState = current2.memoizedState;
16865 var instance = finishedWork.stateNode;
16866 {
16867 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16868 if (instance.props !== finishedWork.memoizedProps) {
16869 error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
16870 }
16871 if (instance.state !== finishedWork.memoizedState) {
16872 error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
16873 }
16874 }
16875 }
16876 var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
16877 {
16878 var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
16879 if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
16880 didWarnSet.add(finishedWork.type);
16881 error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork));
16882 }
16883 }
16884 instance.__reactInternalSnapshotBeforeUpdate = snapshot;
16885 }
16886 break;
16887 }
16888 case HostRoot: {
16889 {
16890 var root2 = finishedWork.stateNode;
16891 clearContainer(root2.containerInfo);
16892 }
16893 break;
16894 }
16895 case HostComponent:
16896 case HostText:
16897 case HostPortal:
16898 case IncompleteClassComponent:
16899 break;
16900 default: {
16901 throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
16902 }
16903 }
16904 resetCurrentFiber();
16905 }
16906 }
16907 function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
16908 var updateQueue = finishedWork.updateQueue;
16909 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
16910 if (lastEffect !== null) {
16911 var firstEffect = lastEffect.next;
16912 var effect = firstEffect;
16913 do {
16914 if ((effect.tag & flags) === flags) {
16915 var destroy = effect.destroy;
16916 effect.destroy = void 0;
16917 if (destroy !== void 0) {
16918 {
16919 if ((flags & Passive$1) !== NoFlags$1) {
16920 markComponentPassiveEffectUnmountStarted(finishedWork);
16921 } else if ((flags & Layout) !== NoFlags$1) {
16922 markComponentLayoutEffectUnmountStarted(finishedWork);
16923 }
16924 }
16925 {
16926 if ((flags & Insertion) !== NoFlags$1) {
16927 setIsRunningInsertionEffect(true);
16928 }
16929 }
16930 safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
16931 {
16932 if ((flags & Insertion) !== NoFlags$1) {
16933 setIsRunningInsertionEffect(false);
16934 }
16935 }
16936 {
16937 if ((flags & Passive$1) !== NoFlags$1) {
16938 markComponentPassiveEffectUnmountStopped();
16939 } else if ((flags & Layout) !== NoFlags$1) {
16940 markComponentLayoutEffectUnmountStopped();
16941 }
16942 }
16943 }
16944 }
16945 effect = effect.next;
16946 } while (effect !== firstEffect);
16947 }
16948 }
16949 function commitHookEffectListMount(flags, finishedWork) {
16950 var updateQueue = finishedWork.updateQueue;
16951 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
16952 if (lastEffect !== null) {
16953 var firstEffect = lastEffect.next;
16954 var effect = firstEffect;
16955 do {
16956 if ((effect.tag & flags) === flags) {
16957 {
16958 if ((flags & Passive$1) !== NoFlags$1) {
16959 markComponentPassiveEffectMountStarted(finishedWork);
16960 } else if ((flags & Layout) !== NoFlags$1) {
16961 markComponentLayoutEffectMountStarted(finishedWork);
16962 }
16963 }
16964 var create = effect.create;
16965 {
16966 if ((flags & Insertion) !== NoFlags$1) {
16967 setIsRunningInsertionEffect(true);
16968 }
16969 }
16970 effect.destroy = create();
16971 {
16972 if ((flags & Insertion) !== NoFlags$1) {
16973 setIsRunningInsertionEffect(false);
16974 }
16975 }
16976 {
16977 if ((flags & Passive$1) !== NoFlags$1) {
16978 markComponentPassiveEffectMountStopped();
16979 } else if ((flags & Layout) !== NoFlags$1) {
16980 markComponentLayoutEffectMountStopped();
16981 }
16982 }
16983 {
16984 var destroy = effect.destroy;
16985 if (destroy !== void 0 && typeof destroy !== "function") {
16986 var hookName = void 0;
16987 if ((effect.tag & Layout) !== NoFlags) {
16988 hookName = "useLayoutEffect";
16989 } else if ((effect.tag & Insertion) !== NoFlags) {
16990 hookName = "useInsertionEffect";
16991 } else {
16992 hookName = "useEffect";
16993 }
16994 var addendum = void 0;
16995 if (destroy === null) {
16996 addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
16997 } else if (typeof destroy.then === "function") {
16998 addendum = "\n\nIt looks like you wrote " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching";
16999 } else {
17000 addendum = " You returned: " + destroy;
17001 }
17002 error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
17003 }
17004 }
17005 }
17006 effect = effect.next;
17007 } while (effect !== firstEffect);
17008 }
17009 }
17010 function commitPassiveEffectDurations(finishedRoot, finishedWork) {
17011 {
17012 if ((finishedWork.flags & Update) !== NoFlags) {
17013 switch (finishedWork.tag) {
17014 case Profiler: {
17015 var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
17016 var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
17017 var commitTime2 = getCommitTime();
17018 var phase = finishedWork.alternate === null ? "mount" : "update";
17019 {
17020 if (isCurrentUpdateNested()) {
17021 phase = "nested-update";
17022 }
17023 }
17024 if (typeof onPostCommit === "function") {
17025 onPostCommit(id, phase, passiveEffectDuration, commitTime2);
17026 }
17027 var parentFiber = finishedWork.return;
17028 outer: while (parentFiber !== null) {
17029 switch (parentFiber.tag) {
17030 case HostRoot:
17031 var root2 = parentFiber.stateNode;
17032 root2.passiveEffectDuration += passiveEffectDuration;
17033 break outer;
17034 case Profiler:
17035 var parentStateNode = parentFiber.stateNode;
17036 parentStateNode.passiveEffectDuration += passiveEffectDuration;
17037 break outer;
17038 }
17039 parentFiber = parentFiber.return;
17040 }
17041 break;
17042 }
17043 }
17044 }
17045 }
17046 }
17047 function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
17048 if ((finishedWork.flags & LayoutMask) !== NoFlags) {
17049 switch (finishedWork.tag) {
17050 case FunctionComponent:
17051 case ForwardRef:
17052 case SimpleMemoComponent: {
17053 if (!offscreenSubtreeWasHidden) {
17054 if (finishedWork.mode & ProfileMode) {
17055 try {
17056 startLayoutEffectTimer();
17057 commitHookEffectListMount(Layout | HasEffect, finishedWork);
17058 } finally {
17059 recordLayoutEffectDuration(finishedWork);
17060 }
17061 } else {
17062 commitHookEffectListMount(Layout | HasEffect, finishedWork);
17063 }
17064 }
17065 break;
17066 }
17067 case ClassComponent: {
17068 var instance = finishedWork.stateNode;
17069 if (finishedWork.flags & Update) {
17070 if (!offscreenSubtreeWasHidden) {
17071 if (current2 === null) {
17072 {
17073 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17074 if (instance.props !== finishedWork.memoizedProps) {
17075 error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17076 }
17077 if (instance.state !== finishedWork.memoizedState) {
17078 error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17079 }
17080 }
17081 }
17082 if (finishedWork.mode & ProfileMode) {
17083 try {
17084 startLayoutEffectTimer();
17085 instance.componentDidMount();
17086 } finally {
17087 recordLayoutEffectDuration(finishedWork);
17088 }
17089 } else {
17090 instance.componentDidMount();
17091 }
17092 } else {
17093 var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
17094 var prevState = current2.memoizedState;
17095 {
17096 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17097 if (instance.props !== finishedWork.memoizedProps) {
17098 error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17099 }
17100 if (instance.state !== finishedWork.memoizedState) {
17101 error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17102 }
17103 }
17104 }
17105 if (finishedWork.mode & ProfileMode) {
17106 try {
17107 startLayoutEffectTimer();
17108 instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
17109 } finally {
17110 recordLayoutEffectDuration(finishedWork);
17111 }
17112 } else {
17113 instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
17114 }
17115 }
17116 }
17117 }
17118 var updateQueue = finishedWork.updateQueue;
17119 if (updateQueue !== null) {
17120 {
17121 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17122 if (instance.props !== finishedWork.memoizedProps) {
17123 error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17124 }
17125 if (instance.state !== finishedWork.memoizedState) {
17126 error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance");
17127 }
17128 }
17129 }
17130 commitUpdateQueue(finishedWork, updateQueue, instance);
17131 }
17132 break;
17133 }
17134 case HostRoot: {
17135 var _updateQueue = finishedWork.updateQueue;
17136 if (_updateQueue !== null) {
17137 var _instance = null;
17138 if (finishedWork.child !== null) {
17139 switch (finishedWork.child.tag) {
17140 case HostComponent:
17141 _instance = getPublicInstance(finishedWork.child.stateNode);
17142 break;
17143 case ClassComponent:
17144 _instance = finishedWork.child.stateNode;
17145 break;
17146 }
17147 }
17148 commitUpdateQueue(finishedWork, _updateQueue, _instance);
17149 }
17150 break;
17151 }
17152 case HostComponent: {
17153 var _instance2 = finishedWork.stateNode;
17154 if (current2 === null && finishedWork.flags & Update) {
17155 var type = finishedWork.type;
17156 var props = finishedWork.memoizedProps;
17157 commitMount(_instance2, type, props);
17158 }
17159 break;
17160 }
17161 case HostText: {
17162 break;
17163 }
17164 case HostPortal: {
17165 break;
17166 }
17167 case Profiler: {
17168 {
17169 var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
17170 var effectDuration = finishedWork.stateNode.effectDuration;
17171 var commitTime2 = getCommitTime();
17172 var phase = current2 === null ? "mount" : "update";
17173 {
17174 if (isCurrentUpdateNested()) {
17175 phase = "nested-update";
17176 }
17177 }
17178 if (typeof onRender === "function") {
17179 onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
17180 }
17181 {
17182 if (typeof onCommit === "function") {
17183 onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
17184 }
17185 enqueuePendingPassiveProfilerEffect(finishedWork);
17186 var parentFiber = finishedWork.return;
17187 outer: while (parentFiber !== null) {
17188 switch (parentFiber.tag) {
17189 case HostRoot:
17190 var root2 = parentFiber.stateNode;
17191 root2.effectDuration += effectDuration;
17192 break outer;
17193 case Profiler:
17194 var parentStateNode = parentFiber.stateNode;
17195 parentStateNode.effectDuration += effectDuration;
17196 break outer;
17197 }
17198 parentFiber = parentFiber.return;
17199 }
17200 }
17201 }
17202 break;
17203 }
17204 case SuspenseComponent: {
17205 commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
17206 break;
17207 }
17208 case SuspenseListComponent:
17209 case IncompleteClassComponent:
17210 case ScopeComponent:
17211 case OffscreenComponent:
17212 case LegacyHiddenComponent:
17213 case TracingMarkerComponent: {
17214 break;
17215 }
17216 default:
17217 throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
17218 }
17219 }
17220 if (!offscreenSubtreeWasHidden) {
17221 {
17222 if (finishedWork.flags & Ref) {
17223 commitAttachRef(finishedWork);
17224 }
17225 }
17226 }
17227 }
17228 function reappearLayoutEffectsOnFiber(node) {
17229 switch (node.tag) {
17230 case FunctionComponent:
17231 case ForwardRef:
17232 case SimpleMemoComponent: {
17233 if (node.mode & ProfileMode) {
17234 try {
17235 startLayoutEffectTimer();
17236 safelyCallCommitHookLayoutEffectListMount(node, node.return);
17237 } finally {
17238 recordLayoutEffectDuration(node);
17239 }
17240 } else {
17241 safelyCallCommitHookLayoutEffectListMount(node, node.return);
17242 }
17243 break;
17244 }
17245 case ClassComponent: {
17246 var instance = node.stateNode;
17247 if (typeof instance.componentDidMount === "function") {
17248 safelyCallComponentDidMount(node, node.return, instance);
17249 }
17250 safelyAttachRef(node, node.return);
17251 break;
17252 }
17253 case HostComponent: {
17254 safelyAttachRef(node, node.return);
17255 break;
17256 }
17257 }
17258 }
17259 function hideOrUnhideAllChildren(finishedWork, isHidden) {
17260 var hostSubtreeRoot = null;
17261 {
17262 var node = finishedWork;
17263 while (true) {
17264 if (node.tag === HostComponent) {
17265 if (hostSubtreeRoot === null) {
17266 hostSubtreeRoot = node;
17267 try {
17268 var instance = node.stateNode;
17269 if (isHidden) {
17270 hideInstance(instance);
17271 } else {
17272 unhideInstance(node.stateNode, node.memoizedProps);
17273 }
17274 } catch (error2) {
17275 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17276 }
17277 }
17278 } else if (node.tag === HostText) {
17279 if (hostSubtreeRoot === null) {
17280 try {
17281 var _instance3 = node.stateNode;
17282 if (isHidden) {
17283 hideTextInstance(_instance3);
17284 } else {
17285 unhideTextInstance(_instance3, node.memoizedProps);
17286 }
17287 } catch (error2) {
17288 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17289 }
17290 }
17291 } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ;
17292 else if (node.child !== null) {
17293 node.child.return = node;
17294 node = node.child;
17295 continue;
17296 }
17297 if (node === finishedWork) {
17298 return;
17299 }
17300 while (node.sibling === null) {
17301 if (node.return === null || node.return === finishedWork) {
17302 return;
17303 }
17304 if (hostSubtreeRoot === node) {
17305 hostSubtreeRoot = null;
17306 }
17307 node = node.return;
17308 }
17309 if (hostSubtreeRoot === node) {
17310 hostSubtreeRoot = null;
17311 }
17312 node.sibling.return = node.return;
17313 node = node.sibling;
17314 }
17315 }
17316 }
17317 function commitAttachRef(finishedWork) {
17318 var ref = finishedWork.ref;
17319 if (ref !== null) {
17320 var instance = finishedWork.stateNode;
17321 var instanceToUse;
17322 switch (finishedWork.tag) {
17323 case HostComponent:
17324 instanceToUse = getPublicInstance(instance);
17325 break;
17326 default:
17327 instanceToUse = instance;
17328 }
17329 if (typeof ref === "function") {
17330 var retVal;
17331 if (finishedWork.mode & ProfileMode) {
17332 try {
17333 startLayoutEffectTimer();
17334 retVal = ref(instanceToUse);
17335 } finally {
17336 recordLayoutEffectDuration(finishedWork);
17337 }
17338 } else {
17339 retVal = ref(instanceToUse);
17340 }
17341 {
17342 if (typeof retVal === "function") {
17343 error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
17344 }
17345 }
17346 } else {
17347 {
17348 if (!ref.hasOwnProperty("current")) {
17349 error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
17350 }
17351 }
17352 ref.current = instanceToUse;
17353 }
17354 }
17355 }
17356 function detachFiberMutation(fiber) {
17357 var alternate = fiber.alternate;
17358 if (alternate !== null) {
17359 alternate.return = null;
17360 }
17361 fiber.return = null;
17362 }
17363 function detachFiberAfterEffects(fiber) {
17364 var alternate = fiber.alternate;
17365 if (alternate !== null) {
17366 fiber.alternate = null;
17367 detachFiberAfterEffects(alternate);
17368 }
17369 {
17370 fiber.child = null;
17371 fiber.deletions = null;
17372 fiber.sibling = null;
17373 if (fiber.tag === HostComponent) {
17374 var hostInstance = fiber.stateNode;
17375 if (hostInstance !== null) {
17376 detachDeletedInstance(hostInstance);
17377 }
17378 }
17379 fiber.stateNode = null;
17380 {
17381 fiber._debugOwner = null;
17382 }
17383 {
17384 fiber.return = null;
17385 fiber.dependencies = null;
17386 fiber.memoizedProps = null;
17387 fiber.memoizedState = null;
17388 fiber.pendingProps = null;
17389 fiber.stateNode = null;
17390 fiber.updateQueue = null;
17391 }
17392 }
17393 }
17394 function getHostParentFiber(fiber) {
17395 var parent = fiber.return;
17396 while (parent !== null) {
17397 if (isHostParent(parent)) {
17398 return parent;
17399 }
17400 parent = parent.return;
17401 }
17402 throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
17403 }
17404 function isHostParent(fiber) {
17405 return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
17406 }
17407 function getHostSibling(fiber) {
17408 var node = fiber;
17409 siblings: while (true) {
17410 while (node.sibling === null) {
17411 if (node.return === null || isHostParent(node.return)) {
17412 return null;
17413 }
17414 node = node.return;
17415 }
17416 node.sibling.return = node.return;
17417 node = node.sibling;
17418 while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
17419 if (node.flags & Placement) {
17420 continue siblings;
17421 }
17422 if (node.child === null || node.tag === HostPortal) {
17423 continue siblings;
17424 } else {
17425 node.child.return = node;
17426 node = node.child;
17427 }
17428 }
17429 if (!(node.flags & Placement)) {
17430 return node.stateNode;
17431 }
17432 }
17433 }
17434 function commitPlacement(finishedWork) {
17435 var parentFiber = getHostParentFiber(finishedWork);
17436 switch (parentFiber.tag) {
17437 case HostComponent: {
17438 var parent = parentFiber.stateNode;
17439 if (parentFiber.flags & ContentReset) {
17440 resetTextContent(parent);
17441 parentFiber.flags &= ~ContentReset;
17442 }
17443 var before = getHostSibling(finishedWork);
17444 insertOrAppendPlacementNode(finishedWork, before, parent);
17445 break;
17446 }
17447 case HostRoot:
17448 case HostPortal: {
17449 var _parent = parentFiber.stateNode.containerInfo;
17450 var _before = getHostSibling(finishedWork);
17451 insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
17452 break;
17453 }
17454 // eslint-disable-next-line-no-fallthrough
17455 default:
17456 throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
17457 }
17458 }
17459 function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
17460 var tag = node.tag;
17461 var isHost = tag === HostComponent || tag === HostText;
17462 if (isHost) {
17463 var stateNode = node.stateNode;
17464 if (before) {
17465 insertInContainerBefore(parent, stateNode, before);
17466 } else {
17467 appendChildToContainer(parent, stateNode);
17468 }
17469 } else if (tag === HostPortal) ;
17470 else {
17471 var child = node.child;
17472 if (child !== null) {
17473 insertOrAppendPlacementNodeIntoContainer(child, before, parent);
17474 var sibling = child.sibling;
17475 while (sibling !== null) {
17476 insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
17477 sibling = sibling.sibling;
17478 }
17479 }
17480 }
17481 }
17482 function insertOrAppendPlacementNode(node, before, parent) {
17483 var tag = node.tag;
17484 var isHost = tag === HostComponent || tag === HostText;
17485 if (isHost) {
17486 var stateNode = node.stateNode;
17487 if (before) {
17488 insertBefore(parent, stateNode, before);
17489 } else {
17490 appendChild(parent, stateNode);
17491 }
17492 } else if (tag === HostPortal) ;
17493 else {
17494 var child = node.child;
17495 if (child !== null) {
17496 insertOrAppendPlacementNode(child, before, parent);
17497 var sibling = child.sibling;
17498 while (sibling !== null) {
17499 insertOrAppendPlacementNode(sibling, before, parent);
17500 sibling = sibling.sibling;
17501 }
17502 }
17503 }
17504 }
17505 var hostParent = null;
17506 var hostParentIsContainer = false;
17507 function commitDeletionEffects(root2, returnFiber, deletedFiber) {
17508 {
17509 var parent = returnFiber;
17510 findParent: while (parent !== null) {
17511 switch (parent.tag) {
17512 case HostComponent: {
17513 hostParent = parent.stateNode;
17514 hostParentIsContainer = false;
17515 break findParent;
17516 }
17517 case HostRoot: {
17518 hostParent = parent.stateNode.containerInfo;
17519 hostParentIsContainer = true;
17520 break findParent;
17521 }
17522 case HostPortal: {
17523 hostParent = parent.stateNode.containerInfo;
17524 hostParentIsContainer = true;
17525 break findParent;
17526 }
17527 }
17528 parent = parent.return;
17529 }
17530 if (hostParent === null) {
17531 throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
17532 }
17533 commitDeletionEffectsOnFiber(root2, returnFiber, deletedFiber);
17534 hostParent = null;
17535 hostParentIsContainer = false;
17536 }
17537 detachFiberMutation(deletedFiber);
17538 }
17539 function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
17540 var child = parent.child;
17541 while (child !== null) {
17542 commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
17543 child = child.sibling;
17544 }
17545 }
17546 function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
17547 onCommitUnmount(deletedFiber);
17548 switch (deletedFiber.tag) {
17549 case HostComponent: {
17550 if (!offscreenSubtreeWasHidden) {
17551 safelyDetachRef(deletedFiber, nearestMountedAncestor);
17552 }
17553 }
17554 // eslint-disable-next-line-no-fallthrough
17555 case HostText: {
17556 {
17557 var prevHostParent = hostParent;
17558 var prevHostParentIsContainer = hostParentIsContainer;
17559 hostParent = null;
17560 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17561 hostParent = prevHostParent;
17562 hostParentIsContainer = prevHostParentIsContainer;
17563 if (hostParent !== null) {
17564 if (hostParentIsContainer) {
17565 removeChildFromContainer(hostParent, deletedFiber.stateNode);
17566 } else {
17567 removeChild(hostParent, deletedFiber.stateNode);
17568 }
17569 }
17570 }
17571 return;
17572 }
17573 case DehydratedFragment: {
17574 {
17575 if (hostParent !== null) {
17576 if (hostParentIsContainer) {
17577 clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
17578 } else {
17579 clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
17580 }
17581 }
17582 }
17583 return;
17584 }
17585 case HostPortal: {
17586 {
17587 var _prevHostParent = hostParent;
17588 var _prevHostParentIsContainer = hostParentIsContainer;
17589 hostParent = deletedFiber.stateNode.containerInfo;
17590 hostParentIsContainer = true;
17591 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17592 hostParent = _prevHostParent;
17593 hostParentIsContainer = _prevHostParentIsContainer;
17594 }
17595 return;
17596 }
17597 case FunctionComponent:
17598 case ForwardRef:
17599 case MemoComponent:
17600 case SimpleMemoComponent: {
17601 if (!offscreenSubtreeWasHidden) {
17602 var updateQueue = deletedFiber.updateQueue;
17603 if (updateQueue !== null) {
17604 var lastEffect = updateQueue.lastEffect;
17605 if (lastEffect !== null) {
17606 var firstEffect = lastEffect.next;
17607 var effect = firstEffect;
17608 do {
17609 var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
17610 if (destroy !== void 0) {
17611 if ((tag & Insertion) !== NoFlags$1) {
17612 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17613 } else if ((tag & Layout) !== NoFlags$1) {
17614 {
17615 markComponentLayoutEffectUnmountStarted(deletedFiber);
17616 }
17617 if (deletedFiber.mode & ProfileMode) {
17618 startLayoutEffectTimer();
17619 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17620 recordLayoutEffectDuration(deletedFiber);
17621 } else {
17622 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17623 }
17624 {
17625 markComponentLayoutEffectUnmountStopped();
17626 }
17627 }
17628 }
17629 effect = effect.next;
17630 } while (effect !== firstEffect);
17631 }
17632 }
17633 }
17634 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17635 return;
17636 }
17637 case ClassComponent: {
17638 if (!offscreenSubtreeWasHidden) {
17639 safelyDetachRef(deletedFiber, nearestMountedAncestor);
17640 var instance = deletedFiber.stateNode;
17641 if (typeof instance.componentWillUnmount === "function") {
17642 safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
17643 }
17644 }
17645 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17646 return;
17647 }
17648 case ScopeComponent: {
17649 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17650 return;
17651 }
17652 case OffscreenComponent: {
17653 if (
17654 // TODO: Remove this dead flag
17655 deletedFiber.mode & ConcurrentMode
17656 ) {
17657 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17658 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
17659 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17660 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
17661 } else {
17662 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17663 }
17664 break;
17665 }
17666 default: {
17667 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17668 return;
17669 }
17670 }
17671 }
17672 function commitSuspenseCallback(finishedWork) {
17673 var newState = finishedWork.memoizedState;
17674 }
17675 function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
17676 var newState = finishedWork.memoizedState;
17677 if (newState === null) {
17678 var current2 = finishedWork.alternate;
17679 if (current2 !== null) {
17680 var prevState = current2.memoizedState;
17681 if (prevState !== null) {
17682 var suspenseInstance = prevState.dehydrated;
17683 if (suspenseInstance !== null) {
17684 commitHydratedSuspenseInstance(suspenseInstance);
17685 }
17686 }
17687 }
17688 }
17689 }
17690 function attachSuspenseRetryListeners(finishedWork) {
17691 var wakeables = finishedWork.updateQueue;
17692 if (wakeables !== null) {
17693 finishedWork.updateQueue = null;
17694 var retryCache = finishedWork.stateNode;
17695 if (retryCache === null) {
17696 retryCache = finishedWork.stateNode = new PossiblyWeakSet();
17697 }
17698 wakeables.forEach(function(wakeable) {
17699 var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
17700 if (!retryCache.has(wakeable)) {
17701 retryCache.add(wakeable);
17702 {
17703 if (isDevToolsPresent) {
17704 if (inProgressLanes !== null && inProgressRoot !== null) {
17705 restorePendingUpdaters(inProgressRoot, inProgressLanes);
17706 } else {
17707 throw Error("Expected finished root and lanes to be set. This is a bug in React.");
17708 }
17709 }
17710 }
17711 wakeable.then(retry, retry);
17712 }
17713 });
17714 }
17715 }
17716 function commitMutationEffects(root2, finishedWork, committedLanes) {
17717 inProgressLanes = committedLanes;
17718 inProgressRoot = root2;
17719 setCurrentFiber(finishedWork);
17720 commitMutationEffectsOnFiber(finishedWork, root2);
17721 setCurrentFiber(finishedWork);
17722 inProgressLanes = null;
17723 inProgressRoot = null;
17724 }
17725 function recursivelyTraverseMutationEffects(root2, parentFiber, lanes) {
17726 var deletions = parentFiber.deletions;
17727 if (deletions !== null) {
17728 for (var i = 0; i < deletions.length; i++) {
17729 var childToDelete = deletions[i];
17730 try {
17731 commitDeletionEffects(root2, parentFiber, childToDelete);
17732 } catch (error2) {
17733 captureCommitPhaseError(childToDelete, parentFiber, error2);
17734 }
17735 }
17736 }
17737 var prevDebugFiber = getCurrentFiber();
17738 if (parentFiber.subtreeFlags & MutationMask) {
17739 var child = parentFiber.child;
17740 while (child !== null) {
17741 setCurrentFiber(child);
17742 commitMutationEffectsOnFiber(child, root2);
17743 child = child.sibling;
17744 }
17745 }
17746 setCurrentFiber(prevDebugFiber);
17747 }
17748 function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
17749 var current2 = finishedWork.alternate;
17750 var flags = finishedWork.flags;
17751 switch (finishedWork.tag) {
17752 case FunctionComponent:
17753 case ForwardRef:
17754 case MemoComponent:
17755 case SimpleMemoComponent: {
17756 recursivelyTraverseMutationEffects(root2, finishedWork);
17757 commitReconciliationEffects(finishedWork);
17758 if (flags & Update) {
17759 try {
17760 commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);
17761 commitHookEffectListMount(Insertion | HasEffect, finishedWork);
17762 } catch (error2) {
17763 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17764 }
17765 if (finishedWork.mode & ProfileMode) {
17766 try {
17767 startLayoutEffectTimer();
17768 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
17769 } catch (error2) {
17770 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17771 }
17772 recordLayoutEffectDuration(finishedWork);
17773 } else {
17774 try {
17775 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
17776 } catch (error2) {
17777 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17778 }
17779 }
17780 }
17781 return;
17782 }
17783 case ClassComponent: {
17784 recursivelyTraverseMutationEffects(root2, finishedWork);
17785 commitReconciliationEffects(finishedWork);
17786 if (flags & Ref) {
17787 if (current2 !== null) {
17788 safelyDetachRef(current2, current2.return);
17789 }
17790 }
17791 return;
17792 }
17793 case HostComponent: {
17794 recursivelyTraverseMutationEffects(root2, finishedWork);
17795 commitReconciliationEffects(finishedWork);
17796 if (flags & Ref) {
17797 if (current2 !== null) {
17798 safelyDetachRef(current2, current2.return);
17799 }
17800 }
17801 {
17802 if (finishedWork.flags & ContentReset) {
17803 var instance = finishedWork.stateNode;
17804 try {
17805 resetTextContent(instance);
17806 } catch (error2) {
17807 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17808 }
17809 }
17810 if (flags & Update) {
17811 var _instance4 = finishedWork.stateNode;
17812 if (_instance4 != null) {
17813 var newProps = finishedWork.memoizedProps;
17814 var oldProps = current2 !== null ? current2.memoizedProps : newProps;
17815 var type = finishedWork.type;
17816 var updatePayload = finishedWork.updateQueue;
17817 finishedWork.updateQueue = null;
17818 if (updatePayload !== null) {
17819 try {
17820 commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
17821 } catch (error2) {
17822 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17823 }
17824 }
17825 }
17826 }
17827 }
17828 return;
17829 }
17830 case HostText: {
17831 recursivelyTraverseMutationEffects(root2, finishedWork);
17832 commitReconciliationEffects(finishedWork);
17833 if (flags & Update) {
17834 {
17835 if (finishedWork.stateNode === null) {
17836 throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
17837 }
17838 var textInstance = finishedWork.stateNode;
17839 var newText = finishedWork.memoizedProps;
17840 var oldText = current2 !== null ? current2.memoizedProps : newText;
17841 try {
17842 commitTextUpdate(textInstance, oldText, newText);
17843 } catch (error2) {
17844 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17845 }
17846 }
17847 }
17848 return;
17849 }
17850 case HostRoot: {
17851 recursivelyTraverseMutationEffects(root2, finishedWork);
17852 commitReconciliationEffects(finishedWork);
17853 if (flags & Update) {
17854 {
17855 if (current2 !== null) {
17856 var prevRootState = current2.memoizedState;
17857 if (prevRootState.isDehydrated) {
17858 try {
17859 commitHydratedContainer(root2.containerInfo);
17860 } catch (error2) {
17861 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17862 }
17863 }
17864 }
17865 }
17866 }
17867 return;
17868 }
17869 case HostPortal: {
17870 recursivelyTraverseMutationEffects(root2, finishedWork);
17871 commitReconciliationEffects(finishedWork);
17872 return;
17873 }
17874 case SuspenseComponent: {
17875 recursivelyTraverseMutationEffects(root2, finishedWork);
17876 commitReconciliationEffects(finishedWork);
17877 var offscreenFiber = finishedWork.child;
17878 if (offscreenFiber.flags & Visibility) {
17879 var offscreenInstance = offscreenFiber.stateNode;
17880 var newState = offscreenFiber.memoizedState;
17881 var isHidden = newState !== null;
17882 offscreenInstance.isHidden = isHidden;
17883 if (isHidden) {
17884 var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
17885 if (!wasHidden) {
17886 markCommitTimeOfFallback();
17887 }
17888 }
17889 }
17890 if (flags & Update) {
17891 try {
17892 commitSuspenseCallback(finishedWork);
17893 } catch (error2) {
17894 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17895 }
17896 attachSuspenseRetryListeners(finishedWork);
17897 }
17898 return;
17899 }
17900 case OffscreenComponent: {
17901 var _wasHidden = current2 !== null && current2.memoizedState !== null;
17902 if (
17903 // TODO: Remove this dead flag
17904 finishedWork.mode & ConcurrentMode
17905 ) {
17906 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17907 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
17908 recursivelyTraverseMutationEffects(root2, finishedWork);
17909 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
17910 } else {
17911 recursivelyTraverseMutationEffects(root2, finishedWork);
17912 }
17913 commitReconciliationEffects(finishedWork);
17914 if (flags & Visibility) {
17915 var _offscreenInstance = finishedWork.stateNode;
17916 var _newState = finishedWork.memoizedState;
17917 var _isHidden = _newState !== null;
17918 var offscreenBoundary = finishedWork;
17919 _offscreenInstance.isHidden = _isHidden;
17920 {
17921 if (_isHidden) {
17922 if (!_wasHidden) {
17923 if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
17924 nextEffect = offscreenBoundary;
17925 var offscreenChild = offscreenBoundary.child;
17926 while (offscreenChild !== null) {
17927 nextEffect = offscreenChild;
17928 disappearLayoutEffects_begin(offscreenChild);
17929 offscreenChild = offscreenChild.sibling;
17930 }
17931 }
17932 }
17933 }
17934 }
17935 {
17936 hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
17937 }
17938 }
17939 return;
17940 }
17941 case SuspenseListComponent: {
17942 recursivelyTraverseMutationEffects(root2, finishedWork);
17943 commitReconciliationEffects(finishedWork);
17944 if (flags & Update) {
17945 attachSuspenseRetryListeners(finishedWork);
17946 }
17947 return;
17948 }
17949 case ScopeComponent: {
17950 return;
17951 }
17952 default: {
17953 recursivelyTraverseMutationEffects(root2, finishedWork);
17954 commitReconciliationEffects(finishedWork);
17955 return;
17956 }
17957 }
17958 }
17959 function commitReconciliationEffects(finishedWork) {
17960 var flags = finishedWork.flags;
17961 if (flags & Placement) {
17962 try {
17963 commitPlacement(finishedWork);
17964 } catch (error2) {
17965 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17966 }
17967 finishedWork.flags &= ~Placement;
17968 }
17969 if (flags & Hydrating) {
17970 finishedWork.flags &= ~Hydrating;
17971 }
17972 }
17973 function commitLayoutEffects(finishedWork, root2, committedLanes) {
17974 inProgressLanes = committedLanes;
17975 inProgressRoot = root2;
17976 nextEffect = finishedWork;
17977 commitLayoutEffects_begin(finishedWork, root2, committedLanes);
17978 inProgressLanes = null;
17979 inProgressRoot = null;
17980 }
17981 function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
17982 var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
17983 while (nextEffect !== null) {
17984 var fiber = nextEffect;
17985 var firstChild = fiber.child;
17986 if (fiber.tag === OffscreenComponent && isModernRoot) {
17987 var isHidden = fiber.memoizedState !== null;
17988 var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
17989 if (newOffscreenSubtreeIsHidden) {
17990 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
17991 continue;
17992 } else {
17993 var current2 = fiber.alternate;
17994 var wasHidden = current2 !== null && current2.memoizedState !== null;
17995 var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
17996 var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
17997 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17998 offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
17999 offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
18000 if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
18001 nextEffect = fiber;
18002 reappearLayoutEffects_begin(fiber);
18003 }
18004 var child = firstChild;
18005 while (child !== null) {
18006 nextEffect = child;
18007 commitLayoutEffects_begin(
18008 child,
18009 // New root; bubble back up to here and stop.
18010 root2,
18011 committedLanes
18012 );
18013 child = child.sibling;
18014 }
18015 nextEffect = fiber;
18016 offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
18017 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
18018 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
18019 continue;
18020 }
18021 }
18022 if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
18023 firstChild.return = fiber;
18024 nextEffect = firstChild;
18025 } else {
18026 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
18027 }
18028 }
18029 }
18030 function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
18031 while (nextEffect !== null) {
18032 var fiber = nextEffect;
18033 if ((fiber.flags & LayoutMask) !== NoFlags) {
18034 var current2 = fiber.alternate;
18035 setCurrentFiber(fiber);
18036 try {
18037 commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
18038 } catch (error2) {
18039 captureCommitPhaseError(fiber, fiber.return, error2);
18040 }
18041 resetCurrentFiber();
18042 }
18043 if (fiber === subtreeRoot) {
18044 nextEffect = null;
18045 return;
18046 }
18047 var sibling = fiber.sibling;
18048 if (sibling !== null) {
18049 sibling.return = fiber.return;
18050 nextEffect = sibling;
18051 return;
18052 }
18053 nextEffect = fiber.return;
18054 }
18055 }
18056 function disappearLayoutEffects_begin(subtreeRoot) {
18057 while (nextEffect !== null) {
18058 var fiber = nextEffect;
18059 var firstChild = fiber.child;
18060 switch (fiber.tag) {
18061 case FunctionComponent:
18062 case ForwardRef:
18063 case MemoComponent:
18064 case SimpleMemoComponent: {
18065 if (fiber.mode & ProfileMode) {
18066 try {
18067 startLayoutEffectTimer();
18068 commitHookEffectListUnmount(Layout, fiber, fiber.return);
18069 } finally {
18070 recordLayoutEffectDuration(fiber);
18071 }
18072 } else {
18073 commitHookEffectListUnmount(Layout, fiber, fiber.return);
18074 }
18075 break;
18076 }
18077 case ClassComponent: {
18078 safelyDetachRef(fiber, fiber.return);
18079 var instance = fiber.stateNode;
18080 if (typeof instance.componentWillUnmount === "function") {
18081 safelyCallComponentWillUnmount(fiber, fiber.return, instance);
18082 }
18083 break;
18084 }
18085 case HostComponent: {
18086 safelyDetachRef(fiber, fiber.return);
18087 break;
18088 }
18089 case OffscreenComponent: {
18090 var isHidden = fiber.memoizedState !== null;
18091 if (isHidden) {
18092 disappearLayoutEffects_complete(subtreeRoot);
18093 continue;
18094 }
18095 break;
18096 }
18097 }
18098 if (firstChild !== null) {
18099 firstChild.return = fiber;
18100 nextEffect = firstChild;
18101 } else {
18102 disappearLayoutEffects_complete(subtreeRoot);
18103 }
18104 }
18105 }
18106 function disappearLayoutEffects_complete(subtreeRoot) {
18107 while (nextEffect !== null) {
18108 var fiber = nextEffect;
18109 if (fiber === subtreeRoot) {
18110 nextEffect = null;
18111 return;
18112 }
18113 var sibling = fiber.sibling;
18114 if (sibling !== null) {
18115 sibling.return = fiber.return;
18116 nextEffect = sibling;
18117 return;
18118 }
18119 nextEffect = fiber.return;
18120 }
18121 }
18122 function reappearLayoutEffects_begin(subtreeRoot) {
18123 while (nextEffect !== null) {
18124 var fiber = nextEffect;
18125 var firstChild = fiber.child;
18126 if (fiber.tag === OffscreenComponent) {
18127 var isHidden = fiber.memoizedState !== null;
18128 if (isHidden) {
18129 reappearLayoutEffects_complete(subtreeRoot);
18130 continue;
18131 }
18132 }
18133 if (firstChild !== null) {
18134 firstChild.return = fiber;
18135 nextEffect = firstChild;
18136 } else {
18137 reappearLayoutEffects_complete(subtreeRoot);
18138 }
18139 }
18140 }
18141 function reappearLayoutEffects_complete(subtreeRoot) {
18142 while (nextEffect !== null) {
18143 var fiber = nextEffect;
18144 setCurrentFiber(fiber);
18145 try {
18146 reappearLayoutEffectsOnFiber(fiber);
18147 } catch (error2) {
18148 captureCommitPhaseError(fiber, fiber.return, error2);
18149 }
18150 resetCurrentFiber();
18151 if (fiber === subtreeRoot) {
18152 nextEffect = null;
18153 return;
18154 }
18155 var sibling = fiber.sibling;
18156 if (sibling !== null) {
18157 sibling.return = fiber.return;
18158 nextEffect = sibling;
18159 return;
18160 }
18161 nextEffect = fiber.return;
18162 }
18163 }
18164 function commitPassiveMountEffects(root2, finishedWork, committedLanes, committedTransitions) {
18165 nextEffect = finishedWork;
18166 commitPassiveMountEffects_begin(finishedWork, root2, committedLanes, committedTransitions);
18167 }
18168 function commitPassiveMountEffects_begin(subtreeRoot, root2, committedLanes, committedTransitions) {
18169 while (nextEffect !== null) {
18170 var fiber = nextEffect;
18171 var firstChild = fiber.child;
18172 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
18173 firstChild.return = fiber;
18174 nextEffect = firstChild;
18175 } else {
18176 commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions);
18177 }
18178 }
18179 }
18180 function commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions) {
18181 while (nextEffect !== null) {
18182 var fiber = nextEffect;
18183 if ((fiber.flags & Passive) !== NoFlags) {
18184 setCurrentFiber(fiber);
18185 try {
18186 commitPassiveMountOnFiber(root2, fiber, committedLanes, committedTransitions);
18187 } catch (error2) {
18188 captureCommitPhaseError(fiber, fiber.return, error2);
18189 }
18190 resetCurrentFiber();
18191 }
18192 if (fiber === subtreeRoot) {
18193 nextEffect = null;
18194 return;
18195 }
18196 var sibling = fiber.sibling;
18197 if (sibling !== null) {
18198 sibling.return = fiber.return;
18199 nextEffect = sibling;
18200 return;
18201 }
18202 nextEffect = fiber.return;
18203 }
18204 }
18205 function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
18206 switch (finishedWork.tag) {
18207 case FunctionComponent:
18208 case ForwardRef:
18209 case SimpleMemoComponent: {
18210 if (finishedWork.mode & ProfileMode) {
18211 startPassiveEffectTimer();
18212 try {
18213 commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
18214 } finally {
18215 recordPassiveEffectDuration(finishedWork);
18216 }
18217 } else {
18218 commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
18219 }
18220 break;
18221 }
18222 }
18223 }
18224 function commitPassiveUnmountEffects(firstChild) {
18225 nextEffect = firstChild;
18226 commitPassiveUnmountEffects_begin();
18227 }
18228 function commitPassiveUnmountEffects_begin() {
18229 while (nextEffect !== null) {
18230 var fiber = nextEffect;
18231 var child = fiber.child;
18232 if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
18233 var deletions = fiber.deletions;
18234 if (deletions !== null) {
18235 for (var i = 0; i < deletions.length; i++) {
18236 var fiberToDelete = deletions[i];
18237 nextEffect = fiberToDelete;
18238 commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
18239 }
18240 {
18241 var previousFiber = fiber.alternate;
18242 if (previousFiber !== null) {
18243 var detachedChild = previousFiber.child;
18244 if (detachedChild !== null) {
18245 previousFiber.child = null;
18246 do {
18247 var detachedSibling = detachedChild.sibling;
18248 detachedChild.sibling = null;
18249 detachedChild = detachedSibling;
18250 } while (detachedChild !== null);
18251 }
18252 }
18253 }
18254 nextEffect = fiber;
18255 }
18256 }
18257 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
18258 child.return = fiber;
18259 nextEffect = child;
18260 } else {
18261 commitPassiveUnmountEffects_complete();
18262 }
18263 }
18264 }
18265 function commitPassiveUnmountEffects_complete() {
18266 while (nextEffect !== null) {
18267 var fiber = nextEffect;
18268 if ((fiber.flags & Passive) !== NoFlags) {
18269 setCurrentFiber(fiber);
18270 commitPassiveUnmountOnFiber(fiber);
18271 resetCurrentFiber();
18272 }
18273 var sibling = fiber.sibling;
18274 if (sibling !== null) {
18275 sibling.return = fiber.return;
18276 nextEffect = sibling;
18277 return;
18278 }
18279 nextEffect = fiber.return;
18280 }
18281 }
18282 function commitPassiveUnmountOnFiber(finishedWork) {
18283 switch (finishedWork.tag) {
18284 case FunctionComponent:
18285 case ForwardRef:
18286 case SimpleMemoComponent: {
18287 if (finishedWork.mode & ProfileMode) {
18288 startPassiveEffectTimer();
18289 commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
18290 recordPassiveEffectDuration(finishedWork);
18291 } else {
18292 commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
18293 }
18294 break;
18295 }
18296 }
18297 }
18298 function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
18299 while (nextEffect !== null) {
18300 var fiber = nextEffect;
18301 setCurrentFiber(fiber);
18302 commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
18303 resetCurrentFiber();
18304 var child = fiber.child;
18305 if (child !== null) {
18306 child.return = fiber;
18307 nextEffect = child;
18308 } else {
18309 commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
18310 }
18311 }
18312 }
18313 function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
18314 while (nextEffect !== null) {
18315 var fiber = nextEffect;
18316 var sibling = fiber.sibling;
18317 var returnFiber = fiber.return;
18318 {
18319 detachFiberAfterEffects(fiber);
18320 if (fiber === deletedSubtreeRoot) {
18321 nextEffect = null;
18322 return;
18323 }
18324 }
18325 if (sibling !== null) {
18326 sibling.return = returnFiber;
18327 nextEffect = sibling;
18328 return;
18329 }
18330 nextEffect = returnFiber;
18331 }
18332 }
18333 function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
18334 switch (current2.tag) {
18335 case FunctionComponent:
18336 case ForwardRef:
18337 case SimpleMemoComponent: {
18338 if (current2.mode & ProfileMode) {
18339 startPassiveEffectTimer();
18340 commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
18341 recordPassiveEffectDuration(current2);
18342 } else {
18343 commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
18344 }
18345 break;
18346 }
18347 }
18348 }
18349 function invokeLayoutEffectMountInDEV(fiber) {
18350 {
18351 switch (fiber.tag) {
18352 case FunctionComponent:
18353 case ForwardRef:
18354 case SimpleMemoComponent: {
18355 try {
18356 commitHookEffectListMount(Layout | HasEffect, fiber);
18357 } catch (error2) {
18358 captureCommitPhaseError(fiber, fiber.return, error2);
18359 }
18360 break;
18361 }
18362 case ClassComponent: {
18363 var instance = fiber.stateNode;
18364 try {
18365 instance.componentDidMount();
18366 } catch (error2) {
18367 captureCommitPhaseError(fiber, fiber.return, error2);
18368 }
18369 break;
18370 }
18371 }
18372 }
18373 }
18374 function invokePassiveEffectMountInDEV(fiber) {
18375 {
18376 switch (fiber.tag) {
18377 case FunctionComponent:
18378 case ForwardRef:
18379 case SimpleMemoComponent: {
18380 try {
18381 commitHookEffectListMount(Passive$1 | HasEffect, fiber);
18382 } catch (error2) {
18383 captureCommitPhaseError(fiber, fiber.return, error2);
18384 }
18385 break;
18386 }
18387 }
18388 }
18389 }
18390 function invokeLayoutEffectUnmountInDEV(fiber) {
18391 {
18392 switch (fiber.tag) {
18393 case FunctionComponent:
18394 case ForwardRef:
18395 case SimpleMemoComponent: {
18396 try {
18397 commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);
18398 } catch (error2) {
18399 captureCommitPhaseError(fiber, fiber.return, error2);
18400 }
18401 break;
18402 }
18403 case ClassComponent: {
18404 var instance = fiber.stateNode;
18405 if (typeof instance.componentWillUnmount === "function") {
18406 safelyCallComponentWillUnmount(fiber, fiber.return, instance);
18407 }
18408 break;
18409 }
18410 }
18411 }
18412 }
18413 function invokePassiveEffectUnmountInDEV(fiber) {
18414 {
18415 switch (fiber.tag) {
18416 case FunctionComponent:
18417 case ForwardRef:
18418 case SimpleMemoComponent: {
18419 try {
18420 commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
18421 } catch (error2) {
18422 captureCommitPhaseError(fiber, fiber.return, error2);
18423 }
18424 }
18425 }
18426 }
18427 }
18428 var COMPONENT_TYPE = 0;
18429 var HAS_PSEUDO_CLASS_TYPE = 1;
18430 var ROLE_TYPE = 2;
18431 var TEST_NAME_TYPE = 3;
18432 var TEXT_TYPE = 4;
18433 if (typeof Symbol === "function" && Symbol.for) {
18434 var symbolFor = Symbol.for;
18435 COMPONENT_TYPE = symbolFor("selector.component");
18436 HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
18437 ROLE_TYPE = symbolFor("selector.role");
18438 TEST_NAME_TYPE = symbolFor("selector.test_id");
18439 TEXT_TYPE = symbolFor("selector.text");
18440 }
18441 var commitHooks = [];
18442 function onCommitRoot$1() {
18443 {
18444 commitHooks.forEach(function(commitHook) {
18445 return commitHook();
18446 });
18447 }
18448 }
18449 var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
18450 function isLegacyActEnvironment(fiber) {
18451 {
18452 var isReactActEnvironmentGlobal = (
18453 // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
18454 typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
18455 );
18456 var jestIsDefined = typeof jest !== "undefined";
18457 return jestIsDefined && isReactActEnvironmentGlobal !== false;
18458 }
18459 }
18460 function isConcurrentActEnvironment() {
18461 {
18462 var isReactActEnvironmentGlobal = (
18463 // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
18464 typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
18465 );
18466 if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
18467 error("The current testing environment is not configured to support act(...)");
18468 }
18469 return isReactActEnvironmentGlobal;
18470 }
18471 }
18472 var ceil = Math.ceil;
18473 var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
18474 var NoContext = (
18475 /* */
18476 0
18477 );
18478 var BatchedContext = (
18479 /* */
18480 1
18481 );
18482 var RenderContext = (
18483 /* */
18484 2
18485 );
18486 var CommitContext = (
18487 /* */
18488 4
18489 );
18490 var RootInProgress = 0;
18491 var RootFatalErrored = 1;
18492 var RootErrored = 2;
18493 var RootSuspended = 3;
18494 var RootSuspendedWithDelay = 4;
18495 var RootCompleted = 5;
18496 var RootDidNotComplete = 6;
18497 var executionContext = NoContext;
18498 var workInProgressRoot = null;
18499 var workInProgress = null;
18500 var workInProgressRootRenderLanes = NoLanes;
18501 var subtreeRenderLanes = NoLanes;
18502 var subtreeRenderLanesCursor = createCursor(NoLanes);
18503 var workInProgressRootExitStatus = RootInProgress;
18504 var workInProgressRootFatalError = null;
18505 var workInProgressRootIncludedLanes = NoLanes;
18506 var workInProgressRootSkippedLanes = NoLanes;
18507 var workInProgressRootInterleavedUpdatedLanes = NoLanes;
18508 var workInProgressRootPingedLanes = NoLanes;
18509 var workInProgressRootConcurrentErrors = null;
18510 var workInProgressRootRecoverableErrors = null;
18511 var globalMostRecentFallbackTime = 0;
18512 var FALLBACK_THROTTLE_MS = 500;
18513 var workInProgressRootRenderTargetTime = Infinity;
18514 var RENDER_TIMEOUT_MS = 500;
18515 var workInProgressTransitions = null;
18516 function resetRenderTimer() {
18517 workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
18518 }
18519 function getRenderTargetTime() {
18520 return workInProgressRootRenderTargetTime;
18521 }
18522 var hasUncaughtError = false;
18523 var firstUncaughtError = null;
18524 var legacyErrorBoundariesThatAlreadyFailed = null;
18525 var rootDoesHavePassiveEffects = false;
18526 var rootWithPendingPassiveEffects = null;
18527 var pendingPassiveEffectsLanes = NoLanes;
18528 var pendingPassiveProfilerEffects = [];
18529 var pendingPassiveTransitions = null;
18530 var NESTED_UPDATE_LIMIT = 50;
18531 var nestedUpdateCount = 0;
18532 var rootWithNestedUpdates = null;
18533 var isFlushingPassiveEffects = false;
18534 var didScheduleUpdateDuringPassiveEffects = false;
18535 var NESTED_PASSIVE_UPDATE_LIMIT = 50;
18536 var nestedPassiveUpdateCount = 0;
18537 var rootWithPassiveNestedUpdates = null;
18538 var currentEventTime = NoTimestamp;
18539 var currentEventTransitionLane = NoLanes;
18540 var isRunningInsertionEffect = false;
18541 function getWorkInProgressRoot() {
18542 return workInProgressRoot;
18543 }
18544 function requestEventTime() {
18545 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18546 return now();
18547 }
18548 if (currentEventTime !== NoTimestamp) {
18549 return currentEventTime;
18550 }
18551 currentEventTime = now();
18552 return currentEventTime;
18553 }
18554 function requestUpdateLane(fiber) {
18555 var mode = fiber.mode;
18556 if ((mode & ConcurrentMode) === NoMode) {
18557 return SyncLane;
18558 } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
18559 return pickArbitraryLane(workInProgressRootRenderLanes);
18560 }
18561 var isTransition = requestCurrentTransition() !== NoTransition;
18562 if (isTransition) {
18563 if (ReactCurrentBatchConfig$3.transition !== null) {
18564 var transition = ReactCurrentBatchConfig$3.transition;
18565 if (!transition._updatedFibers) {
18566 transition._updatedFibers = /* @__PURE__ */ new Set();
18567 }
18568 transition._updatedFibers.add(fiber);
18569 }
18570 if (currentEventTransitionLane === NoLane) {
18571 currentEventTransitionLane = claimNextTransitionLane();
18572 }
18573 return currentEventTransitionLane;
18574 }
18575 var updateLane = getCurrentUpdatePriority();
18576 if (updateLane !== NoLane) {
18577 return updateLane;
18578 }
18579 var eventLane = getCurrentEventPriority();
18580 return eventLane;
18581 }
18582 function requestRetryLane(fiber) {
18583 var mode = fiber.mode;
18584 if ((mode & ConcurrentMode) === NoMode) {
18585 return SyncLane;
18586 }
18587 return claimNextRetryLane();
18588 }
18589 function scheduleUpdateOnFiber(root2, fiber, lane, eventTime) {
18590 checkForNestedUpdates();
18591 {
18592 if (isRunningInsertionEffect) {
18593 error("useInsertionEffect must not schedule updates.");
18594 }
18595 }
18596 {
18597 if (isFlushingPassiveEffects) {
18598 didScheduleUpdateDuringPassiveEffects = true;
18599 }
18600 }
18601 markRootUpdated(root2, lane, eventTime);
18602 if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
18603 warnAboutRenderPhaseUpdatesInDEV(fiber);
18604 } else {
18605 {
18606 if (isDevToolsPresent) {
18607 addFiberToLanesMap(root2, fiber, lane);
18608 }
18609 }
18610 warnIfUpdatesNotWrappedWithActDEV(fiber);
18611 if (root2 === workInProgressRoot) {
18612 if ((executionContext & RenderContext) === NoContext) {
18613 workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
18614 }
18615 if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
18616 markRootSuspended$1(root2, workInProgressRootRenderLanes);
18617 }
18618 }
18619 ensureRootIsScheduled(root2, eventTime);
18620 if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
18621 !ReactCurrentActQueue$1.isBatchingLegacy) {
18622 resetRenderTimer();
18623 flushSyncCallbacksOnlyInLegacyMode();
18624 }
18625 }
18626 }
18627 function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
18628 var current2 = root2.current;
18629 current2.lanes = lane;
18630 markRootUpdated(root2, lane, eventTime);
18631 ensureRootIsScheduled(root2, eventTime);
18632 }
18633 function isUnsafeClassRenderPhaseUpdate(fiber) {
18634 return (
18635 // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
18636 // decided not to enable it.
18637 (executionContext & RenderContext) !== NoContext
18638 );
18639 }
18640 function ensureRootIsScheduled(root2, currentTime) {
18641 var existingCallbackNode = root2.callbackNode;
18642 markStarvedLanesAsExpired(root2, currentTime);
18643 var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
18644 if (nextLanes === NoLanes) {
18645 if (existingCallbackNode !== null) {
18646 cancelCallback$1(existingCallbackNode);
18647 }
18648 root2.callbackNode = null;
18649 root2.callbackPriority = NoLane;
18650 return;
18651 }
18652 var newCallbackPriority = getHighestPriorityLane(nextLanes);
18653 var existingCallbackPriority = root2.callbackPriority;
18654 if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a
18655 // Scheduler task, rather than an `act` task, cancel it and re-scheduled
18656 // on the `act` queue.
18657 !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
18658 {
18659 if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
18660 error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
18661 }
18662 }
18663 return;
18664 }
18665 if (existingCallbackNode != null) {
18666 cancelCallback$1(existingCallbackNode);
18667 }
18668 var newCallbackNode;
18669 if (newCallbackPriority === SyncLane) {
18670 if (root2.tag === LegacyRoot) {
18671 if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
18672 ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
18673 }
18674 scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
18675 } else {
18676 scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
18677 }
18678 {
18679 if (ReactCurrentActQueue$1.current !== null) {
18680 ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
18681 } else {
18682 scheduleMicrotask(function() {
18683 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
18684 flushSyncCallbacks();
18685 }
18686 });
18687 }
18688 }
18689 newCallbackNode = null;
18690 } else {
18691 var schedulerPriorityLevel;
18692 switch (lanesToEventPriority(nextLanes)) {
18693 case DiscreteEventPriority:
18694 schedulerPriorityLevel = ImmediatePriority;
18695 break;
18696 case ContinuousEventPriority:
18697 schedulerPriorityLevel = UserBlockingPriority;
18698 break;
18699 case DefaultEventPriority:
18700 schedulerPriorityLevel = NormalPriority;
18701 break;
18702 case IdleEventPriority:
18703 schedulerPriorityLevel = IdlePriority;
18704 break;
18705 default:
18706 schedulerPriorityLevel = NormalPriority;
18707 break;
18708 }
18709 newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
18710 }
18711 root2.callbackPriority = newCallbackPriority;
18712 root2.callbackNode = newCallbackNode;
18713 }
18714 function performConcurrentWorkOnRoot(root2, didTimeout) {
18715 {
18716 resetNestedUpdateFlag();
18717 }
18718 currentEventTime = NoTimestamp;
18719 currentEventTransitionLane = NoLanes;
18720 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18721 throw new Error("Should not already be working.");
18722 }
18723 var originalCallbackNode = root2.callbackNode;
18724 var didFlushPassiveEffects = flushPassiveEffects();
18725 if (didFlushPassiveEffects) {
18726 if (root2.callbackNode !== originalCallbackNode) {
18727 return null;
18728 }
18729 }
18730 var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
18731 if (lanes === NoLanes) {
18732 return null;
18733 }
18734 var shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
18735 var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
18736 if (exitStatus !== RootInProgress) {
18737 if (exitStatus === RootErrored) {
18738 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18739 if (errorRetryLanes !== NoLanes) {
18740 lanes = errorRetryLanes;
18741 exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
18742 }
18743 }
18744 if (exitStatus === RootFatalErrored) {
18745 var fatalError = workInProgressRootFatalError;
18746 prepareFreshStack(root2, NoLanes);
18747 markRootSuspended$1(root2, lanes);
18748 ensureRootIsScheduled(root2, now());
18749 throw fatalError;
18750 }
18751 if (exitStatus === RootDidNotComplete) {
18752 markRootSuspended$1(root2, lanes);
18753 } else {
18754 var renderWasConcurrent = !includesBlockingLane(root2, lanes);
18755 var finishedWork = root2.current.alternate;
18756 if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
18757 exitStatus = renderRootSync(root2, lanes);
18758 if (exitStatus === RootErrored) {
18759 var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18760 if (_errorRetryLanes !== NoLanes) {
18761 lanes = _errorRetryLanes;
18762 exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
18763 }
18764 }
18765 if (exitStatus === RootFatalErrored) {
18766 var _fatalError = workInProgressRootFatalError;
18767 prepareFreshStack(root2, NoLanes);
18768 markRootSuspended$1(root2, lanes);
18769 ensureRootIsScheduled(root2, now());
18770 throw _fatalError;
18771 }
18772 }
18773 root2.finishedWork = finishedWork;
18774 root2.finishedLanes = lanes;
18775 finishConcurrentRender(root2, exitStatus, lanes);
18776 }
18777 }
18778 ensureRootIsScheduled(root2, now());
18779 if (root2.callbackNode === originalCallbackNode) {
18780 return performConcurrentWorkOnRoot.bind(null, root2);
18781 }
18782 return null;
18783 }
18784 function recoverFromConcurrentError(root2, errorRetryLanes) {
18785 var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
18786 if (isRootDehydrated(root2)) {
18787 var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
18788 rootWorkInProgress.flags |= ForceClientRender;
18789 {
18790 errorHydratingContainer(root2.containerInfo);
18791 }
18792 }
18793 var exitStatus = renderRootSync(root2, errorRetryLanes);
18794 if (exitStatus !== RootErrored) {
18795 var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
18796 workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
18797 if (errorsFromSecondAttempt !== null) {
18798 queueRecoverableErrors(errorsFromSecondAttempt);
18799 }
18800 }
18801 return exitStatus;
18802 }
18803 function queueRecoverableErrors(errors) {
18804 if (workInProgressRootRecoverableErrors === null) {
18805 workInProgressRootRecoverableErrors = errors;
18806 } else {
18807 workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
18808 }
18809 }
18810 function finishConcurrentRender(root2, exitStatus, lanes) {
18811 switch (exitStatus) {
18812 case RootInProgress:
18813 case RootFatalErrored: {
18814 throw new Error("Root did not complete. This is a bug in React.");
18815 }
18816 // Flow knows about invariant, so it complains if I add a break
18817 // statement, but eslint doesn't know about invariant, so it complains
18818 // if I do. eslint-disable-next-line no-fallthrough
18819 case RootErrored: {
18820 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18821 break;
18822 }
18823 case RootSuspended: {
18824 markRootSuspended$1(root2, lanes);
18825 if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
18826 !shouldForceFlushFallbacksInDEV()) {
18827 var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
18828 if (msUntilTimeout > 10) {
18829 var nextLanes = getNextLanes(root2, NoLanes);
18830 if (nextLanes !== NoLanes) {
18831 break;
18832 }
18833 var suspendedLanes = root2.suspendedLanes;
18834 if (!isSubsetOfLanes(suspendedLanes, lanes)) {
18835 var eventTime = requestEventTime();
18836 markRootPinged(root2, suspendedLanes);
18837 break;
18838 }
18839 root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
18840 break;
18841 }
18842 }
18843 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18844 break;
18845 }
18846 case RootSuspendedWithDelay: {
18847 markRootSuspended$1(root2, lanes);
18848 if (includesOnlyTransitions(lanes)) {
18849 break;
18850 }
18851 if (!shouldForceFlushFallbacksInDEV()) {
18852 var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
18853 var eventTimeMs = mostRecentEventTime;
18854 var timeElapsedMs = now() - eventTimeMs;
18855 var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
18856 if (_msUntilTimeout > 10) {
18857 root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
18858 break;
18859 }
18860 }
18861 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18862 break;
18863 }
18864 case RootCompleted: {
18865 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18866 break;
18867 }
18868 default: {
18869 throw new Error("Unknown root exit status.");
18870 }
18871 }
18872 }
18873 function isRenderConsistentWithExternalStores(finishedWork) {
18874 var node = finishedWork;
18875 while (true) {
18876 if (node.flags & StoreConsistency) {
18877 var updateQueue = node.updateQueue;
18878 if (updateQueue !== null) {
18879 var checks = updateQueue.stores;
18880 if (checks !== null) {
18881 for (var i = 0; i < checks.length; i++) {
18882 var check = checks[i];
18883 var getSnapshot = check.getSnapshot;
18884 var renderedValue = check.value;
18885 try {
18886 if (!objectIs(getSnapshot(), renderedValue)) {
18887 return false;
18888 }
18889 } catch (error2) {
18890 return false;
18891 }
18892 }
18893 }
18894 }
18895 }
18896 var child = node.child;
18897 if (node.subtreeFlags & StoreConsistency && child !== null) {
18898 child.return = node;
18899 node = child;
18900 continue;
18901 }
18902 if (node === finishedWork) {
18903 return true;
18904 }
18905 while (node.sibling === null) {
18906 if (node.return === null || node.return === finishedWork) {
18907 return true;
18908 }
18909 node = node.return;
18910 }
18911 node.sibling.return = node.return;
18912 node = node.sibling;
18913 }
18914 return true;
18915 }
18916 function markRootSuspended$1(root2, suspendedLanes) {
18917 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
18918 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
18919 markRootSuspended(root2, suspendedLanes);
18920 }
18921 function performSyncWorkOnRoot(root2) {
18922 {
18923 syncNestedUpdateFlag();
18924 }
18925 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18926 throw new Error("Should not already be working.");
18927 }
18928 flushPassiveEffects();
18929 var lanes = getNextLanes(root2, NoLanes);
18930 if (!includesSomeLane(lanes, SyncLane)) {
18931 ensureRootIsScheduled(root2, now());
18932 return null;
18933 }
18934 var exitStatus = renderRootSync(root2, lanes);
18935 if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
18936 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18937 if (errorRetryLanes !== NoLanes) {
18938 lanes = errorRetryLanes;
18939 exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
18940 }
18941 }
18942 if (exitStatus === RootFatalErrored) {
18943 var fatalError = workInProgressRootFatalError;
18944 prepareFreshStack(root2, NoLanes);
18945 markRootSuspended$1(root2, lanes);
18946 ensureRootIsScheduled(root2, now());
18947 throw fatalError;
18948 }
18949 if (exitStatus === RootDidNotComplete) {
18950 throw new Error("Root did not complete. This is a bug in React.");
18951 }
18952 var finishedWork = root2.current.alternate;
18953 root2.finishedWork = finishedWork;
18954 root2.finishedLanes = lanes;
18955 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18956 ensureRootIsScheduled(root2, now());
18957 return null;
18958 }
18959 function flushRoot(root2, lanes) {
18960 if (lanes !== NoLanes) {
18961 markRootEntangled(root2, mergeLanes(lanes, SyncLane));
18962 ensureRootIsScheduled(root2, now());
18963 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
18964 resetRenderTimer();
18965 flushSyncCallbacks();
18966 }
18967 }
18968 }
18969 function batchedUpdates$1(fn, a) {
18970 var prevExecutionContext = executionContext;
18971 executionContext |= BatchedContext;
18972 try {
18973 return fn(a);
18974 } finally {
18975 executionContext = prevExecutionContext;
18976 if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
18977 !ReactCurrentActQueue$1.isBatchingLegacy) {
18978 resetRenderTimer();
18979 flushSyncCallbacksOnlyInLegacyMode();
18980 }
18981 }
18982 }
18983 function discreteUpdates(fn, a, b, c, d) {
18984 var previousPriority = getCurrentUpdatePriority();
18985 var prevTransition = ReactCurrentBatchConfig$3.transition;
18986 try {
18987 ReactCurrentBatchConfig$3.transition = null;
18988 setCurrentUpdatePriority(DiscreteEventPriority);
18989 return fn(a, b, c, d);
18990 } finally {
18991 setCurrentUpdatePriority(previousPriority);
18992 ReactCurrentBatchConfig$3.transition = prevTransition;
18993 if (executionContext === NoContext) {
18994 resetRenderTimer();
18995 }
18996 }
18997 }
18998 function flushSync(fn) {
18999 if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
19000 flushPassiveEffects();
19001 }
19002 var prevExecutionContext = executionContext;
19003 executionContext |= BatchedContext;
19004 var prevTransition = ReactCurrentBatchConfig$3.transition;
19005 var previousPriority = getCurrentUpdatePriority();
19006 try {
19007 ReactCurrentBatchConfig$3.transition = null;
19008 setCurrentUpdatePriority(DiscreteEventPriority);
19009 if (fn) {
19010 return fn();
19011 } else {
19012 return void 0;
19013 }
19014 } finally {
19015 setCurrentUpdatePriority(previousPriority);
19016 ReactCurrentBatchConfig$3.transition = prevTransition;
19017 executionContext = prevExecutionContext;
19018 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
19019 flushSyncCallbacks();
19020 }
19021 }
19022 }
19023 function isAlreadyRendering() {
19024 return (executionContext & (RenderContext | CommitContext)) !== NoContext;
19025 }
19026 function pushRenderLanes(fiber, lanes) {
19027 push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
19028 subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
19029 workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
19030 }
19031 function popRenderLanes(fiber) {
19032 subtreeRenderLanes = subtreeRenderLanesCursor.current;
19033 pop(subtreeRenderLanesCursor, fiber);
19034 }
19035 function prepareFreshStack(root2, lanes) {
19036 root2.finishedWork = null;
19037 root2.finishedLanes = NoLanes;
19038 var timeoutHandle = root2.timeoutHandle;
19039 if (timeoutHandle !== noTimeout) {
19040 root2.timeoutHandle = noTimeout;
19041 cancelTimeout(timeoutHandle);
19042 }
19043 if (workInProgress !== null) {
19044 var interruptedWork = workInProgress.return;
19045 while (interruptedWork !== null) {
19046 var current2 = interruptedWork.alternate;
19047 unwindInterruptedWork(current2, interruptedWork);
19048 interruptedWork = interruptedWork.return;
19049 }
19050 }
19051 workInProgressRoot = root2;
19052 var rootWorkInProgress = createWorkInProgress(root2.current, null);
19053 workInProgress = rootWorkInProgress;
19054 workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
19055 workInProgressRootExitStatus = RootInProgress;
19056 workInProgressRootFatalError = null;
19057 workInProgressRootSkippedLanes = NoLanes;
19058 workInProgressRootInterleavedUpdatedLanes = NoLanes;
19059 workInProgressRootPingedLanes = NoLanes;
19060 workInProgressRootConcurrentErrors = null;
19061 workInProgressRootRecoverableErrors = null;
19062 finishQueueingConcurrentUpdates();
19063 {
19064 ReactStrictModeWarnings.discardPendingWarnings();
19065 }
19066 return rootWorkInProgress;
19067 }
19068 function handleError(root2, thrownValue) {
19069 do {
19070 var erroredWork = workInProgress;
19071 try {
19072 resetContextDependencies();
19073 resetHooksAfterThrow();
19074 resetCurrentFiber();
19075 ReactCurrentOwner$2.current = null;
19076 if (erroredWork === null || erroredWork.return === null) {
19077 workInProgressRootExitStatus = RootFatalErrored;
19078 workInProgressRootFatalError = thrownValue;
19079 workInProgress = null;
19080 return;
19081 }
19082 if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
19083 stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
19084 }
19085 if (enableSchedulingProfiler) {
19086 markComponentRenderStopped();
19087 if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
19088 var wakeable = thrownValue;
19089 markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
19090 } else {
19091 markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
19092 }
19093 }
19094 throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
19095 completeUnitOfWork(erroredWork);
19096 } catch (yetAnotherThrownValue) {
19097 thrownValue = yetAnotherThrownValue;
19098 if (workInProgress === erroredWork && erroredWork !== null) {
19099 erroredWork = erroredWork.return;
19100 workInProgress = erroredWork;
19101 } else {
19102 erroredWork = workInProgress;
19103 }
19104 continue;
19105 }
19106 return;
19107 } while (true);
19108 }
19109 function pushDispatcher() {
19110 var prevDispatcher = ReactCurrentDispatcher$2.current;
19111 ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
19112 if (prevDispatcher === null) {
19113 return ContextOnlyDispatcher;
19114 } else {
19115 return prevDispatcher;
19116 }
19117 }
19118 function popDispatcher(prevDispatcher) {
19119 ReactCurrentDispatcher$2.current = prevDispatcher;
19120 }
19121 function markCommitTimeOfFallback() {
19122 globalMostRecentFallbackTime = now();
19123 }
19124 function markSkippedUpdateLanes(lane) {
19125 workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
19126 }
19127 function renderDidSuspend() {
19128 if (workInProgressRootExitStatus === RootInProgress) {
19129 workInProgressRootExitStatus = RootSuspended;
19130 }
19131 }
19132 function renderDidSuspendDelayIfPossible() {
19133 if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
19134 workInProgressRootExitStatus = RootSuspendedWithDelay;
19135 }
19136 if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
19137 markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
19138 }
19139 }
19140 function renderDidError(error2) {
19141 if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
19142 workInProgressRootExitStatus = RootErrored;
19143 }
19144 if (workInProgressRootConcurrentErrors === null) {
19145 workInProgressRootConcurrentErrors = [error2];
19146 } else {
19147 workInProgressRootConcurrentErrors.push(error2);
19148 }
19149 }
19150 function renderHasNotSuspendedYet() {
19151 return workInProgressRootExitStatus === RootInProgress;
19152 }
19153 function renderRootSync(root2, lanes) {
19154 var prevExecutionContext = executionContext;
19155 executionContext |= RenderContext;
19156 var prevDispatcher = pushDispatcher();
19157 if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
19158 {
19159 if (isDevToolsPresent) {
19160 var memoizedUpdaters = root2.memoizedUpdaters;
19161 if (memoizedUpdaters.size > 0) {
19162 restorePendingUpdaters(root2, workInProgressRootRenderLanes);
19163 memoizedUpdaters.clear();
19164 }
19165 movePendingFibersToMemoized(root2, lanes);
19166 }
19167 }
19168 workInProgressTransitions = getTransitionsForLanes();
19169 prepareFreshStack(root2, lanes);
19170 }
19171 {
19172 markRenderStarted(lanes);
19173 }
19174 do {
19175 try {
19176 workLoopSync();
19177 break;
19178 } catch (thrownValue) {
19179 handleError(root2, thrownValue);
19180 }
19181 } while (true);
19182 resetContextDependencies();
19183 executionContext = prevExecutionContext;
19184 popDispatcher(prevDispatcher);
19185 if (workInProgress !== null) {
19186 throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
19187 }
19188 {
19189 markRenderStopped();
19190 }
19191 workInProgressRoot = null;
19192 workInProgressRootRenderLanes = NoLanes;
19193 return workInProgressRootExitStatus;
19194 }
19195 function workLoopSync() {
19196 while (workInProgress !== null) {
19197 performUnitOfWork(workInProgress);
19198 }
19199 }
19200 function renderRootConcurrent(root2, lanes) {
19201 var prevExecutionContext = executionContext;
19202 executionContext |= RenderContext;
19203 var prevDispatcher = pushDispatcher();
19204 if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
19205 {
19206 if (isDevToolsPresent) {
19207 var memoizedUpdaters = root2.memoizedUpdaters;
19208 if (memoizedUpdaters.size > 0) {
19209 restorePendingUpdaters(root2, workInProgressRootRenderLanes);
19210 memoizedUpdaters.clear();
19211 }
19212 movePendingFibersToMemoized(root2, lanes);
19213 }
19214 }
19215 workInProgressTransitions = getTransitionsForLanes();
19216 resetRenderTimer();
19217 prepareFreshStack(root2, lanes);
19218 }
19219 {
19220 markRenderStarted(lanes);
19221 }
19222 do {
19223 try {
19224 workLoopConcurrent();
19225 break;
19226 } catch (thrownValue) {
19227 handleError(root2, thrownValue);
19228 }
19229 } while (true);
19230 resetContextDependencies();
19231 popDispatcher(prevDispatcher);
19232 executionContext = prevExecutionContext;
19233 if (workInProgress !== null) {
19234 {
19235 markRenderYielded();
19236 }
19237 return RootInProgress;
19238 } else {
19239 {
19240 markRenderStopped();
19241 }
19242 workInProgressRoot = null;
19243 workInProgressRootRenderLanes = NoLanes;
19244 return workInProgressRootExitStatus;
19245 }
19246 }
19247 function workLoopConcurrent() {
19248 while (workInProgress !== null && !shouldYield()) {
19249 performUnitOfWork(workInProgress);
19250 }
19251 }
19252 function performUnitOfWork(unitOfWork) {
19253 var current2 = unitOfWork.alternate;
19254 setCurrentFiber(unitOfWork);
19255 var next;
19256 if ((unitOfWork.mode & ProfileMode) !== NoMode) {
19257 startProfilerTimer(unitOfWork);
19258 next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
19259 stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
19260 } else {
19261 next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
19262 }
19263 resetCurrentFiber();
19264 unitOfWork.memoizedProps = unitOfWork.pendingProps;
19265 if (next === null) {
19266 completeUnitOfWork(unitOfWork);
19267 } else {
19268 workInProgress = next;
19269 }
19270 ReactCurrentOwner$2.current = null;
19271 }
19272 function completeUnitOfWork(unitOfWork) {
19273 var completedWork = unitOfWork;
19274 do {
19275 var current2 = completedWork.alternate;
19276 var returnFiber = completedWork.return;
19277 if ((completedWork.flags & Incomplete) === NoFlags) {
19278 setCurrentFiber(completedWork);
19279 var next = void 0;
19280 if ((completedWork.mode & ProfileMode) === NoMode) {
19281 next = completeWork(current2, completedWork, subtreeRenderLanes);
19282 } else {
19283 startProfilerTimer(completedWork);
19284 next = completeWork(current2, completedWork, subtreeRenderLanes);
19285 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
19286 }
19287 resetCurrentFiber();
19288 if (next !== null) {
19289 workInProgress = next;
19290 return;
19291 }
19292 } else {
19293 var _next = unwindWork(current2, completedWork);
19294 if (_next !== null) {
19295 _next.flags &= HostEffectMask;
19296 workInProgress = _next;
19297 return;
19298 }
19299 if ((completedWork.mode & ProfileMode) !== NoMode) {
19300 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
19301 var actualDuration = completedWork.actualDuration;
19302 var child = completedWork.child;
19303 while (child !== null) {
19304 actualDuration += child.actualDuration;
19305 child = child.sibling;
19306 }
19307 completedWork.actualDuration = actualDuration;
19308 }
19309 if (returnFiber !== null) {
19310 returnFiber.flags |= Incomplete;
19311 returnFiber.subtreeFlags = NoFlags;
19312 returnFiber.deletions = null;
19313 } else {
19314 workInProgressRootExitStatus = RootDidNotComplete;
19315 workInProgress = null;
19316 return;
19317 }
19318 }
19319 var siblingFiber = completedWork.sibling;
19320 if (siblingFiber !== null) {
19321 workInProgress = siblingFiber;
19322 return;
19323 }
19324 completedWork = returnFiber;
19325 workInProgress = completedWork;
19326 } while (completedWork !== null);
19327 if (workInProgressRootExitStatus === RootInProgress) {
19328 workInProgressRootExitStatus = RootCompleted;
19329 }
19330 }
19331 function commitRoot(root2, recoverableErrors, transitions) {
19332 var previousUpdateLanePriority = getCurrentUpdatePriority();
19333 var prevTransition = ReactCurrentBatchConfig$3.transition;
19334 try {
19335 ReactCurrentBatchConfig$3.transition = null;
19336 setCurrentUpdatePriority(DiscreteEventPriority);
19337 commitRootImpl(root2, recoverableErrors, transitions, previousUpdateLanePriority);
19338 } finally {
19339 ReactCurrentBatchConfig$3.transition = prevTransition;
19340 setCurrentUpdatePriority(previousUpdateLanePriority);
19341 }
19342 return null;
19343 }
19344 function commitRootImpl(root2, recoverableErrors, transitions, renderPriorityLevel) {
19345 do {
19346 flushPassiveEffects();
19347 } while (rootWithPendingPassiveEffects !== null);
19348 flushRenderPhaseStrictModeWarningsInDEV();
19349 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
19350 throw new Error("Should not already be working.");
19351 }
19352 var finishedWork = root2.finishedWork;
19353 var lanes = root2.finishedLanes;
19354 {
19355 markCommitStarted(lanes);
19356 }
19357 if (finishedWork === null) {
19358 {
19359 markCommitStopped();
19360 }
19361 return null;
19362 } else {
19363 {
19364 if (lanes === NoLanes) {
19365 error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
19366 }
19367 }
19368 }
19369 root2.finishedWork = null;
19370 root2.finishedLanes = NoLanes;
19371 if (finishedWork === root2.current) {
19372 throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
19373 }
19374 root2.callbackNode = null;
19375 root2.callbackPriority = NoLane;
19376 var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
19377 markRootFinished(root2, remainingLanes);
19378 if (root2 === workInProgressRoot) {
19379 workInProgressRoot = null;
19380 workInProgress = null;
19381 workInProgressRootRenderLanes = NoLanes;
19382 }
19383 if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
19384 if (!rootDoesHavePassiveEffects) {
19385 rootDoesHavePassiveEffects = true;
19386 pendingPassiveTransitions = transitions;
19387 scheduleCallback$1(NormalPriority, function() {
19388 flushPassiveEffects();
19389 return null;
19390 });
19391 }
19392 }
19393 var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
19394 var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
19395 if (subtreeHasEffects || rootHasEffect) {
19396 var prevTransition = ReactCurrentBatchConfig$3.transition;
19397 ReactCurrentBatchConfig$3.transition = null;
19398 var previousPriority = getCurrentUpdatePriority();
19399 setCurrentUpdatePriority(DiscreteEventPriority);
19400 var prevExecutionContext = executionContext;
19401 executionContext |= CommitContext;
19402 ReactCurrentOwner$2.current = null;
19403 var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
19404 {
19405 recordCommitTime();
19406 }
19407 commitMutationEffects(root2, finishedWork, lanes);
19408 resetAfterCommit(root2.containerInfo);
19409 root2.current = finishedWork;
19410 {
19411 markLayoutEffectsStarted(lanes);
19412 }
19413 commitLayoutEffects(finishedWork, root2, lanes);
19414 {
19415 markLayoutEffectsStopped();
19416 }
19417 requestPaint();
19418 executionContext = prevExecutionContext;
19419 setCurrentUpdatePriority(previousPriority);
19420 ReactCurrentBatchConfig$3.transition = prevTransition;
19421 } else {
19422 root2.current = finishedWork;
19423 {
19424 recordCommitTime();
19425 }
19426 }
19427 var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
19428 if (rootDoesHavePassiveEffects) {
19429 rootDoesHavePassiveEffects = false;
19430 rootWithPendingPassiveEffects = root2;
19431 pendingPassiveEffectsLanes = lanes;
19432 } else {
19433 {
19434 nestedPassiveUpdateCount = 0;
19435 rootWithPassiveNestedUpdates = null;
19436 }
19437 }
19438 remainingLanes = root2.pendingLanes;
19439 if (remainingLanes === NoLanes) {
19440 legacyErrorBoundariesThatAlreadyFailed = null;
19441 }
19442 {
19443 if (!rootDidHavePassiveEffects) {
19444 commitDoubleInvokeEffectsInDEV(root2.current, false);
19445 }
19446 }
19447 onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
19448 {
19449 if (isDevToolsPresent) {
19450 root2.memoizedUpdaters.clear();
19451 }
19452 }
19453 {
19454 onCommitRoot$1();
19455 }
19456 ensureRootIsScheduled(root2, now());
19457 if (recoverableErrors !== null) {
19458 var onRecoverableError = root2.onRecoverableError;
19459 for (var i = 0; i < recoverableErrors.length; i++) {
19460 var recoverableError = recoverableErrors[i];
19461 var componentStack = recoverableError.stack;
19462 var digest = recoverableError.digest;
19463 onRecoverableError(recoverableError.value, {
19464 componentStack,
19465 digest
19466 });
19467 }
19468 }
19469 if (hasUncaughtError) {
19470 hasUncaughtError = false;
19471 var error$1 = firstUncaughtError;
19472 firstUncaughtError = null;
19473 throw error$1;
19474 }
19475 if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
19476 flushPassiveEffects();
19477 }
19478 remainingLanes = root2.pendingLanes;
19479 if (includesSomeLane(remainingLanes, SyncLane)) {
19480 {
19481 markNestedUpdateScheduled();
19482 }
19483 if (root2 === rootWithNestedUpdates) {
19484 nestedUpdateCount++;
19485 } else {
19486 nestedUpdateCount = 0;
19487 rootWithNestedUpdates = root2;
19488 }
19489 } else {
19490 nestedUpdateCount = 0;
19491 }
19492 flushSyncCallbacks();
19493 {
19494 markCommitStopped();
19495 }
19496 return null;
19497 }
19498 function flushPassiveEffects() {
19499 if (rootWithPendingPassiveEffects !== null) {
19500 var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
19501 var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
19502 var prevTransition = ReactCurrentBatchConfig$3.transition;
19503 var previousPriority = getCurrentUpdatePriority();
19504 try {
19505 ReactCurrentBatchConfig$3.transition = null;
19506 setCurrentUpdatePriority(priority);
19507 return flushPassiveEffectsImpl();
19508 } finally {
19509 setCurrentUpdatePriority(previousPriority);
19510 ReactCurrentBatchConfig$3.transition = prevTransition;
19511 }
19512 }
19513 return false;
19514 }
19515 function enqueuePendingPassiveProfilerEffect(fiber) {
19516 {
19517 pendingPassiveProfilerEffects.push(fiber);
19518 if (!rootDoesHavePassiveEffects) {
19519 rootDoesHavePassiveEffects = true;
19520 scheduleCallback$1(NormalPriority, function() {
19521 flushPassiveEffects();
19522 return null;
19523 });
19524 }
19525 }
19526 }
19527 function flushPassiveEffectsImpl() {
19528 if (rootWithPendingPassiveEffects === null) {
19529 return false;
19530 }
19531 var transitions = pendingPassiveTransitions;
19532 pendingPassiveTransitions = null;
19533 var root2 = rootWithPendingPassiveEffects;
19534 var lanes = pendingPassiveEffectsLanes;
19535 rootWithPendingPassiveEffects = null;
19536 pendingPassiveEffectsLanes = NoLanes;
19537 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
19538 throw new Error("Cannot flush passive effects while already rendering.");
19539 }
19540 {
19541 isFlushingPassiveEffects = true;
19542 didScheduleUpdateDuringPassiveEffects = false;
19543 }
19544 {
19545 markPassiveEffectsStarted(lanes);
19546 }
19547 var prevExecutionContext = executionContext;
19548 executionContext |= CommitContext;
19549 commitPassiveUnmountEffects(root2.current);
19550 commitPassiveMountEffects(root2, root2.current, lanes, transitions);
19551 {
19552 var profilerEffects = pendingPassiveProfilerEffects;
19553 pendingPassiveProfilerEffects = [];
19554 for (var i = 0; i < profilerEffects.length; i++) {
19555 var _fiber = profilerEffects[i];
19556 commitPassiveEffectDurations(root2, _fiber);
19557 }
19558 }
19559 {
19560 markPassiveEffectsStopped();
19561 }
19562 {
19563 commitDoubleInvokeEffectsInDEV(root2.current, true);
19564 }
19565 executionContext = prevExecutionContext;
19566 flushSyncCallbacks();
19567 {
19568 if (didScheduleUpdateDuringPassiveEffects) {
19569 if (root2 === rootWithPassiveNestedUpdates) {
19570 nestedPassiveUpdateCount++;
19571 } else {
19572 nestedPassiveUpdateCount = 0;
19573 rootWithPassiveNestedUpdates = root2;
19574 }
19575 } else {
19576 nestedPassiveUpdateCount = 0;
19577 }
19578 isFlushingPassiveEffects = false;
19579 didScheduleUpdateDuringPassiveEffects = false;
19580 }
19581 onPostCommitRoot(root2);
19582 {
19583 var stateNode = root2.current.stateNode;
19584 stateNode.effectDuration = 0;
19585 stateNode.passiveEffectDuration = 0;
19586 }
19587 return true;
19588 }
19589 function isAlreadyFailedLegacyErrorBoundary(instance) {
19590 return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
19591 }
19592 function markLegacyErrorBoundaryAsFailed(instance) {
19593 if (legacyErrorBoundariesThatAlreadyFailed === null) {
19594 legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
19595 } else {
19596 legacyErrorBoundariesThatAlreadyFailed.add(instance);
19597 }
19598 }
19599 function prepareToThrowUncaughtError(error2) {
19600 if (!hasUncaughtError) {
19601 hasUncaughtError = true;
19602 firstUncaughtError = error2;
19603 }
19604 }
19605 var onUncaughtError = prepareToThrowUncaughtError;
19606 function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
19607 var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
19608 var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
19609 var root2 = enqueueUpdate(rootFiber, update, SyncLane);
19610 var eventTime = requestEventTime();
19611 if (root2 !== null) {
19612 markRootUpdated(root2, SyncLane, eventTime);
19613 ensureRootIsScheduled(root2, eventTime);
19614 }
19615 }
19616 function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
19617 {
19618 reportUncaughtErrorInDEV(error$1);
19619 setIsRunningInsertionEffect(false);
19620 }
19621 if (sourceFiber.tag === HostRoot) {
19622 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
19623 return;
19624 }
19625 var fiber = null;
19626 {
19627 fiber = nearestMountedAncestor;
19628 }
19629 while (fiber !== null) {
19630 if (fiber.tag === HostRoot) {
19631 captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
19632 return;
19633 } else if (fiber.tag === ClassComponent) {
19634 var ctor = fiber.type;
19635 var instance = fiber.stateNode;
19636 if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
19637 var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
19638 var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
19639 var root2 = enqueueUpdate(fiber, update, SyncLane);
19640 var eventTime = requestEventTime();
19641 if (root2 !== null) {
19642 markRootUpdated(root2, SyncLane, eventTime);
19643 ensureRootIsScheduled(root2, eventTime);
19644 }
19645 return;
19646 }
19647 }
19648 fiber = fiber.return;
19649 }
19650 {
19651 error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
19652 }
19653 }
19654 function pingSuspendedRoot(root2, wakeable, pingedLanes) {
19655 var pingCache = root2.pingCache;
19656 if (pingCache !== null) {
19657 pingCache.delete(wakeable);
19658 }
19659 var eventTime = requestEventTime();
19660 markRootPinged(root2, pingedLanes);
19661 warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
19662 if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
19663 if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
19664 prepareFreshStack(root2, NoLanes);
19665 } else {
19666 workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
19667 }
19668 }
19669 ensureRootIsScheduled(root2, eventTime);
19670 }
19671 function retryTimedOutBoundary(boundaryFiber, retryLane) {
19672 if (retryLane === NoLane) {
19673 retryLane = requestRetryLane(boundaryFiber);
19674 }
19675 var eventTime = requestEventTime();
19676 var root2 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
19677 if (root2 !== null) {
19678 markRootUpdated(root2, retryLane, eventTime);
19679 ensureRootIsScheduled(root2, eventTime);
19680 }
19681 }
19682 function retryDehydratedSuspenseBoundary(boundaryFiber) {
19683 var suspenseState = boundaryFiber.memoizedState;
19684 var retryLane = NoLane;
19685 if (suspenseState !== null) {
19686 retryLane = suspenseState.retryLane;
19687 }
19688 retryTimedOutBoundary(boundaryFiber, retryLane);
19689 }
19690 function resolveRetryWakeable(boundaryFiber, wakeable) {
19691 var retryLane = NoLane;
19692 var retryCache;
19693 switch (boundaryFiber.tag) {
19694 case SuspenseComponent:
19695 retryCache = boundaryFiber.stateNode;
19696 var suspenseState = boundaryFiber.memoizedState;
19697 if (suspenseState !== null) {
19698 retryLane = suspenseState.retryLane;
19699 }
19700 break;
19701 case SuspenseListComponent:
19702 retryCache = boundaryFiber.stateNode;
19703 break;
19704 default:
19705 throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
19706 }
19707 if (retryCache !== null) {
19708 retryCache.delete(wakeable);
19709 }
19710 retryTimedOutBoundary(boundaryFiber, retryLane);
19711 }
19712 function jnd(timeElapsed) {
19713 return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
19714 }
19715 function checkForNestedUpdates() {
19716 if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
19717 nestedUpdateCount = 0;
19718 rootWithNestedUpdates = null;
19719 throw new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
19720 }
19721 {
19722 if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
19723 nestedPassiveUpdateCount = 0;
19724 rootWithPassiveNestedUpdates = null;
19725 error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.");
19726 }
19727 }
19728 }
19729 function flushRenderPhaseStrictModeWarningsInDEV() {
19730 {
19731 ReactStrictModeWarnings.flushLegacyContextWarning();
19732 {
19733 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
19734 }
19735 }
19736 }
19737 function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
19738 {
19739 setCurrentFiber(fiber);
19740 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
19741 if (hasPassiveEffects) {
19742 invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
19743 }
19744 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
19745 if (hasPassiveEffects) {
19746 invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
19747 }
19748 resetCurrentFiber();
19749 }
19750 }
19751 function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
19752 {
19753 var current2 = firstChild;
19754 var subtreeRoot = null;
19755 while (current2 !== null) {
19756 var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
19757 if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
19758 current2 = current2.child;
19759 } else {
19760 if ((current2.flags & fiberFlags) !== NoFlags) {
19761 invokeEffectFn(current2);
19762 }
19763 if (current2.sibling !== null) {
19764 current2 = current2.sibling;
19765 } else {
19766 current2 = subtreeRoot = current2.return;
19767 }
19768 }
19769 }
19770 }
19771 }
19772 var didWarnStateUpdateForNotYetMountedComponent = null;
19773 function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
19774 {
19775 if ((executionContext & RenderContext) !== NoContext) {
19776 return;
19777 }
19778 if (!(fiber.mode & ConcurrentMode)) {
19779 return;
19780 }
19781 var tag = fiber.tag;
19782 if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
19783 return;
19784 }
19785 var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
19786 if (didWarnStateUpdateForNotYetMountedComponent !== null) {
19787 if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
19788 return;
19789 }
19790 didWarnStateUpdateForNotYetMountedComponent.add(componentName);
19791 } else {
19792 didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
19793 }
19794 var previousFiber = current;
19795 try {
19796 setCurrentFiber(fiber);
19797 error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
19798 } finally {
19799 if (previousFiber) {
19800 setCurrentFiber(fiber);
19801 } else {
19802 resetCurrentFiber();
19803 }
19804 }
19805 }
19806 }
19807 var beginWork$1;
19808 {
19809 var dummyFiber = null;
19810 beginWork$1 = function(current2, unitOfWork, lanes) {
19811 var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
19812 try {
19813 return beginWork(current2, unitOfWork, lanes);
19814 } catch (originalError) {
19815 if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
19816 throw originalError;
19817 }
19818 resetContextDependencies();
19819 resetHooksAfterThrow();
19820 unwindInterruptedWork(current2, unitOfWork);
19821 assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
19822 if (unitOfWork.mode & ProfileMode) {
19823 startProfilerTimer(unitOfWork);
19824 }
19825 invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
19826 if (hasCaughtError()) {
19827 var replayError = clearCaughtError();
19828 if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
19829 originalError._suppressLogging = true;
19830 }
19831 }
19832 throw originalError;
19833 }
19834 };
19835 }
19836 var didWarnAboutUpdateInRender = false;
19837 var didWarnAboutUpdateInRenderForAnotherComponent;
19838 {
19839 didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
19840 }
19841 function warnAboutRenderPhaseUpdatesInDEV(fiber) {
19842 {
19843 if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
19844 switch (fiber.tag) {
19845 case FunctionComponent:
19846 case ForwardRef:
19847 case SimpleMemoComponent: {
19848 var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
19849 var dedupeKey = renderingComponentName;
19850 if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
19851 didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
19852 var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown";
19853 error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", setStateComponentName, renderingComponentName, renderingComponentName);
19854 }
19855 break;
19856 }
19857 case ClassComponent: {
19858 if (!didWarnAboutUpdateInRender) {
19859 error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
19860 didWarnAboutUpdateInRender = true;
19861 }
19862 break;
19863 }
19864 }
19865 }
19866 }
19867 }
19868 function restorePendingUpdaters(root2, lanes) {
19869 {
19870 if (isDevToolsPresent) {
19871 var memoizedUpdaters = root2.memoizedUpdaters;
19872 memoizedUpdaters.forEach(function(schedulingFiber) {
19873 addFiberToLanesMap(root2, schedulingFiber, lanes);
19874 });
19875 }
19876 }
19877 }
19878 var fakeActCallbackNode = {};
19879 function scheduleCallback$1(priorityLevel, callback) {
19880 {
19881 var actQueue = ReactCurrentActQueue$1.current;
19882 if (actQueue !== null) {
19883 actQueue.push(callback);
19884 return fakeActCallbackNode;
19885 } else {
19886 return scheduleCallback(priorityLevel, callback);
19887 }
19888 }
19889 }
19890 function cancelCallback$1(callbackNode) {
19891 if (callbackNode === fakeActCallbackNode) {
19892 return;
19893 }
19894 return cancelCallback(callbackNode);
19895 }
19896 function shouldForceFlushFallbacksInDEV() {
19897 return ReactCurrentActQueue$1.current !== null;
19898 }
19899 function warnIfUpdatesNotWrappedWithActDEV(fiber) {
19900 {
19901 if (fiber.mode & ConcurrentMode) {
19902 if (!isConcurrentActEnvironment()) {
19903 return;
19904 }
19905 } else {
19906 if (!isLegacyActEnvironment()) {
19907 return;
19908 }
19909 if (executionContext !== NoContext) {
19910 return;
19911 }
19912 if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
19913 return;
19914 }
19915 }
19916 if (ReactCurrentActQueue$1.current === null) {
19917 var previousFiber = current;
19918 try {
19919 setCurrentFiber(fiber);
19920 error("An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act", getComponentNameFromFiber(fiber));
19921 } finally {
19922 if (previousFiber) {
19923 setCurrentFiber(fiber);
19924 } else {
19925 resetCurrentFiber();
19926 }
19927 }
19928 }
19929 }
19930 }
19931 function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
19932 {
19933 if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
19934 error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n /* finish loading suspended data */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act");
19935 }
19936 }
19937 }
19938 function setIsRunningInsertionEffect(isRunning) {
19939 {
19940 isRunningInsertionEffect = isRunning;
19941 }
19942 }
19943 var resolveFamily = null;
19944 var failedBoundaries = null;
19945 var setRefreshHandler = function(handler) {
19946 {
19947 resolveFamily = handler;
19948 }
19949 };
19950 function resolveFunctionForHotReloading(type) {
19951 {
19952 if (resolveFamily === null) {
19953 return type;
19954 }
19955 var family = resolveFamily(type);
19956 if (family === void 0) {
19957 return type;
19958 }
19959 return family.current;
19960 }
19961 }
19962 function resolveClassForHotReloading(type) {
19963 return resolveFunctionForHotReloading(type);
19964 }
19965 function resolveForwardRefForHotReloading(type) {
19966 {
19967 if (resolveFamily === null) {
19968 return type;
19969 }
19970 var family = resolveFamily(type);
19971 if (family === void 0) {
19972 if (type !== null && type !== void 0 && typeof type.render === "function") {
19973 var currentRender = resolveFunctionForHotReloading(type.render);
19974 if (type.render !== currentRender) {
19975 var syntheticType = {
19976 $$typeof: REACT_FORWARD_REF_TYPE,
19977 render: currentRender
19978 };
19979 if (type.displayName !== void 0) {
19980 syntheticType.displayName = type.displayName;
19981 }
19982 return syntheticType;
19983 }
19984 }
19985 return type;
19986 }
19987 return family.current;
19988 }
19989 }
19990 function isCompatibleFamilyForHotReloading(fiber, element) {
19991 {
19992 if (resolveFamily === null) {
19993 return false;
19994 }
19995 var prevType = fiber.elementType;
19996 var nextType = element.type;
19997 var needsCompareFamilies = false;
19998 var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
19999 switch (fiber.tag) {
20000 case ClassComponent: {
20001 if (typeof nextType === "function") {
20002 needsCompareFamilies = true;
20003 }
20004 break;
20005 }
20006 case FunctionComponent: {
20007 if (typeof nextType === "function") {
20008 needsCompareFamilies = true;
20009 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20010 needsCompareFamilies = true;
20011 }
20012 break;
20013 }
20014 case ForwardRef: {
20015 if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
20016 needsCompareFamilies = true;
20017 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20018 needsCompareFamilies = true;
20019 }
20020 break;
20021 }
20022 case MemoComponent:
20023 case SimpleMemoComponent: {
20024 if ($$typeofNextType === REACT_MEMO_TYPE) {
20025 needsCompareFamilies = true;
20026 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20027 needsCompareFamilies = true;
20028 }
20029 break;
20030 }
20031 default:
20032 return false;
20033 }
20034 if (needsCompareFamilies) {
20035 var prevFamily = resolveFamily(prevType);
20036 if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
20037 return true;
20038 }
20039 }
20040 return false;
20041 }
20042 }
20043 function markFailedErrorBoundaryForHotReloading(fiber) {
20044 {
20045 if (resolveFamily === null) {
20046 return;
20047 }
20048 if (typeof WeakSet !== "function") {
20049 return;
20050 }
20051 if (failedBoundaries === null) {
20052 failedBoundaries = /* @__PURE__ */ new WeakSet();
20053 }
20054 failedBoundaries.add(fiber);
20055 }
20056 }
20057 var scheduleRefresh = function(root2, update) {
20058 {
20059 if (resolveFamily === null) {
20060 return;
20061 }
20062 var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
20063 flushPassiveEffects();
20064 flushSync(function() {
20065 scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
20066 });
20067 }
20068 };
20069 var scheduleRoot = function(root2, element) {
20070 {
20071 if (root2.context !== emptyContextObject) {
20072 return;
20073 }
20074 flushPassiveEffects();
20075 flushSync(function() {
20076 updateContainer(element, root2, null, null);
20077 });
20078 }
20079 };
20080 function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
20081 {
20082 var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
20083 var candidateType = null;
20084 switch (tag) {
20085 case FunctionComponent:
20086 case SimpleMemoComponent:
20087 case ClassComponent:
20088 candidateType = type;
20089 break;
20090 case ForwardRef:
20091 candidateType = type.render;
20092 break;
20093 }
20094 if (resolveFamily === null) {
20095 throw new Error("Expected resolveFamily to be set during hot reload.");
20096 }
20097 var needsRender = false;
20098 var needsRemount = false;
20099 if (candidateType !== null) {
20100 var family = resolveFamily(candidateType);
20101 if (family !== void 0) {
20102 if (staleFamilies.has(family)) {
20103 needsRemount = true;
20104 } else if (updatedFamilies.has(family)) {
20105 if (tag === ClassComponent) {
20106 needsRemount = true;
20107 } else {
20108 needsRender = true;
20109 }
20110 }
20111 }
20112 }
20113 if (failedBoundaries !== null) {
20114 if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
20115 needsRemount = true;
20116 }
20117 }
20118 if (needsRemount) {
20119 fiber._debugNeedsRemount = true;
20120 }
20121 if (needsRemount || needsRender) {
20122 var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
20123 if (_root !== null) {
20124 scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
20125 }
20126 }
20127 if (child !== null && !needsRemount) {
20128 scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
20129 }
20130 if (sibling !== null) {
20131 scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
20132 }
20133 }
20134 }
20135 var findHostInstancesForRefresh = function(root2, families) {
20136 {
20137 var hostInstances = /* @__PURE__ */ new Set();
20138 var types = new Set(families.map(function(family) {
20139 return family.current;
20140 }));
20141 findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
20142 return hostInstances;
20143 }
20144 };
20145 function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
20146 {
20147 var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
20148 var candidateType = null;
20149 switch (tag) {
20150 case FunctionComponent:
20151 case SimpleMemoComponent:
20152 case ClassComponent:
20153 candidateType = type;
20154 break;
20155 case ForwardRef:
20156 candidateType = type.render;
20157 break;
20158 }
20159 var didMatch = false;
20160 if (candidateType !== null) {
20161 if (types.has(candidateType)) {
20162 didMatch = true;
20163 }
20164 }
20165 if (didMatch) {
20166 findHostInstancesForFiberShallowly(fiber, hostInstances);
20167 } else {
20168 if (child !== null) {
20169 findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
20170 }
20171 }
20172 if (sibling !== null) {
20173 findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
20174 }
20175 }
20176 }
20177 function findHostInstancesForFiberShallowly(fiber, hostInstances) {
20178 {
20179 var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
20180 if (foundHostInstances) {
20181 return;
20182 }
20183 var node = fiber;
20184 while (true) {
20185 switch (node.tag) {
20186 case HostComponent:
20187 hostInstances.add(node.stateNode);
20188 return;
20189 case HostPortal:
20190 hostInstances.add(node.stateNode.containerInfo);
20191 return;
20192 case HostRoot:
20193 hostInstances.add(node.stateNode.containerInfo);
20194 return;
20195 }
20196 if (node.return === null) {
20197 throw new Error("Expected to reach root first.");
20198 }
20199 node = node.return;
20200 }
20201 }
20202 }
20203 function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
20204 {
20205 var node = fiber;
20206 var foundHostInstances = false;
20207 while (true) {
20208 if (node.tag === HostComponent) {
20209 foundHostInstances = true;
20210 hostInstances.add(node.stateNode);
20211 } else if (node.child !== null) {
20212 node.child.return = node;
20213 node = node.child;
20214 continue;
20215 }
20216 if (node === fiber) {
20217 return foundHostInstances;
20218 }
20219 while (node.sibling === null) {
20220 if (node.return === null || node.return === fiber) {
20221 return foundHostInstances;
20222 }
20223 node = node.return;
20224 }
20225 node.sibling.return = node.return;
20226 node = node.sibling;
20227 }
20228 }
20229 return false;
20230 }
20231 var hasBadMapPolyfill;
20232 {
20233 hasBadMapPolyfill = false;
20234 try {
20235 var nonExtensibleObject = Object.preventExtensions({});
20236 /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
20237 /* @__PURE__ */ new Set([nonExtensibleObject]);
20238 } catch (e) {
20239 hasBadMapPolyfill = true;
20240 }
20241 }
20242 function FiberNode(tag, pendingProps, key, mode) {
20243 this.tag = tag;
20244 this.key = key;
20245 this.elementType = null;
20246 this.type = null;
20247 this.stateNode = null;
20248 this.return = null;
20249 this.child = null;
20250 this.sibling = null;
20251 this.index = 0;
20252 this.ref = null;
20253 this.pendingProps = pendingProps;
20254 this.memoizedProps = null;
20255 this.updateQueue = null;
20256 this.memoizedState = null;
20257 this.dependencies = null;
20258 this.mode = mode;
20259 this.flags = NoFlags;
20260 this.subtreeFlags = NoFlags;
20261 this.deletions = null;
20262 this.lanes = NoLanes;
20263 this.childLanes = NoLanes;
20264 this.alternate = null;
20265 {
20266 this.actualDuration = Number.NaN;
20267 this.actualStartTime = Number.NaN;
20268 this.selfBaseDuration = Number.NaN;
20269 this.treeBaseDuration = Number.NaN;
20270 this.actualDuration = 0;
20271 this.actualStartTime = -1;
20272 this.selfBaseDuration = 0;
20273 this.treeBaseDuration = 0;
20274 }
20275 {
20276 this._debugSource = null;
20277 this._debugOwner = null;
20278 this._debugNeedsRemount = false;
20279 this._debugHookTypes = null;
20280 if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
20281 Object.preventExtensions(this);
20282 }
20283 }
20284 }
20285 var createFiber = function(tag, pendingProps, key, mode) {
20286 return new FiberNode(tag, pendingProps, key, mode);
20287 };
20288 function shouldConstruct$1(Component) {
20289 var prototype = Component.prototype;
20290 return !!(prototype && prototype.isReactComponent);
20291 }
20292 function isSimpleFunctionComponent(type) {
20293 return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
20294 }
20295 function resolveLazyComponentTag(Component) {
20296 if (typeof Component === "function") {
20297 return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
20298 } else if (Component !== void 0 && Component !== null) {
20299 var $$typeof = Component.$$typeof;
20300 if ($$typeof === REACT_FORWARD_REF_TYPE) {
20301 return ForwardRef;
20302 }
20303 if ($$typeof === REACT_MEMO_TYPE) {
20304 return MemoComponent;
20305 }
20306 }
20307 return IndeterminateComponent;
20308 }
20309 function createWorkInProgress(current2, pendingProps) {
20310 var workInProgress2 = current2.alternate;
20311 if (workInProgress2 === null) {
20312 workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
20313 workInProgress2.elementType = current2.elementType;
20314 workInProgress2.type = current2.type;
20315 workInProgress2.stateNode = current2.stateNode;
20316 {
20317 workInProgress2._debugSource = current2._debugSource;
20318 workInProgress2._debugOwner = current2._debugOwner;
20319 workInProgress2._debugHookTypes = current2._debugHookTypes;
20320 }
20321 workInProgress2.alternate = current2;
20322 current2.alternate = workInProgress2;
20323 } else {
20324 workInProgress2.pendingProps = pendingProps;
20325 workInProgress2.type = current2.type;
20326 workInProgress2.flags = NoFlags;
20327 workInProgress2.subtreeFlags = NoFlags;
20328 workInProgress2.deletions = null;
20329 {
20330 workInProgress2.actualDuration = 0;
20331 workInProgress2.actualStartTime = -1;
20332 }
20333 }
20334 workInProgress2.flags = current2.flags & StaticMask;
20335 workInProgress2.childLanes = current2.childLanes;
20336 workInProgress2.lanes = current2.lanes;
20337 workInProgress2.child = current2.child;
20338 workInProgress2.memoizedProps = current2.memoizedProps;
20339 workInProgress2.memoizedState = current2.memoizedState;
20340 workInProgress2.updateQueue = current2.updateQueue;
20341 var currentDependencies = current2.dependencies;
20342 workInProgress2.dependencies = currentDependencies === null ? null : {
20343 lanes: currentDependencies.lanes,
20344 firstContext: currentDependencies.firstContext
20345 };
20346 workInProgress2.sibling = current2.sibling;
20347 workInProgress2.index = current2.index;
20348 workInProgress2.ref = current2.ref;
20349 {
20350 workInProgress2.selfBaseDuration = current2.selfBaseDuration;
20351 workInProgress2.treeBaseDuration = current2.treeBaseDuration;
20352 }
20353 {
20354 workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
20355 switch (workInProgress2.tag) {
20356 case IndeterminateComponent:
20357 case FunctionComponent:
20358 case SimpleMemoComponent:
20359 workInProgress2.type = resolveFunctionForHotReloading(current2.type);
20360 break;
20361 case ClassComponent:
20362 workInProgress2.type = resolveClassForHotReloading(current2.type);
20363 break;
20364 case ForwardRef:
20365 workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
20366 break;
20367 }
20368 }
20369 return workInProgress2;
20370 }
20371 function resetWorkInProgress(workInProgress2, renderLanes2) {
20372 workInProgress2.flags &= StaticMask | Placement;
20373 var current2 = workInProgress2.alternate;
20374 if (current2 === null) {
20375 workInProgress2.childLanes = NoLanes;
20376 workInProgress2.lanes = renderLanes2;
20377 workInProgress2.child = null;
20378 workInProgress2.subtreeFlags = NoFlags;
20379 workInProgress2.memoizedProps = null;
20380 workInProgress2.memoizedState = null;
20381 workInProgress2.updateQueue = null;
20382 workInProgress2.dependencies = null;
20383 workInProgress2.stateNode = null;
20384 {
20385 workInProgress2.selfBaseDuration = 0;
20386 workInProgress2.treeBaseDuration = 0;
20387 }
20388 } else {
20389 workInProgress2.childLanes = current2.childLanes;
20390 workInProgress2.lanes = current2.lanes;
20391 workInProgress2.child = current2.child;
20392 workInProgress2.subtreeFlags = NoFlags;
20393 workInProgress2.deletions = null;
20394 workInProgress2.memoizedProps = current2.memoizedProps;
20395 workInProgress2.memoizedState = current2.memoizedState;
20396 workInProgress2.updateQueue = current2.updateQueue;
20397 workInProgress2.type = current2.type;
20398 var currentDependencies = current2.dependencies;
20399 workInProgress2.dependencies = currentDependencies === null ? null : {
20400 lanes: currentDependencies.lanes,
20401 firstContext: currentDependencies.firstContext
20402 };
20403 {
20404 workInProgress2.selfBaseDuration = current2.selfBaseDuration;
20405 workInProgress2.treeBaseDuration = current2.treeBaseDuration;
20406 }
20407 }
20408 return workInProgress2;
20409 }
20410 function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {
20411 var mode;
20412 if (tag === ConcurrentRoot) {
20413 mode = ConcurrentMode;
20414 if (isStrictMode === true) {
20415 mode |= StrictLegacyMode;
20416 {
20417 mode |= StrictEffectsMode;
20418 }
20419 }
20420 } else {
20421 mode = NoMode;
20422 }
20423 if (isDevToolsPresent) {
20424 mode |= ProfileMode;
20425 }
20426 return createFiber(HostRoot, null, null, mode);
20427 }
20428 function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
20429 var fiberTag = IndeterminateComponent;
20430 var resolvedType = type;
20431 if (typeof type === "function") {
20432 if (shouldConstruct$1(type)) {
20433 fiberTag = ClassComponent;
20434 {
20435 resolvedType = resolveClassForHotReloading(resolvedType);
20436 }
20437 } else {
20438 {
20439 resolvedType = resolveFunctionForHotReloading(resolvedType);
20440 }
20441 }
20442 } else if (typeof type === "string") {
20443 fiberTag = HostComponent;
20444 } else {
20445 getTag: switch (type) {
20446 case REACT_FRAGMENT_TYPE:
20447 return createFiberFromFragment(pendingProps.children, mode, lanes, key);
20448 case REACT_STRICT_MODE_TYPE:
20449 fiberTag = Mode;
20450 mode |= StrictLegacyMode;
20451 if ((mode & ConcurrentMode) !== NoMode) {
20452 mode |= StrictEffectsMode;
20453 }
20454 break;
20455 case REACT_PROFILER_TYPE:
20456 return createFiberFromProfiler(pendingProps, mode, lanes, key);
20457 case REACT_SUSPENSE_TYPE:
20458 return createFiberFromSuspense(pendingProps, mode, lanes, key);
20459 case REACT_SUSPENSE_LIST_TYPE:
20460 return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
20461 case REACT_OFFSCREEN_TYPE:
20462 return createFiberFromOffscreen(pendingProps, mode, lanes, key);
20463 case REACT_LEGACY_HIDDEN_TYPE:
20464 // eslint-disable-next-line no-fallthrough
20465 case REACT_SCOPE_TYPE:
20466 // eslint-disable-next-line no-fallthrough
20467 case REACT_CACHE_TYPE:
20468 // eslint-disable-next-line no-fallthrough
20469 case REACT_TRACING_MARKER_TYPE:
20470 // eslint-disable-next-line no-fallthrough
20471 case REACT_DEBUG_TRACING_MODE_TYPE:
20472 // eslint-disable-next-line no-fallthrough
20473 default: {
20474 if (typeof type === "object" && type !== null) {
20475 switch (type.$$typeof) {
20476 case REACT_PROVIDER_TYPE:
20477 fiberTag = ContextProvider;
20478 break getTag;
20479 case REACT_CONTEXT_TYPE:
20480 fiberTag = ContextConsumer;
20481 break getTag;
20482 case REACT_FORWARD_REF_TYPE:
20483 fiberTag = ForwardRef;
20484 {
20485 resolvedType = resolveForwardRefForHotReloading(resolvedType);
20486 }
20487 break getTag;
20488 case REACT_MEMO_TYPE:
20489 fiberTag = MemoComponent;
20490 break getTag;
20491 case REACT_LAZY_TYPE:
20492 fiberTag = LazyComponent;
20493 resolvedType = null;
20494 break getTag;
20495 }
20496 }
20497 var info = "";
20498 {
20499 if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
20500 info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
20501 }
20502 var ownerName = owner ? getComponentNameFromFiber(owner) : null;
20503 if (ownerName) {
20504 info += "\n\nCheck the render method of `" + ownerName + "`.";
20505 }
20506 }
20507 throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info));
20508 }
20509 }
20510 }
20511 var fiber = createFiber(fiberTag, pendingProps, key, mode);
20512 fiber.elementType = type;
20513 fiber.type = resolvedType;
20514 fiber.lanes = lanes;
20515 {
20516 fiber._debugOwner = owner;
20517 }
20518 return fiber;
20519 }
20520 function createFiberFromElement(element, mode, lanes) {
20521 var owner = null;
20522 {
20523 owner = element._owner;
20524 }
20525 var type = element.type;
20526 var key = element.key;
20527 var pendingProps = element.props;
20528 var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
20529 {
20530 fiber._debugSource = element._source;
20531 fiber._debugOwner = element._owner;
20532 }
20533 return fiber;
20534 }
20535 function createFiberFromFragment(elements, mode, lanes, key) {
20536 var fiber = createFiber(Fragment, elements, key, mode);
20537 fiber.lanes = lanes;
20538 return fiber;
20539 }
20540 function createFiberFromProfiler(pendingProps, mode, lanes, key) {
20541 {
20542 if (typeof pendingProps.id !== "string") {
20543 error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
20544 }
20545 }
20546 var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
20547 fiber.elementType = REACT_PROFILER_TYPE;
20548 fiber.lanes = lanes;
20549 {
20550 fiber.stateNode = {
20551 effectDuration: 0,
20552 passiveEffectDuration: 0
20553 };
20554 }
20555 return fiber;
20556 }
20557 function createFiberFromSuspense(pendingProps, mode, lanes, key) {
20558 var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
20559 fiber.elementType = REACT_SUSPENSE_TYPE;
20560 fiber.lanes = lanes;
20561 return fiber;
20562 }
20563 function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
20564 var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
20565 fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
20566 fiber.lanes = lanes;
20567 return fiber;
20568 }
20569 function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
20570 var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
20571 fiber.elementType = REACT_OFFSCREEN_TYPE;
20572 fiber.lanes = lanes;
20573 var primaryChildInstance = {
20574 isHidden: false
20575 };
20576 fiber.stateNode = primaryChildInstance;
20577 return fiber;
20578 }
20579 function createFiberFromText(content, mode, lanes) {
20580 var fiber = createFiber(HostText, content, null, mode);
20581 fiber.lanes = lanes;
20582 return fiber;
20583 }
20584 function createFiberFromHostInstanceForDeletion() {
20585 var fiber = createFiber(HostComponent, null, null, NoMode);
20586 fiber.elementType = "DELETED";
20587 return fiber;
20588 }
20589 function createFiberFromDehydratedFragment(dehydratedNode) {
20590 var fiber = createFiber(DehydratedFragment, null, null, NoMode);
20591 fiber.stateNode = dehydratedNode;
20592 return fiber;
20593 }
20594 function createFiberFromPortal(portal, mode, lanes) {
20595 var pendingProps = portal.children !== null ? portal.children : [];
20596 var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
20597 fiber.lanes = lanes;
20598 fiber.stateNode = {
20599 containerInfo: portal.containerInfo,
20600 pendingChildren: null,
20601 // Used by persistent updates
20602 implementation: portal.implementation
20603 };
20604 return fiber;
20605 }
20606 function assignFiberPropertiesInDEV(target, source) {
20607 if (target === null) {
20608 target = createFiber(IndeterminateComponent, null, null, NoMode);
20609 }
20610 target.tag = source.tag;
20611 target.key = source.key;
20612 target.elementType = source.elementType;
20613 target.type = source.type;
20614 target.stateNode = source.stateNode;
20615 target.return = source.return;
20616 target.child = source.child;
20617 target.sibling = source.sibling;
20618 target.index = source.index;
20619 target.ref = source.ref;
20620 target.pendingProps = source.pendingProps;
20621 target.memoizedProps = source.memoizedProps;
20622 target.updateQueue = source.updateQueue;
20623 target.memoizedState = source.memoizedState;
20624 target.dependencies = source.dependencies;
20625 target.mode = source.mode;
20626 target.flags = source.flags;
20627 target.subtreeFlags = source.subtreeFlags;
20628 target.deletions = source.deletions;
20629 target.lanes = source.lanes;
20630 target.childLanes = source.childLanes;
20631 target.alternate = source.alternate;
20632 {
20633 target.actualDuration = source.actualDuration;
20634 target.actualStartTime = source.actualStartTime;
20635 target.selfBaseDuration = source.selfBaseDuration;
20636 target.treeBaseDuration = source.treeBaseDuration;
20637 }
20638 target._debugSource = source._debugSource;
20639 target._debugOwner = source._debugOwner;
20640 target._debugNeedsRemount = source._debugNeedsRemount;
20641 target._debugHookTypes = source._debugHookTypes;
20642 return target;
20643 }
20644 function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
20645 this.tag = tag;
20646 this.containerInfo = containerInfo;
20647 this.pendingChildren = null;
20648 this.current = null;
20649 this.pingCache = null;
20650 this.finishedWork = null;
20651 this.timeoutHandle = noTimeout;
20652 this.context = null;
20653 this.pendingContext = null;
20654 this.callbackNode = null;
20655 this.callbackPriority = NoLane;
20656 this.eventTimes = createLaneMap(NoLanes);
20657 this.expirationTimes = createLaneMap(NoTimestamp);
20658 this.pendingLanes = NoLanes;
20659 this.suspendedLanes = NoLanes;
20660 this.pingedLanes = NoLanes;
20661 this.expiredLanes = NoLanes;
20662 this.mutableReadLanes = NoLanes;
20663 this.finishedLanes = NoLanes;
20664 this.entangledLanes = NoLanes;
20665 this.entanglements = createLaneMap(NoLanes);
20666 this.identifierPrefix = identifierPrefix;
20667 this.onRecoverableError = onRecoverableError;
20668 {
20669 this.mutableSourceEagerHydrationData = null;
20670 }
20671 {
20672 this.effectDuration = 0;
20673 this.passiveEffectDuration = 0;
20674 }
20675 {
20676 this.memoizedUpdaters = /* @__PURE__ */ new Set();
20677 var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
20678 for (var _i = 0; _i < TotalLanes; _i++) {
20679 pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
20680 }
20681 }
20682 {
20683 switch (tag) {
20684 case ConcurrentRoot:
20685 this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
20686 break;
20687 case LegacyRoot:
20688 this._debugRootType = hydrate2 ? "hydrate()" : "render()";
20689 break;
20690 }
20691 }
20692 }
20693 function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20694 var root2 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
20695 var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
20696 root2.current = uninitializedFiber;
20697 uninitializedFiber.stateNode = root2;
20698 {
20699 var _initialState = {
20700 element: initialChildren,
20701 isDehydrated: hydrate2,
20702 cache: null,
20703 // not enabled yet
20704 transitions: null,
20705 pendingSuspenseBoundaries: null
20706 };
20707 uninitializedFiber.memoizedState = _initialState;
20708 }
20709 initializeUpdateQueue(uninitializedFiber);
20710 return root2;
20711 }
20712 var ReactVersion = "18.3.1";
20713 function createPortal(children, containerInfo, implementation) {
20714 var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
20715 {
20716 checkKeyStringCoercion(key);
20717 }
20718 return {
20719 // This tag allow us to uniquely identify this as a React Portal
20720 $$typeof: REACT_PORTAL_TYPE,
20721 key: key == null ? null : "" + key,
20722 children,
20723 containerInfo,
20724 implementation
20725 };
20726 }
20727 var didWarnAboutNestedUpdates;
20728 var didWarnAboutFindNodeInStrictMode;
20729 {
20730 didWarnAboutNestedUpdates = false;
20731 didWarnAboutFindNodeInStrictMode = {};
20732 }
20733 function getContextForSubtree(parentComponent) {
20734 if (!parentComponent) {
20735 return emptyContextObject;
20736 }
20737 var fiber = get(parentComponent);
20738 var parentContext = findCurrentUnmaskedContext(fiber);
20739 if (fiber.tag === ClassComponent) {
20740 var Component = fiber.type;
20741 if (isContextProvider(Component)) {
20742 return processChildContext(fiber, Component, parentContext);
20743 }
20744 }
20745 return parentContext;
20746 }
20747 function findHostInstanceWithWarning(component, methodName) {
20748 {
20749 var fiber = get(component);
20750 if (fiber === void 0) {
20751 if (typeof component.render === "function") {
20752 throw new Error("Unable to find node on an unmounted component.");
20753 } else {
20754 var keys = Object.keys(component).join(",");
20755 throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys);
20756 }
20757 }
20758 var hostFiber = findCurrentHostFiber(fiber);
20759 if (hostFiber === null) {
20760 return null;
20761 }
20762 if (hostFiber.mode & StrictLegacyMode) {
20763 var componentName = getComponentNameFromFiber(fiber) || "Component";
20764 if (!didWarnAboutFindNodeInStrictMode[componentName]) {
20765 didWarnAboutFindNodeInStrictMode[componentName] = true;
20766 var previousFiber = current;
20767 try {
20768 setCurrentFiber(hostFiber);
20769 if (fiber.mode & StrictLegacyMode) {
20770 error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
20771 } else {
20772 error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", methodName, methodName, componentName);
20773 }
20774 } finally {
20775 if (previousFiber) {
20776 setCurrentFiber(previousFiber);
20777 } else {
20778 resetCurrentFiber();
20779 }
20780 }
20781 }
20782 }
20783 return hostFiber.stateNode;
20784 }
20785 }
20786 function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20787 var hydrate2 = false;
20788 var initialChildren = null;
20789 return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
20790 }
20791 function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20792 var hydrate2 = true;
20793 var root2 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
20794 root2.context = getContextForSubtree(null);
20795 var current2 = root2.current;
20796 var eventTime = requestEventTime();
20797 var lane = requestUpdateLane(current2);
20798 var update = createUpdate(eventTime, lane);
20799 update.callback = callback !== void 0 && callback !== null ? callback : null;
20800 enqueueUpdate(current2, update, lane);
20801 scheduleInitialHydrationOnRoot(root2, lane, eventTime);
20802 return root2;
20803 }
20804 function updateContainer(element, container, parentComponent, callback) {
20805 {
20806 onScheduleRoot(container, element);
20807 }
20808 var current$1 = container.current;
20809 var eventTime = requestEventTime();
20810 var lane = requestUpdateLane(current$1);
20811 {
20812 markRenderScheduled(lane);
20813 }
20814 var context = getContextForSubtree(parentComponent);
20815 if (container.context === null) {
20816 container.context = context;
20817 } else {
20818 container.pendingContext = context;
20819 }
20820 {
20821 if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
20822 didWarnAboutNestedUpdates = true;
20823 error("Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown");
20824 }
20825 }
20826 var update = createUpdate(eventTime, lane);
20827 update.payload = {
20828 element
20829 };
20830 callback = callback === void 0 ? null : callback;
20831 if (callback !== null) {
20832 {
20833 if (typeof callback !== "function") {
20834 error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
20835 }
20836 }
20837 update.callback = callback;
20838 }
20839 var root2 = enqueueUpdate(current$1, update, lane);
20840 if (root2 !== null) {
20841 scheduleUpdateOnFiber(root2, current$1, lane, eventTime);
20842 entangleTransitions(root2, current$1, lane);
20843 }
20844 return lane;
20845 }
20846 function getPublicRootInstance(container) {
20847 var containerFiber = container.current;
20848 if (!containerFiber.child) {
20849 return null;
20850 }
20851 switch (containerFiber.child.tag) {
20852 case HostComponent:
20853 return getPublicInstance(containerFiber.child.stateNode);
20854 default:
20855 return containerFiber.child.stateNode;
20856 }
20857 }
20858 function attemptSynchronousHydration$1(fiber) {
20859 switch (fiber.tag) {
20860 case HostRoot: {
20861 var root2 = fiber.stateNode;
20862 if (isRootDehydrated(root2)) {
20863 var lanes = getHighestPriorityPendingLanes(root2);
20864 flushRoot(root2, lanes);
20865 }
20866 break;
20867 }
20868 case SuspenseComponent: {
20869 flushSync(function() {
20870 var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
20871 if (root3 !== null) {
20872 var eventTime = requestEventTime();
20873 scheduleUpdateOnFiber(root3, fiber, SyncLane, eventTime);
20874 }
20875 });
20876 var retryLane = SyncLane;
20877 markRetryLaneIfNotHydrated(fiber, retryLane);
20878 break;
20879 }
20880 }
20881 }
20882 function markRetryLaneImpl(fiber, retryLane) {
20883 var suspenseState = fiber.memoizedState;
20884 if (suspenseState !== null && suspenseState.dehydrated !== null) {
20885 suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
20886 }
20887 }
20888 function markRetryLaneIfNotHydrated(fiber, retryLane) {
20889 markRetryLaneImpl(fiber, retryLane);
20890 var alternate = fiber.alternate;
20891 if (alternate) {
20892 markRetryLaneImpl(alternate, retryLane);
20893 }
20894 }
20895 function attemptContinuousHydration$1(fiber) {
20896 if (fiber.tag !== SuspenseComponent) {
20897 return;
20898 }
20899 var lane = SelectiveHydrationLane;
20900 var root2 = enqueueConcurrentRenderForLane(fiber, lane);
20901 if (root2 !== null) {
20902 var eventTime = requestEventTime();
20903 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
20904 }
20905 markRetryLaneIfNotHydrated(fiber, lane);
20906 }
20907 function attemptHydrationAtCurrentPriority$1(fiber) {
20908 if (fiber.tag !== SuspenseComponent) {
20909 return;
20910 }
20911 var lane = requestUpdateLane(fiber);
20912 var root2 = enqueueConcurrentRenderForLane(fiber, lane);
20913 if (root2 !== null) {
20914 var eventTime = requestEventTime();
20915 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
20916 }
20917 markRetryLaneIfNotHydrated(fiber, lane);
20918 }
20919 function findHostInstanceWithNoPortals(fiber) {
20920 var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
20921 if (hostFiber === null) {
20922 return null;
20923 }
20924 return hostFiber.stateNode;
20925 }
20926 var shouldErrorImpl = function(fiber) {
20927 return null;
20928 };
20929 function shouldError(fiber) {
20930 return shouldErrorImpl(fiber);
20931 }
20932 var shouldSuspendImpl = function(fiber) {
20933 return false;
20934 };
20935 function shouldSuspend(fiber) {
20936 return shouldSuspendImpl(fiber);
20937 }
20938 var overrideHookState = null;
20939 var overrideHookStateDeletePath = null;
20940 var overrideHookStateRenamePath = null;
20941 var overrideProps = null;
20942 var overridePropsDeletePath = null;
20943 var overridePropsRenamePath = null;
20944 var scheduleUpdate = null;
20945 var setErrorHandler = null;
20946 var setSuspenseHandler = null;
20947 {
20948 var copyWithDeleteImpl = function(obj, path, index2) {
20949 var key = path[index2];
20950 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
20951 if (index2 + 1 === path.length) {
20952 if (isArray(updated)) {
20953 updated.splice(key, 1);
20954 } else {
20955 delete updated[key];
20956 }
20957 return updated;
20958 }
20959 updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1);
20960 return updated;
20961 };
20962 var copyWithDelete = function(obj, path) {
20963 return copyWithDeleteImpl(obj, path, 0);
20964 };
20965 var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
20966 var oldKey = oldPath[index2];
20967 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
20968 if (index2 + 1 === oldPath.length) {
20969 var newKey = newPath[index2];
20970 updated[newKey] = updated[oldKey];
20971 if (isArray(updated)) {
20972 updated.splice(oldKey, 1);
20973 } else {
20974 delete updated[oldKey];
20975 }
20976 } else {
20977 updated[oldKey] = copyWithRenameImpl(
20978 // $FlowFixMe number or string is fine here
20979 obj[oldKey],
20980 oldPath,
20981 newPath,
20982 index2 + 1
20983 );
20984 }
20985 return updated;
20986 };
20987 var copyWithRename = function(obj, oldPath, newPath) {
20988 if (oldPath.length !== newPath.length) {
20989 warn("copyWithRename() expects paths of the same length");
20990 return;
20991 } else {
20992 for (var i = 0; i < newPath.length - 1; i++) {
20993 if (oldPath[i] !== newPath[i]) {
20994 warn("copyWithRename() expects paths to be the same except for the deepest key");
20995 return;
20996 }
20997 }
20998 }
20999 return copyWithRenameImpl(obj, oldPath, newPath, 0);
21000 };
21001 var copyWithSetImpl = function(obj, path, index2, value) {
21002 if (index2 >= path.length) {
21003 return value;
21004 }
21005 var key = path[index2];
21006 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
21007 updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value);
21008 return updated;
21009 };
21010 var copyWithSet = function(obj, path, value) {
21011 return copyWithSetImpl(obj, path, 0, value);
21012 };
21013 var findHook = function(fiber, id) {
21014 var currentHook2 = fiber.memoizedState;
21015 while (currentHook2 !== null && id > 0) {
21016 currentHook2 = currentHook2.next;
21017 id--;
21018 }
21019 return currentHook2;
21020 };
21021 overrideHookState = function(fiber, id, path, value) {
21022 var hook = findHook(fiber, id);
21023 if (hook !== null) {
21024 var newState = copyWithSet(hook.memoizedState, path, value);
21025 hook.memoizedState = newState;
21026 hook.baseState = newState;
21027 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21028 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21029 if (root2 !== null) {
21030 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21031 }
21032 }
21033 };
21034 overrideHookStateDeletePath = function(fiber, id, path) {
21035 var hook = findHook(fiber, id);
21036 if (hook !== null) {
21037 var newState = copyWithDelete(hook.memoizedState, path);
21038 hook.memoizedState = newState;
21039 hook.baseState = newState;
21040 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21041 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21042 if (root2 !== null) {
21043 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21044 }
21045 }
21046 };
21047 overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
21048 var hook = findHook(fiber, id);
21049 if (hook !== null) {
21050 var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
21051 hook.memoizedState = newState;
21052 hook.baseState = newState;
21053 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21054 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21055 if (root2 !== null) {
21056 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21057 }
21058 }
21059 };
21060 overrideProps = function(fiber, path, value) {
21061 fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
21062 if (fiber.alternate) {
21063 fiber.alternate.pendingProps = fiber.pendingProps;
21064 }
21065 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21066 if (root2 !== null) {
21067 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21068 }
21069 };
21070 overridePropsDeletePath = function(fiber, path) {
21071 fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
21072 if (fiber.alternate) {
21073 fiber.alternate.pendingProps = fiber.pendingProps;
21074 }
21075 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21076 if (root2 !== null) {
21077 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21078 }
21079 };
21080 overridePropsRenamePath = function(fiber, oldPath, newPath) {
21081 fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
21082 if (fiber.alternate) {
21083 fiber.alternate.pendingProps = fiber.pendingProps;
21084 }
21085 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21086 if (root2 !== null) {
21087 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21088 }
21089 };
21090 scheduleUpdate = function(fiber) {
21091 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21092 if (root2 !== null) {
21093 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21094 }
21095 };
21096 setErrorHandler = function(newShouldErrorImpl) {
21097 shouldErrorImpl = newShouldErrorImpl;
21098 };
21099 setSuspenseHandler = function(newShouldSuspendImpl) {
21100 shouldSuspendImpl = newShouldSuspendImpl;
21101 };
21102 }
21103 function findHostInstanceByFiber(fiber) {
21104 var hostFiber = findCurrentHostFiber(fiber);
21105 if (hostFiber === null) {
21106 return null;
21107 }
21108 return hostFiber.stateNode;
21109 }
21110 function emptyFindFiberByHostInstance(instance) {
21111 return null;
21112 }
21113 function getCurrentFiberForDevTools() {
21114 return current;
21115 }
21116 function injectIntoDevTools(devToolsConfig) {
21117 var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
21118 var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
21119 return injectInternals({
21120 bundleType: devToolsConfig.bundleType,
21121 version: devToolsConfig.version,
21122 rendererPackageName: devToolsConfig.rendererPackageName,
21123 rendererConfig: devToolsConfig.rendererConfig,
21124 overrideHookState,
21125 overrideHookStateDeletePath,
21126 overrideHookStateRenamePath,
21127 overrideProps,
21128 overridePropsDeletePath,
21129 overridePropsRenamePath,
21130 setErrorHandler,
21131 setSuspenseHandler,
21132 scheduleUpdate,
21133 currentDispatcherRef: ReactCurrentDispatcher2,
21134 findHostInstanceByFiber,
21135 findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
21136 // React Refresh
21137 findHostInstancesForRefresh,
21138 scheduleRefresh,
21139 scheduleRoot,
21140 setRefreshHandler,
21141 // Enables DevTools to append owner stacks to error messages in DEV mode.
21142 getCurrentFiber: getCurrentFiberForDevTools,
21143 // Enables DevTools to detect reconciler version rather than renderer version
21144 // which may not match for third party renderers.
21145 reconcilerVersion: ReactVersion
21146 });
21147 }
21148 var defaultOnRecoverableError = typeof reportError === "function" ? (
21149 // In modern browsers, reportError will dispatch an error event,
21150 // emulating an uncaught JavaScript error.
21151 reportError
21152 ) : function(error2) {
21153 console["error"](error2);
21154 };
21155 function ReactDOMRoot(internalRoot) {
21156 this._internalRoot = internalRoot;
21157 }
21158 ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
21159 var root2 = this._internalRoot;
21160 if (root2 === null) {
21161 throw new Error("Cannot update an unmounted root.");
21162 }
21163 {
21164 if (typeof arguments[1] === "function") {
21165 error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
21166 } else if (isValidContainer(arguments[1])) {
21167 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.");
21168 } else if (typeof arguments[1] !== "undefined") {
21169 error("You passed a second argument to root.render(...) but it only accepts one argument.");
21170 }
21171 var container = root2.containerInfo;
21172 if (container.nodeType !== COMMENT_NODE) {
21173 var hostInstance = findHostInstanceWithNoPortals(root2.current);
21174 if (hostInstance) {
21175 if (hostInstance.parentNode !== container) {
21176 error("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
21177 }
21178 }
21179 }
21180 }
21181 updateContainer(children, root2, null, null);
21182 };
21183 ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
21184 {
21185 if (typeof arguments[0] === "function") {
21186 error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
21187 }
21188 }
21189 var root2 = this._internalRoot;
21190 if (root2 !== null) {
21191 this._internalRoot = null;
21192 var container = root2.containerInfo;
21193 {
21194 if (isAlreadyRendering()) {
21195 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.");
21196 }
21197 }
21198 flushSync(function() {
21199 updateContainer(null, root2, null, null);
21200 });
21201 unmarkContainerAsRoot(container);
21202 }
21203 };
21204 function createRoot(container, options2) {
21205 if (!isValidContainer(container)) {
21206 throw new Error("createRoot(...): Target container is not a DOM element.");
21207 }
21208 warnIfReactDOMContainerInDEV(container);
21209 var isStrictMode = false;
21210 var concurrentUpdatesByDefaultOverride = false;
21211 var identifierPrefix = "";
21212 var onRecoverableError = defaultOnRecoverableError;
21213 var transitionCallbacks = null;
21214 if (options2 !== null && options2 !== void 0) {
21215 {
21216 if (options2.hydrate) {
21217 warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
21218 } else {
21219 if (typeof options2 === "object" && options2 !== null && options2.$$typeof === REACT_ELEMENT_TYPE) {
21220 error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n let root = createRoot(domContainer);\n root.render(<App />);");
21221 }
21222 }
21223 }
21224 if (options2.unstable_strictMode === true) {
21225 isStrictMode = true;
21226 }
21227 if (options2.identifierPrefix !== void 0) {
21228 identifierPrefix = options2.identifierPrefix;
21229 }
21230 if (options2.onRecoverableError !== void 0) {
21231 onRecoverableError = options2.onRecoverableError;
21232 }
21233 if (options2.transitionCallbacks !== void 0) {
21234 transitionCallbacks = options2.transitionCallbacks;
21235 }
21236 }
21237 var root2 = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
21238 markContainerAsRoot(root2.current, container);
21239 var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21240 listenToAllSupportedEvents(rootContainerElement);
21241 return new ReactDOMRoot(root2);
21242 }
21243 function ReactDOMHydrationRoot(internalRoot) {
21244 this._internalRoot = internalRoot;
21245 }
21246 function scheduleHydration(target) {
21247 if (target) {
21248 queueExplicitHydrationTarget(target);
21249 }
21250 }
21251 ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
21252 function hydrateRoot(container, initialChildren, options2) {
21253 if (!isValidContainer(container)) {
21254 throw new Error("hydrateRoot(...): Target container is not a DOM element.");
21255 }
21256 warnIfReactDOMContainerInDEV(container);
21257 {
21258 if (initialChildren === void 0) {
21259 error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
21260 }
21261 }
21262 var hydrationCallbacks = options2 != null ? options2 : null;
21263 var mutableSources = options2 != null && options2.hydratedSources || null;
21264 var isStrictMode = false;
21265 var concurrentUpdatesByDefaultOverride = false;
21266 var identifierPrefix = "";
21267 var onRecoverableError = defaultOnRecoverableError;
21268 if (options2 !== null && options2 !== void 0) {
21269 if (options2.unstable_strictMode === true) {
21270 isStrictMode = true;
21271 }
21272 if (options2.identifierPrefix !== void 0) {
21273 identifierPrefix = options2.identifierPrefix;
21274 }
21275 if (options2.onRecoverableError !== void 0) {
21276 onRecoverableError = options2.onRecoverableError;
21277 }
21278 }
21279 var root2 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
21280 markContainerAsRoot(root2.current, container);
21281 listenToAllSupportedEvents(container);
21282 if (mutableSources) {
21283 for (var i = 0; i < mutableSources.length; i++) {
21284 var mutableSource = mutableSources[i];
21285 registerMutableSourceForHydration(root2, mutableSource);
21286 }
21287 }
21288 return new ReactDOMHydrationRoot(root2);
21289 }
21290 function isValidContainer(node) {
21291 return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
21292 }
21293 function isValidContainerLegacy(node) {
21294 return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === " react-mount-point-unstable "));
21295 }
21296 function warnIfReactDOMContainerInDEV(container) {
21297 {
21298 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
21299 error("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app.");
21300 }
21301 if (isContainerMarkedAsRoot(container)) {
21302 if (container._reactRootContainer) {
21303 error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
21304 } else {
21305 error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.");
21306 }
21307 }
21308 }
21309 }
21310 var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
21311 var topLevelUpdateWarnings;
21312 {
21313 topLevelUpdateWarnings = function(container) {
21314 if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
21315 var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);
21316 if (hostInstance) {
21317 if (hostInstance.parentNode !== container) {
21318 error("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
21319 }
21320 }
21321 }
21322 var isRootRenderedBySomeReact = !!container._reactRootContainer;
21323 var rootEl = getReactRootElementInContainer(container);
21324 var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
21325 if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
21326 error("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.");
21327 }
21328 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
21329 error("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
21330 }
21331 };
21332 }
21333 function getReactRootElementInContainer(container) {
21334 if (!container) {
21335 return null;
21336 }
21337 if (container.nodeType === DOCUMENT_NODE) {
21338 return container.documentElement;
21339 } else {
21340 return container.firstChild;
21341 }
21342 }
21343 function noopOnRecoverableError() {
21344 }
21345 function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
21346 if (isHydrationContainer) {
21347 if (typeof callback === "function") {
21348 var originalCallback = callback;
21349 callback = function() {
21350 var instance = getPublicRootInstance(root2);
21351 originalCallback.call(instance);
21352 };
21353 }
21354 var root2 = createHydrationContainer(
21355 initialChildren,
21356 callback,
21357 container,
21358 LegacyRoot,
21359 null,
21360 // hydrationCallbacks
21361 false,
21362 // isStrictMode
21363 false,
21364 // concurrentUpdatesByDefaultOverride,
21365 "",
21366 // identifierPrefix
21367 noopOnRecoverableError
21368 );
21369 container._reactRootContainer = root2;
21370 markContainerAsRoot(root2.current, container);
21371 var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21372 listenToAllSupportedEvents(rootContainerElement);
21373 flushSync();
21374 return root2;
21375 } else {
21376 var rootSibling;
21377 while (rootSibling = container.lastChild) {
21378 container.removeChild(rootSibling);
21379 }
21380 if (typeof callback === "function") {
21381 var _originalCallback = callback;
21382 callback = function() {
21383 var instance = getPublicRootInstance(_root);
21384 _originalCallback.call(instance);
21385 };
21386 }
21387 var _root = createContainer(
21388 container,
21389 LegacyRoot,
21390 null,
21391 // hydrationCallbacks
21392 false,
21393 // isStrictMode
21394 false,
21395 // concurrentUpdatesByDefaultOverride,
21396 "",
21397 // identifierPrefix
21398 noopOnRecoverableError
21399 );
21400 container._reactRootContainer = _root;
21401 markContainerAsRoot(_root.current, container);
21402 var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21403 listenToAllSupportedEvents(_rootContainerElement);
21404 flushSync(function() {
21405 updateContainer(initialChildren, _root, parentComponent, callback);
21406 });
21407 return _root;
21408 }
21409 }
21410 function warnOnInvalidCallback$1(callback, callerName) {
21411 {
21412 if (callback !== null && typeof callback !== "function") {
21413 error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
21414 }
21415 }
21416 }
21417 function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
21418 {
21419 topLevelUpdateWarnings(container);
21420 warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
21421 }
21422 var maybeRoot = container._reactRootContainer;
21423 var root2;
21424 if (!maybeRoot) {
21425 root2 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
21426 } else {
21427 root2 = maybeRoot;
21428 if (typeof callback === "function") {
21429 var originalCallback = callback;
21430 callback = function() {
21431 var instance = getPublicRootInstance(root2);
21432 originalCallback.call(instance);
21433 };
21434 }
21435 updateContainer(children, root2, parentComponent, callback);
21436 }
21437 return getPublicRootInstance(root2);
21438 }
21439 var didWarnAboutFindDOMNode = false;
21440 function findDOMNode(componentOrElement) {
21441 {
21442 if (!didWarnAboutFindDOMNode) {
21443 didWarnAboutFindDOMNode = true;
21444 error("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node");
21445 }
21446 var owner = ReactCurrentOwner$3.current;
21447 if (owner !== null && owner.stateNode !== null) {
21448 var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
21449 if (!warnedAboutRefsInRender) {
21450 error("%s is accessing findDOMNode inside its render(). 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.", getComponentNameFromType(owner.type) || "A component");
21451 }
21452 owner.stateNode._warnedAboutRefsInRender = true;
21453 }
21454 }
21455 if (componentOrElement == null) {
21456 return null;
21457 }
21458 if (componentOrElement.nodeType === ELEMENT_NODE) {
21459 return componentOrElement;
21460 }
21461 {
21462 return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
21463 }
21464 }
21465 function hydrate(element, container, callback) {
21466 {
21467 error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
21468 }
21469 if (!isValidContainerLegacy(container)) {
21470 throw new Error("Target container is not a DOM element.");
21471 }
21472 {
21473 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21474 if (isModernRoot) {
21475 error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
21476 }
21477 }
21478 return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
21479 }
21480 function render(element, container, callback) {
21481 {
21482 error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
21483 }
21484 if (!isValidContainerLegacy(container)) {
21485 throw new Error("Target container is not a DOM element.");
21486 }
21487 {
21488 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21489 if (isModernRoot) {
21490 error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
21491 }
21492 }
21493 return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
21494 }
21495 function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
21496 {
21497 error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
21498 }
21499 if (!isValidContainerLegacy(containerNode)) {
21500 throw new Error("Target container is not a DOM element.");
21501 }
21502 if (parentComponent == null || !has(parentComponent)) {
21503 throw new Error("parentComponent must be a valid React Component");
21504 }
21505 return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
21506 }
21507 var didWarnAboutUnmountComponentAtNode = false;
21508 function unmountComponentAtNode(container) {
21509 {
21510 if (!didWarnAboutUnmountComponentAtNode) {
21511 didWarnAboutUnmountComponentAtNode = true;
21512 error("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot");
21513 }
21514 }
21515 if (!isValidContainerLegacy(container)) {
21516 throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
21517 }
21518 {
21519 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21520 if (isModernRoot) {
21521 error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
21522 }
21523 }
21524 if (container._reactRootContainer) {
21525 {
21526 var rootEl = getReactRootElementInContainer(container);
21527 var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
21528 if (renderedByDifferentReact) {
21529 error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
21530 }
21531 }
21532 flushSync(function() {
21533 legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
21534 container._reactRootContainer = null;
21535 unmarkContainerAsRoot(container);
21536 });
21537 });
21538 return true;
21539 } else {
21540 {
21541 var _rootEl = getReactRootElementInContainer(container);
21542 var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
21543 var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;
21544 if (hasNonRootReactChild) {
21545 error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
21546 }
21547 }
21548 return false;
21549 }
21550 }
21551 setAttemptSynchronousHydration(attemptSynchronousHydration$1);
21552 setAttemptContinuousHydration(attemptContinuousHydration$1);
21553 setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
21554 setGetCurrentUpdatePriority(getCurrentUpdatePriority);
21555 setAttemptHydrationAtPriority(runWithPriority);
21556 {
21557 if (typeof Map !== "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
21558 Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
21559 Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
21560 error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");
21561 }
21562 }
21563 setRestoreImplementation(restoreControlledState$3);
21564 setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);
21565 function createPortal$1(children, container) {
21566 var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
21567 if (!isValidContainer(container)) {
21568 throw new Error("Target container is not a DOM element.");
21569 }
21570 return createPortal(children, container, null, key);
21571 }
21572 function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
21573 return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
21574 }
21575 var Internals = {
21576 usingClientEntryPoint: false,
21577 // Keep in sync with ReactTestUtils.js.
21578 // This is an array for better minification.
21579 Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
21580 };
21581 function createRoot$1(container, options2) {
21582 {
21583 if (!Internals.usingClientEntryPoint && true) {
21584 error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
21585 }
21586 }
21587 return createRoot(container, options2);
21588 }
21589 function hydrateRoot$1(container, initialChildren, options2) {
21590 {
21591 if (!Internals.usingClientEntryPoint && true) {
21592 error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
21593 }
21594 }
21595 return hydrateRoot(container, initialChildren, options2);
21596 }
21597 function flushSync$1(fn) {
21598 {
21599 if (isAlreadyRendering()) {
21600 error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.");
21601 }
21602 }
21603 return flushSync(fn);
21604 }
21605 var foundDevTools = injectIntoDevTools({
21606 findFiberByHostInstance: getClosestInstanceFromNode,
21607 bundleType: 1,
21608 version: ReactVersion,
21609 rendererPackageName: "react-dom"
21610 });
21611 {
21612 if (!foundDevTools && canUseDOM && window.top === window.self) {
21613 if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
21614 var protocol = window.location.protocol;
21615 if (/^(https?|file):$/.test(protocol)) {
21616 console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (protocol === "file:" ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : ""), "font-weight:bold");
21617 }
21618 }
21619 }
21620 }
21621 exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
21622 exports.createPortal = createPortal$1;
21623 exports.createRoot = createRoot$1;
21624 exports.findDOMNode = findDOMNode;
21625 exports.flushSync = flushSync$1;
21626 exports.hydrate = hydrate;
21627 exports.hydrateRoot = hydrateRoot$1;
21628 exports.render = render;
21629 exports.unmountComponentAtNode = unmountComponentAtNode;
21630 exports.unstable_batchedUpdates = batchedUpdates$1;
21631 exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
21632 exports.version = ReactVersion;
21633 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
21634 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
21635 }
21636 })();
21637 }
21638 }
21639 });
21640
21641 // node_modules/react-dom/index.js
21642 var require_react_dom = __commonJS({
21643 "node_modules/react-dom/index.js"(exports, module) {
21644 if (false) {
21645 checkDCE();
21646 module.exports = null;
21647 } else {
21648 module.exports = require_react_dom_development();
21649 }
21650 }
21651 });
21652 return require_react_dom();
21653 })();
21654 /*! Bundled license information:
21655
21656 scheduler/cjs/scheduler.development.js:
21657 (**
21658 * @license React
21659 * scheduler.development.js
21660 *
21661 * Copyright (c) Facebook, Inc. and its affiliates.
21662 *
21663 * This source code is licensed under the MIT license found in the
21664 * LICENSE file in the root directory of this source tree.
21665 *)
21666
21667 react-dom/cjs/react-dom.development.js:
21668 (**
21669 * @license React
21670 * react-dom.development.js
21671 *
21672 * Copyright (c) Facebook, Inc. and its affiliates.
21673 *
21674 * This source code is licensed under the MIT license found in the
21675 * LICENSE file in the root directory of this source tree.
21676 *)
21677 (**
21678 * Checks if an event is supported in the current execution environment.
21679 *
21680 * NOTE: This will not work correctly for non-generic events such as `change`,
21681 * `reset`, `load`, `error`, and `select`.
21682 *
21683 * Borrows from Modernizr.
21684 *
21685 * @param {string} eventNameSuffix Event name, e.g. "click".
21686 * @return {boolean} True if the event is supported.
21687 * @internal
21688 * @license Modernizr 3.0.0pre (Custom Build) | MIT
21689 *)
21690 */
21691