PluginProbe
Gutenberg / 23.5.2
Gutenberg v23.5.2
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 7.4.0 All 402 releases
gutenberg / build / scripts / vendors / react-dom.js

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

21,732 lines 953.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var ReactDOM = (() => {
2 var __getOwnPropNames = Object.getOwnPropertyNames;
3 var __commonJS = (cb, mod) => function __require() {
4 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5 };
6
7 // react-external:react
8 var require_react = __commonJS({
9 "react-external:react"(exports, module) {
10 module.exports = globalThis.React;
11 }
12 });
13
14 // ../../node_modules/scheduler/cjs/scheduler.development.js
15 var require_scheduler_development = __commonJS({
16 "../../node_modules/scheduler/cjs/scheduler.development.js"(exports) {
17 "use strict";
18 if (true) {
19 (function() {
20 "use strict";
21 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
22 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
23 }
24 var enableSchedulerDebugging = false;
25 var enableProfiling = false;
26 var frameYieldMs = 5;
27 function push(heap, node) {
28 var index = heap.length;
29 heap.push(node);
30 siftUp(heap, node, index);
31 }
32 function peek(heap) {
33 return heap.length === 0 ? null : heap[0];
34 }
35 function pop(heap) {
36 if (heap.length === 0) {
37 return null;
38 }
39 var first = heap[0];
40 var last = heap.pop();
41 if (last !== first) {
42 heap[0] = last;
43 siftDown(heap, last, 0);
44 }
45 return first;
46 }
47 function siftUp(heap, node, i) {
48 var index = i;
49 while (index > 0) {
50 var parentIndex = index - 1 >>> 1;
51 var parent = heap[parentIndex];
52 if (compare(parent, node) > 0) {
53 heap[parentIndex] = node;
54 heap[index] = parent;
55 index = parentIndex;
56 } else {
57 return;
58 }
59 }
60 }
61 function siftDown(heap, node, i) {
62 var index = i;
63 var length = heap.length;
64 var halfLength = length >>> 1;
65 while (index < halfLength) {
66 var leftIndex = (index + 1) * 2 - 1;
67 var left = heap[leftIndex];
68 var rightIndex = leftIndex + 1;
69 var right = heap[rightIndex];
70 if (compare(left, node) < 0) {
71 if (rightIndex < length && compare(right, left) < 0) {
72 heap[index] = right;
73 heap[rightIndex] = node;
74 index = rightIndex;
75 } else {
76 heap[index] = left;
77 heap[leftIndex] = node;
78 index = leftIndex;
79 }
80 } else if (rightIndex < length && compare(right, node) < 0) {
81 heap[index] = right;
82 heap[rightIndex] = node;
83 index = rightIndex;
84 } else {
85 return;
86 }
87 }
88 }
89 function compare(a, b) {
90 var diff = a.sortIndex - b.sortIndex;
91 return diff !== 0 ? diff : a.id - b.id;
92 }
93 var ImmediatePriority = 1;
94 var UserBlockingPriority = 2;
95 var NormalPriority = 3;
96 var LowPriority = 4;
97 var IdlePriority = 5;
98 function markTaskErrored(task, ms) {
99 }
100 var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
101 if (hasPerformanceNow) {
102 var localPerformance = performance;
103 exports.unstable_now = function() {
104 return localPerformance.now();
105 };
106 } else {
107 var localDate = Date;
108 var initialTime = localDate.now();
109 exports.unstable_now = function() {
110 return localDate.now() - initialTime;
111 };
112 }
113 var maxSigned31BitInt = 1073741823;
114 var IMMEDIATE_PRIORITY_TIMEOUT = -1;
115 var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
116 var NORMAL_PRIORITY_TIMEOUT = 5e3;
117 var LOW_PRIORITY_TIMEOUT = 1e4;
118 var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
119 var taskQueue = [];
120 var timerQueue = [];
121 var taskIdCounter = 1;
122 var currentTask = null;
123 var currentPriorityLevel = NormalPriority;
124 var isPerformingWork = false;
125 var isHostCallbackScheduled = false;
126 var isHostTimeoutScheduled = false;
127 var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
128 var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
129 var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
130 var isInputPending = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
131 function advanceTimers(currentTime) {
132 var timer = peek(timerQueue);
133 while (timer !== null) {
134 if (timer.callback === null) {
135 pop(timerQueue);
136 } else if (timer.startTime <= currentTime) {
137 pop(timerQueue);
138 timer.sortIndex = timer.expirationTime;
139 push(taskQueue, timer);
140 } else {
141 return;
142 }
143 timer = peek(timerQueue);
144 }
145 }
146 function handleTimeout(currentTime) {
147 isHostTimeoutScheduled = false;
148 advanceTimers(currentTime);
149 if (!isHostCallbackScheduled) {
150 if (peek(taskQueue) !== null) {
151 isHostCallbackScheduled = true;
152 requestHostCallback(flushWork);
153 } else {
154 var firstTimer = peek(timerQueue);
155 if (firstTimer !== null) {
156 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
157 }
158 }
159 }
160 }
161 function flushWork(hasTimeRemaining, initialTime2) {
162 isHostCallbackScheduled = false;
163 if (isHostTimeoutScheduled) {
164 isHostTimeoutScheduled = false;
165 cancelHostTimeout();
166 }
167 isPerformingWork = true;
168 var previousPriorityLevel = currentPriorityLevel;
169 try {
170 if (enableProfiling) {
171 try {
172 return workLoop(hasTimeRemaining, initialTime2);
173 } catch (error) {
174 if (currentTask !== null) {
175 var currentTime = exports.unstable_now();
176 markTaskErrored(currentTask, currentTime);
177 currentTask.isQueued = false;
178 }
179 throw error;
180 }
181 } else {
182 return workLoop(hasTimeRemaining, initialTime2);
183 }
184 } finally {
185 currentTask = null;
186 currentPriorityLevel = previousPriorityLevel;
187 isPerformingWork = false;
188 }
189 }
190 function workLoop(hasTimeRemaining, initialTime2) {
191 var currentTime = initialTime2;
192 advanceTimers(currentTime);
193 currentTask = peek(taskQueue);
194 while (currentTask !== null && !enableSchedulerDebugging) {
195 if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
196 break;
197 }
198 var callback = currentTask.callback;
199 if (typeof callback === "function") {
200 currentTask.callback = null;
201 currentPriorityLevel = currentTask.priorityLevel;
202 var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
203 var continuationCallback = callback(didUserCallbackTimeout);
204 currentTime = exports.unstable_now();
205 if (typeof continuationCallback === "function") {
206 currentTask.callback = continuationCallback;
207 } else {
208 if (currentTask === peek(taskQueue)) {
209 pop(taskQueue);
210 }
211 }
212 advanceTimers(currentTime);
213 } else {
214 pop(taskQueue);
215 }
216 currentTask = peek(taskQueue);
217 }
218 if (currentTask !== null) {
219 return true;
220 } else {
221 var firstTimer = peek(timerQueue);
222 if (firstTimer !== null) {
223 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
224 }
225 return false;
226 }
227 }
228 function unstable_runWithPriority(priorityLevel, eventHandler) {
229 switch (priorityLevel) {
230 case ImmediatePriority:
231 case UserBlockingPriority:
232 case NormalPriority:
233 case LowPriority:
234 case IdlePriority:
235 break;
236 default:
237 priorityLevel = NormalPriority;
238 }
239 var previousPriorityLevel = currentPriorityLevel;
240 currentPriorityLevel = priorityLevel;
241 try {
242 return eventHandler();
243 } finally {
244 currentPriorityLevel = previousPriorityLevel;
245 }
246 }
247 function unstable_next(eventHandler) {
248 var priorityLevel;
249 switch (currentPriorityLevel) {
250 case ImmediatePriority:
251 case UserBlockingPriority:
252 case NormalPriority:
253 priorityLevel = NormalPriority;
254 break;
255 default:
256 priorityLevel = currentPriorityLevel;
257 break;
258 }
259 var previousPriorityLevel = currentPriorityLevel;
260 currentPriorityLevel = priorityLevel;
261 try {
262 return eventHandler();
263 } finally {
264 currentPriorityLevel = previousPriorityLevel;
265 }
266 }
267 function unstable_wrapCallback(callback) {
268 var parentPriorityLevel = currentPriorityLevel;
269 return function() {
270 var previousPriorityLevel = currentPriorityLevel;
271 currentPriorityLevel = parentPriorityLevel;
272 try {
273 return callback.apply(this, arguments);
274 } finally {
275 currentPriorityLevel = previousPriorityLevel;
276 }
277 };
278 }
279 function unstable_scheduleCallback(priorityLevel, callback, options) {
280 var currentTime = exports.unstable_now();
281 var startTime2;
282 if (typeof options === "object" && options !== null) {
283 var delay = options.delay;
284 if (typeof delay === "number" && delay > 0) {
285 startTime2 = currentTime + delay;
286 } else {
287 startTime2 = currentTime;
288 }
289 } else {
290 startTime2 = currentTime;
291 }
292 var timeout;
293 switch (priorityLevel) {
294 case ImmediatePriority:
295 timeout = IMMEDIATE_PRIORITY_TIMEOUT;
296 break;
297 case UserBlockingPriority:
298 timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
299 break;
300 case IdlePriority:
301 timeout = IDLE_PRIORITY_TIMEOUT;
302 break;
303 case LowPriority:
304 timeout = LOW_PRIORITY_TIMEOUT;
305 break;
306 case NormalPriority:
307 default:
308 timeout = NORMAL_PRIORITY_TIMEOUT;
309 break;
310 }
311 var expirationTime = startTime2 + timeout;
312 var newTask = {
313 id: taskIdCounter++,
314 callback,
315 priorityLevel,
316 startTime: startTime2,
317 expirationTime,
318 sortIndex: -1
319 };
320 if (startTime2 > currentTime) {
321 newTask.sortIndex = startTime2;
322 push(timerQueue, newTask);
323 if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
324 if (isHostTimeoutScheduled) {
325 cancelHostTimeout();
326 } else {
327 isHostTimeoutScheduled = true;
328 }
329 requestHostTimeout(handleTimeout, startTime2 - currentTime);
330 }
331 } else {
332 newTask.sortIndex = expirationTime;
333 push(taskQueue, newTask);
334 if (!isHostCallbackScheduled && !isPerformingWork) {
335 isHostCallbackScheduled = true;
336 requestHostCallback(flushWork);
337 }
338 }
339 return newTask;
340 }
341 function unstable_pauseExecution() {
342 }
343 function unstable_continueExecution() {
344 if (!isHostCallbackScheduled && !isPerformingWork) {
345 isHostCallbackScheduled = true;
346 requestHostCallback(flushWork);
347 }
348 }
349 function unstable_getFirstCallbackNode() {
350 return peek(taskQueue);
351 }
352 function unstable_cancelCallback(task) {
353 task.callback = null;
354 }
355 function unstable_getCurrentPriorityLevel() {
356 return currentPriorityLevel;
357 }
358 var isMessageLoopRunning = false;
359 var scheduledHostCallback = null;
360 var taskTimeoutID = -1;
361 var frameInterval = frameYieldMs;
362 var startTime = -1;
363 function shouldYieldToHost() {
364 var timeElapsed = exports.unstable_now() - startTime;
365 if (timeElapsed < frameInterval) {
366 return false;
367 }
368 return true;
369 }
370 function requestPaint() {
371 }
372 function forceFrameRate(fps) {
373 if (fps < 0 || fps > 125) {
374 console["error"]("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
375 return;
376 }
377 if (fps > 0) {
378 frameInterval = Math.floor(1e3 / fps);
379 } else {
380 frameInterval = frameYieldMs;
381 }
382 }
383 var performWorkUntilDeadline = function() {
384 if (scheduledHostCallback !== null) {
385 var currentTime = exports.unstable_now();
386 startTime = currentTime;
387 var hasTimeRemaining = true;
388 var hasMoreWork = true;
389 try {
390 hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
391 } finally {
392 if (hasMoreWork) {
393 schedulePerformWorkUntilDeadline();
394 } else {
395 isMessageLoopRunning = false;
396 scheduledHostCallback = null;
397 }
398 }
399 } else {
400 isMessageLoopRunning = false;
401 }
402 };
403 var schedulePerformWorkUntilDeadline;
404 if (typeof localSetImmediate === "function") {
405 schedulePerformWorkUntilDeadline = function() {
406 localSetImmediate(performWorkUntilDeadline);
407 };
408 } else if (typeof MessageChannel !== "undefined") {
409 var channel = new MessageChannel();
410 var port = channel.port2;
411 channel.port1.onmessage = performWorkUntilDeadline;
412 schedulePerformWorkUntilDeadline = function() {
413 port.postMessage(null);
414 };
415 } else {
416 schedulePerformWorkUntilDeadline = function() {
417 localSetTimeout(performWorkUntilDeadline, 0);
418 };
419 }
420 function requestHostCallback(callback) {
421 scheduledHostCallback = callback;
422 if (!isMessageLoopRunning) {
423 isMessageLoopRunning = true;
424 schedulePerformWorkUntilDeadline();
425 }
426 }
427 function requestHostTimeout(callback, ms) {
428 taskTimeoutID = localSetTimeout(function() {
429 callback(exports.unstable_now());
430 }, ms);
431 }
432 function cancelHostTimeout() {
433 localClearTimeout(taskTimeoutID);
434 taskTimeoutID = -1;
435 }
436 var unstable_requestPaint = requestPaint;
437 var unstable_Profiling = null;
438 exports.unstable_IdlePriority = IdlePriority;
439 exports.unstable_ImmediatePriority = ImmediatePriority;
440 exports.unstable_LowPriority = LowPriority;
441 exports.unstable_NormalPriority = NormalPriority;
442 exports.unstable_Profiling = unstable_Profiling;
443 exports.unstable_UserBlockingPriority = UserBlockingPriority;
444 exports.unstable_cancelCallback = unstable_cancelCallback;
445 exports.unstable_continueExecution = unstable_continueExecution;
446 exports.unstable_forceFrameRate = forceFrameRate;
447 exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
448 exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
449 exports.unstable_next = unstable_next;
450 exports.unstable_pauseExecution = unstable_pauseExecution;
451 exports.unstable_requestPaint = unstable_requestPaint;
452 exports.unstable_runWithPriority = unstable_runWithPriority;
453 exports.unstable_scheduleCallback = unstable_scheduleCallback;
454 exports.unstable_shouldYield = shouldYieldToHost;
455 exports.unstable_wrapCallback = unstable_wrapCallback;
456 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
457 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
458 }
459 })();
460 }
461 }
462 });
463
464 // ../../node_modules/scheduler/index.js
465 var require_scheduler = __commonJS({
466 "../../node_modules/scheduler/index.js"(exports, module) {
467 "use strict";
468 if (false) {
469 module.exports = null;
470 } else {
471 module.exports = require_scheduler_development();
472 }
473 }
474 });
475
476 // ../../node_modules/react-dom/cjs/react-dom.development.js
477 var require_react_dom_development = __commonJS({
478 "../../node_modules/react-dom/cjs/react-dom.development.js"(exports) {
479 "use strict";
480 if (true) {
481 (function() {
482 "use strict";
483 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
484 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
485 }
486 var React = require_react();
487 var Scheduler = require_scheduler();
488 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
489 var suppressWarning = false;
490 function setSuppressWarning(newSuppressWarning) {
491 {
492 suppressWarning = newSuppressWarning;
493 }
494 }
495 function warn(format) {
496 {
497 if (!suppressWarning) {
498 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
499 args[_key - 1] = arguments[_key];
500 }
501 printWarning("warn", format, args);
502 }
503 }
504 }
505 function error(format) {
506 {
507 if (!suppressWarning) {
508 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
509 args[_key2 - 1] = arguments[_key2];
510 }
511 printWarning("error", format, args);
512 }
513 }
514 }
515 function printWarning(level, format, args) {
516 {
517 var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
518 var stack = ReactDebugCurrentFrame2.getStackAddendum();
519 if (stack !== "") {
520 format += "%s";
521 args = args.concat([stack]);
522 }
523 var argsWithFormat = args.map(function(item) {
524 return String(item);
525 });
526 argsWithFormat.unshift("Warning: " + format);
527 Function.prototype.apply.call(console[level], console, argsWithFormat);
528 }
529 }
530 var FunctionComponent = 0;
531 var ClassComponent = 1;
532 var IndeterminateComponent = 2;
533 var HostRoot = 3;
534 var HostPortal = 4;
535 var HostComponent = 5;
536 var HostText = 6;
537 var Fragment = 7;
538 var Mode = 8;
539 var ContextConsumer = 9;
540 var ContextProvider = 10;
541 var ForwardRef = 11;
542 var Profiler = 12;
543 var SuspenseComponent = 13;
544 var MemoComponent = 14;
545 var SimpleMemoComponent = 15;
546 var LazyComponent = 16;
547 var IncompleteClassComponent = 17;
548 var DehydratedFragment = 18;
549 var SuspenseListComponent = 19;
550 var ScopeComponent = 21;
551 var OffscreenComponent = 22;
552 var LegacyHiddenComponent = 23;
553 var CacheComponent = 24;
554 var TracingMarkerComponent = 25;
555 var enableClientRenderFallbackOnTextMismatch = true;
556 var enableNewReconciler = false;
557 var enableLazyContextPropagation = false;
558 var enableLegacyHidden = false;
559 var enableSuspenseAvoidThisFallback = false;
560 var disableCommentsAsDOMContainers = true;
561 var enableCustomElementPropertySupport = false;
562 var warnAboutStringRefs = true;
563 var enableSchedulingProfiler = true;
564 var enableProfilerTimer = true;
565 var enableProfilerCommitHooks = true;
566 var allNativeEvents = /* @__PURE__ */ new Set();
567 var registrationNameDependencies = {};
568 var possibleRegistrationNames = {};
569 function registerTwoPhaseEvent(registrationName, dependencies) {
570 registerDirectEvent(registrationName, dependencies);
571 registerDirectEvent(registrationName + "Capture", dependencies);
572 }
573 function registerDirectEvent(registrationName, dependencies) {
574 {
575 if (registrationNameDependencies[registrationName]) {
576 error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName);
577 }
578 }
579 registrationNameDependencies[registrationName] = dependencies;
580 {
581 var lowerCasedName = registrationName.toLowerCase();
582 possibleRegistrationNames[lowerCasedName] = registrationName;
583 if (registrationName === "onDoubleClick") {
584 possibleRegistrationNames.ondblclick = registrationName;
585 }
586 }
587 for (var i = 0; i < dependencies.length; i++) {
588 allNativeEvents.add(dependencies[i]);
589 }
590 }
591 var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
592 var hasOwnProperty = Object.prototype.hasOwnProperty;
593 function typeName(value) {
594 {
595 var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
596 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
597 return type;
598 }
599 }
600 function willCoercionThrow(value) {
601 {
602 try {
603 testStringCoercion(value);
604 return false;
605 } catch (e) {
606 return true;
607 }
608 }
609 }
610 function testStringCoercion(value) {
611 return "" + value;
612 }
613 function checkAttributeStringCoercion(value, attributeName) {
614 {
615 if (willCoercionThrow(value)) {
616 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));
617 return testStringCoercion(value);
618 }
619 }
620 }
621 function checkKeyStringCoercion(value) {
622 {
623 if (willCoercionThrow(value)) {
624 error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
625 return testStringCoercion(value);
626 }
627 }
628 }
629 function checkPropStringCoercion(value, propName) {
630 {
631 if (willCoercionThrow(value)) {
632 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));
633 return testStringCoercion(value);
634 }
635 }
636 }
637 function checkCSSPropertyStringCoercion(value, propName) {
638 {
639 if (willCoercionThrow(value)) {
640 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));
641 return testStringCoercion(value);
642 }
643 }
644 }
645 function checkHtmlStringCoercion(value) {
646 {
647 if (willCoercionThrow(value)) {
648 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));
649 return testStringCoercion(value);
650 }
651 }
652 }
653 function checkFormFieldValueStringCoercion(value) {
654 {
655 if (willCoercionThrow(value)) {
656 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));
657 return testStringCoercion(value);
658 }
659 }
660 }
661 var RESERVED = 0;
662 var STRING = 1;
663 var BOOLEANISH_STRING = 2;
664 var BOOLEAN = 3;
665 var OVERLOADED_BOOLEAN = 4;
666 var NUMERIC = 5;
667 var POSITIVE_NUMERIC = 6;
668 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";
669 var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
670 var VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
671 var illegalAttributeNameCache = {};
672 var validatedAttributeNameCache = {};
673 function isAttributeNameSafe(attributeName) {
674 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
675 return true;
676 }
677 if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
678 return false;
679 }
680 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
681 validatedAttributeNameCache[attributeName] = true;
682 return true;
683 }
684 illegalAttributeNameCache[attributeName] = true;
685 {
686 error("Invalid attribute name: `%s`", attributeName);
687 }
688 return false;
689 }
690 function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
691 if (propertyInfo !== null) {
692 return propertyInfo.type === RESERVED;
693 }
694 if (isCustomComponentTag) {
695 return false;
696 }
697 if (name.length > 2 && (name[0] === "o" || name[0] === "O") && (name[1] === "n" || name[1] === "N")) {
698 return true;
699 }
700 return false;
701 }
702 function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
703 if (propertyInfo !== null && propertyInfo.type === RESERVED) {
704 return false;
705 }
706 switch (typeof value) {
707 case "function":
708 // $FlowIssue symbol is perfectly valid here
709 case "symbol":
710 return true;
711 case "boolean": {
712 if (isCustomComponentTag) {
713 return false;
714 }
715 if (propertyInfo !== null) {
716 return !propertyInfo.acceptsBooleans;
717 } else {
718 var prefix2 = name.toLowerCase().slice(0, 5);
719 return prefix2 !== "data-" && prefix2 !== "aria-";
720 }
721 }
722 default:
723 return false;
724 }
725 }
726 function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
727 if (value === null || typeof value === "undefined") {
728 return true;
729 }
730 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
731 return true;
732 }
733 if (isCustomComponentTag) {
734 return false;
735 }
736 if (propertyInfo !== null) {
737 switch (propertyInfo.type) {
738 case BOOLEAN:
739 return !value;
740 case OVERLOADED_BOOLEAN:
741 return value === false;
742 case NUMERIC:
743 return isNaN(value);
744 case POSITIVE_NUMERIC:
745 return isNaN(value) || value < 1;
746 }
747 }
748 return false;
749 }
750 function getPropertyInfo(name) {
751 return properties.hasOwnProperty(name) ? properties[name] : null;
752 }
753 function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) {
754 this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
755 this.attributeName = attributeName;
756 this.attributeNamespace = attributeNamespace;
757 this.mustUseProperty = mustUseProperty;
758 this.propertyName = name;
759 this.type = type;
760 this.sanitizeURL = sanitizeURL2;
761 this.removeEmptyString = removeEmptyString;
762 }
763 var properties = {};
764 var reservedProps = [
765 "children",
766 "dangerouslySetInnerHTML",
767 // TODO: This prevents the assignment of defaultValue to regular
768 // elements (not just inputs). Now that ReactDOMInput assigns to the
769 // defaultValue property -- do we need this?
770 "defaultValue",
771 "defaultChecked",
772 "innerHTML",
773 "suppressContentEditableWarning",
774 "suppressHydrationWarning",
775 "style"
776 ];
777 reservedProps.forEach(function(name) {
778 properties[name] = new PropertyInfoRecord(
779 name,
780 RESERVED,
781 false,
782 // mustUseProperty
783 name,
784 // attributeName
785 null,
786 // attributeNamespace
787 false,
788 // sanitizeURL
789 false
790 );
791 });
792 [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref) {
793 var name = _ref[0], attributeName = _ref[1];
794 properties[name] = new PropertyInfoRecord(
795 name,
796 STRING,
797 false,
798 // mustUseProperty
799 attributeName,
800 // attributeName
801 null,
802 // attributeNamespace
803 false,
804 // sanitizeURL
805 false
806 );
807 });
808 ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name) {
809 properties[name] = new PropertyInfoRecord(
810 name,
811 BOOLEANISH_STRING,
812 false,
813 // mustUseProperty
814 name.toLowerCase(),
815 // attributeName
816 null,
817 // attributeNamespace
818 false,
819 // sanitizeURL
820 false
821 );
822 });
823 ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name) {
824 properties[name] = new PropertyInfoRecord(
825 name,
826 BOOLEANISH_STRING,
827 false,
828 // mustUseProperty
829 name,
830 // attributeName
831 null,
832 // attributeNamespace
833 false,
834 // sanitizeURL
835 false
836 );
837 });
838 [
839 "allowFullScreen",
840 "async",
841 // Note: there is a special case that prevents it from being written to the DOM
842 // on the client side because the browsers are inconsistent. Instead we call focus().
843 "autoFocus",
844 "autoPlay",
845 "controls",
846 "default",
847 "defer",
848 "disabled",
849 "disablePictureInPicture",
850 "disableRemotePlayback",
851 "formNoValidate",
852 "hidden",
853 "loop",
854 "noModule",
855 "noValidate",
856 "open",
857 "playsInline",
858 "readOnly",
859 "required",
860 "reversed",
861 "scoped",
862 "seamless",
863 // Microdata
864 "itemScope"
865 ].forEach(function(name) {
866 properties[name] = new PropertyInfoRecord(
867 name,
868 BOOLEAN,
869 false,
870 // mustUseProperty
871 name.toLowerCase(),
872 // attributeName
873 null,
874 // attributeNamespace
875 false,
876 // sanitizeURL
877 false
878 );
879 });
880 [
881 "checked",
882 // Note: `option.selected` is not updated if `select.multiple` is
883 // disabled with `removeAttribute`. We have special logic for handling this.
884 "multiple",
885 "muted",
886 "selected"
887 // NOTE: if you add a camelCased prop to this list,
888 // you'll need to set attributeName to name.toLowerCase()
889 // instead in the assignment below.
890 ].forEach(function(name) {
891 properties[name] = new PropertyInfoRecord(
892 name,
893 BOOLEAN,
894 true,
895 // mustUseProperty
896 name,
897 // attributeName
898 null,
899 // attributeNamespace
900 false,
901 // sanitizeURL
902 false
903 );
904 });
905 [
906 "capture",
907 "download"
908 // NOTE: if you add a camelCased prop to this list,
909 // you'll need to set attributeName to name.toLowerCase()
910 // instead in the assignment below.
911 ].forEach(function(name) {
912 properties[name] = new PropertyInfoRecord(
913 name,
914 OVERLOADED_BOOLEAN,
915 false,
916 // mustUseProperty
917 name,
918 // attributeName
919 null,
920 // attributeNamespace
921 false,
922 // sanitizeURL
923 false
924 );
925 });
926 [
927 "cols",
928 "rows",
929 "size",
930 "span"
931 // NOTE: if you add a camelCased prop to this list,
932 // you'll need to set attributeName to name.toLowerCase()
933 // instead in the assignment below.
934 ].forEach(function(name) {
935 properties[name] = new PropertyInfoRecord(
936 name,
937 POSITIVE_NUMERIC,
938 false,
939 // mustUseProperty
940 name,
941 // attributeName
942 null,
943 // attributeNamespace
944 false,
945 // sanitizeURL
946 false
947 );
948 });
949 ["rowSpan", "start"].forEach(function(name) {
950 properties[name] = new PropertyInfoRecord(
951 name,
952 NUMERIC,
953 false,
954 // mustUseProperty
955 name.toLowerCase(),
956 // attributeName
957 null,
958 // attributeNamespace
959 false,
960 // sanitizeURL
961 false
962 );
963 });
964 var CAMELIZE = /[\-\:]([a-z])/g;
965 var capitalize = function(token) {
966 return token[1].toUpperCase();
967 };
968 [
969 "accent-height",
970 "alignment-baseline",
971 "arabic-form",
972 "baseline-shift",
973 "cap-height",
974 "clip-path",
975 "clip-rule",
976 "color-interpolation",
977 "color-interpolation-filters",
978 "color-profile",
979 "color-rendering",
980 "dominant-baseline",
981 "enable-background",
982 "fill-opacity",
983 "fill-rule",
984 "flood-color",
985 "flood-opacity",
986 "font-family",
987 "font-size",
988 "font-size-adjust",
989 "font-stretch",
990 "font-style",
991 "font-variant",
992 "font-weight",
993 "glyph-name",
994 "glyph-orientation-horizontal",
995 "glyph-orientation-vertical",
996 "horiz-adv-x",
997 "horiz-origin-x",
998 "image-rendering",
999 "letter-spacing",
1000 "lighting-color",
1001 "marker-end",
1002 "marker-mid",
1003 "marker-start",
1004 "overline-position",
1005 "overline-thickness",
1006 "paint-order",
1007 "panose-1",
1008 "pointer-events",
1009 "rendering-intent",
1010 "shape-rendering",
1011 "stop-color",
1012 "stop-opacity",
1013 "strikethrough-position",
1014 "strikethrough-thickness",
1015 "stroke-dasharray",
1016 "stroke-dashoffset",
1017 "stroke-linecap",
1018 "stroke-linejoin",
1019 "stroke-miterlimit",
1020 "stroke-opacity",
1021 "stroke-width",
1022 "text-anchor",
1023 "text-decoration",
1024 "text-rendering",
1025 "underline-position",
1026 "underline-thickness",
1027 "unicode-bidi",
1028 "unicode-range",
1029 "units-per-em",
1030 "v-alphabetic",
1031 "v-hanging",
1032 "v-ideographic",
1033 "v-mathematical",
1034 "vector-effect",
1035 "vert-adv-y",
1036 "vert-origin-x",
1037 "vert-origin-y",
1038 "word-spacing",
1039 "writing-mode",
1040 "xmlns:xlink",
1041 "x-height"
1042 // NOTE: if you add a camelCased prop to this list,
1043 // you'll need to set attributeName to name.toLowerCase()
1044 // instead in the assignment below.
1045 ].forEach(function(attributeName) {
1046 var name = attributeName.replace(CAMELIZE, capitalize);
1047 properties[name] = new PropertyInfoRecord(
1048 name,
1049 STRING,
1050 false,
1051 // mustUseProperty
1052 attributeName,
1053 null,
1054 // attributeNamespace
1055 false,
1056 // sanitizeURL
1057 false
1058 );
1059 });
1060 [
1061 "xlink:actuate",
1062 "xlink:arcrole",
1063 "xlink:role",
1064 "xlink:show",
1065 "xlink:title",
1066 "xlink:type"
1067 // NOTE: if you add a camelCased prop to this list,
1068 // you'll need to set attributeName to name.toLowerCase()
1069 // instead in the assignment below.
1070 ].forEach(function(attributeName) {
1071 var name = attributeName.replace(CAMELIZE, capitalize);
1072 properties[name] = new PropertyInfoRecord(
1073 name,
1074 STRING,
1075 false,
1076 // mustUseProperty
1077 attributeName,
1078 "http://www.w3.org/1999/xlink",
1079 false,
1080 // sanitizeURL
1081 false
1082 );
1083 });
1084 [
1085 "xml:base",
1086 "xml:lang",
1087 "xml:space"
1088 // NOTE: if you add a camelCased prop to this list,
1089 // you'll need to set attributeName to name.toLowerCase()
1090 // instead in the assignment below.
1091 ].forEach(function(attributeName) {
1092 var name = attributeName.replace(CAMELIZE, capitalize);
1093 properties[name] = new PropertyInfoRecord(
1094 name,
1095 STRING,
1096 false,
1097 // mustUseProperty
1098 attributeName,
1099 "http://www.w3.org/XML/1998/namespace",
1100 false,
1101 // sanitizeURL
1102 false
1103 );
1104 });
1105 ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
1106 properties[attributeName] = new PropertyInfoRecord(
1107 attributeName,
1108 STRING,
1109 false,
1110 // mustUseProperty
1111 attributeName.toLowerCase(),
1112 // attributeName
1113 null,
1114 // attributeNamespace
1115 false,
1116 // sanitizeURL
1117 false
1118 );
1119 });
1120 var xlinkHref = "xlinkHref";
1121 properties[xlinkHref] = new PropertyInfoRecord(
1122 "xlinkHref",
1123 STRING,
1124 false,
1125 // mustUseProperty
1126 "xlink:href",
1127 "http://www.w3.org/1999/xlink",
1128 true,
1129 // sanitizeURL
1130 false
1131 );
1132 ["src", "href", "action", "formAction"].forEach(function(attributeName) {
1133 properties[attributeName] = new PropertyInfoRecord(
1134 attributeName,
1135 STRING,
1136 false,
1137 // mustUseProperty
1138 attributeName.toLowerCase(),
1139 // attributeName
1140 null,
1141 // attributeNamespace
1142 true,
1143 // sanitizeURL
1144 true
1145 );
1146 });
1147 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;
1148 var didWarn = false;
1149 function sanitizeURL(url) {
1150 {
1151 if (!didWarn && isJavaScriptProtocol.test(url)) {
1152 didWarn = true;
1153 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));
1154 }
1155 }
1156 }
1157 function getValueForProperty(node, name, expected, propertyInfo) {
1158 {
1159 if (propertyInfo.mustUseProperty) {
1160 var propertyName = propertyInfo.propertyName;
1161 return node[propertyName];
1162 } else {
1163 {
1164 checkAttributeStringCoercion(expected, name);
1165 }
1166 if (propertyInfo.sanitizeURL) {
1167 sanitizeURL("" + expected);
1168 }
1169 var attributeName = propertyInfo.attributeName;
1170 var stringValue = null;
1171 if (propertyInfo.type === OVERLOADED_BOOLEAN) {
1172 if (node.hasAttribute(attributeName)) {
1173 var value = node.getAttribute(attributeName);
1174 if (value === "") {
1175 return true;
1176 }
1177 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1178 return value;
1179 }
1180 if (value === "" + expected) {
1181 return expected;
1182 }
1183 return value;
1184 }
1185 } else if (node.hasAttribute(attributeName)) {
1186 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1187 return node.getAttribute(attributeName);
1188 }
1189 if (propertyInfo.type === BOOLEAN) {
1190 return expected;
1191 }
1192 stringValue = node.getAttribute(attributeName);
1193 }
1194 if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
1195 return stringValue === null ? expected : stringValue;
1196 } else if (stringValue === "" + expected) {
1197 return expected;
1198 } else {
1199 return stringValue;
1200 }
1201 }
1202 }
1203 }
1204 function getValueForAttribute(node, name, expected, isCustomComponentTag) {
1205 {
1206 if (!isAttributeNameSafe(name)) {
1207 return;
1208 }
1209 if (!node.hasAttribute(name)) {
1210 return expected === void 0 ? void 0 : null;
1211 }
1212 var value = node.getAttribute(name);
1213 {
1214 checkAttributeStringCoercion(expected, name);
1215 }
1216 if (value === "" + expected) {
1217 return expected;
1218 }
1219 return value;
1220 }
1221 }
1222 function setValueForProperty(node, name, value, isCustomComponentTag) {
1223 var propertyInfo = getPropertyInfo(name);
1224 if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
1225 return;
1226 }
1227 if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
1228 value = null;
1229 }
1230 if (isCustomComponentTag || propertyInfo === null) {
1231 if (isAttributeNameSafe(name)) {
1232 var _attributeName = name;
1233 if (value === null) {
1234 node.removeAttribute(_attributeName);
1235 } else {
1236 {
1237 checkAttributeStringCoercion(value, name);
1238 }
1239 node.setAttribute(_attributeName, "" + value);
1240 }
1241 }
1242 return;
1243 }
1244 var mustUseProperty = propertyInfo.mustUseProperty;
1245 if (mustUseProperty) {
1246 var propertyName = propertyInfo.propertyName;
1247 if (value === null) {
1248 var type = propertyInfo.type;
1249 node[propertyName] = type === BOOLEAN ? false : "";
1250 } else {
1251 node[propertyName] = value;
1252 }
1253 return;
1254 }
1255 var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
1256 if (value === null) {
1257 node.removeAttribute(attributeName);
1258 } else {
1259 var _type = propertyInfo.type;
1260 var attributeValue;
1261 if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
1262 attributeValue = "";
1263 } else {
1264 {
1265 {
1266 checkAttributeStringCoercion(value, attributeName);
1267 }
1268 attributeValue = "" + value;
1269 }
1270 if (propertyInfo.sanitizeURL) {
1271 sanitizeURL(attributeValue.toString());
1272 }
1273 }
1274 if (attributeNamespace) {
1275 node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
1276 } else {
1277 node.setAttribute(attributeName, attributeValue);
1278 }
1279 }
1280 }
1281 var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
1282 var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
1283 var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
1284 var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
1285 var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
1286 var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
1287 var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
1288 var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
1289 var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
1290 var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
1291 var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
1292 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1293 var REACT_SCOPE_TYPE = /* @__PURE__ */ Symbol.for("react.scope");
1294 var REACT_DEBUG_TRACING_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.debug_trace_mode");
1295 var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
1296 var REACT_LEGACY_HIDDEN_TYPE = /* @__PURE__ */ Symbol.for("react.legacy_hidden");
1297 var REACT_CACHE_TYPE = /* @__PURE__ */ Symbol.for("react.cache");
1298 var REACT_TRACING_MARKER_TYPE = /* @__PURE__ */ Symbol.for("react.tracing_marker");
1299 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
1300 var FAUX_ITERATOR_SYMBOL = "@@iterator";
1301 function getIteratorFn(maybeIterable) {
1302 if (maybeIterable === null || typeof maybeIterable !== "object") {
1303 return null;
1304 }
1305 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1306 if (typeof maybeIterator === "function") {
1307 return maybeIterator;
1308 }
1309 return null;
1310 }
1311 var assign = Object.assign;
1312 var disabledDepth = 0;
1313 var prevLog;
1314 var prevInfo;
1315 var prevWarn;
1316 var prevError;
1317 var prevGroup;
1318 var prevGroupCollapsed;
1319 var prevGroupEnd;
1320 function disabledLog() {
1321 }
1322 disabledLog.__reactDisabledLog = true;
1323 function disableLogs() {
1324 {
1325 if (disabledDepth === 0) {
1326 prevLog = console.log;
1327 prevInfo = console.info;
1328 prevWarn = console.warn;
1329 prevError = console.error;
1330 prevGroup = console.group;
1331 prevGroupCollapsed = console.groupCollapsed;
1332 prevGroupEnd = console.groupEnd;
1333 var props = {
1334 configurable: true,
1335 enumerable: true,
1336 value: disabledLog,
1337 writable: true
1338 };
1339 Object.defineProperties(console, {
1340 info: props,
1341 log: props,
1342 warn: props,
1343 error: props,
1344 group: props,
1345 groupCollapsed: props,
1346 groupEnd: props
1347 });
1348 }
1349 disabledDepth++;
1350 }
1351 }
1352 function reenableLogs() {
1353 {
1354 disabledDepth--;
1355 if (disabledDepth === 0) {
1356 var props = {
1357 configurable: true,
1358 enumerable: true,
1359 writable: true
1360 };
1361 Object.defineProperties(console, {
1362 log: assign({}, props, {
1363 value: prevLog
1364 }),
1365 info: assign({}, props, {
1366 value: prevInfo
1367 }),
1368 warn: assign({}, props, {
1369 value: prevWarn
1370 }),
1371 error: assign({}, props, {
1372 value: prevError
1373 }),
1374 group: assign({}, props, {
1375 value: prevGroup
1376 }),
1377 groupCollapsed: assign({}, props, {
1378 value: prevGroupCollapsed
1379 }),
1380 groupEnd: assign({}, props, {
1381 value: prevGroupEnd
1382 })
1383 });
1384 }
1385 if (disabledDepth < 0) {
1386 error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1387 }
1388 }
1389 }
1390 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
1391 var prefix;
1392 function describeBuiltInComponentFrame(name, source, ownerFn) {
1393 {
1394 if (prefix === void 0) {
1395 try {
1396 throw Error();
1397 } catch (x) {
1398 var match = x.stack.trim().match(/\n( *(at )?)/);
1399 prefix = match && match[1] || "";
1400 }
1401 }
1402 return "\n" + prefix + name;
1403 }
1404 }
1405 var reentry = false;
1406 var componentFrameCache;
1407 {
1408 var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
1409 componentFrameCache = new PossiblyWeakMap();
1410 }
1411 function describeNativeComponentFrame(fn, construct) {
1412 if (!fn || reentry) {
1413 return "";
1414 }
1415 {
1416 var frame = componentFrameCache.get(fn);
1417 if (frame !== void 0) {
1418 return frame;
1419 }
1420 }
1421 var control;
1422 reentry = true;
1423 var previousPrepareStackTrace = Error.prepareStackTrace;
1424 Error.prepareStackTrace = void 0;
1425 var previousDispatcher;
1426 {
1427 previousDispatcher = ReactCurrentDispatcher.current;
1428 ReactCurrentDispatcher.current = null;
1429 disableLogs();
1430 }
1431 try {
1432 if (construct) {
1433 var Fake = function() {
1434 throw Error();
1435 };
1436 Object.defineProperty(Fake.prototype, "props", {
1437 set: function() {
1438 throw Error();
1439 }
1440 });
1441 if (typeof Reflect === "object" && Reflect.construct) {
1442 try {
1443 Reflect.construct(Fake, []);
1444 } catch (x) {
1445 control = x;
1446 }
1447 Reflect.construct(fn, [], Fake);
1448 } else {
1449 try {
1450 Fake.call();
1451 } catch (x) {
1452 control = x;
1453 }
1454 fn.call(Fake.prototype);
1455 }
1456 } else {
1457 try {
1458 throw Error();
1459 } catch (x) {
1460 control = x;
1461 }
1462 fn();
1463 }
1464 } catch (sample) {
1465 if (sample && control && typeof sample.stack === "string") {
1466 var sampleLines = sample.stack.split("\n");
1467 var controlLines = control.stack.split("\n");
1468 var s = sampleLines.length - 1;
1469 var c = controlLines.length - 1;
1470 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1471 c--;
1472 }
1473 for (; s >= 1 && c >= 0; s--, c--) {
1474 if (sampleLines[s] !== controlLines[c]) {
1475 if (s !== 1 || c !== 1) {
1476 do {
1477 s--;
1478 c--;
1479 if (c < 0 || sampleLines[s] !== controlLines[c]) {
1480 var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
1481 if (fn.displayName && _frame.includes("<anonymous>")) {
1482 _frame = _frame.replace("<anonymous>", fn.displayName);
1483 }
1484 {
1485 if (typeof fn === "function") {
1486 componentFrameCache.set(fn, _frame);
1487 }
1488 }
1489 return _frame;
1490 }
1491 } while (s >= 1 && c >= 0);
1492 }
1493 break;
1494 }
1495 }
1496 }
1497 } finally {
1498 reentry = false;
1499 {
1500 ReactCurrentDispatcher.current = previousDispatcher;
1501 reenableLogs();
1502 }
1503 Error.prepareStackTrace = previousPrepareStackTrace;
1504 }
1505 var name = fn ? fn.displayName || fn.name : "";
1506 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
1507 {
1508 if (typeof fn === "function") {
1509 componentFrameCache.set(fn, syntheticFrame);
1510 }
1511 }
1512 return syntheticFrame;
1513 }
1514 function describeClassComponentFrame(ctor, source, ownerFn) {
1515 {
1516 return describeNativeComponentFrame(ctor, true);
1517 }
1518 }
1519 function describeFunctionComponentFrame(fn, source, ownerFn) {
1520 {
1521 return describeNativeComponentFrame(fn, false);
1522 }
1523 }
1524 function shouldConstruct(Component) {
1525 var prototype = Component.prototype;
1526 return !!(prototype && prototype.isReactComponent);
1527 }
1528 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1529 if (type == null) {
1530 return "";
1531 }
1532 if (typeof type === "function") {
1533 {
1534 return describeNativeComponentFrame(type, shouldConstruct(type));
1535 }
1536 }
1537 if (typeof type === "string") {
1538 return describeBuiltInComponentFrame(type);
1539 }
1540 switch (type) {
1541 case REACT_SUSPENSE_TYPE:
1542 return describeBuiltInComponentFrame("Suspense");
1543 case REACT_SUSPENSE_LIST_TYPE:
1544 return describeBuiltInComponentFrame("SuspenseList");
1545 }
1546 if (typeof type === "object") {
1547 switch (type.$$typeof) {
1548 case REACT_FORWARD_REF_TYPE:
1549 return describeFunctionComponentFrame(type.render);
1550 case REACT_MEMO_TYPE:
1551 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1552 case REACT_LAZY_TYPE: {
1553 var lazyComponent = type;
1554 var payload = lazyComponent._payload;
1555 var init = lazyComponent._init;
1556 try {
1557 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
1558 } catch (x) {
1559 }
1560 }
1561 }
1562 }
1563 return "";
1564 }
1565 function describeFiber(fiber) {
1566 var owner = fiber._debugOwner ? fiber._debugOwner.type : null;
1567 var source = fiber._debugSource;
1568 switch (fiber.tag) {
1569 case HostComponent:
1570 return describeBuiltInComponentFrame(fiber.type);
1571 case LazyComponent:
1572 return describeBuiltInComponentFrame("Lazy");
1573 case SuspenseComponent:
1574 return describeBuiltInComponentFrame("Suspense");
1575 case SuspenseListComponent:
1576 return describeBuiltInComponentFrame("SuspenseList");
1577 case FunctionComponent:
1578 case IndeterminateComponent:
1579 case SimpleMemoComponent:
1580 return describeFunctionComponentFrame(fiber.type);
1581 case ForwardRef:
1582 return describeFunctionComponentFrame(fiber.type.render);
1583 case ClassComponent:
1584 return describeClassComponentFrame(fiber.type);
1585 default:
1586 return "";
1587 }
1588 }
1589 function getStackByFiberInDevAndProd(workInProgress2) {
1590 try {
1591 var info = "";
1592 var node = workInProgress2;
1593 do {
1594 info += describeFiber(node);
1595 node = node.return;
1596 } while (node);
1597 return info;
1598 } catch (x) {
1599 return "\nError generating stack: " + x.message + "\n" + x.stack;
1600 }
1601 }
1602 function getWrappedName(outerType, innerType, wrapperName) {
1603 var displayName = outerType.displayName;
1604 if (displayName) {
1605 return displayName;
1606 }
1607 var functionName = innerType.displayName || innerType.name || "";
1608 return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
1609 }
1610 function getContextName(type) {
1611 return type.displayName || "Context";
1612 }
1613 function getComponentNameFromType(type) {
1614 if (type == null) {
1615 return null;
1616 }
1617 {
1618 if (typeof type.tag === "number") {
1619 error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
1620 }
1621 }
1622 if (typeof type === "function") {
1623 return type.displayName || type.name || null;
1624 }
1625 if (typeof type === "string") {
1626 return type;
1627 }
1628 switch (type) {
1629 case REACT_FRAGMENT_TYPE:
1630 return "Fragment";
1631 case REACT_PORTAL_TYPE:
1632 return "Portal";
1633 case REACT_PROFILER_TYPE:
1634 return "Profiler";
1635 case REACT_STRICT_MODE_TYPE:
1636 return "StrictMode";
1637 case REACT_SUSPENSE_TYPE:
1638 return "Suspense";
1639 case REACT_SUSPENSE_LIST_TYPE:
1640 return "SuspenseList";
1641 }
1642 if (typeof type === "object") {
1643 switch (type.$$typeof) {
1644 case REACT_CONTEXT_TYPE:
1645 var context = type;
1646 return getContextName(context) + ".Consumer";
1647 case REACT_PROVIDER_TYPE:
1648 var provider = type;
1649 return getContextName(provider._context) + ".Provider";
1650 case REACT_FORWARD_REF_TYPE:
1651 return getWrappedName(type, type.render, "ForwardRef");
1652 case REACT_MEMO_TYPE:
1653 var outerName = type.displayName || null;
1654 if (outerName !== null) {
1655 return outerName;
1656 }
1657 return getComponentNameFromType(type.type) || "Memo";
1658 case REACT_LAZY_TYPE: {
1659 var lazyComponent = type;
1660 var payload = lazyComponent._payload;
1661 var init = lazyComponent._init;
1662 try {
1663 return getComponentNameFromType(init(payload));
1664 } catch (x) {
1665 return null;
1666 }
1667 }
1668 }
1669 }
1670 return null;
1671 }
1672 function getWrappedName$1(outerType, innerType, wrapperName) {
1673 var functionName = innerType.displayName || innerType.name || "";
1674 return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
1675 }
1676 function getContextName$1(type) {
1677 return type.displayName || "Context";
1678 }
1679 function getComponentNameFromFiber(fiber) {
1680 var tag = fiber.tag, type = fiber.type;
1681 switch (tag) {
1682 case CacheComponent:
1683 return "Cache";
1684 case ContextConsumer:
1685 var context = type;
1686 return getContextName$1(context) + ".Consumer";
1687 case ContextProvider:
1688 var provider = type;
1689 return getContextName$1(provider._context) + ".Provider";
1690 case DehydratedFragment:
1691 return "DehydratedFragment";
1692 case ForwardRef:
1693 return getWrappedName$1(type, type.render, "ForwardRef");
1694 case Fragment:
1695 return "Fragment";
1696 case HostComponent:
1697 return type;
1698 case HostPortal:
1699 return "Portal";
1700 case HostRoot:
1701 return "Root";
1702 case HostText:
1703 return "Text";
1704 case LazyComponent:
1705 return getComponentNameFromType(type);
1706 case Mode:
1707 if (type === REACT_STRICT_MODE_TYPE) {
1708 return "StrictMode";
1709 }
1710 return "Mode";
1711 case OffscreenComponent:
1712 return "Offscreen";
1713 case Profiler:
1714 return "Profiler";
1715 case ScopeComponent:
1716 return "Scope";
1717 case SuspenseComponent:
1718 return "Suspense";
1719 case SuspenseListComponent:
1720 return "SuspenseList";
1721 case TracingMarkerComponent:
1722 return "TracingMarker";
1723 // The display name for this tags come from the user-provided type:
1724 case ClassComponent:
1725 case FunctionComponent:
1726 case IncompleteClassComponent:
1727 case IndeterminateComponent:
1728 case MemoComponent:
1729 case SimpleMemoComponent:
1730 if (typeof type === "function") {
1731 return type.displayName || type.name || null;
1732 }
1733 if (typeof type === "string") {
1734 return type;
1735 }
1736 break;
1737 }
1738 return null;
1739 }
1740 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1741 var current = null;
1742 var isRendering = false;
1743 function getCurrentFiberOwnerNameInDevOrNull() {
1744 {
1745 if (current === null) {
1746 return null;
1747 }
1748 var owner = current._debugOwner;
1749 if (owner !== null && typeof owner !== "undefined") {
1750 return getComponentNameFromFiber(owner);
1751 }
1752 }
1753 return null;
1754 }
1755 function getCurrentFiberStackInDev() {
1756 {
1757 if (current === null) {
1758 return "";
1759 }
1760 return getStackByFiberInDevAndProd(current);
1761 }
1762 }
1763 function resetCurrentFiber() {
1764 {
1765 ReactDebugCurrentFrame.getCurrentStack = null;
1766 current = null;
1767 isRendering = false;
1768 }
1769 }
1770 function setCurrentFiber(fiber) {
1771 {
1772 ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev;
1773 current = fiber;
1774 isRendering = false;
1775 }
1776 }
1777 function getCurrentFiber() {
1778 {
1779 return current;
1780 }
1781 }
1782 function setIsRendering(rendering) {
1783 {
1784 isRendering = rendering;
1785 }
1786 }
1787 function toString(value) {
1788 return "" + value;
1789 }
1790 function getToStringValue(value) {
1791 switch (typeof value) {
1792 case "boolean":
1793 case "number":
1794 case "string":
1795 case "undefined":
1796 return value;
1797 case "object":
1798 {
1799 checkFormFieldValueStringCoercion(value);
1800 }
1801 return value;
1802 default:
1803 return "";
1804 }
1805 }
1806 var hasReadOnlyValue = {
1807 button: true,
1808 checkbox: true,
1809 image: true,
1810 hidden: true,
1811 radio: true,
1812 reset: true,
1813 submit: true
1814 };
1815 function checkControlledValueProps(tagName, props) {
1816 {
1817 if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {
1818 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`.");
1819 }
1820 if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {
1821 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`.");
1822 }
1823 }
1824 }
1825 function isCheckable(elem) {
1826 var type = elem.type;
1827 var nodeName = elem.nodeName;
1828 return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio");
1829 }
1830 function getTracker(node) {
1831 return node._valueTracker;
1832 }
1833 function detachTracker(node) {
1834 node._valueTracker = null;
1835 }
1836 function getValueFromNode(node) {
1837 var value = "";
1838 if (!node) {
1839 return value;
1840 }
1841 if (isCheckable(node)) {
1842 value = node.checked ? "true" : "false";
1843 } else {
1844 value = node.value;
1845 }
1846 return value;
1847 }
1848 function trackValueOnNode(node) {
1849 var valueField = isCheckable(node) ? "checked" : "value";
1850 var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
1851 {
1852 checkFormFieldValueStringCoercion(node[valueField]);
1853 }
1854 var currentValue = "" + node[valueField];
1855 if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
1856 return;
1857 }
1858 var get2 = descriptor.get, set2 = descriptor.set;
1859 Object.defineProperty(node, valueField, {
1860 configurable: true,
1861 get: function() {
1862 return get2.call(this);
1863 },
1864 set: function(value) {
1865 {
1866 checkFormFieldValueStringCoercion(value);
1867 }
1868 currentValue = "" + value;
1869 set2.call(this, value);
1870 }
1871 });
1872 Object.defineProperty(node, valueField, {
1873 enumerable: descriptor.enumerable
1874 });
1875 var tracker = {
1876 getValue: function() {
1877 return currentValue;
1878 },
1879 setValue: function(value) {
1880 {
1881 checkFormFieldValueStringCoercion(value);
1882 }
1883 currentValue = "" + value;
1884 },
1885 stopTracking: function() {
1886 detachTracker(node);
1887 delete node[valueField];
1888 }
1889 };
1890 return tracker;
1891 }
1892 function track(node) {
1893 if (getTracker(node)) {
1894 return;
1895 }
1896 node._valueTracker = trackValueOnNode(node);
1897 }
1898 function updateValueIfChanged(node) {
1899 if (!node) {
1900 return false;
1901 }
1902 var tracker = getTracker(node);
1903 if (!tracker) {
1904 return true;
1905 }
1906 var lastValue = tracker.getValue();
1907 var nextValue = getValueFromNode(node);
1908 if (nextValue !== lastValue) {
1909 tracker.setValue(nextValue);
1910 return true;
1911 }
1912 return false;
1913 }
1914 function getActiveElement(doc) {
1915 doc = doc || (typeof document !== "undefined" ? document : void 0);
1916 if (typeof doc === "undefined") {
1917 return null;
1918 }
1919 try {
1920 return doc.activeElement || doc.body;
1921 } catch (e) {
1922 return doc.body;
1923 }
1924 }
1925 var didWarnValueDefaultValue = false;
1926 var didWarnCheckedDefaultChecked = false;
1927 var didWarnControlledToUncontrolled = false;
1928 var didWarnUncontrolledToControlled = false;
1929 function isControlled(props) {
1930 var usesChecked = props.type === "checkbox" || props.type === "radio";
1931 return usesChecked ? props.checked != null : props.value != null;
1932 }
1933 function getHostProps(element, props) {
1934 var node = element;
1935 var checked = props.checked;
1936 var hostProps = assign({}, props, {
1937 defaultChecked: void 0,
1938 defaultValue: void 0,
1939 value: void 0,
1940 checked: checked != null ? checked : node._wrapperState.initialChecked
1941 });
1942 return hostProps;
1943 }
1944 function initWrapperState(element, props) {
1945 {
1946 checkControlledValueProps("input", props);
1947 if (props.checked !== void 0 && props.defaultChecked !== void 0 && !didWarnCheckedDefaultChecked) {
1948 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);
1949 didWarnCheckedDefaultChecked = true;
1950 }
1951 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue) {
1952 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);
1953 didWarnValueDefaultValue = true;
1954 }
1955 }
1956 var node = element;
1957 var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
1958 node._wrapperState = {
1959 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
1960 initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
1961 controlled: isControlled(props)
1962 };
1963 }
1964 function updateChecked(element, props) {
1965 var node = element;
1966 var checked = props.checked;
1967 if (checked != null) {
1968 setValueForProperty(node, "checked", checked, false);
1969 }
1970 }
1971 function updateWrapper(element, props) {
1972 var node = element;
1973 {
1974 var controlled = isControlled(props);
1975 if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
1976 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");
1977 didWarnUncontrolledToControlled = true;
1978 }
1979 if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
1980 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");
1981 didWarnControlledToUncontrolled = true;
1982 }
1983 }
1984 updateChecked(element, props);
1985 var value = getToStringValue(props.value);
1986 var type = props.type;
1987 if (value != null) {
1988 if (type === "number") {
1989 if (value === 0 && node.value === "" || // We explicitly want to coerce to number here if possible.
1990 // eslint-disable-next-line
1991 node.value != value) {
1992 node.value = toString(value);
1993 }
1994 } else if (node.value !== toString(value)) {
1995 node.value = toString(value);
1996 }
1997 } else if (type === "submit" || type === "reset") {
1998 node.removeAttribute("value");
1999 return;
2000 }
2001 {
2002 if (props.hasOwnProperty("value")) {
2003 setDefaultValue(node, props.type, value);
2004 } else if (props.hasOwnProperty("defaultValue")) {
2005 setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
2006 }
2007 }
2008 {
2009 if (props.checked == null && props.defaultChecked != null) {
2010 node.defaultChecked = !!props.defaultChecked;
2011 }
2012 }
2013 }
2014 function postMountWrapper(element, props, isHydrating2) {
2015 var node = element;
2016 if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) {
2017 var type = props.type;
2018 var isButton = type === "submit" || type === "reset";
2019 if (isButton && (props.value === void 0 || props.value === null)) {
2020 return;
2021 }
2022 var initialValue = toString(node._wrapperState.initialValue);
2023 if (!isHydrating2) {
2024 {
2025 if (initialValue !== node.value) {
2026 node.value = initialValue;
2027 }
2028 }
2029 }
2030 {
2031 node.defaultValue = initialValue;
2032 }
2033 }
2034 var name = node.name;
2035 if (name !== "") {
2036 node.name = "";
2037 }
2038 {
2039 node.defaultChecked = !node.defaultChecked;
2040 node.defaultChecked = !!node._wrapperState.initialChecked;
2041 }
2042 if (name !== "") {
2043 node.name = name;
2044 }
2045 }
2046 function restoreControlledState(element, props) {
2047 var node = element;
2048 updateWrapper(node, props);
2049 updateNamedCousins(node, props);
2050 }
2051 function updateNamedCousins(rootNode, props) {
2052 var name = props.name;
2053 if (props.type === "radio" && name != null) {
2054 var queryRoot = rootNode;
2055 while (queryRoot.parentNode) {
2056 queryRoot = queryRoot.parentNode;
2057 }
2058 {
2059 checkAttributeStringCoercion(name, "name");
2060 }
2061 var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name) + '][type="radio"]');
2062 for (var i = 0; i < group.length; i++) {
2063 var otherNode = group[i];
2064 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
2065 continue;
2066 }
2067 var otherProps = getFiberCurrentPropsFromNode(otherNode);
2068 if (!otherProps) {
2069 throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
2070 }
2071 updateValueIfChanged(otherNode);
2072 updateWrapper(otherNode, otherProps);
2073 }
2074 }
2075 }
2076 function setDefaultValue(node, type, value) {
2077 if (
2078 // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
2079 type !== "number" || getActiveElement(node.ownerDocument) !== node
2080 ) {
2081 if (value == null) {
2082 node.defaultValue = toString(node._wrapperState.initialValue);
2083 } else if (node.defaultValue !== toString(value)) {
2084 node.defaultValue = toString(value);
2085 }
2086 }
2087 }
2088 var didWarnSelectedSetOnOption = false;
2089 var didWarnInvalidChild = false;
2090 var didWarnInvalidInnerHTML = false;
2091 function validateProps(element, props) {
2092 {
2093 if (props.value == null) {
2094 if (typeof props.children === "object" && props.children !== null) {
2095 React.Children.forEach(props.children, function(child) {
2096 if (child == null) {
2097 return;
2098 }
2099 if (typeof child === "string" || typeof child === "number") {
2100 return;
2101 }
2102 if (!didWarnInvalidChild) {
2103 didWarnInvalidChild = true;
2104 error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
2105 }
2106 });
2107 } else if (props.dangerouslySetInnerHTML != null) {
2108 if (!didWarnInvalidInnerHTML) {
2109 didWarnInvalidInnerHTML = true;
2110 error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
2111 }
2112 }
2113 }
2114 if (props.selected != null && !didWarnSelectedSetOnOption) {
2115 error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.");
2116 didWarnSelectedSetOnOption = true;
2117 }
2118 }
2119 }
2120 function postMountWrapper$1(element, props) {
2121 if (props.value != null) {
2122 element.setAttribute("value", toString(getToStringValue(props.value)));
2123 }
2124 }
2125 var isArrayImpl = Array.isArray;
2126 function isArray(a) {
2127 return isArrayImpl(a);
2128 }
2129 var didWarnValueDefaultValue$1;
2130 {
2131 didWarnValueDefaultValue$1 = false;
2132 }
2133 function getDeclarationErrorAddendum() {
2134 var ownerName = getCurrentFiberOwnerNameInDevOrNull();
2135 if (ownerName) {
2136 return "\n\nCheck the render method of `" + ownerName + "`.";
2137 }
2138 return "";
2139 }
2140 var valuePropNames = ["value", "defaultValue"];
2141 function checkSelectPropTypes(props) {
2142 {
2143 checkControlledValueProps("select", props);
2144 for (var i = 0; i < valuePropNames.length; i++) {
2145 var propName = valuePropNames[i];
2146 if (props[propName] == null) {
2147 continue;
2148 }
2149 var propNameIsArray = isArray(props[propName]);
2150 if (props.multiple && !propNameIsArray) {
2151 error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
2152 } else if (!props.multiple && propNameIsArray) {
2153 error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
2154 }
2155 }
2156 }
2157 }
2158 function updateOptions(node, multiple, propValue, setDefaultSelected) {
2159 var options2 = node.options;
2160 if (multiple) {
2161 var selectedValues = propValue;
2162 var selectedValue = {};
2163 for (var i = 0; i < selectedValues.length; i++) {
2164 selectedValue["$" + selectedValues[i]] = true;
2165 }
2166 for (var _i = 0; _i < options2.length; _i++) {
2167 var selected = selectedValue.hasOwnProperty("$" + options2[_i].value);
2168 if (options2[_i].selected !== selected) {
2169 options2[_i].selected = selected;
2170 }
2171 if (selected && setDefaultSelected) {
2172 options2[_i].defaultSelected = true;
2173 }
2174 }
2175 } else {
2176 var _selectedValue = toString(getToStringValue(propValue));
2177 var defaultSelected = null;
2178 for (var _i2 = 0; _i2 < options2.length; _i2++) {
2179 if (options2[_i2].value === _selectedValue) {
2180 options2[_i2].selected = true;
2181 if (setDefaultSelected) {
2182 options2[_i2].defaultSelected = true;
2183 }
2184 return;
2185 }
2186 if (defaultSelected === null && !options2[_i2].disabled) {
2187 defaultSelected = options2[_i2];
2188 }
2189 }
2190 if (defaultSelected !== null) {
2191 defaultSelected.selected = true;
2192 }
2193 }
2194 }
2195 function getHostProps$1(element, props) {
2196 return assign({}, props, {
2197 value: void 0
2198 });
2199 }
2200 function initWrapperState$1(element, props) {
2201 var node = element;
2202 {
2203 checkSelectPropTypes(props);
2204 }
2205 node._wrapperState = {
2206 wasMultiple: !!props.multiple
2207 };
2208 {
2209 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValueDefaultValue$1) {
2210 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");
2211 didWarnValueDefaultValue$1 = true;
2212 }
2213 }
2214 }
2215 function postMountWrapper$2(element, props) {
2216 var node = element;
2217 node.multiple = !!props.multiple;
2218 var value = props.value;
2219 if (value != null) {
2220 updateOptions(node, !!props.multiple, value, false);
2221 } else if (props.defaultValue != null) {
2222 updateOptions(node, !!props.multiple, props.defaultValue, true);
2223 }
2224 }
2225 function postUpdateWrapper(element, props) {
2226 var node = element;
2227 var wasMultiple = node._wrapperState.wasMultiple;
2228 node._wrapperState.wasMultiple = !!props.multiple;
2229 var value = props.value;
2230 if (value != null) {
2231 updateOptions(node, !!props.multiple, value, false);
2232 } else if (wasMultiple !== !!props.multiple) {
2233 if (props.defaultValue != null) {
2234 updateOptions(node, !!props.multiple, props.defaultValue, true);
2235 } else {
2236 updateOptions(node, !!props.multiple, props.multiple ? [] : "", false);
2237 }
2238 }
2239 }
2240 function restoreControlledState$1(element, props) {
2241 var node = element;
2242 var value = props.value;
2243 if (value != null) {
2244 updateOptions(node, !!props.multiple, value, false);
2245 }
2246 }
2247 var didWarnValDefaultVal = false;
2248 function getHostProps$2(element, props) {
2249 var node = element;
2250 if (props.dangerouslySetInnerHTML != null) {
2251 throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
2252 }
2253 var hostProps = assign({}, props, {
2254 value: void 0,
2255 defaultValue: void 0,
2256 children: toString(node._wrapperState.initialValue)
2257 });
2258 return hostProps;
2259 }
2260 function initWrapperState$2(element, props) {
2261 var node = element;
2262 {
2263 checkControlledValueProps("textarea", props);
2264 if (props.value !== void 0 && props.defaultValue !== void 0 && !didWarnValDefaultVal) {
2265 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");
2266 didWarnValDefaultVal = true;
2267 }
2268 }
2269 var initialValue = props.value;
2270 if (initialValue == null) {
2271 var children = props.children, defaultValue = props.defaultValue;
2272 if (children != null) {
2273 {
2274 error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
2275 }
2276 {
2277 if (defaultValue != null) {
2278 throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
2279 }
2280 if (isArray(children)) {
2281 if (children.length > 1) {
2282 throw new Error("<textarea> can only have at most one child.");
2283 }
2284 children = children[0];
2285 }
2286 defaultValue = children;
2287 }
2288 }
2289 if (defaultValue == null) {
2290 defaultValue = "";
2291 }
2292 initialValue = defaultValue;
2293 }
2294 node._wrapperState = {
2295 initialValue: getToStringValue(initialValue)
2296 };
2297 }
2298 function updateWrapper$1(element, props) {
2299 var node = element;
2300 var value = getToStringValue(props.value);
2301 var defaultValue = getToStringValue(props.defaultValue);
2302 if (value != null) {
2303 var newValue = toString(value);
2304 if (newValue !== node.value) {
2305 node.value = newValue;
2306 }
2307 if (props.defaultValue == null && node.defaultValue !== newValue) {
2308 node.defaultValue = newValue;
2309 }
2310 }
2311 if (defaultValue != null) {
2312 node.defaultValue = toString(defaultValue);
2313 }
2314 }
2315 function postMountWrapper$3(element, props) {
2316 var node = element;
2317 var textContent = node.textContent;
2318 if (textContent === node._wrapperState.initialValue) {
2319 if (textContent !== "" && textContent !== null) {
2320 node.value = textContent;
2321 }
2322 }
2323 }
2324 function restoreControlledState$2(element, props) {
2325 updateWrapper$1(element, props);
2326 }
2327 var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
2328 var MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
2329 var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
2330 function getIntrinsicNamespace(type) {
2331 switch (type) {
2332 case "svg":
2333 return SVG_NAMESPACE;
2334 case "math":
2335 return MATH_NAMESPACE;
2336 default:
2337 return HTML_NAMESPACE;
2338 }
2339 }
2340 function getChildNamespace(parentNamespace, type) {
2341 if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
2342 return getIntrinsicNamespace(type);
2343 }
2344 if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") {
2345 return HTML_NAMESPACE;
2346 }
2347 return parentNamespace;
2348 }
2349 var createMicrosoftUnsafeLocalFunction = function(func) {
2350 if (typeof MSApp !== "undefined" && MSApp.execUnsafeLocalFunction) {
2351 return function(arg0, arg1, arg2, arg3) {
2352 MSApp.execUnsafeLocalFunction(function() {
2353 return func(arg0, arg1, arg2, arg3);
2354 });
2355 };
2356 } else {
2357 return func;
2358 }
2359 };
2360 var reusableSVGContainer;
2361 var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) {
2362 if (node.namespaceURI === SVG_NAMESPACE) {
2363 if (!("innerHTML" in node)) {
2364 reusableSVGContainer = reusableSVGContainer || document.createElement("div");
2365 reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
2366 var svgNode = reusableSVGContainer.firstChild;
2367 while (node.firstChild) {
2368 node.removeChild(node.firstChild);
2369 }
2370 while (svgNode.firstChild) {
2371 node.appendChild(svgNode.firstChild);
2372 }
2373 return;
2374 }
2375 }
2376 node.innerHTML = html;
2377 });
2378 var ELEMENT_NODE = 1;
2379 var TEXT_NODE = 3;
2380 var COMMENT_NODE = 8;
2381 var DOCUMENT_NODE = 9;
2382 var DOCUMENT_FRAGMENT_NODE = 11;
2383 var setTextContent = function(node, text) {
2384 if (text) {
2385 var firstChild = node.firstChild;
2386 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
2387 firstChild.nodeValue = text;
2388 return;
2389 }
2390 }
2391 node.textContent = text;
2392 };
2393 var shorthandToLonghand = {
2394 animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
2395 background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
2396 backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
2397 border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
2398 borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
2399 borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
2400 borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
2401 borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
2402 borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
2403 borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
2404 borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
2405 borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
2406 borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
2407 borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
2408 borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
2409 borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
2410 borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
2411 columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
2412 columns: ["columnCount", "columnWidth"],
2413 flex: ["flexBasis", "flexGrow", "flexShrink"],
2414 flexFlow: ["flexDirection", "flexWrap"],
2415 font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
2416 fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
2417 gap: ["columnGap", "rowGap"],
2418 grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
2419 gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
2420 gridColumn: ["gridColumnEnd", "gridColumnStart"],
2421 gridColumnGap: ["columnGap"],
2422 gridGap: ["columnGap", "rowGap"],
2423 gridRow: ["gridRowEnd", "gridRowStart"],
2424 gridRowGap: ["rowGap"],
2425 gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
2426 listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
2427 margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
2428 marker: ["markerEnd", "markerMid", "markerStart"],
2429 mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
2430 maskPosition: ["maskPositionX", "maskPositionY"],
2431 outline: ["outlineColor", "outlineStyle", "outlineWidth"],
2432 overflow: ["overflowX", "overflowY"],
2433 padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
2434 placeContent: ["alignContent", "justifyContent"],
2435 placeItems: ["alignItems", "justifyItems"],
2436 placeSelf: ["alignSelf", "justifySelf"],
2437 textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
2438 textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
2439 transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
2440 wordWrap: ["overflowWrap"]
2441 };
2442 var isUnitlessNumber = {
2443 animationIterationCount: true,
2444 aspectRatio: true,
2445 borderImageOutset: true,
2446 borderImageSlice: true,
2447 borderImageWidth: true,
2448 boxFlex: true,
2449 boxFlexGroup: true,
2450 boxOrdinalGroup: true,
2451 columnCount: true,
2452 columns: true,
2453 flex: true,
2454 flexGrow: true,
2455 flexPositive: true,
2456 flexShrink: true,
2457 flexNegative: true,
2458 flexOrder: true,
2459 gridArea: true,
2460 gridRow: true,
2461 gridRowEnd: true,
2462 gridRowSpan: true,
2463 gridRowStart: true,
2464 gridColumn: true,
2465 gridColumnEnd: true,
2466 gridColumnSpan: true,
2467 gridColumnStart: true,
2468 fontWeight: true,
2469 lineClamp: true,
2470 lineHeight: true,
2471 opacity: true,
2472 order: true,
2473 orphans: true,
2474 tabSize: true,
2475 widows: true,
2476 zIndex: true,
2477 zoom: true,
2478 // SVG-related properties
2479 fillOpacity: true,
2480 floodOpacity: true,
2481 stopOpacity: true,
2482 strokeDasharray: true,
2483 strokeDashoffset: true,
2484 strokeMiterlimit: true,
2485 strokeOpacity: true,
2486 strokeWidth: true
2487 };
2488 function prefixKey(prefix2, key) {
2489 return prefix2 + key.charAt(0).toUpperCase() + key.substring(1);
2490 }
2491 var prefixes = ["Webkit", "ms", "Moz", "O"];
2492 Object.keys(isUnitlessNumber).forEach(function(prop) {
2493 prefixes.forEach(function(prefix2) {
2494 isUnitlessNumber[prefixKey(prefix2, prop)] = isUnitlessNumber[prop];
2495 });
2496 });
2497 function dangerousStyleValue(name, value, isCustomProperty) {
2498 var isEmpty = value == null || typeof value === "boolean" || value === "";
2499 if (isEmpty) {
2500 return "";
2501 }
2502 if (!isCustomProperty && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
2503 return value + "px";
2504 }
2505 {
2506 checkCSSPropertyStringCoercion(value, name);
2507 }
2508 return ("" + value).trim();
2509 }
2510 var uppercasePattern = /([A-Z])/g;
2511 var msPattern = /^ms-/;
2512 function hyphenateStyleName(name) {
2513 return name.replace(uppercasePattern, "-$1").toLowerCase().replace(msPattern, "-ms-");
2514 }
2515 var warnValidStyle = function() {
2516 };
2517 {
2518 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
2519 var msPattern$1 = /^-ms-/;
2520 var hyphenPattern = /-(.)/g;
2521 var badStyleValueWithSemicolonPattern = /;\s*$/;
2522 var warnedStyleNames = {};
2523 var warnedStyleValues = {};
2524 var warnedForNaNValue = false;
2525 var warnedForInfinityValue = false;
2526 var camelize = function(string) {
2527 return string.replace(hyphenPattern, function(_, character) {
2528 return character.toUpperCase();
2529 });
2530 };
2531 var warnHyphenatedStyleName = function(name) {
2532 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
2533 return;
2534 }
2535 warnedStyleNames[name] = true;
2536 error(
2537 "Unsupported style property %s. Did you mean %s?",
2538 name,
2539 // As Andi Smith suggests
2540 // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
2541 // is converted to lowercase `ms`.
2542 camelize(name.replace(msPattern$1, "ms-"))
2543 );
2544 };
2545 var warnBadVendoredStyleName = function(name) {
2546 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
2547 return;
2548 }
2549 warnedStyleNames[name] = true;
2550 error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name, name.charAt(0).toUpperCase() + name.slice(1));
2551 };
2552 var warnStyleValueWithSemicolon = function(name, value) {
2553 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
2554 return;
2555 }
2556 warnedStyleValues[value] = true;
2557 error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name, value.replace(badStyleValueWithSemicolonPattern, ""));
2558 };
2559 var warnStyleValueIsNaN = function(name, value) {
2560 if (warnedForNaNValue) {
2561 return;
2562 }
2563 warnedForNaNValue = true;
2564 error("`NaN` is an invalid value for the `%s` css style property.", name);
2565 };
2566 var warnStyleValueIsInfinity = function(name, value) {
2567 if (warnedForInfinityValue) {
2568 return;
2569 }
2570 warnedForInfinityValue = true;
2571 error("`Infinity` is an invalid value for the `%s` css style property.", name);
2572 };
2573 warnValidStyle = function(name, value) {
2574 if (name.indexOf("-") > -1) {
2575 warnHyphenatedStyleName(name);
2576 } else if (badVendoredStyleNamePattern.test(name)) {
2577 warnBadVendoredStyleName(name);
2578 } else if (badStyleValueWithSemicolonPattern.test(value)) {
2579 warnStyleValueWithSemicolon(name, value);
2580 }
2581 if (typeof value === "number") {
2582 if (isNaN(value)) {
2583 warnStyleValueIsNaN(name, value);
2584 } else if (!isFinite(value)) {
2585 warnStyleValueIsInfinity(name, value);
2586 }
2587 }
2588 };
2589 }
2590 var warnValidStyle$1 = warnValidStyle;
2591 function createDangerousStringForStyles(styles) {
2592 {
2593 var serialized = "";
2594 var delimiter = "";
2595 for (var styleName in styles) {
2596 if (!styles.hasOwnProperty(styleName)) {
2597 continue;
2598 }
2599 var styleValue = styles[styleName];
2600 if (styleValue != null) {
2601 var isCustomProperty = styleName.indexOf("--") === 0;
2602 serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ":";
2603 serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
2604 delimiter = ";";
2605 }
2606 }
2607 return serialized || null;
2608 }
2609 }
2610 function setValueForStyles(node, styles) {
2611 var style2 = node.style;
2612 for (var styleName in styles) {
2613 if (!styles.hasOwnProperty(styleName)) {
2614 continue;
2615 }
2616 var isCustomProperty = styleName.indexOf("--") === 0;
2617 {
2618 if (!isCustomProperty) {
2619 warnValidStyle$1(styleName, styles[styleName]);
2620 }
2621 }
2622 var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
2623 if (styleName === "float") {
2624 styleName = "cssFloat";
2625 }
2626 if (isCustomProperty) {
2627 style2.setProperty(styleName, styleValue);
2628 } else {
2629 style2[styleName] = styleValue;
2630 }
2631 }
2632 }
2633 function isValueEmpty(value) {
2634 return value == null || typeof value === "boolean" || value === "";
2635 }
2636 function expandShorthandMap(styles) {
2637 var expanded = {};
2638 for (var key in styles) {
2639 var longhands = shorthandToLonghand[key] || [key];
2640 for (var i = 0; i < longhands.length; i++) {
2641 expanded[longhands[i]] = key;
2642 }
2643 }
2644 return expanded;
2645 }
2646 function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
2647 {
2648 if (!nextStyles) {
2649 return;
2650 }
2651 var expandedUpdates = expandShorthandMap(styleUpdates);
2652 var expandedStyles = expandShorthandMap(nextStyles);
2653 var warnedAbout = {};
2654 for (var key in expandedUpdates) {
2655 var originalKey = expandedUpdates[key];
2656 var correctOriginalKey = expandedStyles[key];
2657 if (correctOriginalKey && originalKey !== correctOriginalKey) {
2658 var warningKey = originalKey + "," + correctOriginalKey;
2659 if (warnedAbout[warningKey]) {
2660 continue;
2661 }
2662 warnedAbout[warningKey] = true;
2663 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);
2664 }
2665 }
2666 }
2667 }
2668 var omittedCloseTags = {
2669 area: true,
2670 base: true,
2671 br: true,
2672 col: true,
2673 embed: true,
2674 hr: true,
2675 img: true,
2676 input: true,
2677 keygen: true,
2678 link: true,
2679 meta: true,
2680 param: true,
2681 source: true,
2682 track: true,
2683 wbr: true
2684 // NOTE: menuitem's close tag should be omitted, but that causes problems.
2685 };
2686 var voidElementTags = assign({
2687 menuitem: true
2688 }, omittedCloseTags);
2689 var HTML = "__html";
2690 function assertValidProps(tag, props) {
2691 if (!props) {
2692 return;
2693 }
2694 if (voidElementTags[tag]) {
2695 if (props.children != null || props.dangerouslySetInnerHTML != null) {
2696 throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
2697 }
2698 }
2699 if (props.dangerouslySetInnerHTML != null) {
2700 if (props.children != null) {
2701 throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
2702 }
2703 if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
2704 throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
2705 }
2706 }
2707 {
2708 if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
2709 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.");
2710 }
2711 }
2712 if (props.style != null && typeof props.style !== "object") {
2713 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.");
2714 }
2715 }
2716 function isCustomComponent(tagName, props) {
2717 if (tagName.indexOf("-") === -1) {
2718 return typeof props.is === "string";
2719 }
2720 switch (tagName) {
2721 // These are reserved SVG and MathML elements.
2722 // We don't mind this list too much because we expect it to never grow.
2723 // The alternative is to track the namespace in a few places which is convoluted.
2724 // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
2725 case "annotation-xml":
2726 case "color-profile":
2727 case "font-face":
2728 case "font-face-src":
2729 case "font-face-uri":
2730 case "font-face-format":
2731 case "font-face-name":
2732 case "missing-glyph":
2733 return false;
2734 default:
2735 return true;
2736 }
2737 }
2738 var possibleStandardNames = {
2739 // HTML
2740 accept: "accept",
2741 acceptcharset: "acceptCharset",
2742 "accept-charset": "acceptCharset",
2743 accesskey: "accessKey",
2744 action: "action",
2745 allowfullscreen: "allowFullScreen",
2746 alt: "alt",
2747 as: "as",
2748 async: "async",
2749 autocapitalize: "autoCapitalize",
2750 autocomplete: "autoComplete",
2751 autocorrect: "autoCorrect",
2752 autofocus: "autoFocus",
2753 autoplay: "autoPlay",
2754 autosave: "autoSave",
2755 capture: "capture",
2756 cellpadding: "cellPadding",
2757 cellspacing: "cellSpacing",
2758 challenge: "challenge",
2759 charset: "charSet",
2760 checked: "checked",
2761 children: "children",
2762 cite: "cite",
2763 class: "className",
2764 classid: "classID",
2765 classname: "className",
2766 cols: "cols",
2767 colspan: "colSpan",
2768 content: "content",
2769 contenteditable: "contentEditable",
2770 contextmenu: "contextMenu",
2771 controls: "controls",
2772 controlslist: "controlsList",
2773 coords: "coords",
2774 crossorigin: "crossOrigin",
2775 dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
2776 data: "data",
2777 datetime: "dateTime",
2778 default: "default",
2779 defaultchecked: "defaultChecked",
2780 defaultvalue: "defaultValue",
2781 defer: "defer",
2782 dir: "dir",
2783 disabled: "disabled",
2784 disablepictureinpicture: "disablePictureInPicture",
2785 disableremoteplayback: "disableRemotePlayback",
2786 download: "download",
2787 draggable: "draggable",
2788 enctype: "encType",
2789 enterkeyhint: "enterKeyHint",
2790 for: "htmlFor",
2791 form: "form",
2792 formmethod: "formMethod",
2793 formaction: "formAction",
2794 formenctype: "formEncType",
2795 formnovalidate: "formNoValidate",
2796 formtarget: "formTarget",
2797 frameborder: "frameBorder",
2798 headers: "headers",
2799 height: "height",
2800 hidden: "hidden",
2801 high: "high",
2802 href: "href",
2803 hreflang: "hrefLang",
2804 htmlfor: "htmlFor",
2805 httpequiv: "httpEquiv",
2806 "http-equiv": "httpEquiv",
2807 icon: "icon",
2808 id: "id",
2809 imagesizes: "imageSizes",
2810 imagesrcset: "imageSrcSet",
2811 innerhtml: "innerHTML",
2812 inputmode: "inputMode",
2813 integrity: "integrity",
2814 is: "is",
2815 itemid: "itemID",
2816 itemprop: "itemProp",
2817 itemref: "itemRef",
2818 itemscope: "itemScope",
2819 itemtype: "itemType",
2820 keyparams: "keyParams",
2821 keytype: "keyType",
2822 kind: "kind",
2823 label: "label",
2824 lang: "lang",
2825 list: "list",
2826 loop: "loop",
2827 low: "low",
2828 manifest: "manifest",
2829 marginwidth: "marginWidth",
2830 marginheight: "marginHeight",
2831 max: "max",
2832 maxlength: "maxLength",
2833 media: "media",
2834 mediagroup: "mediaGroup",
2835 method: "method",
2836 min: "min",
2837 minlength: "minLength",
2838 multiple: "multiple",
2839 muted: "muted",
2840 name: "name",
2841 nomodule: "noModule",
2842 nonce: "nonce",
2843 novalidate: "noValidate",
2844 open: "open",
2845 optimum: "optimum",
2846 pattern: "pattern",
2847 placeholder: "placeholder",
2848 playsinline: "playsInline",
2849 poster: "poster",
2850 preload: "preload",
2851 profile: "profile",
2852 radiogroup: "radioGroup",
2853 readonly: "readOnly",
2854 referrerpolicy: "referrerPolicy",
2855 rel: "rel",
2856 required: "required",
2857 reversed: "reversed",
2858 role: "role",
2859 rows: "rows",
2860 rowspan: "rowSpan",
2861 sandbox: "sandbox",
2862 scope: "scope",
2863 scoped: "scoped",
2864 scrolling: "scrolling",
2865 seamless: "seamless",
2866 selected: "selected",
2867 shape: "shape",
2868 size: "size",
2869 sizes: "sizes",
2870 span: "span",
2871 spellcheck: "spellCheck",
2872 src: "src",
2873 srcdoc: "srcDoc",
2874 srclang: "srcLang",
2875 srcset: "srcSet",
2876 start: "start",
2877 step: "step",
2878 style: "style",
2879 summary: "summary",
2880 tabindex: "tabIndex",
2881 target: "target",
2882 title: "title",
2883 type: "type",
2884 usemap: "useMap",
2885 value: "value",
2886 width: "width",
2887 wmode: "wmode",
2888 wrap: "wrap",
2889 // SVG
2890 about: "about",
2891 accentheight: "accentHeight",
2892 "accent-height": "accentHeight",
2893 accumulate: "accumulate",
2894 additive: "additive",
2895 alignmentbaseline: "alignmentBaseline",
2896 "alignment-baseline": "alignmentBaseline",
2897 allowreorder: "allowReorder",
2898 alphabetic: "alphabetic",
2899 amplitude: "amplitude",
2900 arabicform: "arabicForm",
2901 "arabic-form": "arabicForm",
2902 ascent: "ascent",
2903 attributename: "attributeName",
2904 attributetype: "attributeType",
2905 autoreverse: "autoReverse",
2906 azimuth: "azimuth",
2907 basefrequency: "baseFrequency",
2908 baselineshift: "baselineShift",
2909 "baseline-shift": "baselineShift",
2910 baseprofile: "baseProfile",
2911 bbox: "bbox",
2912 begin: "begin",
2913 bias: "bias",
2914 by: "by",
2915 calcmode: "calcMode",
2916 capheight: "capHeight",
2917 "cap-height": "capHeight",
2918 clip: "clip",
2919 clippath: "clipPath",
2920 "clip-path": "clipPath",
2921 clippathunits: "clipPathUnits",
2922 cliprule: "clipRule",
2923 "clip-rule": "clipRule",
2924 color: "color",
2925 colorinterpolation: "colorInterpolation",
2926 "color-interpolation": "colorInterpolation",
2927 colorinterpolationfilters: "colorInterpolationFilters",
2928 "color-interpolation-filters": "colorInterpolationFilters",
2929 colorprofile: "colorProfile",
2930 "color-profile": "colorProfile",
2931 colorrendering: "colorRendering",
2932 "color-rendering": "colorRendering",
2933 contentscripttype: "contentScriptType",
2934 contentstyletype: "contentStyleType",
2935 cursor: "cursor",
2936 cx: "cx",
2937 cy: "cy",
2938 d: "d",
2939 datatype: "datatype",
2940 decelerate: "decelerate",
2941 descent: "descent",
2942 diffuseconstant: "diffuseConstant",
2943 direction: "direction",
2944 display: "display",
2945 divisor: "divisor",
2946 dominantbaseline: "dominantBaseline",
2947 "dominant-baseline": "dominantBaseline",
2948 dur: "dur",
2949 dx: "dx",
2950 dy: "dy",
2951 edgemode: "edgeMode",
2952 elevation: "elevation",
2953 enablebackground: "enableBackground",
2954 "enable-background": "enableBackground",
2955 end: "end",
2956 exponent: "exponent",
2957 externalresourcesrequired: "externalResourcesRequired",
2958 fill: "fill",
2959 fillopacity: "fillOpacity",
2960 "fill-opacity": "fillOpacity",
2961 fillrule: "fillRule",
2962 "fill-rule": "fillRule",
2963 filter: "filter",
2964 filterres: "filterRes",
2965 filterunits: "filterUnits",
2966 floodopacity: "floodOpacity",
2967 "flood-opacity": "floodOpacity",
2968 floodcolor: "floodColor",
2969 "flood-color": "floodColor",
2970 focusable: "focusable",
2971 fontfamily: "fontFamily",
2972 "font-family": "fontFamily",
2973 fontsize: "fontSize",
2974 "font-size": "fontSize",
2975 fontsizeadjust: "fontSizeAdjust",
2976 "font-size-adjust": "fontSizeAdjust",
2977 fontstretch: "fontStretch",
2978 "font-stretch": "fontStretch",
2979 fontstyle: "fontStyle",
2980 "font-style": "fontStyle",
2981 fontvariant: "fontVariant",
2982 "font-variant": "fontVariant",
2983 fontweight: "fontWeight",
2984 "font-weight": "fontWeight",
2985 format: "format",
2986 from: "from",
2987 fx: "fx",
2988 fy: "fy",
2989 g1: "g1",
2990 g2: "g2",
2991 glyphname: "glyphName",
2992 "glyph-name": "glyphName",
2993 glyphorientationhorizontal: "glyphOrientationHorizontal",
2994 "glyph-orientation-horizontal": "glyphOrientationHorizontal",
2995 glyphorientationvertical: "glyphOrientationVertical",
2996 "glyph-orientation-vertical": "glyphOrientationVertical",
2997 glyphref: "glyphRef",
2998 gradienttransform: "gradientTransform",
2999 gradientunits: "gradientUnits",
3000 hanging: "hanging",
3001 horizadvx: "horizAdvX",
3002 "horiz-adv-x": "horizAdvX",
3003 horizoriginx: "horizOriginX",
3004 "horiz-origin-x": "horizOriginX",
3005 ideographic: "ideographic",
3006 imagerendering: "imageRendering",
3007 "image-rendering": "imageRendering",
3008 in2: "in2",
3009 in: "in",
3010 inlist: "inlist",
3011 intercept: "intercept",
3012 k1: "k1",
3013 k2: "k2",
3014 k3: "k3",
3015 k4: "k4",
3016 k: "k",
3017 kernelmatrix: "kernelMatrix",
3018 kernelunitlength: "kernelUnitLength",
3019 kerning: "kerning",
3020 keypoints: "keyPoints",
3021 keysplines: "keySplines",
3022 keytimes: "keyTimes",
3023 lengthadjust: "lengthAdjust",
3024 letterspacing: "letterSpacing",
3025 "letter-spacing": "letterSpacing",
3026 lightingcolor: "lightingColor",
3027 "lighting-color": "lightingColor",
3028 limitingconeangle: "limitingConeAngle",
3029 local: "local",
3030 markerend: "markerEnd",
3031 "marker-end": "markerEnd",
3032 markerheight: "markerHeight",
3033 markermid: "markerMid",
3034 "marker-mid": "markerMid",
3035 markerstart: "markerStart",
3036 "marker-start": "markerStart",
3037 markerunits: "markerUnits",
3038 markerwidth: "markerWidth",
3039 mask: "mask",
3040 maskcontentunits: "maskContentUnits",
3041 maskunits: "maskUnits",
3042 mathematical: "mathematical",
3043 mode: "mode",
3044 numoctaves: "numOctaves",
3045 offset: "offset",
3046 opacity: "opacity",
3047 operator: "operator",
3048 order: "order",
3049 orient: "orient",
3050 orientation: "orientation",
3051 origin: "origin",
3052 overflow: "overflow",
3053 overlineposition: "overlinePosition",
3054 "overline-position": "overlinePosition",
3055 overlinethickness: "overlineThickness",
3056 "overline-thickness": "overlineThickness",
3057 paintorder: "paintOrder",
3058 "paint-order": "paintOrder",
3059 panose1: "panose1",
3060 "panose-1": "panose1",
3061 pathlength: "pathLength",
3062 patterncontentunits: "patternContentUnits",
3063 patterntransform: "patternTransform",
3064 patternunits: "patternUnits",
3065 pointerevents: "pointerEvents",
3066 "pointer-events": "pointerEvents",
3067 points: "points",
3068 pointsatx: "pointsAtX",
3069 pointsaty: "pointsAtY",
3070 pointsatz: "pointsAtZ",
3071 prefix: "prefix",
3072 preservealpha: "preserveAlpha",
3073 preserveaspectratio: "preserveAspectRatio",
3074 primitiveunits: "primitiveUnits",
3075 property: "property",
3076 r: "r",
3077 radius: "radius",
3078 refx: "refX",
3079 refy: "refY",
3080 renderingintent: "renderingIntent",
3081 "rendering-intent": "renderingIntent",
3082 repeatcount: "repeatCount",
3083 repeatdur: "repeatDur",
3084 requiredextensions: "requiredExtensions",
3085 requiredfeatures: "requiredFeatures",
3086 resource: "resource",
3087 restart: "restart",
3088 result: "result",
3089 results: "results",
3090 rotate: "rotate",
3091 rx: "rx",
3092 ry: "ry",
3093 scale: "scale",
3094 security: "security",
3095 seed: "seed",
3096 shaperendering: "shapeRendering",
3097 "shape-rendering": "shapeRendering",
3098 slope: "slope",
3099 spacing: "spacing",
3100 specularconstant: "specularConstant",
3101 specularexponent: "specularExponent",
3102 speed: "speed",
3103 spreadmethod: "spreadMethod",
3104 startoffset: "startOffset",
3105 stddeviation: "stdDeviation",
3106 stemh: "stemh",
3107 stemv: "stemv",
3108 stitchtiles: "stitchTiles",
3109 stopcolor: "stopColor",
3110 "stop-color": "stopColor",
3111 stopopacity: "stopOpacity",
3112 "stop-opacity": "stopOpacity",
3113 strikethroughposition: "strikethroughPosition",
3114 "strikethrough-position": "strikethroughPosition",
3115 strikethroughthickness: "strikethroughThickness",
3116 "strikethrough-thickness": "strikethroughThickness",
3117 string: "string",
3118 stroke: "stroke",
3119 strokedasharray: "strokeDasharray",
3120 "stroke-dasharray": "strokeDasharray",
3121 strokedashoffset: "strokeDashoffset",
3122 "stroke-dashoffset": "strokeDashoffset",
3123 strokelinecap: "strokeLinecap",
3124 "stroke-linecap": "strokeLinecap",
3125 strokelinejoin: "strokeLinejoin",
3126 "stroke-linejoin": "strokeLinejoin",
3127 strokemiterlimit: "strokeMiterlimit",
3128 "stroke-miterlimit": "strokeMiterlimit",
3129 strokewidth: "strokeWidth",
3130 "stroke-width": "strokeWidth",
3131 strokeopacity: "strokeOpacity",
3132 "stroke-opacity": "strokeOpacity",
3133 suppresscontenteditablewarning: "suppressContentEditableWarning",
3134 suppresshydrationwarning: "suppressHydrationWarning",
3135 surfacescale: "surfaceScale",
3136 systemlanguage: "systemLanguage",
3137 tablevalues: "tableValues",
3138 targetx: "targetX",
3139 targety: "targetY",
3140 textanchor: "textAnchor",
3141 "text-anchor": "textAnchor",
3142 textdecoration: "textDecoration",
3143 "text-decoration": "textDecoration",
3144 textlength: "textLength",
3145 textrendering: "textRendering",
3146 "text-rendering": "textRendering",
3147 to: "to",
3148 transform: "transform",
3149 typeof: "typeof",
3150 u1: "u1",
3151 u2: "u2",
3152 underlineposition: "underlinePosition",
3153 "underline-position": "underlinePosition",
3154 underlinethickness: "underlineThickness",
3155 "underline-thickness": "underlineThickness",
3156 unicode: "unicode",
3157 unicodebidi: "unicodeBidi",
3158 "unicode-bidi": "unicodeBidi",
3159 unicoderange: "unicodeRange",
3160 "unicode-range": "unicodeRange",
3161 unitsperem: "unitsPerEm",
3162 "units-per-em": "unitsPerEm",
3163 unselectable: "unselectable",
3164 valphabetic: "vAlphabetic",
3165 "v-alphabetic": "vAlphabetic",
3166 values: "values",
3167 vectoreffect: "vectorEffect",
3168 "vector-effect": "vectorEffect",
3169 version: "version",
3170 vertadvy: "vertAdvY",
3171 "vert-adv-y": "vertAdvY",
3172 vertoriginx: "vertOriginX",
3173 "vert-origin-x": "vertOriginX",
3174 vertoriginy: "vertOriginY",
3175 "vert-origin-y": "vertOriginY",
3176 vhanging: "vHanging",
3177 "v-hanging": "vHanging",
3178 videographic: "vIdeographic",
3179 "v-ideographic": "vIdeographic",
3180 viewbox: "viewBox",
3181 viewtarget: "viewTarget",
3182 visibility: "visibility",
3183 vmathematical: "vMathematical",
3184 "v-mathematical": "vMathematical",
3185 vocab: "vocab",
3186 widths: "widths",
3187 wordspacing: "wordSpacing",
3188 "word-spacing": "wordSpacing",
3189 writingmode: "writingMode",
3190 "writing-mode": "writingMode",
3191 x1: "x1",
3192 x2: "x2",
3193 x: "x",
3194 xchannelselector: "xChannelSelector",
3195 xheight: "xHeight",
3196 "x-height": "xHeight",
3197 xlinkactuate: "xlinkActuate",
3198 "xlink:actuate": "xlinkActuate",
3199 xlinkarcrole: "xlinkArcrole",
3200 "xlink:arcrole": "xlinkArcrole",
3201 xlinkhref: "xlinkHref",
3202 "xlink:href": "xlinkHref",
3203 xlinkrole: "xlinkRole",
3204 "xlink:role": "xlinkRole",
3205 xlinkshow: "xlinkShow",
3206 "xlink:show": "xlinkShow",
3207 xlinktitle: "xlinkTitle",
3208 "xlink:title": "xlinkTitle",
3209 xlinktype: "xlinkType",
3210 "xlink:type": "xlinkType",
3211 xmlbase: "xmlBase",
3212 "xml:base": "xmlBase",
3213 xmllang: "xmlLang",
3214 "xml:lang": "xmlLang",
3215 xmlns: "xmlns",
3216 "xml:space": "xmlSpace",
3217 xmlnsxlink: "xmlnsXlink",
3218 "xmlns:xlink": "xmlnsXlink",
3219 xmlspace: "xmlSpace",
3220 y1: "y1",
3221 y2: "y2",
3222 y: "y",
3223 ychannelselector: "yChannelSelector",
3224 z: "z",
3225 zoomandpan: "zoomAndPan"
3226 };
3227 var ariaProperties = {
3228 "aria-current": 0,
3229 // state
3230 "aria-description": 0,
3231 "aria-details": 0,
3232 "aria-disabled": 0,
3233 // state
3234 "aria-hidden": 0,
3235 // state
3236 "aria-invalid": 0,
3237 // state
3238 "aria-keyshortcuts": 0,
3239 "aria-label": 0,
3240 "aria-roledescription": 0,
3241 // Widget Attributes
3242 "aria-autocomplete": 0,
3243 "aria-checked": 0,
3244 "aria-expanded": 0,
3245 "aria-haspopup": 0,
3246 "aria-level": 0,
3247 "aria-modal": 0,
3248 "aria-multiline": 0,
3249 "aria-multiselectable": 0,
3250 "aria-orientation": 0,
3251 "aria-placeholder": 0,
3252 "aria-pressed": 0,
3253 "aria-readonly": 0,
3254 "aria-required": 0,
3255 "aria-selected": 0,
3256 "aria-sort": 0,
3257 "aria-valuemax": 0,
3258 "aria-valuemin": 0,
3259 "aria-valuenow": 0,
3260 "aria-valuetext": 0,
3261 // Live Region Attributes
3262 "aria-atomic": 0,
3263 "aria-busy": 0,
3264 "aria-live": 0,
3265 "aria-relevant": 0,
3266 // Drag-and-Drop Attributes
3267 "aria-dropeffect": 0,
3268 "aria-grabbed": 0,
3269 // Relationship Attributes
3270 "aria-activedescendant": 0,
3271 "aria-colcount": 0,
3272 "aria-colindex": 0,
3273 "aria-colspan": 0,
3274 "aria-controls": 0,
3275 "aria-describedby": 0,
3276 "aria-errormessage": 0,
3277 "aria-flowto": 0,
3278 "aria-labelledby": 0,
3279 "aria-owns": 0,
3280 "aria-posinset": 0,
3281 "aria-rowcount": 0,
3282 "aria-rowindex": 0,
3283 "aria-rowspan": 0,
3284 "aria-setsize": 0
3285 };
3286 var warnedProperties = {};
3287 var rARIA = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
3288 var rARIACamel = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
3289 function validateProperty(tagName, name) {
3290 {
3291 if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
3292 return true;
3293 }
3294 if (rARIACamel.test(name)) {
3295 var ariaName = "aria-" + name.slice(4).toLowerCase();
3296 var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
3297 if (correctName == null) {
3298 error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", name);
3299 warnedProperties[name] = true;
3300 return true;
3301 }
3302 if (name !== correctName) {
3303 error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name, correctName);
3304 warnedProperties[name] = true;
3305 return true;
3306 }
3307 }
3308 if (rARIA.test(name)) {
3309 var lowerCasedName = name.toLowerCase();
3310 var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
3311 if (standardName == null) {
3312 warnedProperties[name] = true;
3313 return false;
3314 }
3315 if (name !== standardName) {
3316 error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name, standardName);
3317 warnedProperties[name] = true;
3318 return true;
3319 }
3320 }
3321 }
3322 return true;
3323 }
3324 function warnInvalidARIAProps(type, props) {
3325 {
3326 var invalidProps = [];
3327 for (var key in props) {
3328 var isValid = validateProperty(type, key);
3329 if (!isValid) {
3330 invalidProps.push(key);
3331 }
3332 }
3333 var unknownPropString = invalidProps.map(function(prop) {
3334 return "`" + prop + "`";
3335 }).join(", ");
3336 if (invalidProps.length === 1) {
3337 error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
3338 } else if (invalidProps.length > 1) {
3339 error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type);
3340 }
3341 }
3342 }
3343 function validateProperties(type, props) {
3344 if (isCustomComponent(type, props)) {
3345 return;
3346 }
3347 warnInvalidARIAProps(type, props);
3348 }
3349 var didWarnValueNull = false;
3350 function validateProperties$1(type, props) {
3351 {
3352 if (type !== "input" && type !== "textarea" && type !== "select") {
3353 return;
3354 }
3355 if (props != null && props.value === null && !didWarnValueNull) {
3356 didWarnValueNull = true;
3357 if (type === "select" && props.multiple) {
3358 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);
3359 } else {
3360 error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type);
3361 }
3362 }
3363 }
3364 }
3365 var validateProperty$1 = function() {
3366 };
3367 {
3368 var warnedProperties$1 = {};
3369 var EVENT_NAME_REGEX = /^on./;
3370 var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
3371 var rARIA$1 = new RegExp("^(aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$");
3372 var rARIACamel$1 = new RegExp("^(aria)[A-Z][" + ATTRIBUTE_NAME_CHAR + "]*$");
3373 validateProperty$1 = function(tagName, name, value, eventRegistry) {
3374 if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
3375 return true;
3376 }
3377 var lowerCasedName = name.toLowerCase();
3378 if (lowerCasedName === "onfocusin" || lowerCasedName === "onfocusout") {
3379 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.");
3380 warnedProperties$1[name] = true;
3381 return true;
3382 }
3383 if (eventRegistry != null) {
3384 var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
3385 if (registrationNameDependencies2.hasOwnProperty(name)) {
3386 return true;
3387 }
3388 var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
3389 if (registrationName != null) {
3390 error("Invalid event handler property `%s`. Did you mean `%s`?", name, registrationName);
3391 warnedProperties$1[name] = true;
3392 return true;
3393 }
3394 if (EVENT_NAME_REGEX.test(name)) {
3395 error("Unknown event handler property `%s`. It will be ignored.", name);
3396 warnedProperties$1[name] = true;
3397 return true;
3398 }
3399 } else if (EVENT_NAME_REGEX.test(name)) {
3400 if (INVALID_EVENT_NAME_REGEX.test(name)) {
3401 error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name);
3402 }
3403 warnedProperties$1[name] = true;
3404 return true;
3405 }
3406 if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
3407 return true;
3408 }
3409 if (lowerCasedName === "innerhtml") {
3410 error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
3411 warnedProperties$1[name] = true;
3412 return true;
3413 }
3414 if (lowerCasedName === "aria") {
3415 error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
3416 warnedProperties$1[name] = true;
3417 return true;
3418 }
3419 if (lowerCasedName === "is" && value !== null && value !== void 0 && typeof value !== "string") {
3420 error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof value);
3421 warnedProperties$1[name] = true;
3422 return true;
3423 }
3424 if (typeof value === "number" && isNaN(value)) {
3425 error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", name);
3426 warnedProperties$1[name] = true;
3427 return true;
3428 }
3429 var propertyInfo = getPropertyInfo(name);
3430 var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
3431 if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
3432 var standardName = possibleStandardNames[lowerCasedName];
3433 if (standardName !== name) {
3434 error("Invalid DOM property `%s`. Did you mean `%s`?", name, standardName);
3435 warnedProperties$1[name] = true;
3436 return true;
3437 }
3438 } else if (!isReserved && name !== lowerCasedName) {
3439 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);
3440 warnedProperties$1[name] = true;
3441 return true;
3442 }
3443 if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
3444 if (value) {
3445 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);
3446 } else {
3447 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);
3448 }
3449 warnedProperties$1[name] = true;
3450 return true;
3451 }
3452 if (isReserved) {
3453 return true;
3454 }
3455 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
3456 warnedProperties$1[name] = true;
3457 return false;
3458 }
3459 if ((value === "false" || value === "true") && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
3460 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);
3461 warnedProperties$1[name] = true;
3462 return true;
3463 }
3464 return true;
3465 };
3466 }
3467 var warnUnknownProperties = function(type, props, eventRegistry) {
3468 {
3469 var unknownProps = [];
3470 for (var key in props) {
3471 var isValid = validateProperty$1(type, key, props[key], eventRegistry);
3472 if (!isValid) {
3473 unknownProps.push(key);
3474 }
3475 }
3476 var unknownPropString = unknownProps.map(function(prop) {
3477 return "`" + prop + "`";
3478 }).join(", ");
3479 if (unknownProps.length === 1) {
3480 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);
3481 } else if (unknownProps.length > 1) {
3482 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);
3483 }
3484 }
3485 };
3486 function validateProperties$2(type, props, eventRegistry) {
3487 if (isCustomComponent(type, props)) {
3488 return;
3489 }
3490 warnUnknownProperties(type, props, eventRegistry);
3491 }
3492 var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;
3493 var IS_NON_DELEGATED = 1 << 1;
3494 var IS_CAPTURE_PHASE = 1 << 2;
3495 var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
3496 var currentReplayingEvent = null;
3497 function setReplayingEvent(event) {
3498 {
3499 if (currentReplayingEvent !== null) {
3500 error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
3501 }
3502 }
3503 currentReplayingEvent = event;
3504 }
3505 function resetReplayingEvent() {
3506 {
3507 if (currentReplayingEvent === null) {
3508 error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
3509 }
3510 }
3511 currentReplayingEvent = null;
3512 }
3513 function isReplayingEvent(event) {
3514 return event === currentReplayingEvent;
3515 }
3516 function getEventTarget(nativeEvent) {
3517 var target = nativeEvent.target || nativeEvent.srcElement || window;
3518 if (target.correspondingUseElement) {
3519 target = target.correspondingUseElement;
3520 }
3521 return target.nodeType === TEXT_NODE ? target.parentNode : target;
3522 }
3523 var restoreImpl = null;
3524 var restoreTarget = null;
3525 var restoreQueue = null;
3526 function restoreStateOfTarget(target) {
3527 var internalInstance = getInstanceFromNode(target);
3528 if (!internalInstance) {
3529 return;
3530 }
3531 if (typeof restoreImpl !== "function") {
3532 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.");
3533 }
3534 var stateNode = internalInstance.stateNode;
3535 if (stateNode) {
3536 var _props = getFiberCurrentPropsFromNode(stateNode);
3537 restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
3538 }
3539 }
3540 function setRestoreImplementation(impl) {
3541 restoreImpl = impl;
3542 }
3543 function enqueueStateRestore(target) {
3544 if (restoreTarget) {
3545 if (restoreQueue) {
3546 restoreQueue.push(target);
3547 } else {
3548 restoreQueue = [target];
3549 }
3550 } else {
3551 restoreTarget = target;
3552 }
3553 }
3554 function needsStateRestore() {
3555 return restoreTarget !== null || restoreQueue !== null;
3556 }
3557 function restoreStateIfNeeded() {
3558 if (!restoreTarget) {
3559 return;
3560 }
3561 var target = restoreTarget;
3562 var queuedTargets = restoreQueue;
3563 restoreTarget = null;
3564 restoreQueue = null;
3565 restoreStateOfTarget(target);
3566 if (queuedTargets) {
3567 for (var i = 0; i < queuedTargets.length; i++) {
3568 restoreStateOfTarget(queuedTargets[i]);
3569 }
3570 }
3571 }
3572 var batchedUpdatesImpl = function(fn, bookkeeping) {
3573 return fn(bookkeeping);
3574 };
3575 var flushSyncImpl = function() {
3576 };
3577 var isInsideEventHandler = false;
3578 function finishEventHandler() {
3579 var controlledComponentsHavePendingUpdates = needsStateRestore();
3580 if (controlledComponentsHavePendingUpdates) {
3581 flushSyncImpl();
3582 restoreStateIfNeeded();
3583 }
3584 }
3585 function batchedUpdates(fn, a, b) {
3586 if (isInsideEventHandler) {
3587 return fn(a, b);
3588 }
3589 isInsideEventHandler = true;
3590 try {
3591 return batchedUpdatesImpl(fn, a, b);
3592 } finally {
3593 isInsideEventHandler = false;
3594 finishEventHandler();
3595 }
3596 }
3597 function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
3598 batchedUpdatesImpl = _batchedUpdatesImpl;
3599 flushSyncImpl = _flushSyncImpl;
3600 }
3601 function isInteractive(tag) {
3602 return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
3603 }
3604 function shouldPreventMouseEvent(name, type, props) {
3605 switch (name) {
3606 case "onClick":
3607 case "onClickCapture":
3608 case "onDoubleClick":
3609 case "onDoubleClickCapture":
3610 case "onMouseDown":
3611 case "onMouseDownCapture":
3612 case "onMouseMove":
3613 case "onMouseMoveCapture":
3614 case "onMouseUp":
3615 case "onMouseUpCapture":
3616 case "onMouseEnter":
3617 return !!(props.disabled && isInteractive(type));
3618 default:
3619 return false;
3620 }
3621 }
3622 function getListener(inst, registrationName) {
3623 var stateNode = inst.stateNode;
3624 if (stateNode === null) {
3625 return null;
3626 }
3627 var props = getFiberCurrentPropsFromNode(stateNode);
3628 if (props === null) {
3629 return null;
3630 }
3631 var listener = props[registrationName];
3632 if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
3633 return null;
3634 }
3635 if (listener && typeof listener !== "function") {
3636 throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
3637 }
3638 return listener;
3639 }
3640 var passiveBrowserEventsSupported = false;
3641 if (canUseDOM) {
3642 try {
3643 var options = {};
3644 Object.defineProperty(options, "passive", {
3645 get: function() {
3646 passiveBrowserEventsSupported = true;
3647 }
3648 });
3649 window.addEventListener("test", options, options);
3650 window.removeEventListener("test", options, options);
3651 } catch (e) {
3652 passiveBrowserEventsSupported = false;
3653 }
3654 }
3655 function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {
3656 var funcArgs = Array.prototype.slice.call(arguments, 3);
3657 try {
3658 func.apply(context, funcArgs);
3659 } catch (error2) {
3660 this.onError(error2);
3661 }
3662 }
3663 var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
3664 {
3665 if (typeof window !== "undefined" && typeof window.dispatchEvent === "function" && typeof document !== "undefined" && typeof document.createEvent === "function") {
3666 var fakeNode = document.createElement("react");
3667 invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {
3668 if (typeof document === "undefined" || document === null) {
3669 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.");
3670 }
3671 var evt = document.createEvent("Event");
3672 var didCall = false;
3673 var didError = true;
3674 var windowEvent = window.event;
3675 var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, "event");
3676 function restoreAfterDispatch() {
3677 fakeNode.removeEventListener(evtType, callCallback2, false);
3678 if (typeof window.event !== "undefined" && window.hasOwnProperty("event")) {
3679 window.event = windowEvent;
3680 }
3681 }
3682 var funcArgs = Array.prototype.slice.call(arguments, 3);
3683 function callCallback2() {
3684 didCall = true;
3685 restoreAfterDispatch();
3686 func.apply(context, funcArgs);
3687 didError = false;
3688 }
3689 var error2;
3690 var didSetError = false;
3691 var isCrossOriginError = false;
3692 function handleWindowError(event) {
3693 error2 = event.error;
3694 didSetError = true;
3695 if (error2 === null && event.colno === 0 && event.lineno === 0) {
3696 isCrossOriginError = true;
3697 }
3698 if (event.defaultPrevented) {
3699 if (error2 != null && typeof error2 === "object") {
3700 try {
3701 error2._suppressLogging = true;
3702 } catch (inner) {
3703 }
3704 }
3705 }
3706 }
3707 var evtType = "react-" + (name ? name : "invokeguardedcallback");
3708 window.addEventListener("error", handleWindowError);
3709 fakeNode.addEventListener(evtType, callCallback2, false);
3710 evt.initEvent(evtType, false, false);
3711 fakeNode.dispatchEvent(evt);
3712 if (windowEventDescriptor) {
3713 Object.defineProperty(window, "event", windowEventDescriptor);
3714 }
3715 if (didCall && didError) {
3716 if (!didSetError) {
3717 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.`);
3718 } else if (isCrossOriginError) {
3719 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.");
3720 }
3721 this.onError(error2);
3722 }
3723 window.removeEventListener("error", handleWindowError);
3724 if (!didCall) {
3725 restoreAfterDispatch();
3726 return invokeGuardedCallbackProd.apply(this, arguments);
3727 }
3728 };
3729 }
3730 }
3731 var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
3732 var hasError = false;
3733 var caughtError = null;
3734 var hasRethrowError = false;
3735 var rethrowError = null;
3736 var reporter = {
3737 onError: function(error2) {
3738 hasError = true;
3739 caughtError = error2;
3740 }
3741 };
3742 function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
3743 hasError = false;
3744 caughtError = null;
3745 invokeGuardedCallbackImpl$1.apply(reporter, arguments);
3746 }
3747 function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
3748 invokeGuardedCallback.apply(this, arguments);
3749 if (hasError) {
3750 var error2 = clearCaughtError();
3751 if (!hasRethrowError) {
3752 hasRethrowError = true;
3753 rethrowError = error2;
3754 }
3755 }
3756 }
3757 function rethrowCaughtError() {
3758 if (hasRethrowError) {
3759 var error2 = rethrowError;
3760 hasRethrowError = false;
3761 rethrowError = null;
3762 throw error2;
3763 }
3764 }
3765 function hasCaughtError() {
3766 return hasError;
3767 }
3768 function clearCaughtError() {
3769 if (hasError) {
3770 var error2 = caughtError;
3771 hasError = false;
3772 caughtError = null;
3773 return error2;
3774 } else {
3775 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.");
3776 }
3777 }
3778 function get(key) {
3779 return key._reactInternals;
3780 }
3781 function has(key) {
3782 return key._reactInternals !== void 0;
3783 }
3784 function set(key, value) {
3785 key._reactInternals = value;
3786 }
3787 var NoFlags = (
3788 /* */
3789 0
3790 );
3791 var PerformedWork = (
3792 /* */
3793 1
3794 );
3795 var Placement = (
3796 /* */
3797 2
3798 );
3799 var Update = (
3800 /* */
3801 4
3802 );
3803 var ChildDeletion = (
3804 /* */
3805 16
3806 );
3807 var ContentReset = (
3808 /* */
3809 32
3810 );
3811 var Callback = (
3812 /* */
3813 64
3814 );
3815 var DidCapture = (
3816 /* */
3817 128
3818 );
3819 var ForceClientRender = (
3820 /* */
3821 256
3822 );
3823 var Ref = (
3824 /* */
3825 512
3826 );
3827 var Snapshot = (
3828 /* */
3829 1024
3830 );
3831 var Passive = (
3832 /* */
3833 2048
3834 );
3835 var Hydrating = (
3836 /* */
3837 4096
3838 );
3839 var Visibility = (
3840 /* */
3841 8192
3842 );
3843 var StoreConsistency = (
3844 /* */
3845 16384
3846 );
3847 var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
3848 var HostEffectMask = (
3849 /* */
3850 32767
3851 );
3852 var Incomplete = (
3853 /* */
3854 32768
3855 );
3856 var ShouldCapture = (
3857 /* */
3858 65536
3859 );
3860 var ForceUpdateForLegacySuspense = (
3861 /* */
3862 131072
3863 );
3864 var Forked = (
3865 /* */
3866 1048576
3867 );
3868 var RefStatic = (
3869 /* */
3870 2097152
3871 );
3872 var LayoutStatic = (
3873 /* */
3874 4194304
3875 );
3876 var PassiveStatic = (
3877 /* */
3878 8388608
3879 );
3880 var MountLayoutDev = (
3881 /* */
3882 16777216
3883 );
3884 var MountPassiveDev = (
3885 /* */
3886 33554432
3887 );
3888 var BeforeMutationMask = (
3889 // TODO: Remove Update flag from before mutation phase by re-landing Visibility
3890 // flag logic (see #20043)
3891 Update | Snapshot | 0
3892 );
3893 var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility;
3894 var LayoutMask = Update | Callback | Ref | Visibility;
3895 var PassiveMask = Passive | ChildDeletion;
3896 var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
3897 var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
3898 function getNearestMountedFiber(fiber) {
3899 var node = fiber;
3900 var nearestMounted = fiber;
3901 if (!fiber.alternate) {
3902 var nextNode = node;
3903 do {
3904 node = nextNode;
3905 if ((node.flags & (Placement | Hydrating)) !== NoFlags) {
3906 nearestMounted = node.return;
3907 }
3908 nextNode = node.return;
3909 } while (nextNode);
3910 } else {
3911 while (node.return) {
3912 node = node.return;
3913 }
3914 }
3915 if (node.tag === HostRoot) {
3916 return nearestMounted;
3917 }
3918 return null;
3919 }
3920 function getSuspenseInstanceFromFiber(fiber) {
3921 if (fiber.tag === SuspenseComponent) {
3922 var suspenseState = fiber.memoizedState;
3923 if (suspenseState === null) {
3924 var current2 = fiber.alternate;
3925 if (current2 !== null) {
3926 suspenseState = current2.memoizedState;
3927 }
3928 }
3929 if (suspenseState !== null) {
3930 return suspenseState.dehydrated;
3931 }
3932 }
3933 return null;
3934 }
3935 function getContainerFromFiber(fiber) {
3936 return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
3937 }
3938 function isFiberMounted(fiber) {
3939 return getNearestMountedFiber(fiber) === fiber;
3940 }
3941 function isMounted(component) {
3942 {
3943 var owner = ReactCurrentOwner.current;
3944 if (owner !== null && owner.tag === ClassComponent) {
3945 var ownerFiber = owner;
3946 var instance = ownerFiber.stateNode;
3947 if (!instance._warnedAboutRefsInRender) {
3948 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");
3949 }
3950 instance._warnedAboutRefsInRender = true;
3951 }
3952 }
3953 var fiber = get(component);
3954 if (!fiber) {
3955 return false;
3956 }
3957 return getNearestMountedFiber(fiber) === fiber;
3958 }
3959 function assertIsMounted(fiber) {
3960 if (getNearestMountedFiber(fiber) !== fiber) {
3961 throw new Error("Unable to find node on an unmounted component.");
3962 }
3963 }
3964 function findCurrentFiberUsingSlowPath(fiber) {
3965 var alternate = fiber.alternate;
3966 if (!alternate) {
3967 var nearestMounted = getNearestMountedFiber(fiber);
3968 if (nearestMounted === null) {
3969 throw new Error("Unable to find node on an unmounted component.");
3970 }
3971 if (nearestMounted !== fiber) {
3972 return null;
3973 }
3974 return fiber;
3975 }
3976 var a = fiber;
3977 var b = alternate;
3978 while (true) {
3979 var parentA = a.return;
3980 if (parentA === null) {
3981 break;
3982 }
3983 var parentB = parentA.alternate;
3984 if (parentB === null) {
3985 var nextParent = parentA.return;
3986 if (nextParent !== null) {
3987 a = b = nextParent;
3988 continue;
3989 }
3990 break;
3991 }
3992 if (parentA.child === parentB.child) {
3993 var child = parentA.child;
3994 while (child) {
3995 if (child === a) {
3996 assertIsMounted(parentA);
3997 return fiber;
3998 }
3999 if (child === b) {
4000 assertIsMounted(parentA);
4001 return alternate;
4002 }
4003 child = child.sibling;
4004 }
4005 throw new Error("Unable to find node on an unmounted component.");
4006 }
4007 if (a.return !== b.return) {
4008 a = parentA;
4009 b = parentB;
4010 } else {
4011 var didFindChild = false;
4012 var _child = parentA.child;
4013 while (_child) {
4014 if (_child === a) {
4015 didFindChild = true;
4016 a = parentA;
4017 b = parentB;
4018 break;
4019 }
4020 if (_child === b) {
4021 didFindChild = true;
4022 b = parentA;
4023 a = parentB;
4024 break;
4025 }
4026 _child = _child.sibling;
4027 }
4028 if (!didFindChild) {
4029 _child = parentB.child;
4030 while (_child) {
4031 if (_child === a) {
4032 didFindChild = true;
4033 a = parentB;
4034 b = parentA;
4035 break;
4036 }
4037 if (_child === b) {
4038 didFindChild = true;
4039 b = parentB;
4040 a = parentA;
4041 break;
4042 }
4043 _child = _child.sibling;
4044 }
4045 if (!didFindChild) {
4046 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.");
4047 }
4048 }
4049 }
4050 if (a.alternate !== b) {
4051 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.");
4052 }
4053 }
4054 if (a.tag !== HostRoot) {
4055 throw new Error("Unable to find node on an unmounted component.");
4056 }
4057 if (a.stateNode.current === a) {
4058 return fiber;
4059 }
4060 return alternate;
4061 }
4062 function findCurrentHostFiber(parent) {
4063 var currentParent = findCurrentFiberUsingSlowPath(parent);
4064 return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
4065 }
4066 function findCurrentHostFiberImpl(node) {
4067 if (node.tag === HostComponent || node.tag === HostText) {
4068 return node;
4069 }
4070 var child = node.child;
4071 while (child !== null) {
4072 var match = findCurrentHostFiberImpl(child);
4073 if (match !== null) {
4074 return match;
4075 }
4076 child = child.sibling;
4077 }
4078 return null;
4079 }
4080 function findCurrentHostFiberWithNoPortals(parent) {
4081 var currentParent = findCurrentFiberUsingSlowPath(parent);
4082 return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
4083 }
4084 function findCurrentHostFiberWithNoPortalsImpl(node) {
4085 if (node.tag === HostComponent || node.tag === HostText) {
4086 return node;
4087 }
4088 var child = node.child;
4089 while (child !== null) {
4090 if (child.tag !== HostPortal) {
4091 var match = findCurrentHostFiberWithNoPortalsImpl(child);
4092 if (match !== null) {
4093 return match;
4094 }
4095 }
4096 child = child.sibling;
4097 }
4098 return null;
4099 }
4100 var scheduleCallback = Scheduler.unstable_scheduleCallback;
4101 var cancelCallback = Scheduler.unstable_cancelCallback;
4102 var shouldYield = Scheduler.unstable_shouldYield;
4103 var requestPaint = Scheduler.unstable_requestPaint;
4104 var now = Scheduler.unstable_now;
4105 var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
4106 var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
4107 var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
4108 var NormalPriority = Scheduler.unstable_NormalPriority;
4109 var LowPriority = Scheduler.unstable_LowPriority;
4110 var IdlePriority = Scheduler.unstable_IdlePriority;
4111 var unstable_yieldValue = Scheduler.unstable_yieldValue;
4112 var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
4113 var rendererID = null;
4114 var injectedHook = null;
4115 var injectedProfilingHooks = null;
4116 var hasLoggedError = false;
4117 var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
4118 function injectInternals(internals) {
4119 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined") {
4120 return false;
4121 }
4122 var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
4123 if (hook.isDisabled) {
4124 return true;
4125 }
4126 if (!hook.supportsFiber) {
4127 {
4128 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");
4129 }
4130 return true;
4131 }
4132 try {
4133 if (enableSchedulingProfiler) {
4134 internals = assign({}, internals, {
4135 getLaneLabelMap,
4136 injectProfilingHooks
4137 });
4138 }
4139 rendererID = hook.inject(internals);
4140 injectedHook = hook;
4141 } catch (err) {
4142 {
4143 error("React instrumentation encountered an error: %s.", err);
4144 }
4145 }
4146 if (hook.checkDCE) {
4147 return true;
4148 } else {
4149 return false;
4150 }
4151 }
4152 function onScheduleRoot(root2, children) {
4153 {
4154 if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
4155 try {
4156 injectedHook.onScheduleFiberRoot(rendererID, root2, children);
4157 } catch (err) {
4158 if (!hasLoggedError) {
4159 hasLoggedError = true;
4160 error("React instrumentation encountered an error: %s", err);
4161 }
4162 }
4163 }
4164 }
4165 }
4166 function onCommitRoot(root2, eventPriority) {
4167 if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
4168 try {
4169 var didError = (root2.current.flags & DidCapture) === DidCapture;
4170 if (enableProfilerTimer) {
4171 var schedulerPriority;
4172 switch (eventPriority) {
4173 case DiscreteEventPriority:
4174 schedulerPriority = ImmediatePriority;
4175 break;
4176 case ContinuousEventPriority:
4177 schedulerPriority = UserBlockingPriority;
4178 break;
4179 case DefaultEventPriority:
4180 schedulerPriority = NormalPriority;
4181 break;
4182 case IdleEventPriority:
4183 schedulerPriority = IdlePriority;
4184 break;
4185 default:
4186 schedulerPriority = NormalPriority;
4187 break;
4188 }
4189 injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
4190 } else {
4191 injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
4192 }
4193 } catch (err) {
4194 {
4195 if (!hasLoggedError) {
4196 hasLoggedError = true;
4197 error("React instrumentation encountered an error: %s", err);
4198 }
4199 }
4200 }
4201 }
4202 }
4203 function onPostCommitRoot(root2) {
4204 if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
4205 try {
4206 injectedHook.onPostCommitFiberRoot(rendererID, root2);
4207 } catch (err) {
4208 {
4209 if (!hasLoggedError) {
4210 hasLoggedError = true;
4211 error("React instrumentation encountered an error: %s", err);
4212 }
4213 }
4214 }
4215 }
4216 }
4217 function onCommitUnmount(fiber) {
4218 if (injectedHook && typeof injectedHook.onCommitFiberUnmount === "function") {
4219 try {
4220 injectedHook.onCommitFiberUnmount(rendererID, fiber);
4221 } catch (err) {
4222 {
4223 if (!hasLoggedError) {
4224 hasLoggedError = true;
4225 error("React instrumentation encountered an error: %s", err);
4226 }
4227 }
4228 }
4229 }
4230 }
4231 function setIsStrictModeForDevtools(newIsStrictMode) {
4232 {
4233 if (typeof unstable_yieldValue === "function") {
4234 unstable_setDisableYieldValue(newIsStrictMode);
4235 setSuppressWarning(newIsStrictMode);
4236 }
4237 if (injectedHook && typeof injectedHook.setStrictMode === "function") {
4238 try {
4239 injectedHook.setStrictMode(rendererID, newIsStrictMode);
4240 } catch (err) {
4241 {
4242 if (!hasLoggedError) {
4243 hasLoggedError = true;
4244 error("React instrumentation encountered an error: %s", err);
4245 }
4246 }
4247 }
4248 }
4249 }
4250 }
4251 function injectProfilingHooks(profilingHooks) {
4252 injectedProfilingHooks = profilingHooks;
4253 }
4254 function getLaneLabelMap() {
4255 {
4256 var map = /* @__PURE__ */ new Map();
4257 var lane = 1;
4258 for (var index2 = 0; index2 < TotalLanes; index2++) {
4259 var label = getLabelForLane(lane);
4260 map.set(lane, label);
4261 lane *= 2;
4262 }
4263 return map;
4264 }
4265 }
4266 function markCommitStarted(lanes) {
4267 {
4268 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
4269 injectedProfilingHooks.markCommitStarted(lanes);
4270 }
4271 }
4272 }
4273 function markCommitStopped() {
4274 {
4275 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
4276 injectedProfilingHooks.markCommitStopped();
4277 }
4278 }
4279 }
4280 function markComponentRenderStarted(fiber) {
4281 {
4282 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
4283 injectedProfilingHooks.markComponentRenderStarted(fiber);
4284 }
4285 }
4286 }
4287 function markComponentRenderStopped() {
4288 {
4289 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
4290 injectedProfilingHooks.markComponentRenderStopped();
4291 }
4292 }
4293 }
4294 function markComponentPassiveEffectMountStarted(fiber) {
4295 {
4296 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
4297 injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
4298 }
4299 }
4300 }
4301 function markComponentPassiveEffectMountStopped() {
4302 {
4303 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
4304 injectedProfilingHooks.markComponentPassiveEffectMountStopped();
4305 }
4306 }
4307 }
4308 function markComponentPassiveEffectUnmountStarted(fiber) {
4309 {
4310 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
4311 injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
4312 }
4313 }
4314 }
4315 function markComponentPassiveEffectUnmountStopped() {
4316 {
4317 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
4318 injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
4319 }
4320 }
4321 }
4322 function markComponentLayoutEffectMountStarted(fiber) {
4323 {
4324 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
4325 injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
4326 }
4327 }
4328 }
4329 function markComponentLayoutEffectMountStopped() {
4330 {
4331 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
4332 injectedProfilingHooks.markComponentLayoutEffectMountStopped();
4333 }
4334 }
4335 }
4336 function markComponentLayoutEffectUnmountStarted(fiber) {
4337 {
4338 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
4339 injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
4340 }
4341 }
4342 }
4343 function markComponentLayoutEffectUnmountStopped() {
4344 {
4345 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
4346 injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
4347 }
4348 }
4349 }
4350 function markComponentErrored(fiber, thrownValue, lanes) {
4351 {
4352 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
4353 injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
4354 }
4355 }
4356 }
4357 function markComponentSuspended(fiber, wakeable, lanes) {
4358 {
4359 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
4360 injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
4361 }
4362 }
4363 }
4364 function markLayoutEffectsStarted(lanes) {
4365 {
4366 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
4367 injectedProfilingHooks.markLayoutEffectsStarted(lanes);
4368 }
4369 }
4370 }
4371 function markLayoutEffectsStopped() {
4372 {
4373 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
4374 injectedProfilingHooks.markLayoutEffectsStopped();
4375 }
4376 }
4377 }
4378 function markPassiveEffectsStarted(lanes) {
4379 {
4380 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
4381 injectedProfilingHooks.markPassiveEffectsStarted(lanes);
4382 }
4383 }
4384 }
4385 function markPassiveEffectsStopped() {
4386 {
4387 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
4388 injectedProfilingHooks.markPassiveEffectsStopped();
4389 }
4390 }
4391 }
4392 function markRenderStarted(lanes) {
4393 {
4394 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
4395 injectedProfilingHooks.markRenderStarted(lanes);
4396 }
4397 }
4398 }
4399 function markRenderYielded() {
4400 {
4401 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
4402 injectedProfilingHooks.markRenderYielded();
4403 }
4404 }
4405 }
4406 function markRenderStopped() {
4407 {
4408 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
4409 injectedProfilingHooks.markRenderStopped();
4410 }
4411 }
4412 }
4413 function markRenderScheduled(lane) {
4414 {
4415 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
4416 injectedProfilingHooks.markRenderScheduled(lane);
4417 }
4418 }
4419 }
4420 function markForceUpdateScheduled(fiber, lane) {
4421 {
4422 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
4423 injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
4424 }
4425 }
4426 }
4427 function markStateUpdateScheduled(fiber, lane) {
4428 {
4429 if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
4430 injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
4431 }
4432 }
4433 }
4434 var NoMode = (
4435 /* */
4436 0
4437 );
4438 var ConcurrentMode = (
4439 /* */
4440 1
4441 );
4442 var ProfileMode = (
4443 /* */
4444 2
4445 );
4446 var StrictLegacyMode = (
4447 /* */
4448 8
4449 );
4450 var StrictEffectsMode = (
4451 /* */
4452 16
4453 );
4454 var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
4455 var log = Math.log;
4456 var LN2 = Math.LN2;
4457 function clz32Fallback(x) {
4458 var asUint = x >>> 0;
4459 if (asUint === 0) {
4460 return 32;
4461 }
4462 return 31 - (log(asUint) / LN2 | 0) | 0;
4463 }
4464 var TotalLanes = 31;
4465 var NoLanes = (
4466 /* */
4467 0
4468 );
4469 var NoLane = (
4470 /* */
4471 0
4472 );
4473 var SyncLane = (
4474 /* */
4475 1
4476 );
4477 var InputContinuousHydrationLane = (
4478 /* */
4479 2
4480 );
4481 var InputContinuousLane = (
4482 /* */
4483 4
4484 );
4485 var DefaultHydrationLane = (
4486 /* */
4487 8
4488 );
4489 var DefaultLane = (
4490 /* */
4491 16
4492 );
4493 var TransitionHydrationLane = (
4494 /* */
4495 32
4496 );
4497 var TransitionLanes = (
4498 /* */
4499 4194240
4500 );
4501 var TransitionLane1 = (
4502 /* */
4503 64
4504 );
4505 var TransitionLane2 = (
4506 /* */
4507 128
4508 );
4509 var TransitionLane3 = (
4510 /* */
4511 256
4512 );
4513 var TransitionLane4 = (
4514 /* */
4515 512
4516 );
4517 var TransitionLane5 = (
4518 /* */
4519 1024
4520 );
4521 var TransitionLane6 = (
4522 /* */
4523 2048
4524 );
4525 var TransitionLane7 = (
4526 /* */
4527 4096
4528 );
4529 var TransitionLane8 = (
4530 /* */
4531 8192
4532 );
4533 var TransitionLane9 = (
4534 /* */
4535 16384
4536 );
4537 var TransitionLane10 = (
4538 /* */
4539 32768
4540 );
4541 var TransitionLane11 = (
4542 /* */
4543 65536
4544 );
4545 var TransitionLane12 = (
4546 /* */
4547 131072
4548 );
4549 var TransitionLane13 = (
4550 /* */
4551 262144
4552 );
4553 var TransitionLane14 = (
4554 /* */
4555 524288
4556 );
4557 var TransitionLane15 = (
4558 /* */
4559 1048576
4560 );
4561 var TransitionLane16 = (
4562 /* */
4563 2097152
4564 );
4565 var RetryLanes = (
4566 /* */
4567 130023424
4568 );
4569 var RetryLane1 = (
4570 /* */
4571 4194304
4572 );
4573 var RetryLane2 = (
4574 /* */
4575 8388608
4576 );
4577 var RetryLane3 = (
4578 /* */
4579 16777216
4580 );
4581 var RetryLane4 = (
4582 /* */
4583 33554432
4584 );
4585 var RetryLane5 = (
4586 /* */
4587 67108864
4588 );
4589 var SomeRetryLane = RetryLane1;
4590 var SelectiveHydrationLane = (
4591 /* */
4592 134217728
4593 );
4594 var NonIdleLanes = (
4595 /* */
4596 268435455
4597 );
4598 var IdleHydrationLane = (
4599 /* */
4600 268435456
4601 );
4602 var IdleLane = (
4603 /* */
4604 536870912
4605 );
4606 var OffscreenLane = (
4607 /* */
4608 1073741824
4609 );
4610 function getLabelForLane(lane) {
4611 {
4612 if (lane & SyncLane) {
4613 return "Sync";
4614 }
4615 if (lane & InputContinuousHydrationLane) {
4616 return "InputContinuousHydration";
4617 }
4618 if (lane & InputContinuousLane) {
4619 return "InputContinuous";
4620 }
4621 if (lane & DefaultHydrationLane) {
4622 return "DefaultHydration";
4623 }
4624 if (lane & DefaultLane) {
4625 return "Default";
4626 }
4627 if (lane & TransitionHydrationLane) {
4628 return "TransitionHydration";
4629 }
4630 if (lane & TransitionLanes) {
4631 return "Transition";
4632 }
4633 if (lane & RetryLanes) {
4634 return "Retry";
4635 }
4636 if (lane & SelectiveHydrationLane) {
4637 return "SelectiveHydration";
4638 }
4639 if (lane & IdleHydrationLane) {
4640 return "IdleHydration";
4641 }
4642 if (lane & IdleLane) {
4643 return "Idle";
4644 }
4645 if (lane & OffscreenLane) {
4646 return "Offscreen";
4647 }
4648 }
4649 }
4650 var NoTimestamp = -1;
4651 var nextTransitionLane = TransitionLane1;
4652 var nextRetryLane = RetryLane1;
4653 function getHighestPriorityLanes(lanes) {
4654 switch (getHighestPriorityLane(lanes)) {
4655 case SyncLane:
4656 return SyncLane;
4657 case InputContinuousHydrationLane:
4658 return InputContinuousHydrationLane;
4659 case InputContinuousLane:
4660 return InputContinuousLane;
4661 case DefaultHydrationLane:
4662 return DefaultHydrationLane;
4663 case DefaultLane:
4664 return DefaultLane;
4665 case TransitionHydrationLane:
4666 return TransitionHydrationLane;
4667 case TransitionLane1:
4668 case TransitionLane2:
4669 case TransitionLane3:
4670 case TransitionLane4:
4671 case TransitionLane5:
4672 case TransitionLane6:
4673 case TransitionLane7:
4674 case TransitionLane8:
4675 case TransitionLane9:
4676 case TransitionLane10:
4677 case TransitionLane11:
4678 case TransitionLane12:
4679 case TransitionLane13:
4680 case TransitionLane14:
4681 case TransitionLane15:
4682 case TransitionLane16:
4683 return lanes & TransitionLanes;
4684 case RetryLane1:
4685 case RetryLane2:
4686 case RetryLane3:
4687 case RetryLane4:
4688 case RetryLane5:
4689 return lanes & RetryLanes;
4690 case SelectiveHydrationLane:
4691 return SelectiveHydrationLane;
4692 case IdleHydrationLane:
4693 return IdleHydrationLane;
4694 case IdleLane:
4695 return IdleLane;
4696 case OffscreenLane:
4697 return OffscreenLane;
4698 default:
4699 {
4700 error("Should have found matching lanes. This is a bug in React.");
4701 }
4702 return lanes;
4703 }
4704 }
4705 function getNextLanes(root2, wipLanes) {
4706 var pendingLanes = root2.pendingLanes;
4707 if (pendingLanes === NoLanes) {
4708 return NoLanes;
4709 }
4710 var nextLanes = NoLanes;
4711 var suspendedLanes = root2.suspendedLanes;
4712 var pingedLanes = root2.pingedLanes;
4713 var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
4714 if (nonIdlePendingLanes !== NoLanes) {
4715 var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
4716 if (nonIdleUnblockedLanes !== NoLanes) {
4717 nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
4718 } else {
4719 var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
4720 if (nonIdlePingedLanes !== NoLanes) {
4721 nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
4722 }
4723 }
4724 } else {
4725 var unblockedLanes = pendingLanes & ~suspendedLanes;
4726 if (unblockedLanes !== NoLanes) {
4727 nextLanes = getHighestPriorityLanes(unblockedLanes);
4728 } else {
4729 if (pingedLanes !== NoLanes) {
4730 nextLanes = getHighestPriorityLanes(pingedLanes);
4731 }
4732 }
4733 }
4734 if (nextLanes === NoLanes) {
4735 return NoLanes;
4736 }
4737 if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
4738 // bother waiting until the root is complete.
4739 (wipLanes & suspendedLanes) === NoLanes) {
4740 var nextLane = getHighestPriorityLane(nextLanes);
4741 var wipLane = getHighestPriorityLane(wipLanes);
4742 if (
4743 // Tests whether the next lane is equal or lower priority than the wip
4744 // one. This works because the bits decrease in priority as you go left.
4745 nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The
4746 // only difference between default updates and transition updates is that
4747 // default updates do not support refresh transitions.
4748 nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes
4749 ) {
4750 return wipLanes;
4751 }
4752 }
4753 if ((nextLanes & InputContinuousLane) !== NoLanes) {
4754 nextLanes |= pendingLanes & DefaultLane;
4755 }
4756 var entangledLanes = root2.entangledLanes;
4757 if (entangledLanes !== NoLanes) {
4758 var entanglements = root2.entanglements;
4759 var lanes = nextLanes & entangledLanes;
4760 while (lanes > 0) {
4761 var index2 = pickArbitraryLaneIndex(lanes);
4762 var lane = 1 << index2;
4763 nextLanes |= entanglements[index2];
4764 lanes &= ~lane;
4765 }
4766 }
4767 return nextLanes;
4768 }
4769 function getMostRecentEventTime(root2, lanes) {
4770 var eventTimes = root2.eventTimes;
4771 var mostRecentEventTime = NoTimestamp;
4772 while (lanes > 0) {
4773 var index2 = pickArbitraryLaneIndex(lanes);
4774 var lane = 1 << index2;
4775 var eventTime = eventTimes[index2];
4776 if (eventTime > mostRecentEventTime) {
4777 mostRecentEventTime = eventTime;
4778 }
4779 lanes &= ~lane;
4780 }
4781 return mostRecentEventTime;
4782 }
4783 function computeExpirationTime(lane, currentTime) {
4784 switch (lane) {
4785 case SyncLane:
4786 case InputContinuousHydrationLane:
4787 case InputContinuousLane:
4788 return currentTime + 250;
4789 case DefaultHydrationLane:
4790 case DefaultLane:
4791 case TransitionHydrationLane:
4792 case TransitionLane1:
4793 case TransitionLane2:
4794 case TransitionLane3:
4795 case TransitionLane4:
4796 case TransitionLane5:
4797 case TransitionLane6:
4798 case TransitionLane7:
4799 case TransitionLane8:
4800 case TransitionLane9:
4801 case TransitionLane10:
4802 case TransitionLane11:
4803 case TransitionLane12:
4804 case TransitionLane13:
4805 case TransitionLane14:
4806 case TransitionLane15:
4807 case TransitionLane16:
4808 return currentTime + 5e3;
4809 case RetryLane1:
4810 case RetryLane2:
4811 case RetryLane3:
4812 case RetryLane4:
4813 case RetryLane5:
4814 return NoTimestamp;
4815 case SelectiveHydrationLane:
4816 case IdleHydrationLane:
4817 case IdleLane:
4818 case OffscreenLane:
4819 return NoTimestamp;
4820 default:
4821 {
4822 error("Should have found matching lanes. This is a bug in React.");
4823 }
4824 return NoTimestamp;
4825 }
4826 }
4827 function markStarvedLanesAsExpired(root2, currentTime) {
4828 var pendingLanes = root2.pendingLanes;
4829 var suspendedLanes = root2.suspendedLanes;
4830 var pingedLanes = root2.pingedLanes;
4831 var expirationTimes = root2.expirationTimes;
4832 var lanes = pendingLanes;
4833 while (lanes > 0) {
4834 var index2 = pickArbitraryLaneIndex(lanes);
4835 var lane = 1 << index2;
4836 var expirationTime = expirationTimes[index2];
4837 if (expirationTime === NoTimestamp) {
4838 if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {
4839 expirationTimes[index2] = computeExpirationTime(lane, currentTime);
4840 }
4841 } else if (expirationTime <= currentTime) {
4842 root2.expiredLanes |= lane;
4843 }
4844 lanes &= ~lane;
4845 }
4846 }
4847 function getHighestPriorityPendingLanes(root2) {
4848 return getHighestPriorityLanes(root2.pendingLanes);
4849 }
4850 function getLanesToRetrySynchronouslyOnError(root2) {
4851 var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
4852 if (everythingButOffscreen !== NoLanes) {
4853 return everythingButOffscreen;
4854 }
4855 if (everythingButOffscreen & OffscreenLane) {
4856 return OffscreenLane;
4857 }
4858 return NoLanes;
4859 }
4860 function includesSyncLane(lanes) {
4861 return (lanes & SyncLane) !== NoLanes;
4862 }
4863 function includesNonIdleWork(lanes) {
4864 return (lanes & NonIdleLanes) !== NoLanes;
4865 }
4866 function includesOnlyRetries(lanes) {
4867 return (lanes & RetryLanes) === lanes;
4868 }
4869 function includesOnlyNonUrgentLanes(lanes) {
4870 var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
4871 return (lanes & UrgentLanes) === NoLanes;
4872 }
4873 function includesOnlyTransitions(lanes) {
4874 return (lanes & TransitionLanes) === lanes;
4875 }
4876 function includesBlockingLane(root2, lanes) {
4877 var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
4878 return (lanes & SyncDefaultLanes) !== NoLanes;
4879 }
4880 function includesExpiredLane(root2, lanes) {
4881 return (lanes & root2.expiredLanes) !== NoLanes;
4882 }
4883 function isTransitionLane(lane) {
4884 return (lane & TransitionLanes) !== NoLanes;
4885 }
4886 function claimNextTransitionLane() {
4887 var lane = nextTransitionLane;
4888 nextTransitionLane <<= 1;
4889 if ((nextTransitionLane & TransitionLanes) === NoLanes) {
4890 nextTransitionLane = TransitionLane1;
4891 }
4892 return lane;
4893 }
4894 function claimNextRetryLane() {
4895 var lane = nextRetryLane;
4896 nextRetryLane <<= 1;
4897 if ((nextRetryLane & RetryLanes) === NoLanes) {
4898 nextRetryLane = RetryLane1;
4899 }
4900 return lane;
4901 }
4902 function getHighestPriorityLane(lanes) {
4903 return lanes & -lanes;
4904 }
4905 function pickArbitraryLane(lanes) {
4906 return getHighestPriorityLane(lanes);
4907 }
4908 function pickArbitraryLaneIndex(lanes) {
4909 return 31 - clz32(lanes);
4910 }
4911 function laneToIndex(lane) {
4912 return pickArbitraryLaneIndex(lane);
4913 }
4914 function includesSomeLane(a, b) {
4915 return (a & b) !== NoLanes;
4916 }
4917 function isSubsetOfLanes(set2, subset) {
4918 return (set2 & subset) === subset;
4919 }
4920 function mergeLanes(a, b) {
4921 return a | b;
4922 }
4923 function removeLanes(set2, subset) {
4924 return set2 & ~subset;
4925 }
4926 function intersectLanes(a, b) {
4927 return a & b;
4928 }
4929 function laneToLanes(lane) {
4930 return lane;
4931 }
4932 function higherPriorityLane(a, b) {
4933 return a !== NoLane && a < b ? a : b;
4934 }
4935 function createLaneMap(initial) {
4936 var laneMap = [];
4937 for (var i = 0; i < TotalLanes; i++) {
4938 laneMap.push(initial);
4939 }
4940 return laneMap;
4941 }
4942 function markRootUpdated(root2, updateLane, eventTime) {
4943 root2.pendingLanes |= updateLane;
4944 if (updateLane !== IdleLane) {
4945 root2.suspendedLanes = NoLanes;
4946 root2.pingedLanes = NoLanes;
4947 }
4948 var eventTimes = root2.eventTimes;
4949 var index2 = laneToIndex(updateLane);
4950 eventTimes[index2] = eventTime;
4951 }
4952 function markRootSuspended(root2, suspendedLanes) {
4953 root2.suspendedLanes |= suspendedLanes;
4954 root2.pingedLanes &= ~suspendedLanes;
4955 var expirationTimes = root2.expirationTimes;
4956 var lanes = suspendedLanes;
4957 while (lanes > 0) {
4958 var index2 = pickArbitraryLaneIndex(lanes);
4959 var lane = 1 << index2;
4960 expirationTimes[index2] = NoTimestamp;
4961 lanes &= ~lane;
4962 }
4963 }
4964 function markRootPinged(root2, pingedLanes, eventTime) {
4965 root2.pingedLanes |= root2.suspendedLanes & pingedLanes;
4966 }
4967 function markRootFinished(root2, remainingLanes) {
4968 var noLongerPendingLanes = root2.pendingLanes & ~remainingLanes;
4969 root2.pendingLanes = remainingLanes;
4970 root2.suspendedLanes = NoLanes;
4971 root2.pingedLanes = NoLanes;
4972 root2.expiredLanes &= remainingLanes;
4973 root2.mutableReadLanes &= remainingLanes;
4974 root2.entangledLanes &= remainingLanes;
4975 var entanglements = root2.entanglements;
4976 var eventTimes = root2.eventTimes;
4977 var expirationTimes = root2.expirationTimes;
4978 var lanes = noLongerPendingLanes;
4979 while (lanes > 0) {
4980 var index2 = pickArbitraryLaneIndex(lanes);
4981 var lane = 1 << index2;
4982 entanglements[index2] = NoLanes;
4983 eventTimes[index2] = NoTimestamp;
4984 expirationTimes[index2] = NoTimestamp;
4985 lanes &= ~lane;
4986 }
4987 }
4988 function markRootEntangled(root2, entangledLanes) {
4989 var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
4990 var entanglements = root2.entanglements;
4991 var lanes = rootEntangledLanes;
4992 while (lanes) {
4993 var index2 = pickArbitraryLaneIndex(lanes);
4994 var lane = 1 << index2;
4995 if (
4996 // Is this one of the newly entangled lanes?
4997 lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?
4998 entanglements[index2] & entangledLanes
4999 ) {
5000 entanglements[index2] |= entangledLanes;
5001 }
5002 lanes &= ~lane;
5003 }
5004 }
5005 function getBumpedLaneForHydration(root2, renderLanes2) {
5006 var renderLane = getHighestPriorityLane(renderLanes2);
5007 var lane;
5008 switch (renderLane) {
5009 case InputContinuousLane:
5010 lane = InputContinuousHydrationLane;
5011 break;
5012 case DefaultLane:
5013 lane = DefaultHydrationLane;
5014 break;
5015 case TransitionLane1:
5016 case TransitionLane2:
5017 case TransitionLane3:
5018 case TransitionLane4:
5019 case TransitionLane5:
5020 case TransitionLane6:
5021 case TransitionLane7:
5022 case TransitionLane8:
5023 case TransitionLane9:
5024 case TransitionLane10:
5025 case TransitionLane11:
5026 case TransitionLane12:
5027 case TransitionLane13:
5028 case TransitionLane14:
5029 case TransitionLane15:
5030 case TransitionLane16:
5031 case RetryLane1:
5032 case RetryLane2:
5033 case RetryLane3:
5034 case RetryLane4:
5035 case RetryLane5:
5036 lane = TransitionHydrationLane;
5037 break;
5038 case IdleLane:
5039 lane = IdleHydrationLane;
5040 break;
5041 default:
5042 lane = NoLane;
5043 break;
5044 }
5045 if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
5046 return NoLane;
5047 }
5048 return lane;
5049 }
5050 function addFiberToLanesMap(root2, fiber, lanes) {
5051 if (!isDevToolsPresent) {
5052 return;
5053 }
5054 var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
5055 while (lanes > 0) {
5056 var index2 = laneToIndex(lanes);
5057 var lane = 1 << index2;
5058 var updaters = pendingUpdatersLaneMap[index2];
5059 updaters.add(fiber);
5060 lanes &= ~lane;
5061 }
5062 }
5063 function movePendingFibersToMemoized(root2, lanes) {
5064 if (!isDevToolsPresent) {
5065 return;
5066 }
5067 var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
5068 var memoizedUpdaters = root2.memoizedUpdaters;
5069 while (lanes > 0) {
5070 var index2 = laneToIndex(lanes);
5071 var lane = 1 << index2;
5072 var updaters = pendingUpdatersLaneMap[index2];
5073 if (updaters.size > 0) {
5074 updaters.forEach(function(fiber) {
5075 var alternate = fiber.alternate;
5076 if (alternate === null || !memoizedUpdaters.has(alternate)) {
5077 memoizedUpdaters.add(fiber);
5078 }
5079 });
5080 updaters.clear();
5081 }
5082 lanes &= ~lane;
5083 }
5084 }
5085 function getTransitionsForLanes(root2, lanes) {
5086 {
5087 return null;
5088 }
5089 }
5090 var DiscreteEventPriority = SyncLane;
5091 var ContinuousEventPriority = InputContinuousLane;
5092 var DefaultEventPriority = DefaultLane;
5093 var IdleEventPriority = IdleLane;
5094 var currentUpdatePriority = NoLane;
5095 function getCurrentUpdatePriority() {
5096 return currentUpdatePriority;
5097 }
5098 function setCurrentUpdatePriority(newPriority) {
5099 currentUpdatePriority = newPriority;
5100 }
5101 function runWithPriority(priority, fn) {
5102 var previousPriority = currentUpdatePriority;
5103 try {
5104 currentUpdatePriority = priority;
5105 return fn();
5106 } finally {
5107 currentUpdatePriority = previousPriority;
5108 }
5109 }
5110 function higherEventPriority(a, b) {
5111 return a !== 0 && a < b ? a : b;
5112 }
5113 function lowerEventPriority(a, b) {
5114 return a === 0 || a > b ? a : b;
5115 }
5116 function isHigherEventPriority(a, b) {
5117 return a !== 0 && a < b;
5118 }
5119 function lanesToEventPriority(lanes) {
5120 var lane = getHighestPriorityLane(lanes);
5121 if (!isHigherEventPriority(DiscreteEventPriority, lane)) {
5122 return DiscreteEventPriority;
5123 }
5124 if (!isHigherEventPriority(ContinuousEventPriority, lane)) {
5125 return ContinuousEventPriority;
5126 }
5127 if (includesNonIdleWork(lane)) {
5128 return DefaultEventPriority;
5129 }
5130 return IdleEventPriority;
5131 }
5132 function isRootDehydrated(root2) {
5133 var currentState = root2.current.memoizedState;
5134 return currentState.isDehydrated;
5135 }
5136 var _attemptSynchronousHydration;
5137 function setAttemptSynchronousHydration(fn) {
5138 _attemptSynchronousHydration = fn;
5139 }
5140 function attemptSynchronousHydration(fiber) {
5141 _attemptSynchronousHydration(fiber);
5142 }
5143 var attemptContinuousHydration;
5144 function setAttemptContinuousHydration(fn) {
5145 attemptContinuousHydration = fn;
5146 }
5147 var attemptHydrationAtCurrentPriority;
5148 function setAttemptHydrationAtCurrentPriority(fn) {
5149 attemptHydrationAtCurrentPriority = fn;
5150 }
5151 var getCurrentUpdatePriority$1;
5152 function setGetCurrentUpdatePriority(fn) {
5153 getCurrentUpdatePriority$1 = fn;
5154 }
5155 var attemptHydrationAtPriority;
5156 function setAttemptHydrationAtPriority(fn) {
5157 attemptHydrationAtPriority = fn;
5158 }
5159 var hasScheduledReplayAttempt = false;
5160 var queuedDiscreteEvents = [];
5161 var queuedFocus = null;
5162 var queuedDrag = null;
5163 var queuedMouse = null;
5164 var queuedPointers = /* @__PURE__ */ new Map();
5165 var queuedPointerCaptures = /* @__PURE__ */ new Map();
5166 var queuedExplicitHydrationTargets = [];
5167 var discreteReplayableEvents = [
5168 "mousedown",
5169 "mouseup",
5170 "touchcancel",
5171 "touchend",
5172 "touchstart",
5173 "auxclick",
5174 "dblclick",
5175 "pointercancel",
5176 "pointerdown",
5177 "pointerup",
5178 "dragend",
5179 "dragstart",
5180 "drop",
5181 "compositionend",
5182 "compositionstart",
5183 "keydown",
5184 "keypress",
5185 "keyup",
5186 "input",
5187 "textInput",
5188 // Intentionally camelCase
5189 "copy",
5190 "cut",
5191 "paste",
5192 "click",
5193 "change",
5194 "contextmenu",
5195 "reset",
5196 "submit"
5197 ];
5198 function isDiscreteEventThatRequiresHydration(eventType) {
5199 return discreteReplayableEvents.indexOf(eventType) > -1;
5200 }
5201 function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5202 return {
5203 blockedOn,
5204 domEventName,
5205 eventSystemFlags,
5206 nativeEvent,
5207 targetContainers: [targetContainer]
5208 };
5209 }
5210 function clearIfContinuousEvent(domEventName, nativeEvent) {
5211 switch (domEventName) {
5212 case "focusin":
5213 case "focusout":
5214 queuedFocus = null;
5215 break;
5216 case "dragenter":
5217 case "dragleave":
5218 queuedDrag = null;
5219 break;
5220 case "mouseover":
5221 case "mouseout":
5222 queuedMouse = null;
5223 break;
5224 case "pointerover":
5225 case "pointerout": {
5226 var pointerId = nativeEvent.pointerId;
5227 queuedPointers.delete(pointerId);
5228 break;
5229 }
5230 case "gotpointercapture":
5231 case "lostpointercapture": {
5232 var _pointerId = nativeEvent.pointerId;
5233 queuedPointerCaptures.delete(_pointerId);
5234 break;
5235 }
5236 }
5237 }
5238 function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5239 if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
5240 var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);
5241 if (blockedOn !== null) {
5242 var _fiber2 = getInstanceFromNode(blockedOn);
5243 if (_fiber2 !== null) {
5244 attemptContinuousHydration(_fiber2);
5245 }
5246 }
5247 return queuedEvent;
5248 }
5249 existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
5250 var targetContainers = existingQueuedEvent.targetContainers;
5251 if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {
5252 targetContainers.push(targetContainer);
5253 }
5254 return existingQueuedEvent;
5255 }
5256 function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5257 switch (domEventName) {
5258 case "focusin": {
5259 var focusEvent = nativeEvent;
5260 queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);
5261 return true;
5262 }
5263 case "dragenter": {
5264 var dragEvent = nativeEvent;
5265 queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);
5266 return true;
5267 }
5268 case "mouseover": {
5269 var mouseEvent = nativeEvent;
5270 queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);
5271 return true;
5272 }
5273 case "pointerover": {
5274 var pointerEvent = nativeEvent;
5275 var pointerId = pointerEvent.pointerId;
5276 queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));
5277 return true;
5278 }
5279 case "gotpointercapture": {
5280 var _pointerEvent = nativeEvent;
5281 var _pointerId2 = _pointerEvent.pointerId;
5282 queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));
5283 return true;
5284 }
5285 }
5286 return false;
5287 }
5288 function attemptExplicitHydrationTarget(queuedTarget) {
5289 var targetInst = getClosestInstanceFromNode(queuedTarget.target);
5290 if (targetInst !== null) {
5291 var nearestMounted = getNearestMountedFiber(targetInst);
5292 if (nearestMounted !== null) {
5293 var tag = nearestMounted.tag;
5294 if (tag === SuspenseComponent) {
5295 var instance = getSuspenseInstanceFromFiber(nearestMounted);
5296 if (instance !== null) {
5297 queuedTarget.blockedOn = instance;
5298 attemptHydrationAtPriority(queuedTarget.priority, function() {
5299 attemptHydrationAtCurrentPriority(nearestMounted);
5300 });
5301 return;
5302 }
5303 } else if (tag === HostRoot) {
5304 var root2 = nearestMounted.stateNode;
5305 if (isRootDehydrated(root2)) {
5306 queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
5307 return;
5308 }
5309 }
5310 }
5311 }
5312 queuedTarget.blockedOn = null;
5313 }
5314 function queueExplicitHydrationTarget(target) {
5315 var updatePriority = getCurrentUpdatePriority$1();
5316 var queuedTarget = {
5317 blockedOn: null,
5318 target,
5319 priority: updatePriority
5320 };
5321 var i = 0;
5322 for (; i < queuedExplicitHydrationTargets.length; i++) {
5323 if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) {
5324 break;
5325 }
5326 }
5327 queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
5328 if (i === 0) {
5329 attemptExplicitHydrationTarget(queuedTarget);
5330 }
5331 }
5332 function attemptReplayContinuousQueuedEvent(queuedEvent) {
5333 if (queuedEvent.blockedOn !== null) {
5334 return false;
5335 }
5336 var targetContainers = queuedEvent.targetContainers;
5337 while (targetContainers.length > 0) {
5338 var targetContainer = targetContainers[0];
5339 var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
5340 if (nextBlockedOn === null) {
5341 {
5342 var nativeEvent = queuedEvent.nativeEvent;
5343 var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
5344 setReplayingEvent(nativeEventClone);
5345 nativeEvent.target.dispatchEvent(nativeEventClone);
5346 resetReplayingEvent();
5347 }
5348 } else {
5349 var _fiber3 = getInstanceFromNode(nextBlockedOn);
5350 if (_fiber3 !== null) {
5351 attemptContinuousHydration(_fiber3);
5352 }
5353 queuedEvent.blockedOn = nextBlockedOn;
5354 return false;
5355 }
5356 targetContainers.shift();
5357 }
5358 return true;
5359 }
5360 function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
5361 if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
5362 map.delete(key);
5363 }
5364 }
5365 function replayUnblockedEvents() {
5366 hasScheduledReplayAttempt = false;
5367 if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
5368 queuedFocus = null;
5369 }
5370 if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
5371 queuedDrag = null;
5372 }
5373 if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
5374 queuedMouse = null;
5375 }
5376 queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
5377 queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
5378 }
5379 function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
5380 if (queuedEvent.blockedOn === unblocked) {
5381 queuedEvent.blockedOn = null;
5382 if (!hasScheduledReplayAttempt) {
5383 hasScheduledReplayAttempt = true;
5384 Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
5385 }
5386 }
5387 }
5388 function retryIfBlockedOn(unblocked) {
5389 if (queuedDiscreteEvents.length > 0) {
5390 scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
5391 for (var i = 1; i < queuedDiscreteEvents.length; i++) {
5392 var queuedEvent = queuedDiscreteEvents[i];
5393 if (queuedEvent.blockedOn === unblocked) {
5394 queuedEvent.blockedOn = null;
5395 }
5396 }
5397 }
5398 if (queuedFocus !== null) {
5399 scheduleCallbackIfUnblocked(queuedFocus, unblocked);
5400 }
5401 if (queuedDrag !== null) {
5402 scheduleCallbackIfUnblocked(queuedDrag, unblocked);
5403 }
5404 if (queuedMouse !== null) {
5405 scheduleCallbackIfUnblocked(queuedMouse, unblocked);
5406 }
5407 var unblock = function(queuedEvent2) {
5408 return scheduleCallbackIfUnblocked(queuedEvent2, unblocked);
5409 };
5410 queuedPointers.forEach(unblock);
5411 queuedPointerCaptures.forEach(unblock);
5412 for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
5413 var queuedTarget = queuedExplicitHydrationTargets[_i];
5414 if (queuedTarget.blockedOn === unblocked) {
5415 queuedTarget.blockedOn = null;
5416 }
5417 }
5418 while (queuedExplicitHydrationTargets.length > 0) {
5419 var nextExplicitTarget = queuedExplicitHydrationTargets[0];
5420 if (nextExplicitTarget.blockedOn !== null) {
5421 break;
5422 } else {
5423 attemptExplicitHydrationTarget(nextExplicitTarget);
5424 if (nextExplicitTarget.blockedOn === null) {
5425 queuedExplicitHydrationTargets.shift();
5426 }
5427 }
5428 }
5429 }
5430 var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
5431 var _enabled = true;
5432 function setEnabled(enabled) {
5433 _enabled = !!enabled;
5434 }
5435 function isEnabled() {
5436 return _enabled;
5437 }
5438 function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
5439 var eventPriority = getEventPriority(domEventName);
5440 var listenerWrapper;
5441 switch (eventPriority) {
5442 case DiscreteEventPriority:
5443 listenerWrapper = dispatchDiscreteEvent;
5444 break;
5445 case ContinuousEventPriority:
5446 listenerWrapper = dispatchContinuousEvent;
5447 break;
5448 case DefaultEventPriority:
5449 default:
5450 listenerWrapper = dispatchEvent;
5451 break;
5452 }
5453 return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
5454 }
5455 function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
5456 var previousPriority = getCurrentUpdatePriority();
5457 var prevTransition = ReactCurrentBatchConfig.transition;
5458 ReactCurrentBatchConfig.transition = null;
5459 try {
5460 setCurrentUpdatePriority(DiscreteEventPriority);
5461 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
5462 } finally {
5463 setCurrentUpdatePriority(previousPriority);
5464 ReactCurrentBatchConfig.transition = prevTransition;
5465 }
5466 }
5467 function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
5468 var previousPriority = getCurrentUpdatePriority();
5469 var prevTransition = ReactCurrentBatchConfig.transition;
5470 ReactCurrentBatchConfig.transition = null;
5471 try {
5472 setCurrentUpdatePriority(ContinuousEventPriority);
5473 dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
5474 } finally {
5475 setCurrentUpdatePriority(previousPriority);
5476 ReactCurrentBatchConfig.transition = prevTransition;
5477 }
5478 }
5479 function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5480 if (!_enabled) {
5481 return;
5482 }
5483 {
5484 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5485 }
5486 }
5487 function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5488 var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5489 if (blockedOn === null) {
5490 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
5491 clearIfContinuousEvent(domEventName, nativeEvent);
5492 return;
5493 }
5494 if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
5495 nativeEvent.stopPropagation();
5496 return;
5497 }
5498 clearIfContinuousEvent(domEventName, nativeEvent);
5499 if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
5500 while (blockedOn !== null) {
5501 var fiber = getInstanceFromNode(blockedOn);
5502 if (fiber !== null) {
5503 attemptSynchronousHydration(fiber);
5504 }
5505 var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
5506 if (nextBlockedOn === null) {
5507 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
5508 }
5509 if (nextBlockedOn === blockedOn) {
5510 break;
5511 }
5512 blockedOn = nextBlockedOn;
5513 }
5514 if (blockedOn !== null) {
5515 nativeEvent.stopPropagation();
5516 }
5517 return;
5518 }
5519 dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
5520 }
5521 var return_targetInst = null;
5522 function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
5523 return_targetInst = null;
5524 var nativeEventTarget = getEventTarget(nativeEvent);
5525 var targetInst = getClosestInstanceFromNode(nativeEventTarget);
5526 if (targetInst !== null) {
5527 var nearestMounted = getNearestMountedFiber(targetInst);
5528 if (nearestMounted === null) {
5529 targetInst = null;
5530 } else {
5531 var tag = nearestMounted.tag;
5532 if (tag === SuspenseComponent) {
5533 var instance = getSuspenseInstanceFromFiber(nearestMounted);
5534 if (instance !== null) {
5535 return instance;
5536 }
5537 targetInst = null;
5538 } else if (tag === HostRoot) {
5539 var root2 = nearestMounted.stateNode;
5540 if (isRootDehydrated(root2)) {
5541 return getContainerFromFiber(nearestMounted);
5542 }
5543 targetInst = null;
5544 } else if (nearestMounted !== targetInst) {
5545 targetInst = null;
5546 }
5547 }
5548 }
5549 return_targetInst = targetInst;
5550 return null;
5551 }
5552 function getEventPriority(domEventName) {
5553 switch (domEventName) {
5554 // Used by SimpleEventPlugin:
5555 case "cancel":
5556 case "click":
5557 case "close":
5558 case "contextmenu":
5559 case "copy":
5560 case "cut":
5561 case "auxclick":
5562 case "dblclick":
5563 case "dragend":
5564 case "dragstart":
5565 case "drop":
5566 case "focusin":
5567 case "focusout":
5568 case "input":
5569 case "invalid":
5570 case "keydown":
5571 case "keypress":
5572 case "keyup":
5573 case "mousedown":
5574 case "mouseup":
5575 case "paste":
5576 case "pause":
5577 case "play":
5578 case "pointercancel":
5579 case "pointerdown":
5580 case "pointerup":
5581 case "ratechange":
5582 case "reset":
5583 case "resize":
5584 case "seeked":
5585 case "submit":
5586 case "touchcancel":
5587 case "touchend":
5588 case "touchstart":
5589 case "volumechange":
5590 // Used by polyfills:
5591 // eslint-disable-next-line no-fallthrough
5592 case "change":
5593 case "selectionchange":
5594 case "textInput":
5595 case "compositionstart":
5596 case "compositionend":
5597 case "compositionupdate":
5598 // Only enableCreateEventHandleAPI:
5599 // eslint-disable-next-line no-fallthrough
5600 case "beforeblur":
5601 case "afterblur":
5602 // Not used by React but could be by user code:
5603 // eslint-disable-next-line no-fallthrough
5604 case "beforeinput":
5605 case "blur":
5606 case "fullscreenchange":
5607 case "focus":
5608 case "hashchange":
5609 case "popstate":
5610 case "select":
5611 case "selectstart":
5612 return DiscreteEventPriority;
5613 case "drag":
5614 case "dragenter":
5615 case "dragexit":
5616 case "dragleave":
5617 case "dragover":
5618 case "mousemove":
5619 case "mouseout":
5620 case "mouseover":
5621 case "pointermove":
5622 case "pointerout":
5623 case "pointerover":
5624 case "scroll":
5625 case "toggle":
5626 case "touchmove":
5627 case "wheel":
5628 // Not used by React but could be by user code:
5629 // eslint-disable-next-line no-fallthrough
5630 case "mouseenter":
5631 case "mouseleave":
5632 case "pointerenter":
5633 case "pointerleave":
5634 return ContinuousEventPriority;
5635 case "message": {
5636 var schedulerPriority = getCurrentPriorityLevel();
5637 switch (schedulerPriority) {
5638 case ImmediatePriority:
5639 return DiscreteEventPriority;
5640 case UserBlockingPriority:
5641 return ContinuousEventPriority;
5642 case NormalPriority:
5643 case LowPriority:
5644 return DefaultEventPriority;
5645 case IdlePriority:
5646 return IdleEventPriority;
5647 default:
5648 return DefaultEventPriority;
5649 }
5650 }
5651 default:
5652 return DefaultEventPriority;
5653 }
5654 }
5655 function addEventBubbleListener(target, eventType, listener) {
5656 target.addEventListener(eventType, listener, false);
5657 return listener;
5658 }
5659 function addEventCaptureListener(target, eventType, listener) {
5660 target.addEventListener(eventType, listener, true);
5661 return listener;
5662 }
5663 function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {
5664 target.addEventListener(eventType, listener, {
5665 capture: true,
5666 passive
5667 });
5668 return listener;
5669 }
5670 function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {
5671 target.addEventListener(eventType, listener, {
5672 passive
5673 });
5674 return listener;
5675 }
5676 var root = null;
5677 var startText = null;
5678 var fallbackText = null;
5679 function initialize(nativeEventTarget) {
5680 root = nativeEventTarget;
5681 startText = getText();
5682 return true;
5683 }
5684 function reset() {
5685 root = null;
5686 startText = null;
5687 fallbackText = null;
5688 }
5689 function getData() {
5690 if (fallbackText) {
5691 return fallbackText;
5692 }
5693 var start;
5694 var startValue = startText;
5695 var startLength = startValue.length;
5696 var end;
5697 var endValue = getText();
5698 var endLength = endValue.length;
5699 for (start = 0; start < startLength; start++) {
5700 if (startValue[start] !== endValue[start]) {
5701 break;
5702 }
5703 }
5704 var minEnd = startLength - start;
5705 for (end = 1; end <= minEnd; end++) {
5706 if (startValue[startLength - end] !== endValue[endLength - end]) {
5707 break;
5708 }
5709 }
5710 var sliceTail = end > 1 ? 1 - end : void 0;
5711 fallbackText = endValue.slice(start, sliceTail);
5712 return fallbackText;
5713 }
5714 function getText() {
5715 if ("value" in root) {
5716 return root.value;
5717 }
5718 return root.textContent;
5719 }
5720 function getEventCharCode(nativeEvent) {
5721 var charCode;
5722 var keyCode = nativeEvent.keyCode;
5723 if ("charCode" in nativeEvent) {
5724 charCode = nativeEvent.charCode;
5725 if (charCode === 0 && keyCode === 13) {
5726 charCode = 13;
5727 }
5728 } else {
5729 charCode = keyCode;
5730 }
5731 if (charCode === 10) {
5732 charCode = 13;
5733 }
5734 if (charCode >= 32 || charCode === 13) {
5735 return charCode;
5736 }
5737 return 0;
5738 }
5739 function functionThatReturnsTrue() {
5740 return true;
5741 }
5742 function functionThatReturnsFalse() {
5743 return false;
5744 }
5745 function createSyntheticEvent(Interface) {
5746 function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
5747 this._reactName = reactName;
5748 this._targetInst = targetInst;
5749 this.type = reactEventType;
5750 this.nativeEvent = nativeEvent;
5751 this.target = nativeEventTarget;
5752 this.currentTarget = null;
5753 for (var _propName in Interface) {
5754 if (!Interface.hasOwnProperty(_propName)) {
5755 continue;
5756 }
5757 var normalize = Interface[_propName];
5758 if (normalize) {
5759 this[_propName] = normalize(nativeEvent);
5760 } else {
5761 this[_propName] = nativeEvent[_propName];
5762 }
5763 }
5764 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
5765 if (defaultPrevented) {
5766 this.isDefaultPrevented = functionThatReturnsTrue;
5767 } else {
5768 this.isDefaultPrevented = functionThatReturnsFalse;
5769 }
5770 this.isPropagationStopped = functionThatReturnsFalse;
5771 return this;
5772 }
5773 assign(SyntheticBaseEvent.prototype, {
5774 preventDefault: function() {
5775 this.defaultPrevented = true;
5776 var event = this.nativeEvent;
5777 if (!event) {
5778 return;
5779 }
5780 if (event.preventDefault) {
5781 event.preventDefault();
5782 } else if (typeof event.returnValue !== "unknown") {
5783 event.returnValue = false;
5784 }
5785 this.isDefaultPrevented = functionThatReturnsTrue;
5786 },
5787 stopPropagation: function() {
5788 var event = this.nativeEvent;
5789 if (!event) {
5790 return;
5791 }
5792 if (event.stopPropagation) {
5793 event.stopPropagation();
5794 } else if (typeof event.cancelBubble !== "unknown") {
5795 event.cancelBubble = true;
5796 }
5797 this.isPropagationStopped = functionThatReturnsTrue;
5798 },
5799 /**
5800 * We release all dispatched `SyntheticEvent`s after each event loop, adding
5801 * them back into the pool. This allows a way to hold onto a reference that
5802 * won't be added back into the pool.
5803 */
5804 persist: function() {
5805 },
5806 /**
5807 * Checks if this event should be released back into the pool.
5808 *
5809 * @return {boolean} True if this should not be released, false otherwise.
5810 */
5811 isPersistent: functionThatReturnsTrue
5812 });
5813 return SyntheticBaseEvent;
5814 }
5815 var EventInterface = {
5816 eventPhase: 0,
5817 bubbles: 0,
5818 cancelable: 0,
5819 timeStamp: function(event) {
5820 return event.timeStamp || Date.now();
5821 },
5822 defaultPrevented: 0,
5823 isTrusted: 0
5824 };
5825 var SyntheticEvent = createSyntheticEvent(EventInterface);
5826 var UIEventInterface = assign({}, EventInterface, {
5827 view: 0,
5828 detail: 0
5829 });
5830 var SyntheticUIEvent = createSyntheticEvent(UIEventInterface);
5831 var lastMovementX;
5832 var lastMovementY;
5833 var lastMouseEvent;
5834 function updateMouseMovementPolyfillState(event) {
5835 if (event !== lastMouseEvent) {
5836 if (lastMouseEvent && event.type === "mousemove") {
5837 lastMovementX = event.screenX - lastMouseEvent.screenX;
5838 lastMovementY = event.screenY - lastMouseEvent.screenY;
5839 } else {
5840 lastMovementX = 0;
5841 lastMovementY = 0;
5842 }
5843 lastMouseEvent = event;
5844 }
5845 }
5846 var MouseEventInterface = assign({}, UIEventInterface, {
5847 screenX: 0,
5848 screenY: 0,
5849 clientX: 0,
5850 clientY: 0,
5851 pageX: 0,
5852 pageY: 0,
5853 ctrlKey: 0,
5854 shiftKey: 0,
5855 altKey: 0,
5856 metaKey: 0,
5857 getModifierState: getEventModifierState,
5858 button: 0,
5859 buttons: 0,
5860 relatedTarget: function(event) {
5861 if (event.relatedTarget === void 0) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;
5862 return event.relatedTarget;
5863 },
5864 movementX: function(event) {
5865 if ("movementX" in event) {
5866 return event.movementX;
5867 }
5868 updateMouseMovementPolyfillState(event);
5869 return lastMovementX;
5870 },
5871 movementY: function(event) {
5872 if ("movementY" in event) {
5873 return event.movementY;
5874 }
5875 return lastMovementY;
5876 }
5877 });
5878 var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);
5879 var DragEventInterface = assign({}, MouseEventInterface, {
5880 dataTransfer: 0
5881 });
5882 var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
5883 var FocusEventInterface = assign({}, UIEventInterface, {
5884 relatedTarget: 0
5885 });
5886 var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
5887 var AnimationEventInterface = assign({}, EventInterface, {
5888 animationName: 0,
5889 elapsedTime: 0,
5890 pseudoElement: 0
5891 });
5892 var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
5893 var ClipboardEventInterface = assign({}, EventInterface, {
5894 clipboardData: function(event) {
5895 return "clipboardData" in event ? event.clipboardData : window.clipboardData;
5896 }
5897 });
5898 var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
5899 var CompositionEventInterface = assign({}, EventInterface, {
5900 data: 0
5901 });
5902 var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);
5903 var SyntheticInputEvent = SyntheticCompositionEvent;
5904 var normalizeKey = {
5905 Esc: "Escape",
5906 Spacebar: " ",
5907 Left: "ArrowLeft",
5908 Up: "ArrowUp",
5909 Right: "ArrowRight",
5910 Down: "ArrowDown",
5911 Del: "Delete",
5912 Win: "OS",
5913 Menu: "ContextMenu",
5914 Apps: "ContextMenu",
5915 Scroll: "ScrollLock",
5916 MozPrintableKey: "Unidentified"
5917 };
5918 var translateToKey = {
5919 "8": "Backspace",
5920 "9": "Tab",
5921 "12": "Clear",
5922 "13": "Enter",
5923 "16": "Shift",
5924 "17": "Control",
5925 "18": "Alt",
5926 "19": "Pause",
5927 "20": "CapsLock",
5928 "27": "Escape",
5929 "32": " ",
5930 "33": "PageUp",
5931 "34": "PageDown",
5932 "35": "End",
5933 "36": "Home",
5934 "37": "ArrowLeft",
5935 "38": "ArrowUp",
5936 "39": "ArrowRight",
5937 "40": "ArrowDown",
5938 "45": "Insert",
5939 "46": "Delete",
5940 "112": "F1",
5941 "113": "F2",
5942 "114": "F3",
5943 "115": "F4",
5944 "116": "F5",
5945 "117": "F6",
5946 "118": "F7",
5947 "119": "F8",
5948 "120": "F9",
5949 "121": "F10",
5950 "122": "F11",
5951 "123": "F12",
5952 "144": "NumLock",
5953 "145": "ScrollLock",
5954 "224": "Meta"
5955 };
5956 function getEventKey(nativeEvent) {
5957 if (nativeEvent.key) {
5958 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
5959 if (key !== "Unidentified") {
5960 return key;
5961 }
5962 }
5963 if (nativeEvent.type === "keypress") {
5964 var charCode = getEventCharCode(nativeEvent);
5965 return charCode === 13 ? "Enter" : String.fromCharCode(charCode);
5966 }
5967 if (nativeEvent.type === "keydown" || nativeEvent.type === "keyup") {
5968 return translateToKey[nativeEvent.keyCode] || "Unidentified";
5969 }
5970 return "";
5971 }
5972 var modifierKeyToProp = {
5973 Alt: "altKey",
5974 Control: "ctrlKey",
5975 Meta: "metaKey",
5976 Shift: "shiftKey"
5977 };
5978 function modifierStateGetter(keyArg) {
5979 var syntheticEvent = this;
5980 var nativeEvent = syntheticEvent.nativeEvent;
5981 if (nativeEvent.getModifierState) {
5982 return nativeEvent.getModifierState(keyArg);
5983 }
5984 var keyProp = modifierKeyToProp[keyArg];
5985 return keyProp ? !!nativeEvent[keyProp] : false;
5986 }
5987 function getEventModifierState(nativeEvent) {
5988 return modifierStateGetter;
5989 }
5990 var KeyboardEventInterface = assign({}, UIEventInterface, {
5991 key: getEventKey,
5992 code: 0,
5993 location: 0,
5994 ctrlKey: 0,
5995 shiftKey: 0,
5996 altKey: 0,
5997 metaKey: 0,
5998 repeat: 0,
5999 locale: 0,
6000 getModifierState: getEventModifierState,
6001 // Legacy Interface
6002 charCode: function(event) {
6003 if (event.type === "keypress") {
6004 return getEventCharCode(event);
6005 }
6006 return 0;
6007 },
6008 keyCode: function(event) {
6009 if (event.type === "keydown" || event.type === "keyup") {
6010 return event.keyCode;
6011 }
6012 return 0;
6013 },
6014 which: function(event) {
6015 if (event.type === "keypress") {
6016 return getEventCharCode(event);
6017 }
6018 if (event.type === "keydown" || event.type === "keyup") {
6019 return event.keyCode;
6020 }
6021 return 0;
6022 }
6023 });
6024 var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);
6025 var PointerEventInterface = assign({}, MouseEventInterface, {
6026 pointerId: 0,
6027 width: 0,
6028 height: 0,
6029 pressure: 0,
6030 tangentialPressure: 0,
6031 tiltX: 0,
6032 tiltY: 0,
6033 twist: 0,
6034 pointerType: 0,
6035 isPrimary: 0
6036 });
6037 var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);
6038 var TouchEventInterface = assign({}, UIEventInterface, {
6039 touches: 0,
6040 targetTouches: 0,
6041 changedTouches: 0,
6042 altKey: 0,
6043 metaKey: 0,
6044 ctrlKey: 0,
6045 shiftKey: 0,
6046 getModifierState: getEventModifierState
6047 });
6048 var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
6049 var TransitionEventInterface = assign({}, EventInterface, {
6050 propertyName: 0,
6051 elapsedTime: 0,
6052 pseudoElement: 0
6053 });
6054 var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
6055 var WheelEventInterface = assign({}, MouseEventInterface, {
6056 deltaX: function(event) {
6057 return "deltaX" in event ? event.deltaX : (
6058 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
6059 "wheelDeltaX" in event ? -event.wheelDeltaX : 0
6060 );
6061 },
6062 deltaY: function(event) {
6063 return "deltaY" in event ? event.deltaY : (
6064 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
6065 "wheelDeltaY" in event ? -event.wheelDeltaY : (
6066 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
6067 "wheelDelta" in event ? -event.wheelDelta : 0
6068 )
6069 );
6070 },
6071 deltaZ: 0,
6072 // Browsers without "deltaMode" is reporting in raw wheel delta where one
6073 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
6074 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
6075 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
6076 deltaMode: 0
6077 });
6078 var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);
6079 var END_KEYCODES = [9, 13, 27, 32];
6080 var START_KEYCODE = 229;
6081 var canUseCompositionEvent = canUseDOM && "CompositionEvent" in window;
6082 var documentMode = null;
6083 if (canUseDOM && "documentMode" in document) {
6084 documentMode = document.documentMode;
6085 }
6086 var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode;
6087 var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
6088 var SPACEBAR_CODE = 32;
6089 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
6090 function registerEvents() {
6091 registerTwoPhaseEvent("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
6092 registerTwoPhaseEvent("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6093 registerTwoPhaseEvent("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6094 registerTwoPhaseEvent("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
6095 }
6096 var hasSpaceKeypress = false;
6097 function isKeypressCommand(nativeEvent) {
6098 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
6099 !(nativeEvent.ctrlKey && nativeEvent.altKey);
6100 }
6101 function getCompositionEventType(domEventName) {
6102 switch (domEventName) {
6103 case "compositionstart":
6104 return "onCompositionStart";
6105 case "compositionend":
6106 return "onCompositionEnd";
6107 case "compositionupdate":
6108 return "onCompositionUpdate";
6109 }
6110 }
6111 function isFallbackCompositionStart(domEventName, nativeEvent) {
6112 return domEventName === "keydown" && nativeEvent.keyCode === START_KEYCODE;
6113 }
6114 function isFallbackCompositionEnd(domEventName, nativeEvent) {
6115 switch (domEventName) {
6116 case "keyup":
6117 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
6118 case "keydown":
6119 return nativeEvent.keyCode !== START_KEYCODE;
6120 case "keypress":
6121 case "mousedown":
6122 case "focusout":
6123 return true;
6124 default:
6125 return false;
6126 }
6127 }
6128 function getDataFromCustomEvent(nativeEvent) {
6129 var detail = nativeEvent.detail;
6130 if (typeof detail === "object" && "data" in detail) {
6131 return detail.data;
6132 }
6133 return null;
6134 }
6135 function isUsingKoreanIME(nativeEvent) {
6136 return nativeEvent.locale === "ko";
6137 }
6138 var isComposing = false;
6139 function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
6140 var eventType;
6141 var fallbackData;
6142 if (canUseCompositionEvent) {
6143 eventType = getCompositionEventType(domEventName);
6144 } else if (!isComposing) {
6145 if (isFallbackCompositionStart(domEventName, nativeEvent)) {
6146 eventType = "onCompositionStart";
6147 }
6148 } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {
6149 eventType = "onCompositionEnd";
6150 }
6151 if (!eventType) {
6152 return null;
6153 }
6154 if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
6155 if (!isComposing && eventType === "onCompositionStart") {
6156 isComposing = initialize(nativeEventTarget);
6157 } else if (eventType === "onCompositionEnd") {
6158 if (isComposing) {
6159 fallbackData = getData();
6160 }
6161 }
6162 }
6163 var listeners = accumulateTwoPhaseListeners(targetInst, eventType);
6164 if (listeners.length > 0) {
6165 var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);
6166 dispatchQueue.push({
6167 event,
6168 listeners
6169 });
6170 if (fallbackData) {
6171 event.data = fallbackData;
6172 } else {
6173 var customData = getDataFromCustomEvent(nativeEvent);
6174 if (customData !== null) {
6175 event.data = customData;
6176 }
6177 }
6178 }
6179 }
6180 function getNativeBeforeInputChars(domEventName, nativeEvent) {
6181 switch (domEventName) {
6182 case "compositionend":
6183 return getDataFromCustomEvent(nativeEvent);
6184 case "keypress":
6185 var which = nativeEvent.which;
6186 if (which !== SPACEBAR_CODE) {
6187 return null;
6188 }
6189 hasSpaceKeypress = true;
6190 return SPACEBAR_CHAR;
6191 case "textInput":
6192 var chars = nativeEvent.data;
6193 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
6194 return null;
6195 }
6196 return chars;
6197 default:
6198 return null;
6199 }
6200 }
6201 function getFallbackBeforeInputChars(domEventName, nativeEvent) {
6202 if (isComposing) {
6203 if (domEventName === "compositionend" || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {
6204 var chars = getData();
6205 reset();
6206 isComposing = false;
6207 return chars;
6208 }
6209 return null;
6210 }
6211 switch (domEventName) {
6212 case "paste":
6213 return null;
6214 case "keypress":
6215 if (!isKeypressCommand(nativeEvent)) {
6216 if (nativeEvent.char && nativeEvent.char.length > 1) {
6217 return nativeEvent.char;
6218 } else if (nativeEvent.which) {
6219 return String.fromCharCode(nativeEvent.which);
6220 }
6221 }
6222 return null;
6223 case "compositionend":
6224 return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
6225 default:
6226 return null;
6227 }
6228 }
6229 function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {
6230 var chars;
6231 if (canUseTextInputEvent) {
6232 chars = getNativeBeforeInputChars(domEventName, nativeEvent);
6233 } else {
6234 chars = getFallbackBeforeInputChars(domEventName, nativeEvent);
6235 }
6236 if (!chars) {
6237 return null;
6238 }
6239 var listeners = accumulateTwoPhaseListeners(targetInst, "onBeforeInput");
6240 if (listeners.length > 0) {
6241 var event = new SyntheticInputEvent("onBeforeInput", "beforeinput", null, nativeEvent, nativeEventTarget);
6242 dispatchQueue.push({
6243 event,
6244 listeners
6245 });
6246 event.data = chars;
6247 }
6248 }
6249 function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6250 extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
6251 extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
6252 }
6253 var supportedInputTypes = {
6254 color: true,
6255 date: true,
6256 datetime: true,
6257 "datetime-local": true,
6258 email: true,
6259 month: true,
6260 number: true,
6261 password: true,
6262 range: true,
6263 search: true,
6264 tel: true,
6265 text: true,
6266 time: true,
6267 url: true,
6268 week: true
6269 };
6270 function isTextInputElement(elem) {
6271 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
6272 if (nodeName === "input") {
6273 return !!supportedInputTypes[elem.type];
6274 }
6275 if (nodeName === "textarea") {
6276 return true;
6277 }
6278 return false;
6279 }
6280 function isEventSupported(eventNameSuffix) {
6281 if (!canUseDOM) {
6282 return false;
6283 }
6284 var eventName = "on" + eventNameSuffix;
6285 var isSupported = eventName in document;
6286 if (!isSupported) {
6287 var element = document.createElement("div");
6288 element.setAttribute(eventName, "return;");
6289 isSupported = typeof element[eventName] === "function";
6290 }
6291 return isSupported;
6292 }
6293 function registerEvents$1() {
6294 registerTwoPhaseEvent("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
6295 }
6296 function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
6297 enqueueStateRestore(target);
6298 var listeners = accumulateTwoPhaseListeners(inst, "onChange");
6299 if (listeners.length > 0) {
6300 var event = new SyntheticEvent("onChange", "change", null, nativeEvent, target);
6301 dispatchQueue.push({
6302 event,
6303 listeners
6304 });
6305 }
6306 }
6307 var activeElement = null;
6308 var activeElementInst = null;
6309 function shouldUseChangeEvent(elem) {
6310 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
6311 return nodeName === "select" || nodeName === "input" && elem.type === "file";
6312 }
6313 function manualDispatchChangeEvent(nativeEvent) {
6314 var dispatchQueue = [];
6315 createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
6316 batchedUpdates(runEventInBatch, dispatchQueue);
6317 }
6318 function runEventInBatch(dispatchQueue) {
6319 processDispatchQueue(dispatchQueue, 0);
6320 }
6321 function getInstIfValueChanged(targetInst) {
6322 var targetNode = getNodeFromInstance(targetInst);
6323 if (updateValueIfChanged(targetNode)) {
6324 return targetInst;
6325 }
6326 }
6327 function getTargetInstForChangeEvent(domEventName, targetInst) {
6328 if (domEventName === "change") {
6329 return targetInst;
6330 }
6331 }
6332 var isInputEventSupported = false;
6333 if (canUseDOM) {
6334 isInputEventSupported = isEventSupported("input") && (!document.documentMode || document.documentMode > 9);
6335 }
6336 function startWatchingForValueChange(target, targetInst) {
6337 activeElement = target;
6338 activeElementInst = targetInst;
6339 activeElement.attachEvent("onpropertychange", handlePropertyChange);
6340 }
6341 function stopWatchingForValueChange() {
6342 if (!activeElement) {
6343 return;
6344 }
6345 activeElement.detachEvent("onpropertychange", handlePropertyChange);
6346 activeElement = null;
6347 activeElementInst = null;
6348 }
6349 function handlePropertyChange(nativeEvent) {
6350 if (nativeEvent.propertyName !== "value") {
6351 return;
6352 }
6353 if (getInstIfValueChanged(activeElementInst)) {
6354 manualDispatchChangeEvent(nativeEvent);
6355 }
6356 }
6357 function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
6358 if (domEventName === "focusin") {
6359 stopWatchingForValueChange();
6360 startWatchingForValueChange(target, targetInst);
6361 } else if (domEventName === "focusout") {
6362 stopWatchingForValueChange();
6363 }
6364 }
6365 function getTargetInstForInputEventPolyfill(domEventName, targetInst) {
6366 if (domEventName === "selectionchange" || domEventName === "keyup" || domEventName === "keydown") {
6367 return getInstIfValueChanged(activeElementInst);
6368 }
6369 }
6370 function shouldUseClickEvent(elem) {
6371 var nodeName = elem.nodeName;
6372 return nodeName && nodeName.toLowerCase() === "input" && (elem.type === "checkbox" || elem.type === "radio");
6373 }
6374 function getTargetInstForClickEvent(domEventName, targetInst) {
6375 if (domEventName === "click") {
6376 return getInstIfValueChanged(targetInst);
6377 }
6378 }
6379 function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
6380 if (domEventName === "input" || domEventName === "change") {
6381 return getInstIfValueChanged(targetInst);
6382 }
6383 }
6384 function handleControlledInputBlur(node) {
6385 var state = node._wrapperState;
6386 if (!state || !state.controlled || node.type !== "number") {
6387 return;
6388 }
6389 {
6390 setDefaultValue(node, "number", node.value);
6391 }
6392 }
6393 function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6394 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
6395 var getTargetInstFunc, handleEventFunc;
6396 if (shouldUseChangeEvent(targetNode)) {
6397 getTargetInstFunc = getTargetInstForChangeEvent;
6398 } else if (isTextInputElement(targetNode)) {
6399 if (isInputEventSupported) {
6400 getTargetInstFunc = getTargetInstForInputOrChangeEvent;
6401 } else {
6402 getTargetInstFunc = getTargetInstForInputEventPolyfill;
6403 handleEventFunc = handleEventsForInputEventPolyfill;
6404 }
6405 } else if (shouldUseClickEvent(targetNode)) {
6406 getTargetInstFunc = getTargetInstForClickEvent;
6407 }
6408 if (getTargetInstFunc) {
6409 var inst = getTargetInstFunc(domEventName, targetInst);
6410 if (inst) {
6411 createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);
6412 return;
6413 }
6414 }
6415 if (handleEventFunc) {
6416 handleEventFunc(domEventName, targetNode, targetInst);
6417 }
6418 if (domEventName === "focusout") {
6419 handleControlledInputBlur(targetNode);
6420 }
6421 }
6422 function registerEvents$2() {
6423 registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
6424 registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
6425 registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
6426 registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
6427 }
6428 function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6429 var isOverEvent = domEventName === "mouseover" || domEventName === "pointerover";
6430 var isOutEvent = domEventName === "mouseout" || domEventName === "pointerout";
6431 if (isOverEvent && !isReplayingEvent(nativeEvent)) {
6432 var related = nativeEvent.relatedTarget || nativeEvent.fromElement;
6433 if (related) {
6434 if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {
6435 return;
6436 }
6437 }
6438 }
6439 if (!isOutEvent && !isOverEvent) {
6440 return;
6441 }
6442 var win;
6443 if (nativeEventTarget.window === nativeEventTarget) {
6444 win = nativeEventTarget;
6445 } else {
6446 var doc = nativeEventTarget.ownerDocument;
6447 if (doc) {
6448 win = doc.defaultView || doc.parentWindow;
6449 } else {
6450 win = window;
6451 }
6452 }
6453 var from;
6454 var to;
6455 if (isOutEvent) {
6456 var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
6457 from = targetInst;
6458 to = _related ? getClosestInstanceFromNode(_related) : null;
6459 if (to !== null) {
6460 var nearestMounted = getNearestMountedFiber(to);
6461 if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
6462 to = null;
6463 }
6464 }
6465 } else {
6466 from = null;
6467 to = targetInst;
6468 }
6469 if (from === to) {
6470 return;
6471 }
6472 var SyntheticEventCtor = SyntheticMouseEvent;
6473 var leaveEventType = "onMouseLeave";
6474 var enterEventType = "onMouseEnter";
6475 var eventTypePrefix = "mouse";
6476 if (domEventName === "pointerout" || domEventName === "pointerover") {
6477 SyntheticEventCtor = SyntheticPointerEvent;
6478 leaveEventType = "onPointerLeave";
6479 enterEventType = "onPointerEnter";
6480 eventTypePrefix = "pointer";
6481 }
6482 var fromNode = from == null ? win : getNodeFromInstance(from);
6483 var toNode = to == null ? win : getNodeFromInstance(to);
6484 var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from, nativeEvent, nativeEventTarget);
6485 leave.target = fromNode;
6486 leave.relatedTarget = toNode;
6487 var enter = null;
6488 var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);
6489 if (nativeTargetInst === targetInst) {
6490 var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + "enter", to, nativeEvent, nativeEventTarget);
6491 enterEvent.target = toNode;
6492 enterEvent.relatedTarget = fromNode;
6493 enter = enterEvent;
6494 }
6495 accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);
6496 }
6497 function is(x, y) {
6498 return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
6499 }
6500 var objectIs = typeof Object.is === "function" ? Object.is : is;
6501 function shallowEqual(objA, objB) {
6502 if (objectIs(objA, objB)) {
6503 return true;
6504 }
6505 if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
6506 return false;
6507 }
6508 var keysA = Object.keys(objA);
6509 var keysB = Object.keys(objB);
6510 if (keysA.length !== keysB.length) {
6511 return false;
6512 }
6513 for (var i = 0; i < keysA.length; i++) {
6514 var currentKey = keysA[i];
6515 if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
6516 return false;
6517 }
6518 }
6519 return true;
6520 }
6521 function getLeafNode(node) {
6522 while (node && node.firstChild) {
6523 node = node.firstChild;
6524 }
6525 return node;
6526 }
6527 function getSiblingNode(node) {
6528 while (node) {
6529 if (node.nextSibling) {
6530 return node.nextSibling;
6531 }
6532 node = node.parentNode;
6533 }
6534 }
6535 function getNodeForCharacterOffset(root2, offset) {
6536 var node = getLeafNode(root2);
6537 var nodeStart = 0;
6538 var nodeEnd = 0;
6539 while (node) {
6540 if (node.nodeType === TEXT_NODE) {
6541 nodeEnd = nodeStart + node.textContent.length;
6542 if (nodeStart <= offset && nodeEnd >= offset) {
6543 return {
6544 node,
6545 offset: offset - nodeStart
6546 };
6547 }
6548 nodeStart = nodeEnd;
6549 }
6550 node = getLeafNode(getSiblingNode(node));
6551 }
6552 }
6553 function getOffsets(outerNode) {
6554 var ownerDocument = outerNode.ownerDocument;
6555 var win = ownerDocument && ownerDocument.defaultView || window;
6556 var selection = win.getSelection && win.getSelection();
6557 if (!selection || selection.rangeCount === 0) {
6558 return null;
6559 }
6560 var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset;
6561 try {
6562 anchorNode.nodeType;
6563 focusNode.nodeType;
6564 } catch (e) {
6565 return null;
6566 }
6567 return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
6568 }
6569 function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
6570 var length = 0;
6571 var start = -1;
6572 var end = -1;
6573 var indexWithinAnchor = 0;
6574 var indexWithinFocus = 0;
6575 var node = outerNode;
6576 var parentNode = null;
6577 outer: while (true) {
6578 var next = null;
6579 while (true) {
6580 if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
6581 start = length + anchorOffset;
6582 }
6583 if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
6584 end = length + focusOffset;
6585 }
6586 if (node.nodeType === TEXT_NODE) {
6587 length += node.nodeValue.length;
6588 }
6589 if ((next = node.firstChild) === null) {
6590 break;
6591 }
6592 parentNode = node;
6593 node = next;
6594 }
6595 while (true) {
6596 if (node === outerNode) {
6597 break outer;
6598 }
6599 if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
6600 start = length;
6601 }
6602 if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
6603 end = length;
6604 }
6605 if ((next = node.nextSibling) !== null) {
6606 break;
6607 }
6608 node = parentNode;
6609 parentNode = node.parentNode;
6610 }
6611 node = next;
6612 }
6613 if (start === -1 || end === -1) {
6614 return null;
6615 }
6616 return {
6617 start,
6618 end
6619 };
6620 }
6621 function setOffsets(node, offsets) {
6622 var doc = node.ownerDocument || document;
6623 var win = doc && doc.defaultView || window;
6624 if (!win.getSelection) {
6625 return;
6626 }
6627 var selection = win.getSelection();
6628 var length = node.textContent.length;
6629 var start = Math.min(offsets.start, length);
6630 var end = offsets.end === void 0 ? start : Math.min(offsets.end, length);
6631 if (!selection.extend && start > end) {
6632 var temp = end;
6633 end = start;
6634 start = temp;
6635 }
6636 var startMarker = getNodeForCharacterOffset(node, start);
6637 var endMarker = getNodeForCharacterOffset(node, end);
6638 if (startMarker && endMarker) {
6639 if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
6640 return;
6641 }
6642 var range = doc.createRange();
6643 range.setStart(startMarker.node, startMarker.offset);
6644 selection.removeAllRanges();
6645 if (start > end) {
6646 selection.addRange(range);
6647 selection.extend(endMarker.node, endMarker.offset);
6648 } else {
6649 range.setEnd(endMarker.node, endMarker.offset);
6650 selection.addRange(range);
6651 }
6652 }
6653 }
6654 function isTextNode(node) {
6655 return node && node.nodeType === TEXT_NODE;
6656 }
6657 function containsNode(outerNode, innerNode) {
6658 if (!outerNode || !innerNode) {
6659 return false;
6660 } else if (outerNode === innerNode) {
6661 return true;
6662 } else if (isTextNode(outerNode)) {
6663 return false;
6664 } else if (isTextNode(innerNode)) {
6665 return containsNode(outerNode, innerNode.parentNode);
6666 } else if ("contains" in outerNode) {
6667 return outerNode.contains(innerNode);
6668 } else if (outerNode.compareDocumentPosition) {
6669 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
6670 } else {
6671 return false;
6672 }
6673 }
6674 function isInDocument(node) {
6675 return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
6676 }
6677 function isSameOriginFrame(iframe) {
6678 try {
6679 return typeof iframe.contentWindow.location.href === "string";
6680 } catch (err) {
6681 return false;
6682 }
6683 }
6684 function getActiveElementDeep() {
6685 var win = window;
6686 var element = getActiveElement();
6687 while (element instanceof win.HTMLIFrameElement) {
6688 if (isSameOriginFrame(element)) {
6689 win = element.contentWindow;
6690 } else {
6691 return element;
6692 }
6693 element = getActiveElement(win.document);
6694 }
6695 return element;
6696 }
6697 function hasSelectionCapabilities(elem) {
6698 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
6699 return nodeName && (nodeName === "input" && (elem.type === "text" || elem.type === "search" || elem.type === "tel" || elem.type === "url" || elem.type === "password") || nodeName === "textarea" || elem.contentEditable === "true");
6700 }
6701 function getSelectionInformation() {
6702 var focusedElem = getActiveElementDeep();
6703 return {
6704 focusedElem,
6705 selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
6706 };
6707 }
6708 function restoreSelection(priorSelectionInformation) {
6709 var curFocusedElem = getActiveElementDeep();
6710 var priorFocusedElem = priorSelectionInformation.focusedElem;
6711 var priorSelectionRange = priorSelectionInformation.selectionRange;
6712 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
6713 if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
6714 setSelection(priorFocusedElem, priorSelectionRange);
6715 }
6716 var ancestors = [];
6717 var ancestor = priorFocusedElem;
6718 while (ancestor = ancestor.parentNode) {
6719 if (ancestor.nodeType === ELEMENT_NODE) {
6720 ancestors.push({
6721 element: ancestor,
6722 left: ancestor.scrollLeft,
6723 top: ancestor.scrollTop
6724 });
6725 }
6726 }
6727 if (typeof priorFocusedElem.focus === "function") {
6728 priorFocusedElem.focus();
6729 }
6730 for (var i = 0; i < ancestors.length; i++) {
6731 var info = ancestors[i];
6732 info.element.scrollLeft = info.left;
6733 info.element.scrollTop = info.top;
6734 }
6735 }
6736 }
6737 function getSelection(input) {
6738 var selection;
6739 if ("selectionStart" in input) {
6740 selection = {
6741 start: input.selectionStart,
6742 end: input.selectionEnd
6743 };
6744 } else {
6745 selection = getOffsets(input);
6746 }
6747 return selection || {
6748 start: 0,
6749 end: 0
6750 };
6751 }
6752 function setSelection(input, offsets) {
6753 var start = offsets.start;
6754 var end = offsets.end;
6755 if (end === void 0) {
6756 end = start;
6757 }
6758 if ("selectionStart" in input) {
6759 input.selectionStart = start;
6760 input.selectionEnd = Math.min(end, input.value.length);
6761 } else {
6762 setOffsets(input, offsets);
6763 }
6764 }
6765 var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document.documentMode <= 11;
6766 function registerEvents$3() {
6767 registerTwoPhaseEvent("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
6768 }
6769 var activeElement$1 = null;
6770 var activeElementInst$1 = null;
6771 var lastSelection = null;
6772 var mouseDown = false;
6773 function getSelection$1(node) {
6774 if ("selectionStart" in node && hasSelectionCapabilities(node)) {
6775 return {
6776 start: node.selectionStart,
6777 end: node.selectionEnd
6778 };
6779 } else {
6780 var win = node.ownerDocument && node.ownerDocument.defaultView || window;
6781 var selection = win.getSelection();
6782 return {
6783 anchorNode: selection.anchorNode,
6784 anchorOffset: selection.anchorOffset,
6785 focusNode: selection.focusNode,
6786 focusOffset: selection.focusOffset
6787 };
6788 }
6789 }
6790 function getEventTargetDocument(eventTarget) {
6791 return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
6792 }
6793 function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
6794 var doc = getEventTargetDocument(nativeEventTarget);
6795 if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
6796 return;
6797 }
6798 var currentSelection = getSelection$1(activeElement$1);
6799 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
6800 lastSelection = currentSelection;
6801 var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect");
6802 if (listeners.length > 0) {
6803 var event = new SyntheticEvent("onSelect", "select", null, nativeEvent, nativeEventTarget);
6804 dispatchQueue.push({
6805 event,
6806 listeners
6807 });
6808 event.target = activeElement$1;
6809 }
6810 }
6811 }
6812 function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6813 var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;
6814 switch (domEventName) {
6815 // Track the input node that has focus.
6816 case "focusin":
6817 if (isTextInputElement(targetNode) || targetNode.contentEditable === "true") {
6818 activeElement$1 = targetNode;
6819 activeElementInst$1 = targetInst;
6820 lastSelection = null;
6821 }
6822 break;
6823 case "focusout":
6824 activeElement$1 = null;
6825 activeElementInst$1 = null;
6826 lastSelection = null;
6827 break;
6828 // Don't fire the event while the user is dragging. This matches the
6829 // semantics of the native select event.
6830 case "mousedown":
6831 mouseDown = true;
6832 break;
6833 case "contextmenu":
6834 case "mouseup":
6835 case "dragend":
6836 mouseDown = false;
6837 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
6838 break;
6839 // Chrome and IE fire non-standard event when selection is changed (and
6840 // sometimes when it hasn't). IE's event fires out of order with respect
6841 // to key and input events on deletion, so we discard it.
6842 //
6843 // Firefox doesn't support selectionchange, so check selection status
6844 // after each key entry. The selection changes after keydown and before
6845 // keyup, but we check on keydown as well in the case of holding down a
6846 // key, when multiple keydown events are fired but only one keyup is.
6847 // This is also our approach for IE handling, for the reason above.
6848 case "selectionchange":
6849 if (skipSelectionChangeEvent) {
6850 break;
6851 }
6852 // falls through
6853 case "keydown":
6854 case "keyup":
6855 constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
6856 }
6857 }
6858 function makePrefixMap(styleProp, eventName) {
6859 var prefixes2 = {};
6860 prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
6861 prefixes2["Webkit" + styleProp] = "webkit" + eventName;
6862 prefixes2["Moz" + styleProp] = "moz" + eventName;
6863 return prefixes2;
6864 }
6865 var vendorPrefixes = {
6866 animationend: makePrefixMap("Animation", "AnimationEnd"),
6867 animationiteration: makePrefixMap("Animation", "AnimationIteration"),
6868 animationstart: makePrefixMap("Animation", "AnimationStart"),
6869 transitionend: makePrefixMap("Transition", "TransitionEnd")
6870 };
6871 var prefixedEventNames = {};
6872 var style = {};
6873 if (canUseDOM) {
6874 style = document.createElement("div").style;
6875 if (!("AnimationEvent" in window)) {
6876 delete vendorPrefixes.animationend.animation;
6877 delete vendorPrefixes.animationiteration.animation;
6878 delete vendorPrefixes.animationstart.animation;
6879 }
6880 if (!("TransitionEvent" in window)) {
6881 delete vendorPrefixes.transitionend.transition;
6882 }
6883 }
6884 function getVendorPrefixedEventName(eventName) {
6885 if (prefixedEventNames[eventName]) {
6886 return prefixedEventNames[eventName];
6887 } else if (!vendorPrefixes[eventName]) {
6888 return eventName;
6889 }
6890 var prefixMap = vendorPrefixes[eventName];
6891 for (var styleProp in prefixMap) {
6892 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
6893 return prefixedEventNames[eventName] = prefixMap[styleProp];
6894 }
6895 }
6896 return eventName;
6897 }
6898 var ANIMATION_END = getVendorPrefixedEventName("animationend");
6899 var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration");
6900 var ANIMATION_START = getVendorPrefixedEventName("animationstart");
6901 var TRANSITION_END = getVendorPrefixedEventName("transitionend");
6902 var topLevelEventsToReactNames = /* @__PURE__ */ new Map();
6903 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"];
6904 function registerSimpleEvent(domEventName, reactName) {
6905 topLevelEventsToReactNames.set(domEventName, reactName);
6906 registerTwoPhaseEvent(reactName, [domEventName]);
6907 }
6908 function registerSimpleEvents() {
6909 for (var i = 0; i < simpleEventPluginEvents.length; i++) {
6910 var eventName = simpleEventPluginEvents[i];
6911 var domEventName = eventName.toLowerCase();
6912 var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
6913 registerSimpleEvent(domEventName, "on" + capitalizedEvent);
6914 }
6915 registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
6916 registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
6917 registerSimpleEvent(ANIMATION_START, "onAnimationStart");
6918 registerSimpleEvent("dblclick", "onDoubleClick");
6919 registerSimpleEvent("focusin", "onFocus");
6920 registerSimpleEvent("focusout", "onBlur");
6921 registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
6922 }
6923 function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
6924 var reactName = topLevelEventsToReactNames.get(domEventName);
6925 if (reactName === void 0) {
6926 return;
6927 }
6928 var SyntheticEventCtor = SyntheticEvent;
6929 var reactEventType = domEventName;
6930 switch (domEventName) {
6931 case "keypress":
6932 if (getEventCharCode(nativeEvent) === 0) {
6933 return;
6934 }
6935 /* falls through */
6936 case "keydown":
6937 case "keyup":
6938 SyntheticEventCtor = SyntheticKeyboardEvent;
6939 break;
6940 case "focusin":
6941 reactEventType = "focus";
6942 SyntheticEventCtor = SyntheticFocusEvent;
6943 break;
6944 case "focusout":
6945 reactEventType = "blur";
6946 SyntheticEventCtor = SyntheticFocusEvent;
6947 break;
6948 case "beforeblur":
6949 case "afterblur":
6950 SyntheticEventCtor = SyntheticFocusEvent;
6951 break;
6952 case "click":
6953 if (nativeEvent.button === 2) {
6954 return;
6955 }
6956 /* falls through */
6957 case "auxclick":
6958 case "dblclick":
6959 case "mousedown":
6960 case "mousemove":
6961 case "mouseup":
6962 // TODO: Disabled elements should not respond to mouse events
6963 /* falls through */
6964 case "mouseout":
6965 case "mouseover":
6966 case "contextmenu":
6967 SyntheticEventCtor = SyntheticMouseEvent;
6968 break;
6969 case "drag":
6970 case "dragend":
6971 case "dragenter":
6972 case "dragexit":
6973 case "dragleave":
6974 case "dragover":
6975 case "dragstart":
6976 case "drop":
6977 SyntheticEventCtor = SyntheticDragEvent;
6978 break;
6979 case "touchcancel":
6980 case "touchend":
6981 case "touchmove":
6982 case "touchstart":
6983 SyntheticEventCtor = SyntheticTouchEvent;
6984 break;
6985 case ANIMATION_END:
6986 case ANIMATION_ITERATION:
6987 case ANIMATION_START:
6988 SyntheticEventCtor = SyntheticAnimationEvent;
6989 break;
6990 case TRANSITION_END:
6991 SyntheticEventCtor = SyntheticTransitionEvent;
6992 break;
6993 case "scroll":
6994 SyntheticEventCtor = SyntheticUIEvent;
6995 break;
6996 case "wheel":
6997 SyntheticEventCtor = SyntheticWheelEvent;
6998 break;
6999 case "copy":
7000 case "cut":
7001 case "paste":
7002 SyntheticEventCtor = SyntheticClipboardEvent;
7003 break;
7004 case "gotpointercapture":
7005 case "lostpointercapture":
7006 case "pointercancel":
7007 case "pointerdown":
7008 case "pointermove":
7009 case "pointerout":
7010 case "pointerover":
7011 case "pointerup":
7012 SyntheticEventCtor = SyntheticPointerEvent;
7013 break;
7014 }
7015 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
7016 {
7017 var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from
7018 // nonDelegatedEvents list in DOMPluginEventSystem.
7019 // Then we can remove this special list.
7020 // This is a breaking change that can wait until React 18.
7021 domEventName === "scroll";
7022 var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);
7023 if (_listeners.length > 0) {
7024 var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);
7025 dispatchQueue.push({
7026 event: _event,
7027 listeners: _listeners
7028 });
7029 }
7030 }
7031 }
7032 registerSimpleEvents();
7033 registerEvents$2();
7034 registerEvents$1();
7035 registerEvents$3();
7036 registerEvents();
7037 function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
7038 extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
7039 var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0;
7040 if (shouldProcessPolyfillPlugins) {
7041 extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7042 extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7043 extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7044 extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);
7045 }
7046 }
7047 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"];
7048 var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes));
7049 function executeDispatch(event, listener, currentTarget) {
7050 var type = event.type || "unknown-event";
7051 event.currentTarget = currentTarget;
7052 invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
7053 event.currentTarget = null;
7054 }
7055 function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {
7056 var previousInstance;
7057 if (inCapturePhase) {
7058 for (var i = dispatchListeners.length - 1; i >= 0; i--) {
7059 var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener;
7060 if (instance !== previousInstance && event.isPropagationStopped()) {
7061 return;
7062 }
7063 executeDispatch(event, listener, currentTarget);
7064 previousInstance = instance;
7065 }
7066 } else {
7067 for (var _i = 0; _i < dispatchListeners.length; _i++) {
7068 var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener;
7069 if (_instance !== previousInstance && event.isPropagationStopped()) {
7070 return;
7071 }
7072 executeDispatch(event, _listener, _currentTarget);
7073 previousInstance = _instance;
7074 }
7075 }
7076 }
7077 function processDispatchQueue(dispatchQueue, eventSystemFlags) {
7078 var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;
7079 for (var i = 0; i < dispatchQueue.length; i++) {
7080 var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners;
7081 processDispatchQueueItemsInOrder(event, listeners, inCapturePhase);
7082 }
7083 rethrowCaughtError();
7084 }
7085 function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
7086 var nativeEventTarget = getEventTarget(nativeEvent);
7087 var dispatchQueue = [];
7088 extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
7089 processDispatchQueue(dispatchQueue, eventSystemFlags);
7090 }
7091 function listenToNonDelegatedEvent(domEventName, targetElement) {
7092 {
7093 if (!nonDelegatedEvents.has(domEventName)) {
7094 error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
7095 }
7096 }
7097 var isCapturePhaseListener = false;
7098 var listenerSet = getEventListenerSet(targetElement);
7099 var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);
7100 if (!listenerSet.has(listenerSetKey)) {
7101 addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);
7102 listenerSet.add(listenerSetKey);
7103 }
7104 }
7105 function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
7106 {
7107 if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
7108 error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
7109 }
7110 }
7111 var eventSystemFlags = 0;
7112 if (isCapturePhaseListener) {
7113 eventSystemFlags |= IS_CAPTURE_PHASE;
7114 }
7115 addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
7116 }
7117 var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
7118 function listenToAllSupportedEvents(rootContainerElement) {
7119 if (!rootContainerElement[listeningMarker]) {
7120 rootContainerElement[listeningMarker] = true;
7121 allNativeEvents.forEach(function(domEventName) {
7122 if (domEventName !== "selectionchange") {
7123 if (!nonDelegatedEvents.has(domEventName)) {
7124 listenToNativeEvent(domEventName, false, rootContainerElement);
7125 }
7126 listenToNativeEvent(domEventName, true, rootContainerElement);
7127 }
7128 });
7129 var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
7130 if (ownerDocument !== null) {
7131 if (!ownerDocument[listeningMarker]) {
7132 ownerDocument[listeningMarker] = true;
7133 listenToNativeEvent("selectionchange", false, ownerDocument);
7134 }
7135 }
7136 }
7137 }
7138 function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {
7139 var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags);
7140 var isPassiveListener = void 0;
7141 if (passiveBrowserEventsSupported) {
7142 if (domEventName === "touchstart" || domEventName === "touchmove" || domEventName === "wheel") {
7143 isPassiveListener = true;
7144 }
7145 }
7146 targetContainer = targetContainer;
7147 var unsubscribeListener;
7148 if (isCapturePhaseListener) {
7149 if (isPassiveListener !== void 0) {
7150 unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
7151 } else {
7152 unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);
7153 }
7154 } else {
7155 if (isPassiveListener !== void 0) {
7156 unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);
7157 } else {
7158 unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);
7159 }
7160 }
7161 }
7162 function isMatchingRootContainer(grandContainer, targetContainer) {
7163 return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;
7164 }
7165 function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {
7166 var ancestorInst = targetInst;
7167 if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {
7168 var targetContainerNode = targetContainer;
7169 if (targetInst !== null) {
7170 var node = targetInst;
7171 mainLoop: while (true) {
7172 if (node === null) {
7173 return;
7174 }
7175 var nodeTag = node.tag;
7176 if (nodeTag === HostRoot || nodeTag === HostPortal) {
7177 var container = node.stateNode.containerInfo;
7178 if (isMatchingRootContainer(container, targetContainerNode)) {
7179 break;
7180 }
7181 if (nodeTag === HostPortal) {
7182 var grandNode = node.return;
7183 while (grandNode !== null) {
7184 var grandTag = grandNode.tag;
7185 if (grandTag === HostRoot || grandTag === HostPortal) {
7186 var grandContainer = grandNode.stateNode.containerInfo;
7187 if (isMatchingRootContainer(grandContainer, targetContainerNode)) {
7188 return;
7189 }
7190 }
7191 grandNode = grandNode.return;
7192 }
7193 }
7194 while (container !== null) {
7195 var parentNode = getClosestInstanceFromNode(container);
7196 if (parentNode === null) {
7197 return;
7198 }
7199 var parentTag = parentNode.tag;
7200 if (parentTag === HostComponent || parentTag === HostText) {
7201 node = ancestorInst = parentNode;
7202 continue mainLoop;
7203 }
7204 container = container.parentNode;
7205 }
7206 }
7207 node = node.return;
7208 }
7209 }
7210 }
7211 batchedUpdates(function() {
7212 return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
7213 });
7214 }
7215 function createDispatchListener(instance, listener, currentTarget) {
7216 return {
7217 instance,
7218 listener,
7219 currentTarget
7220 };
7221 }
7222 function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
7223 var captureName = reactName !== null ? reactName + "Capture" : null;
7224 var reactEventName = inCapturePhase ? captureName : reactName;
7225 var listeners = [];
7226 var instance = targetFiber;
7227 var lastHostComponent = null;
7228 while (instance !== null) {
7229 var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag;
7230 if (tag === HostComponent && stateNode !== null) {
7231 lastHostComponent = stateNode;
7232 if (reactEventName !== null) {
7233 var listener = getListener(instance, reactEventName);
7234 if (listener != null) {
7235 listeners.push(createDispatchListener(instance, listener, lastHostComponent));
7236 }
7237 }
7238 }
7239 if (accumulateTargetOnly) {
7240 break;
7241 }
7242 instance = instance.return;
7243 }
7244 return listeners;
7245 }
7246 function accumulateTwoPhaseListeners(targetFiber, reactName) {
7247 var captureName = reactName + "Capture";
7248 var listeners = [];
7249 var instance = targetFiber;
7250 while (instance !== null) {
7251 var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;
7252 if (tag === HostComponent && stateNode !== null) {
7253 var currentTarget = stateNode;
7254 var captureListener = getListener(instance, captureName);
7255 if (captureListener != null) {
7256 listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
7257 }
7258 var bubbleListener = getListener(instance, reactName);
7259 if (bubbleListener != null) {
7260 listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
7261 }
7262 }
7263 instance = instance.return;
7264 }
7265 return listeners;
7266 }
7267 function getParent(inst) {
7268 if (inst === null) {
7269 return null;
7270 }
7271 do {
7272 inst = inst.return;
7273 } while (inst && inst.tag !== HostComponent);
7274 if (inst) {
7275 return inst;
7276 }
7277 return null;
7278 }
7279 function getLowestCommonAncestor(instA, instB) {
7280 var nodeA = instA;
7281 var nodeB = instB;
7282 var depthA = 0;
7283 for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
7284 depthA++;
7285 }
7286 var depthB = 0;
7287 for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
7288 depthB++;
7289 }
7290 while (depthA - depthB > 0) {
7291 nodeA = getParent(nodeA);
7292 depthA--;
7293 }
7294 while (depthB - depthA > 0) {
7295 nodeB = getParent(nodeB);
7296 depthB--;
7297 }
7298 var depth = depthA;
7299 while (depth--) {
7300 if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
7301 return nodeA;
7302 }
7303 nodeA = getParent(nodeA);
7304 nodeB = getParent(nodeB);
7305 }
7306 return null;
7307 }
7308 function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
7309 var registrationName = event._reactName;
7310 var listeners = [];
7311 var instance = target;
7312 while (instance !== null) {
7313 if (instance === common) {
7314 break;
7315 }
7316 var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
7317 if (alternate !== null && alternate === common) {
7318 break;
7319 }
7320 if (tag === HostComponent && stateNode !== null) {
7321 var currentTarget = stateNode;
7322 if (inCapturePhase) {
7323 var captureListener = getListener(instance, registrationName);
7324 if (captureListener != null) {
7325 listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
7326 }
7327 } else if (!inCapturePhase) {
7328 var bubbleListener = getListener(instance, registrationName);
7329 if (bubbleListener != null) {
7330 listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
7331 }
7332 }
7333 }
7334 instance = instance.return;
7335 }
7336 if (listeners.length !== 0) {
7337 dispatchQueue.push({
7338 event,
7339 listeners
7340 });
7341 }
7342 }
7343 function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
7344 var common = from && to ? getLowestCommonAncestor(from, to) : null;
7345 if (from !== null) {
7346 accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
7347 }
7348 if (to !== null && enterEvent !== null) {
7349 accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
7350 }
7351 }
7352 function getListenerSetKey(domEventName, capture) {
7353 return domEventName + "__" + (capture ? "capture" : "bubble");
7354 }
7355 var didWarnInvalidHydration = false;
7356 var DANGEROUSLY_SET_INNER_HTML = "dangerouslySetInnerHTML";
7357 var SUPPRESS_CONTENT_EDITABLE_WARNING = "suppressContentEditableWarning";
7358 var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning";
7359 var AUTOFOCUS = "autoFocus";
7360 var CHILDREN = "children";
7361 var STYLE = "style";
7362 var HTML$1 = "__html";
7363 var warnedUnknownTags;
7364 var validatePropertiesInDevelopment;
7365 var warnForPropDifference;
7366 var warnForExtraAttributes;
7367 var warnForInvalidEventListener;
7368 var canDiffStyleForHydrationWarning;
7369 var normalizeHTML;
7370 {
7371 warnedUnknownTags = {
7372 // There are working polyfills for <dialog>. Let people use it.
7373 dialog: true,
7374 // Electron ships a custom <webview> tag to display external web content in
7375 // an isolated frame and process.
7376 // This tag is not present in non Electron environments such as JSDom which
7377 // is often used for testing purposes.
7378 // @see https://electronjs.org/docs/api/webview-tag
7379 webview: true
7380 };
7381 validatePropertiesInDevelopment = function(type, props) {
7382 validateProperties(type, props);
7383 validateProperties$1(type, props);
7384 validateProperties$2(type, props, {
7385 registrationNameDependencies,
7386 possibleRegistrationNames
7387 });
7388 };
7389 canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
7390 warnForPropDifference = function(propName, serverValue, clientValue) {
7391 if (didWarnInvalidHydration) {
7392 return;
7393 }
7394 var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
7395 var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
7396 if (normalizedServerValue === normalizedClientValue) {
7397 return;
7398 }
7399 didWarnInvalidHydration = true;
7400 error("Prop `%s` did not match. Server: %s Client: %s", propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
7401 };
7402 warnForExtraAttributes = function(attributeNames) {
7403 if (didWarnInvalidHydration) {
7404 return;
7405 }
7406 didWarnInvalidHydration = true;
7407 var names = [];
7408 attributeNames.forEach(function(name) {
7409 names.push(name);
7410 });
7411 error("Extra attributes from the server: %s", names);
7412 };
7413 warnForInvalidEventListener = function(registrationName, listener) {
7414 if (listener === false) {
7415 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);
7416 } else {
7417 error("Expected `%s` listener to be a function, instead got a value of `%s` type.", registrationName, typeof listener);
7418 }
7419 };
7420 normalizeHTML = function(parent, html) {
7421 var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
7422 testElement.innerHTML = html;
7423 return testElement.innerHTML;
7424 };
7425 }
7426 var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
7427 var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
7428 function normalizeMarkupForTextOrAttribute(markup) {
7429 {
7430 checkHtmlStringCoercion(markup);
7431 }
7432 var markupString = typeof markup === "string" ? markup : "" + markup;
7433 return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
7434 }
7435 function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
7436 var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
7437 var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
7438 if (normalizedServerText === normalizedClientText) {
7439 return;
7440 }
7441 if (shouldWarnDev) {
7442 {
7443 if (!didWarnInvalidHydration) {
7444 didWarnInvalidHydration = true;
7445 error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
7446 }
7447 }
7448 }
7449 if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
7450 throw new Error("Text content does not match server-rendered HTML.");
7451 }
7452 }
7453 function getOwnerDocumentFromRootContainer(rootContainerElement) {
7454 return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
7455 }
7456 function noop() {
7457 }
7458 function trapClickOnNonInteractiveElement(node) {
7459 node.onclick = noop;
7460 }
7461 function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
7462 for (var propKey in nextProps) {
7463 if (!nextProps.hasOwnProperty(propKey)) {
7464 continue;
7465 }
7466 var nextProp = nextProps[propKey];
7467 if (propKey === STYLE) {
7468 {
7469 if (nextProp) {
7470 Object.freeze(nextProp);
7471 }
7472 }
7473 setValueForStyles(domElement, nextProp);
7474 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7475 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7476 if (nextHtml != null) {
7477 setInnerHTML(domElement, nextHtml);
7478 }
7479 } else if (propKey === CHILDREN) {
7480 if (typeof nextProp === "string") {
7481 var canSetTextContent = tag !== "textarea" || nextProp !== "";
7482 if (canSetTextContent) {
7483 setTextContent(domElement, nextProp);
7484 }
7485 } else if (typeof nextProp === "number") {
7486 setTextContent(domElement, "" + nextProp);
7487 }
7488 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7489 else if (propKey === AUTOFOCUS) ;
7490 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7491 if (nextProp != null) {
7492 if (typeof nextProp !== "function") {
7493 warnForInvalidEventListener(propKey, nextProp);
7494 }
7495 if (propKey === "onScroll") {
7496 listenToNonDelegatedEvent("scroll", domElement);
7497 }
7498 }
7499 } else if (nextProp != null) {
7500 setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
7501 }
7502 }
7503 }
7504 function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
7505 for (var i = 0; i < updatePayload.length; i += 2) {
7506 var propKey = updatePayload[i];
7507 var propValue = updatePayload[i + 1];
7508 if (propKey === STYLE) {
7509 setValueForStyles(domElement, propValue);
7510 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7511 setInnerHTML(domElement, propValue);
7512 } else if (propKey === CHILDREN) {
7513 setTextContent(domElement, propValue);
7514 } else {
7515 setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
7516 }
7517 }
7518 }
7519 function createElement(type, props, rootContainerElement, parentNamespace) {
7520 var isCustomComponentTag;
7521 var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
7522 var domElement;
7523 var namespaceURI = parentNamespace;
7524 if (namespaceURI === HTML_NAMESPACE) {
7525 namespaceURI = getIntrinsicNamespace(type);
7526 }
7527 if (namespaceURI === HTML_NAMESPACE) {
7528 {
7529 isCustomComponentTag = isCustomComponent(type, props);
7530 if (!isCustomComponentTag && type !== type.toLowerCase()) {
7531 error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type);
7532 }
7533 }
7534 if (type === "script") {
7535 var div = ownerDocument.createElement("div");
7536 div.innerHTML = "<script><\/script>";
7537 var firstChild = div.firstChild;
7538 domElement = div.removeChild(firstChild);
7539 } else if (typeof props.is === "string") {
7540 domElement = ownerDocument.createElement(type, {
7541 is: props.is
7542 });
7543 } else {
7544 domElement = ownerDocument.createElement(type);
7545 if (type === "select") {
7546 var node = domElement;
7547 if (props.multiple) {
7548 node.multiple = true;
7549 } else if (props.size) {
7550 node.size = props.size;
7551 }
7552 }
7553 }
7554 } else {
7555 domElement = ownerDocument.createElementNS(namespaceURI, type);
7556 }
7557 {
7558 if (namespaceURI === HTML_NAMESPACE) {
7559 if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty.call(warnedUnknownTags, type)) {
7560 warnedUnknownTags[type] = true;
7561 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);
7562 }
7563 }
7564 }
7565 return domElement;
7566 }
7567 function createTextNode(text, rootContainerElement) {
7568 return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
7569 }
7570 function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
7571 var isCustomComponentTag = isCustomComponent(tag, rawProps);
7572 {
7573 validatePropertiesInDevelopment(tag, rawProps);
7574 }
7575 var props;
7576 switch (tag) {
7577 case "dialog":
7578 listenToNonDelegatedEvent("cancel", domElement);
7579 listenToNonDelegatedEvent("close", domElement);
7580 props = rawProps;
7581 break;
7582 case "iframe":
7583 case "object":
7584 case "embed":
7585 listenToNonDelegatedEvent("load", domElement);
7586 props = rawProps;
7587 break;
7588 case "video":
7589 case "audio":
7590 for (var i = 0; i < mediaEventTypes.length; i++) {
7591 listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
7592 }
7593 props = rawProps;
7594 break;
7595 case "source":
7596 listenToNonDelegatedEvent("error", domElement);
7597 props = rawProps;
7598 break;
7599 case "img":
7600 case "image":
7601 case "link":
7602 listenToNonDelegatedEvent("error", domElement);
7603 listenToNonDelegatedEvent("load", domElement);
7604 props = rawProps;
7605 break;
7606 case "details":
7607 listenToNonDelegatedEvent("toggle", domElement);
7608 props = rawProps;
7609 break;
7610 case "input":
7611 initWrapperState(domElement, rawProps);
7612 props = getHostProps(domElement, rawProps);
7613 listenToNonDelegatedEvent("invalid", domElement);
7614 break;
7615 case "option":
7616 validateProps(domElement, rawProps);
7617 props = rawProps;
7618 break;
7619 case "select":
7620 initWrapperState$1(domElement, rawProps);
7621 props = getHostProps$1(domElement, rawProps);
7622 listenToNonDelegatedEvent("invalid", domElement);
7623 break;
7624 case "textarea":
7625 initWrapperState$2(domElement, rawProps);
7626 props = getHostProps$2(domElement, rawProps);
7627 listenToNonDelegatedEvent("invalid", domElement);
7628 break;
7629 default:
7630 props = rawProps;
7631 }
7632 assertValidProps(tag, props);
7633 setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
7634 switch (tag) {
7635 case "input":
7636 track(domElement);
7637 postMountWrapper(domElement, rawProps, false);
7638 break;
7639 case "textarea":
7640 track(domElement);
7641 postMountWrapper$3(domElement);
7642 break;
7643 case "option":
7644 postMountWrapper$1(domElement, rawProps);
7645 break;
7646 case "select":
7647 postMountWrapper$2(domElement, rawProps);
7648 break;
7649 default:
7650 if (typeof props.onClick === "function") {
7651 trapClickOnNonInteractiveElement(domElement);
7652 }
7653 break;
7654 }
7655 }
7656 function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
7657 {
7658 validatePropertiesInDevelopment(tag, nextRawProps);
7659 }
7660 var updatePayload = null;
7661 var lastProps;
7662 var nextProps;
7663 switch (tag) {
7664 case "input":
7665 lastProps = getHostProps(domElement, lastRawProps);
7666 nextProps = getHostProps(domElement, nextRawProps);
7667 updatePayload = [];
7668 break;
7669 case "select":
7670 lastProps = getHostProps$1(domElement, lastRawProps);
7671 nextProps = getHostProps$1(domElement, nextRawProps);
7672 updatePayload = [];
7673 break;
7674 case "textarea":
7675 lastProps = getHostProps$2(domElement, lastRawProps);
7676 nextProps = getHostProps$2(domElement, nextRawProps);
7677 updatePayload = [];
7678 break;
7679 default:
7680 lastProps = lastRawProps;
7681 nextProps = nextRawProps;
7682 if (typeof lastProps.onClick !== "function" && typeof nextProps.onClick === "function") {
7683 trapClickOnNonInteractiveElement(domElement);
7684 }
7685 break;
7686 }
7687 assertValidProps(tag, nextProps);
7688 var propKey;
7689 var styleName;
7690 var styleUpdates = null;
7691 for (propKey in lastProps) {
7692 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
7693 continue;
7694 }
7695 if (propKey === STYLE) {
7696 var lastStyle = lastProps[propKey];
7697 for (styleName in lastStyle) {
7698 if (lastStyle.hasOwnProperty(styleName)) {
7699 if (!styleUpdates) {
7700 styleUpdates = {};
7701 }
7702 styleUpdates[styleName] = "";
7703 }
7704 }
7705 } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ;
7706 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7707 else if (propKey === AUTOFOCUS) ;
7708 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7709 if (!updatePayload) {
7710 updatePayload = [];
7711 }
7712 } else {
7713 (updatePayload = updatePayload || []).push(propKey, null);
7714 }
7715 }
7716 for (propKey in nextProps) {
7717 var nextProp = nextProps[propKey];
7718 var lastProp = lastProps != null ? lastProps[propKey] : void 0;
7719 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
7720 continue;
7721 }
7722 if (propKey === STYLE) {
7723 {
7724 if (nextProp) {
7725 Object.freeze(nextProp);
7726 }
7727 }
7728 if (lastProp) {
7729 for (styleName in lastProp) {
7730 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7731 if (!styleUpdates) {
7732 styleUpdates = {};
7733 }
7734 styleUpdates[styleName] = "";
7735 }
7736 }
7737 for (styleName in nextProp) {
7738 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7739 if (!styleUpdates) {
7740 styleUpdates = {};
7741 }
7742 styleUpdates[styleName] = nextProp[styleName];
7743 }
7744 }
7745 } else {
7746 if (!styleUpdates) {
7747 if (!updatePayload) {
7748 updatePayload = [];
7749 }
7750 updatePayload.push(propKey, styleUpdates);
7751 }
7752 styleUpdates = nextProp;
7753 }
7754 } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7755 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7756 var lastHtml = lastProp ? lastProp[HTML$1] : void 0;
7757 if (nextHtml != null) {
7758 if (lastHtml !== nextHtml) {
7759 (updatePayload = updatePayload || []).push(propKey, nextHtml);
7760 }
7761 }
7762 } else if (propKey === CHILDREN) {
7763 if (typeof nextProp === "string" || typeof nextProp === "number") {
7764 (updatePayload = updatePayload || []).push(propKey, "" + nextProp);
7765 }
7766 } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ;
7767 else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7768 if (nextProp != null) {
7769 if (typeof nextProp !== "function") {
7770 warnForInvalidEventListener(propKey, nextProp);
7771 }
7772 if (propKey === "onScroll") {
7773 listenToNonDelegatedEvent("scroll", domElement);
7774 }
7775 }
7776 if (!updatePayload && lastProp !== nextProp) {
7777 updatePayload = [];
7778 }
7779 } else {
7780 (updatePayload = updatePayload || []).push(propKey, nextProp);
7781 }
7782 }
7783 if (styleUpdates) {
7784 {
7785 validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
7786 }
7787 (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
7788 }
7789 return updatePayload;
7790 }
7791 function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
7792 if (tag === "input" && nextRawProps.type === "radio" && nextRawProps.name != null) {
7793 updateChecked(domElement, nextRawProps);
7794 }
7795 var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
7796 var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
7797 updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
7798 switch (tag) {
7799 case "input":
7800 updateWrapper(domElement, nextRawProps);
7801 break;
7802 case "textarea":
7803 updateWrapper$1(domElement, nextRawProps);
7804 break;
7805 case "select":
7806 postUpdateWrapper(domElement, nextRawProps);
7807 break;
7808 }
7809 }
7810 function getPossibleStandardName(propName) {
7811 {
7812 var lowerCasedName = propName.toLowerCase();
7813 if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
7814 return null;
7815 }
7816 return possibleStandardNames[lowerCasedName] || null;
7817 }
7818 }
7819 function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) {
7820 var isCustomComponentTag;
7821 var extraAttributeNames;
7822 {
7823 isCustomComponentTag = isCustomComponent(tag, rawProps);
7824 validatePropertiesInDevelopment(tag, rawProps);
7825 }
7826 switch (tag) {
7827 case "dialog":
7828 listenToNonDelegatedEvent("cancel", domElement);
7829 listenToNonDelegatedEvent("close", domElement);
7830 break;
7831 case "iframe":
7832 case "object":
7833 case "embed":
7834 listenToNonDelegatedEvent("load", domElement);
7835 break;
7836 case "video":
7837 case "audio":
7838 for (var i = 0; i < mediaEventTypes.length; i++) {
7839 listenToNonDelegatedEvent(mediaEventTypes[i], domElement);
7840 }
7841 break;
7842 case "source":
7843 listenToNonDelegatedEvent("error", domElement);
7844 break;
7845 case "img":
7846 case "image":
7847 case "link":
7848 listenToNonDelegatedEvent("error", domElement);
7849 listenToNonDelegatedEvent("load", domElement);
7850 break;
7851 case "details":
7852 listenToNonDelegatedEvent("toggle", domElement);
7853 break;
7854 case "input":
7855 initWrapperState(domElement, rawProps);
7856 listenToNonDelegatedEvent("invalid", domElement);
7857 break;
7858 case "option":
7859 validateProps(domElement, rawProps);
7860 break;
7861 case "select":
7862 initWrapperState$1(domElement, rawProps);
7863 listenToNonDelegatedEvent("invalid", domElement);
7864 break;
7865 case "textarea":
7866 initWrapperState$2(domElement, rawProps);
7867 listenToNonDelegatedEvent("invalid", domElement);
7868 break;
7869 }
7870 assertValidProps(tag, rawProps);
7871 {
7872 extraAttributeNames = /* @__PURE__ */ new Set();
7873 var attributes = domElement.attributes;
7874 for (var _i = 0; _i < attributes.length; _i++) {
7875 var name = attributes[_i].name.toLowerCase();
7876 switch (name) {
7877 // Controlled attributes are not validated
7878 // TODO: Only ignore them on controlled tags.
7879 case "value":
7880 break;
7881 case "checked":
7882 break;
7883 case "selected":
7884 break;
7885 default:
7886 extraAttributeNames.add(attributes[_i].name);
7887 }
7888 }
7889 }
7890 var updatePayload = null;
7891 for (var propKey in rawProps) {
7892 if (!rawProps.hasOwnProperty(propKey)) {
7893 continue;
7894 }
7895 var nextProp = rawProps[propKey];
7896 if (propKey === CHILDREN) {
7897 if (typeof nextProp === "string") {
7898 if (domElement.textContent !== nextProp) {
7899 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
7900 checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
7901 }
7902 updatePayload = [CHILDREN, nextProp];
7903 }
7904 } else if (typeof nextProp === "number") {
7905 if (domElement.textContent !== "" + nextProp) {
7906 if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
7907 checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
7908 }
7909 updatePayload = [CHILDREN, "" + nextProp];
7910 }
7911 }
7912 } else if (registrationNameDependencies.hasOwnProperty(propKey)) {
7913 if (nextProp != null) {
7914 if (typeof nextProp !== "function") {
7915 warnForInvalidEventListener(propKey, nextProp);
7916 }
7917 if (propKey === "onScroll") {
7918 listenToNonDelegatedEvent("scroll", domElement);
7919 }
7920 }
7921 } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.)
7922 typeof isCustomComponentTag === "boolean") {
7923 var serverValue = void 0;
7924 var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
7925 if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ;
7926 else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
7927 // TODO: Only ignore them on controlled tags.
7928 propKey === "value" || propKey === "checked" || propKey === "selected") ;
7929 else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
7930 var serverHTML = domElement.innerHTML;
7931 var nextHtml = nextProp ? nextProp[HTML$1] : void 0;
7932 if (nextHtml != null) {
7933 var expectedHTML = normalizeHTML(domElement, nextHtml);
7934 if (expectedHTML !== serverHTML) {
7935 warnForPropDifference(propKey, serverHTML, expectedHTML);
7936 }
7937 }
7938 } else if (propKey === STYLE) {
7939 extraAttributeNames.delete(propKey);
7940 if (canDiffStyleForHydrationWarning) {
7941 var expectedStyle = createDangerousStringForStyles(nextProp);
7942 serverValue = domElement.getAttribute("style");
7943 if (expectedStyle !== serverValue) {
7944 warnForPropDifference(propKey, serverValue, expectedStyle);
7945 }
7946 }
7947 } else if (isCustomComponentTag && !enableCustomElementPropertySupport) {
7948 extraAttributeNames.delete(propKey.toLowerCase());
7949 serverValue = getValueForAttribute(domElement, propKey, nextProp);
7950 if (nextProp !== serverValue) {
7951 warnForPropDifference(propKey, serverValue, nextProp);
7952 }
7953 } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
7954 var isMismatchDueToBadCasing = false;
7955 if (propertyInfo !== null) {
7956 extraAttributeNames.delete(propertyInfo.attributeName);
7957 serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
7958 } else {
7959 var ownNamespace = parentNamespace;
7960 if (ownNamespace === HTML_NAMESPACE) {
7961 ownNamespace = getIntrinsicNamespace(tag);
7962 }
7963 if (ownNamespace === HTML_NAMESPACE) {
7964 extraAttributeNames.delete(propKey.toLowerCase());
7965 } else {
7966 var standardName = getPossibleStandardName(propKey);
7967 if (standardName !== null && standardName !== propKey) {
7968 isMismatchDueToBadCasing = true;
7969 extraAttributeNames.delete(standardName);
7970 }
7971 extraAttributeNames.delete(propKey);
7972 }
7973 serverValue = getValueForAttribute(domElement, propKey, nextProp);
7974 }
7975 var dontWarnCustomElement = enableCustomElementPropertySupport;
7976 if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
7977 warnForPropDifference(propKey, serverValue, nextProp);
7978 }
7979 }
7980 }
7981 }
7982 {
7983 if (shouldWarnDev) {
7984 if (
7985 // $FlowFixMe - Should be inferred as not undefined.
7986 extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true
7987 ) {
7988 warnForExtraAttributes(extraAttributeNames);
7989 }
7990 }
7991 }
7992 switch (tag) {
7993 case "input":
7994 track(domElement);
7995 postMountWrapper(domElement, rawProps, true);
7996 break;
7997 case "textarea":
7998 track(domElement);
7999 postMountWrapper$3(domElement);
8000 break;
8001 case "select":
8002 case "option":
8003 break;
8004 default:
8005 if (typeof rawProps.onClick === "function") {
8006 trapClickOnNonInteractiveElement(domElement);
8007 }
8008 break;
8009 }
8010 return updatePayload;
8011 }
8012 function diffHydratedText(textNode, text, isConcurrentMode) {
8013 var isDifferent = textNode.nodeValue !== text;
8014 return isDifferent;
8015 }
8016 function warnForDeletedHydratableElement(parentNode, child) {
8017 {
8018 if (didWarnInvalidHydration) {
8019 return;
8020 }
8021 didWarnInvalidHydration = true;
8022 error("Did not expect server HTML to contain a <%s> in <%s>.", child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
8023 }
8024 }
8025 function warnForDeletedHydratableText(parentNode, child) {
8026 {
8027 if (didWarnInvalidHydration) {
8028 return;
8029 }
8030 didWarnInvalidHydration = true;
8031 error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
8032 }
8033 }
8034 function warnForInsertedHydratedElement(parentNode, tag, props) {
8035 {
8036 if (didWarnInvalidHydration) {
8037 return;
8038 }
8039 didWarnInvalidHydration = true;
8040 error("Expected server HTML to contain a matching <%s> in <%s>.", tag, parentNode.nodeName.toLowerCase());
8041 }
8042 }
8043 function warnForInsertedHydratedText(parentNode, text) {
8044 {
8045 if (text === "") {
8046 return;
8047 }
8048 if (didWarnInvalidHydration) {
8049 return;
8050 }
8051 didWarnInvalidHydration = true;
8052 error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
8053 }
8054 }
8055 function restoreControlledState$3(domElement, tag, props) {
8056 switch (tag) {
8057 case "input":
8058 restoreControlledState(domElement, props);
8059 return;
8060 case "textarea":
8061 restoreControlledState$2(domElement, props);
8062 return;
8063 case "select":
8064 restoreControlledState$1(domElement, props);
8065 return;
8066 }
8067 }
8068 var validateDOMNesting = function() {
8069 };
8070 var updatedAncestorInfo = function() {
8071 };
8072 {
8073 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"];
8074 var inScopeTags = [
8075 "applet",
8076 "caption",
8077 "html",
8078 "table",
8079 "td",
8080 "th",
8081 "marquee",
8082 "object",
8083 "template",
8084 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
8085 // TODO: Distinguish by namespace here -- for <title>, including it here
8086 // errs on the side of fewer warnings
8087 "foreignObject",
8088 "desc",
8089 "title"
8090 ];
8091 var buttonScopeTags = inScopeTags.concat(["button"]);
8092 var impliedEndTags = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"];
8093 var emptyAncestorInfo = {
8094 current: null,
8095 formTag: null,
8096 aTagInScope: null,
8097 buttonTagInScope: null,
8098 nobrTagInScope: null,
8099 pTagInButtonScope: null,
8100 listItemTagAutoclosing: null,
8101 dlItemTagAutoclosing: null
8102 };
8103 updatedAncestorInfo = function(oldInfo, tag) {
8104 var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
8105 var info = {
8106 tag
8107 };
8108 if (inScopeTags.indexOf(tag) !== -1) {
8109 ancestorInfo.aTagInScope = null;
8110 ancestorInfo.buttonTagInScope = null;
8111 ancestorInfo.nobrTagInScope = null;
8112 }
8113 if (buttonScopeTags.indexOf(tag) !== -1) {
8114 ancestorInfo.pTagInButtonScope = null;
8115 }
8116 if (specialTags.indexOf(tag) !== -1 && tag !== "address" && tag !== "div" && tag !== "p") {
8117 ancestorInfo.listItemTagAutoclosing = null;
8118 ancestorInfo.dlItemTagAutoclosing = null;
8119 }
8120 ancestorInfo.current = info;
8121 if (tag === "form") {
8122 ancestorInfo.formTag = info;
8123 }
8124 if (tag === "a") {
8125 ancestorInfo.aTagInScope = info;
8126 }
8127 if (tag === "button") {
8128 ancestorInfo.buttonTagInScope = info;
8129 }
8130 if (tag === "nobr") {
8131 ancestorInfo.nobrTagInScope = info;
8132 }
8133 if (tag === "p") {
8134 ancestorInfo.pTagInButtonScope = info;
8135 }
8136 if (tag === "li") {
8137 ancestorInfo.listItemTagAutoclosing = info;
8138 }
8139 if (tag === "dd" || tag === "dt") {
8140 ancestorInfo.dlItemTagAutoclosing = info;
8141 }
8142 return ancestorInfo;
8143 };
8144 var isTagValidWithParent = function(tag, parentTag) {
8145 switch (parentTag) {
8146 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
8147 case "select":
8148 return tag === "option" || tag === "optgroup" || tag === "#text";
8149 case "optgroup":
8150 return tag === "option" || tag === "#text";
8151 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
8152 // but
8153 case "option":
8154 return tag === "#text";
8155 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
8156 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
8157 // No special behavior since these rules fall back to "in body" mode for
8158 // all except special table nodes which cause bad parsing behavior anyway.
8159 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
8160 case "tr":
8161 return tag === "th" || tag === "td" || tag === "style" || tag === "script" || tag === "template";
8162 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
8163 case "tbody":
8164 case "thead":
8165 case "tfoot":
8166 return tag === "tr" || tag === "style" || tag === "script" || tag === "template";
8167 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
8168 case "colgroup":
8169 return tag === "col" || tag === "template";
8170 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
8171 case "table":
8172 return tag === "caption" || tag === "colgroup" || tag === "tbody" || tag === "tfoot" || tag === "thead" || tag === "style" || tag === "script" || tag === "template";
8173 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
8174 case "head":
8175 return tag === "base" || tag === "basefont" || tag === "bgsound" || tag === "link" || tag === "meta" || tag === "title" || tag === "noscript" || tag === "noframes" || tag === "style" || tag === "script" || tag === "template";
8176 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
8177 case "html":
8178 return tag === "head" || tag === "body" || tag === "frameset";
8179 case "frameset":
8180 return tag === "frame";
8181 case "#document":
8182 return tag === "html";
8183 }
8184 switch (tag) {
8185 case "h1":
8186 case "h2":
8187 case "h3":
8188 case "h4":
8189 case "h5":
8190 case "h6":
8191 return parentTag !== "h1" && parentTag !== "h2" && parentTag !== "h3" && parentTag !== "h4" && parentTag !== "h5" && parentTag !== "h6";
8192 case "rp":
8193 case "rt":
8194 return impliedEndTags.indexOf(parentTag) === -1;
8195 case "body":
8196 case "caption":
8197 case "col":
8198 case "colgroup":
8199 case "frameset":
8200 case "frame":
8201 case "head":
8202 case "html":
8203 case "tbody":
8204 case "td":
8205 case "tfoot":
8206 case "th":
8207 case "thead":
8208 case "tr":
8209 return parentTag == null;
8210 }
8211 return true;
8212 };
8213 var findInvalidAncestorForTag = function(tag, ancestorInfo) {
8214 switch (tag) {
8215 case "address":
8216 case "article":
8217 case "aside":
8218 case "blockquote":
8219 case "center":
8220 case "details":
8221 case "dialog":
8222 case "dir":
8223 case "div":
8224 case "dl":
8225 case "fieldset":
8226 case "figcaption":
8227 case "figure":
8228 case "footer":
8229 case "header":
8230 case "hgroup":
8231 case "main":
8232 case "menu":
8233 case "nav":
8234 case "ol":
8235 case "p":
8236 case "section":
8237 case "summary":
8238 case "ul":
8239 case "pre":
8240 case "listing":
8241 case "table":
8242 case "hr":
8243 case "xmp":
8244 case "h1":
8245 case "h2":
8246 case "h3":
8247 case "h4":
8248 case "h5":
8249 case "h6":
8250 return ancestorInfo.pTagInButtonScope;
8251 case "form":
8252 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
8253 case "li":
8254 return ancestorInfo.listItemTagAutoclosing;
8255 case "dd":
8256 case "dt":
8257 return ancestorInfo.dlItemTagAutoclosing;
8258 case "button":
8259 return ancestorInfo.buttonTagInScope;
8260 case "a":
8261 return ancestorInfo.aTagInScope;
8262 case "nobr":
8263 return ancestorInfo.nobrTagInScope;
8264 }
8265 return null;
8266 };
8267 var didWarn$1 = {};
8268 validateDOMNesting = function(childTag, childText, ancestorInfo) {
8269 ancestorInfo = ancestorInfo || emptyAncestorInfo;
8270 var parentInfo = ancestorInfo.current;
8271 var parentTag = parentInfo && parentInfo.tag;
8272 if (childText != null) {
8273 if (childTag != null) {
8274 error("validateDOMNesting: when childText is passed, childTag should be null");
8275 }
8276 childTag = "#text";
8277 }
8278 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
8279 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
8280 var invalidParentOrAncestor = invalidParent || invalidAncestor;
8281 if (!invalidParentOrAncestor) {
8282 return;
8283 }
8284 var ancestorTag = invalidParentOrAncestor.tag;
8285 var warnKey = !!invalidParent + "|" + childTag + "|" + ancestorTag;
8286 if (didWarn$1[warnKey]) {
8287 return;
8288 }
8289 didWarn$1[warnKey] = true;
8290 var tagDisplayName = childTag;
8291 var whitespaceInfo = "";
8292 if (childTag === "#text") {
8293 if (/\S/.test(childText)) {
8294 tagDisplayName = "Text nodes";
8295 } else {
8296 tagDisplayName = "Whitespace text nodes";
8297 whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code.";
8298 }
8299 } else {
8300 tagDisplayName = "<" + childTag + ">";
8301 }
8302 if (invalidParent) {
8303 var info = "";
8304 if (ancestorTag === "table" && childTag === "tr") {
8305 info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.";
8306 }
8307 error("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", tagDisplayName, ancestorTag, whitespaceInfo, info);
8308 } else {
8309 error("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", tagDisplayName, ancestorTag);
8310 }
8311 };
8312 }
8313 var SUPPRESS_HYDRATION_WARNING$1 = "suppressHydrationWarning";
8314 var SUSPENSE_START_DATA = "$";
8315 var SUSPENSE_END_DATA = "/$";
8316 var SUSPENSE_PENDING_START_DATA = "$?";
8317 var SUSPENSE_FALLBACK_START_DATA = "$!";
8318 var STYLE$1 = "style";
8319 var eventsEnabled = null;
8320 var selectionInformation = null;
8321 function getRootHostContext(rootContainerInstance) {
8322 var type;
8323 var namespace;
8324 var nodeType = rootContainerInstance.nodeType;
8325 switch (nodeType) {
8326 case DOCUMENT_NODE:
8327 case DOCUMENT_FRAGMENT_NODE: {
8328 type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment";
8329 var root2 = rootContainerInstance.documentElement;
8330 namespace = root2 ? root2.namespaceURI : getChildNamespace(null, "");
8331 break;
8332 }
8333 default: {
8334 var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
8335 var ownNamespace = container.namespaceURI || null;
8336 type = container.tagName;
8337 namespace = getChildNamespace(ownNamespace, type);
8338 break;
8339 }
8340 }
8341 {
8342 var validatedTag = type.toLowerCase();
8343 var ancestorInfo = updatedAncestorInfo(null, validatedTag);
8344 return {
8345 namespace,
8346 ancestorInfo
8347 };
8348 }
8349 }
8350 function getChildHostContext(parentHostContext, type, rootContainerInstance) {
8351 {
8352 var parentHostContextDev = parentHostContext;
8353 var namespace = getChildNamespace(parentHostContextDev.namespace, type);
8354 var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
8355 return {
8356 namespace,
8357 ancestorInfo
8358 };
8359 }
8360 }
8361 function getPublicInstance(instance) {
8362 return instance;
8363 }
8364 function prepareForCommit(containerInfo) {
8365 eventsEnabled = isEnabled();
8366 selectionInformation = getSelectionInformation();
8367 var activeInstance = null;
8368 setEnabled(false);
8369 return activeInstance;
8370 }
8371 function resetAfterCommit(containerInfo) {
8372 restoreSelection(selectionInformation);
8373 setEnabled(eventsEnabled);
8374 eventsEnabled = null;
8375 selectionInformation = null;
8376 }
8377 function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
8378 var parentNamespace;
8379 {
8380 var hostContextDev = hostContext;
8381 validateDOMNesting(type, null, hostContextDev.ancestorInfo);
8382 if (typeof props.children === "string" || typeof props.children === "number") {
8383 var string = "" + props.children;
8384 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
8385 validateDOMNesting(null, string, ownAncestorInfo);
8386 }
8387 parentNamespace = hostContextDev.namespace;
8388 }
8389 var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
8390 precacheFiberNode(internalInstanceHandle, domElement);
8391 updateFiberProps(domElement, props);
8392 return domElement;
8393 }
8394 function appendInitialChild(parentInstance, child) {
8395 parentInstance.appendChild(child);
8396 }
8397 function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
8398 setInitialProperties(domElement, type, props, rootContainerInstance);
8399 switch (type) {
8400 case "button":
8401 case "input":
8402 case "select":
8403 case "textarea":
8404 return !!props.autoFocus;
8405 case "img":
8406 return true;
8407 default:
8408 return false;
8409 }
8410 }
8411 function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
8412 {
8413 var hostContextDev = hostContext;
8414 if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) {
8415 var string = "" + newProps.children;
8416 var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
8417 validateDOMNesting(null, string, ownAncestorInfo);
8418 }
8419 }
8420 return diffProperties(domElement, type, oldProps, newProps);
8421 }
8422 function shouldSetTextContent(type, props) {
8423 return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
8424 }
8425 function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
8426 {
8427 var hostContextDev = hostContext;
8428 validateDOMNesting(null, text, hostContextDev.ancestorInfo);
8429 }
8430 var textNode = createTextNode(text, rootContainerInstance);
8431 precacheFiberNode(internalInstanceHandle, textNode);
8432 return textNode;
8433 }
8434 function getCurrentEventPriority() {
8435 var currentEvent = window.event;
8436 if (currentEvent === void 0) {
8437 return DefaultEventPriority;
8438 }
8439 return getEventPriority(currentEvent.type);
8440 }
8441 var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
8442 var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
8443 var noTimeout = -1;
8444 var localPromise = typeof Promise === "function" ? Promise : void 0;
8445 var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
8446 return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
8447 } : scheduleTimeout;
8448 function handleErrorInNextTick(error2) {
8449 setTimeout(function() {
8450 throw error2;
8451 });
8452 }
8453 function commitMount(domElement, type, newProps, internalInstanceHandle) {
8454 switch (type) {
8455 case "button":
8456 case "input":
8457 case "select":
8458 case "textarea":
8459 if (newProps.autoFocus) {
8460 domElement.focus();
8461 }
8462 return;
8463 case "img": {
8464 if (newProps.src) {
8465 domElement.src = newProps.src;
8466 }
8467 return;
8468 }
8469 }
8470 }
8471 function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
8472 updateProperties(domElement, updatePayload, type, oldProps, newProps);
8473 updateFiberProps(domElement, newProps);
8474 }
8475 function resetTextContent(domElement) {
8476 setTextContent(domElement, "");
8477 }
8478 function commitTextUpdate(textInstance, oldText, newText) {
8479 textInstance.nodeValue = newText;
8480 }
8481 function appendChild(parentInstance, child) {
8482 parentInstance.appendChild(child);
8483 }
8484 function appendChildToContainer(container, child) {
8485 var parentNode;
8486 if (container.nodeType === COMMENT_NODE) {
8487 parentNode = container.parentNode;
8488 parentNode.insertBefore(child, container);
8489 } else {
8490 parentNode = container;
8491 parentNode.appendChild(child);
8492 }
8493 var reactRootContainer = container._reactRootContainer;
8494 if ((reactRootContainer === null || reactRootContainer === void 0) && parentNode.onclick === null) {
8495 trapClickOnNonInteractiveElement(parentNode);
8496 }
8497 }
8498 function insertBefore(parentInstance, child, beforeChild) {
8499 parentInstance.insertBefore(child, beforeChild);
8500 }
8501 function insertInContainerBefore(container, child, beforeChild) {
8502 if (container.nodeType === COMMENT_NODE) {
8503 container.parentNode.insertBefore(child, beforeChild);
8504 } else {
8505 container.insertBefore(child, beforeChild);
8506 }
8507 }
8508 function removeChild(parentInstance, child) {
8509 parentInstance.removeChild(child);
8510 }
8511 function removeChildFromContainer(container, child) {
8512 if (container.nodeType === COMMENT_NODE) {
8513 container.parentNode.removeChild(child);
8514 } else {
8515 container.removeChild(child);
8516 }
8517 }
8518 function clearSuspenseBoundary(parentInstance, suspenseInstance) {
8519 var node = suspenseInstance;
8520 var depth = 0;
8521 do {
8522 var nextNode = node.nextSibling;
8523 parentInstance.removeChild(node);
8524 if (nextNode && nextNode.nodeType === COMMENT_NODE) {
8525 var data = nextNode.data;
8526 if (data === SUSPENSE_END_DATA) {
8527 if (depth === 0) {
8528 parentInstance.removeChild(nextNode);
8529 retryIfBlockedOn(suspenseInstance);
8530 return;
8531 } else {
8532 depth--;
8533 }
8534 } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
8535 depth++;
8536 }
8537 }
8538 node = nextNode;
8539 } while (node);
8540 retryIfBlockedOn(suspenseInstance);
8541 }
8542 function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
8543 if (container.nodeType === COMMENT_NODE) {
8544 clearSuspenseBoundary(container.parentNode, suspenseInstance);
8545 } else if (container.nodeType === ELEMENT_NODE) {
8546 clearSuspenseBoundary(container, suspenseInstance);
8547 }
8548 retryIfBlockedOn(container);
8549 }
8550 function hideInstance(instance) {
8551 instance = instance;
8552 var style2 = instance.style;
8553 if (typeof style2.setProperty === "function") {
8554 style2.setProperty("display", "none", "important");
8555 } else {
8556 style2.display = "none";
8557 }
8558 }
8559 function hideTextInstance(textInstance) {
8560 textInstance.nodeValue = "";
8561 }
8562 function unhideInstance(instance, props) {
8563 instance = instance;
8564 var styleProp = props[STYLE$1];
8565 var display = styleProp !== void 0 && styleProp !== null && styleProp.hasOwnProperty("display") ? styleProp.display : null;
8566 instance.style.display = dangerousStyleValue("display", display);
8567 }
8568 function unhideTextInstance(textInstance, text) {
8569 textInstance.nodeValue = text;
8570 }
8571 function clearContainer(container) {
8572 if (container.nodeType === ELEMENT_NODE) {
8573 container.textContent = "";
8574 } else if (container.nodeType === DOCUMENT_NODE) {
8575 if (container.documentElement) {
8576 container.removeChild(container.documentElement);
8577 }
8578 }
8579 }
8580 function canHydrateInstance(instance, type, props) {
8581 if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
8582 return null;
8583 }
8584 return instance;
8585 }
8586 function canHydrateTextInstance(instance, text) {
8587 if (text === "" || instance.nodeType !== TEXT_NODE) {
8588 return null;
8589 }
8590 return instance;
8591 }
8592 function canHydrateSuspenseInstance(instance) {
8593 if (instance.nodeType !== COMMENT_NODE) {
8594 return null;
8595 }
8596 return instance;
8597 }
8598 function isSuspenseInstancePending(instance) {
8599 return instance.data === SUSPENSE_PENDING_START_DATA;
8600 }
8601 function isSuspenseInstanceFallback(instance) {
8602 return instance.data === SUSPENSE_FALLBACK_START_DATA;
8603 }
8604 function getSuspenseInstanceFallbackErrorDetails(instance) {
8605 var dataset = instance.nextSibling && instance.nextSibling.dataset;
8606 var digest, message, stack;
8607 if (dataset) {
8608 digest = dataset.dgst;
8609 {
8610 message = dataset.msg;
8611 stack = dataset.stck;
8612 }
8613 }
8614 {
8615 return {
8616 message,
8617 digest,
8618 stack
8619 };
8620 }
8621 }
8622 function registerSuspenseInstanceRetry(instance, callback) {
8623 instance._reactRetry = callback;
8624 }
8625 function getNextHydratable(node) {
8626 for (; node != null; node = node.nextSibling) {
8627 var nodeType = node.nodeType;
8628 if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
8629 break;
8630 }
8631 if (nodeType === COMMENT_NODE) {
8632 var nodeData = node.data;
8633 if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
8634 break;
8635 }
8636 if (nodeData === SUSPENSE_END_DATA) {
8637 return null;
8638 }
8639 }
8640 }
8641 return node;
8642 }
8643 function getNextHydratableSibling(instance) {
8644 return getNextHydratable(instance.nextSibling);
8645 }
8646 function getFirstHydratableChild(parentInstance) {
8647 return getNextHydratable(parentInstance.firstChild);
8648 }
8649 function getFirstHydratableChildWithinContainer(parentContainer) {
8650 return getNextHydratable(parentContainer.firstChild);
8651 }
8652 function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
8653 return getNextHydratable(parentInstance.nextSibling);
8654 }
8655 function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
8656 precacheFiberNode(internalInstanceHandle, instance);
8657 updateFiberProps(instance, props);
8658 var parentNamespace;
8659 {
8660 var hostContextDev = hostContext;
8661 parentNamespace = hostContextDev.namespace;
8662 }
8663 var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
8664 return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
8665 }
8666 function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) {
8667 precacheFiberNode(internalInstanceHandle, textInstance);
8668 var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
8669 return diffHydratedText(textInstance, text);
8670 }
8671 function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
8672 precacheFiberNode(internalInstanceHandle, suspenseInstance);
8673 }
8674 function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
8675 var node = suspenseInstance.nextSibling;
8676 var depth = 0;
8677 while (node) {
8678 if (node.nodeType === COMMENT_NODE) {
8679 var data = node.data;
8680 if (data === SUSPENSE_END_DATA) {
8681 if (depth === 0) {
8682 return getNextHydratableSibling(node);
8683 } else {
8684 depth--;
8685 }
8686 } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
8687 depth++;
8688 }
8689 }
8690 node = node.nextSibling;
8691 }
8692 return null;
8693 }
8694 function getParentSuspenseInstance(targetInstance) {
8695 var node = targetInstance.previousSibling;
8696 var depth = 0;
8697 while (node) {
8698 if (node.nodeType === COMMENT_NODE) {
8699 var data = node.data;
8700 if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
8701 if (depth === 0) {
8702 return node;
8703 } else {
8704 depth--;
8705 }
8706 } else if (data === SUSPENSE_END_DATA) {
8707 depth++;
8708 }
8709 }
8710 node = node.previousSibling;
8711 }
8712 return null;
8713 }
8714 function commitHydratedContainer(container) {
8715 retryIfBlockedOn(container);
8716 }
8717 function commitHydratedSuspenseInstance(suspenseInstance) {
8718 retryIfBlockedOn(suspenseInstance);
8719 }
8720 function shouldDeleteUnhydratedTailInstances(parentType) {
8721 return parentType !== "head" && parentType !== "body";
8722 }
8723 function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) {
8724 var shouldWarnDev = true;
8725 checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
8726 }
8727 function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) {
8728 if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8729 var shouldWarnDev = true;
8730 checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev);
8731 }
8732 }
8733 function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
8734 {
8735 if (instance.nodeType === ELEMENT_NODE) {
8736 warnForDeletedHydratableElement(parentContainer, instance);
8737 } else if (instance.nodeType === COMMENT_NODE) ;
8738 else {
8739 warnForDeletedHydratableText(parentContainer, instance);
8740 }
8741 }
8742 }
8743 function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
8744 {
8745 var parentNode = parentInstance.parentNode;
8746 if (parentNode !== null) {
8747 if (instance.nodeType === ELEMENT_NODE) {
8748 warnForDeletedHydratableElement(parentNode, instance);
8749 } else if (instance.nodeType === COMMENT_NODE) ;
8750 else {
8751 warnForDeletedHydratableText(parentNode, instance);
8752 }
8753 }
8754 }
8755 }
8756 function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
8757 {
8758 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8759 if (instance.nodeType === ELEMENT_NODE) {
8760 warnForDeletedHydratableElement(parentInstance, instance);
8761 } else if (instance.nodeType === COMMENT_NODE) ;
8762 else {
8763 warnForDeletedHydratableText(parentInstance, instance);
8764 }
8765 }
8766 }
8767 }
8768 function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
8769 {
8770 warnForInsertedHydratedElement(parentContainer, type);
8771 }
8772 }
8773 function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) {
8774 {
8775 warnForInsertedHydratedText(parentContainer, text);
8776 }
8777 }
8778 function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
8779 {
8780 var parentNode = parentInstance.parentNode;
8781 if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type);
8782 }
8783 }
8784 function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) {
8785 {
8786 var parentNode = parentInstance.parentNode;
8787 if (parentNode !== null) warnForInsertedHydratedText(parentNode, text);
8788 }
8789 }
8790 function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
8791 {
8792 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8793 warnForInsertedHydratedElement(parentInstance, type);
8794 }
8795 }
8796 }
8797 function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) {
8798 {
8799 if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
8800 warnForInsertedHydratedText(parentInstance, text);
8801 }
8802 }
8803 }
8804 function errorHydratingContainer(parentContainer) {
8805 {
8806 error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
8807 }
8808 }
8809 function preparePortalMount(portalInstance) {
8810 listenToAllSupportedEvents(portalInstance);
8811 }
8812 var randomKey = Math.random().toString(36).slice(2);
8813 var internalInstanceKey = "__reactFiber$" + randomKey;
8814 var internalPropsKey = "__reactProps$" + randomKey;
8815 var internalContainerInstanceKey = "__reactContainer$" + randomKey;
8816 var internalEventHandlersKey = "__reactEvents$" + randomKey;
8817 var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
8818 var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
8819 function detachDeletedInstance(node) {
8820 delete node[internalInstanceKey];
8821 delete node[internalPropsKey];
8822 delete node[internalEventHandlersKey];
8823 delete node[internalEventHandlerListenersKey];
8824 delete node[internalEventHandlesSetKey];
8825 }
8826 function precacheFiberNode(hostInst, node) {
8827 node[internalInstanceKey] = hostInst;
8828 }
8829 function markContainerAsRoot(hostRoot, node) {
8830 node[internalContainerInstanceKey] = hostRoot;
8831 }
8832 function unmarkContainerAsRoot(node) {
8833 node[internalContainerInstanceKey] = null;
8834 }
8835 function isContainerMarkedAsRoot(node) {
8836 return !!node[internalContainerInstanceKey];
8837 }
8838 function getClosestInstanceFromNode(targetNode) {
8839 var targetInst = targetNode[internalInstanceKey];
8840 if (targetInst) {
8841 return targetInst;
8842 }
8843 var parentNode = targetNode.parentNode;
8844 while (parentNode) {
8845 targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
8846 if (targetInst) {
8847 var alternate = targetInst.alternate;
8848 if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
8849 var suspenseInstance = getParentSuspenseInstance(targetNode);
8850 while (suspenseInstance !== null) {
8851 var targetSuspenseInst = suspenseInstance[internalInstanceKey];
8852 if (targetSuspenseInst) {
8853 return targetSuspenseInst;
8854 }
8855 suspenseInstance = getParentSuspenseInstance(suspenseInstance);
8856 }
8857 }
8858 return targetInst;
8859 }
8860 targetNode = parentNode;
8861 parentNode = targetNode.parentNode;
8862 }
8863 return null;
8864 }
8865 function getInstanceFromNode(node) {
8866 var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
8867 if (inst) {
8868 if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
8869 return inst;
8870 } else {
8871 return null;
8872 }
8873 }
8874 return null;
8875 }
8876 function getNodeFromInstance(inst) {
8877 if (inst.tag === HostComponent || inst.tag === HostText) {
8878 return inst.stateNode;
8879 }
8880 throw new Error("getNodeFromInstance: Invalid argument.");
8881 }
8882 function getFiberCurrentPropsFromNode(node) {
8883 return node[internalPropsKey] || null;
8884 }
8885 function updateFiberProps(node, props) {
8886 node[internalPropsKey] = props;
8887 }
8888 function getEventListenerSet(node) {
8889 var elementListenerSet = node[internalEventHandlersKey];
8890 if (elementListenerSet === void 0) {
8891 elementListenerSet = node[internalEventHandlersKey] = /* @__PURE__ */ new Set();
8892 }
8893 return elementListenerSet;
8894 }
8895 var loggedTypeFailures = {};
8896 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
8897 function setCurrentlyValidatingElement(element) {
8898 {
8899 if (element) {
8900 var owner = element._owner;
8901 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
8902 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
8903 } else {
8904 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
8905 }
8906 }
8907 }
8908 function checkPropTypes(typeSpecs, values, location, componentName, element) {
8909 {
8910 var has2 = Function.call.bind(hasOwnProperty);
8911 for (var typeSpecName in typeSpecs) {
8912 if (has2(typeSpecs, typeSpecName)) {
8913 var error$1 = void 0;
8914 try {
8915 if (typeof typeSpecs[typeSpecName] !== "function") {
8916 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`.");
8917 err.name = "Invariant Violation";
8918 throw err;
8919 }
8920 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
8921 } catch (ex) {
8922 error$1 = ex;
8923 }
8924 if (error$1 && !(error$1 instanceof Error)) {
8925 setCurrentlyValidatingElement(element);
8926 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);
8927 setCurrentlyValidatingElement(null);
8928 }
8929 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
8930 loggedTypeFailures[error$1.message] = true;
8931 setCurrentlyValidatingElement(element);
8932 error("Failed %s type: %s", location, error$1.message);
8933 setCurrentlyValidatingElement(null);
8934 }
8935 }
8936 }
8937 }
8938 }
8939 var valueStack = [];
8940 var fiberStack;
8941 {
8942 fiberStack = [];
8943 }
8944 var index = -1;
8945 function createCursor(defaultValue) {
8946 return {
8947 current: defaultValue
8948 };
8949 }
8950 function pop(cursor, fiber) {
8951 if (index < 0) {
8952 {
8953 error("Unexpected pop.");
8954 }
8955 return;
8956 }
8957 {
8958 if (fiber !== fiberStack[index]) {
8959 error("Unexpected Fiber popped.");
8960 }
8961 }
8962 cursor.current = valueStack[index];
8963 valueStack[index] = null;
8964 {
8965 fiberStack[index] = null;
8966 }
8967 index--;
8968 }
8969 function push(cursor, value, fiber) {
8970 index++;
8971 valueStack[index] = cursor.current;
8972 {
8973 fiberStack[index] = fiber;
8974 }
8975 cursor.current = value;
8976 }
8977 var warnedAboutMissingGetChildContext;
8978 {
8979 warnedAboutMissingGetChildContext = {};
8980 }
8981 var emptyContextObject = {};
8982 {
8983 Object.freeze(emptyContextObject);
8984 }
8985 var contextStackCursor = createCursor(emptyContextObject);
8986 var didPerformWorkStackCursor = createCursor(false);
8987 var previousContext = emptyContextObject;
8988 function getUnmaskedContext(workInProgress2, Component, didPushOwnContextIfProvider) {
8989 {
8990 if (didPushOwnContextIfProvider && isContextProvider(Component)) {
8991 return previousContext;
8992 }
8993 return contextStackCursor.current;
8994 }
8995 }
8996 function cacheContext(workInProgress2, unmaskedContext, maskedContext) {
8997 {
8998 var instance = workInProgress2.stateNode;
8999 instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
9000 instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
9001 }
9002 }
9003 function getMaskedContext(workInProgress2, unmaskedContext) {
9004 {
9005 var type = workInProgress2.type;
9006 var contextTypes = type.contextTypes;
9007 if (!contextTypes) {
9008 return emptyContextObject;
9009 }
9010 var instance = workInProgress2.stateNode;
9011 if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
9012 return instance.__reactInternalMemoizedMaskedChildContext;
9013 }
9014 var context = {};
9015 for (var key in contextTypes) {
9016 context[key] = unmaskedContext[key];
9017 }
9018 {
9019 var name = getComponentNameFromFiber(workInProgress2) || "Unknown";
9020 checkPropTypes(contextTypes, context, "context", name);
9021 }
9022 if (instance) {
9023 cacheContext(workInProgress2, unmaskedContext, context);
9024 }
9025 return context;
9026 }
9027 }
9028 function hasContextChanged() {
9029 {
9030 return didPerformWorkStackCursor.current;
9031 }
9032 }
9033 function isContextProvider(type) {
9034 {
9035 var childContextTypes = type.childContextTypes;
9036 return childContextTypes !== null && childContextTypes !== void 0;
9037 }
9038 }
9039 function popContext(fiber) {
9040 {
9041 pop(didPerformWorkStackCursor, fiber);
9042 pop(contextStackCursor, fiber);
9043 }
9044 }
9045 function popTopLevelContextObject(fiber) {
9046 {
9047 pop(didPerformWorkStackCursor, fiber);
9048 pop(contextStackCursor, fiber);
9049 }
9050 }
9051 function pushTopLevelContextObject(fiber, context, didChange) {
9052 {
9053 if (contextStackCursor.current !== emptyContextObject) {
9054 throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
9055 }
9056 push(contextStackCursor, context, fiber);
9057 push(didPerformWorkStackCursor, didChange, fiber);
9058 }
9059 }
9060 function processChildContext(fiber, type, parentContext) {
9061 {
9062 var instance = fiber.stateNode;
9063 var childContextTypes = type.childContextTypes;
9064 if (typeof instance.getChildContext !== "function") {
9065 {
9066 var componentName = getComponentNameFromFiber(fiber) || "Unknown";
9067 if (!warnedAboutMissingGetChildContext[componentName]) {
9068 warnedAboutMissingGetChildContext[componentName] = true;
9069 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);
9070 }
9071 }
9072 return parentContext;
9073 }
9074 var childContext = instance.getChildContext();
9075 for (var contextKey in childContext) {
9076 if (!(contextKey in childContextTypes)) {
9077 throw new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
9078 }
9079 }
9080 {
9081 var name = getComponentNameFromFiber(fiber) || "Unknown";
9082 checkPropTypes(childContextTypes, childContext, "child context", name);
9083 }
9084 return assign({}, parentContext, childContext);
9085 }
9086 }
9087 function pushContextProvider(workInProgress2) {
9088 {
9089 var instance = workInProgress2.stateNode;
9090 var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
9091 previousContext = contextStackCursor.current;
9092 push(contextStackCursor, memoizedMergedChildContext, workInProgress2);
9093 push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress2);
9094 return true;
9095 }
9096 }
9097 function invalidateContextProvider(workInProgress2, type, didChange) {
9098 {
9099 var instance = workInProgress2.stateNode;
9100 if (!instance) {
9101 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.");
9102 }
9103 if (didChange) {
9104 var mergedContext = processChildContext(workInProgress2, type, previousContext);
9105 instance.__reactInternalMemoizedMergedChildContext = mergedContext;
9106 pop(didPerformWorkStackCursor, workInProgress2);
9107 pop(contextStackCursor, workInProgress2);
9108 push(contextStackCursor, mergedContext, workInProgress2);
9109 push(didPerformWorkStackCursor, didChange, workInProgress2);
9110 } else {
9111 pop(didPerformWorkStackCursor, workInProgress2);
9112 push(didPerformWorkStackCursor, didChange, workInProgress2);
9113 }
9114 }
9115 }
9116 function findCurrentUnmaskedContext(fiber) {
9117 {
9118 if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) {
9119 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.");
9120 }
9121 var node = fiber;
9122 do {
9123 switch (node.tag) {
9124 case HostRoot:
9125 return node.stateNode.context;
9126 case ClassComponent: {
9127 var Component = node.type;
9128 if (isContextProvider(Component)) {
9129 return node.stateNode.__reactInternalMemoizedMergedChildContext;
9130 }
9131 break;
9132 }
9133 }
9134 node = node.return;
9135 } while (node !== null);
9136 throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
9137 }
9138 }
9139 var LegacyRoot = 0;
9140 var ConcurrentRoot = 1;
9141 var syncQueue = null;
9142 var includesLegacySyncCallbacks = false;
9143 var isFlushingSyncQueue = false;
9144 function scheduleSyncCallback(callback) {
9145 if (syncQueue === null) {
9146 syncQueue = [callback];
9147 } else {
9148 syncQueue.push(callback);
9149 }
9150 }
9151 function scheduleLegacySyncCallback(callback) {
9152 includesLegacySyncCallbacks = true;
9153 scheduleSyncCallback(callback);
9154 }
9155 function flushSyncCallbacksOnlyInLegacyMode() {
9156 if (includesLegacySyncCallbacks) {
9157 flushSyncCallbacks();
9158 }
9159 }
9160 function flushSyncCallbacks() {
9161 if (!isFlushingSyncQueue && syncQueue !== null) {
9162 isFlushingSyncQueue = true;
9163 var i = 0;
9164 var previousUpdatePriority = getCurrentUpdatePriority();
9165 try {
9166 var isSync = true;
9167 var queue = syncQueue;
9168 setCurrentUpdatePriority(DiscreteEventPriority);
9169 for (; i < queue.length; i++) {
9170 var callback = queue[i];
9171 do {
9172 callback = callback(isSync);
9173 } while (callback !== null);
9174 }
9175 syncQueue = null;
9176 includesLegacySyncCallbacks = false;
9177 } catch (error2) {
9178 if (syncQueue !== null) {
9179 syncQueue = syncQueue.slice(i + 1);
9180 }
9181 scheduleCallback(ImmediatePriority, flushSyncCallbacks);
9182 throw error2;
9183 } finally {
9184 setCurrentUpdatePriority(previousUpdatePriority);
9185 isFlushingSyncQueue = false;
9186 }
9187 }
9188 return null;
9189 }
9190 var forkStack = [];
9191 var forkStackIndex = 0;
9192 var treeForkProvider = null;
9193 var treeForkCount = 0;
9194 var idStack = [];
9195 var idStackIndex = 0;
9196 var treeContextProvider = null;
9197 var treeContextId = 1;
9198 var treeContextOverflow = "";
9199 function isForkedChild(workInProgress2) {
9200 warnIfNotHydrating();
9201 return (workInProgress2.flags & Forked) !== NoFlags;
9202 }
9203 function getForksAtLevel(workInProgress2) {
9204 warnIfNotHydrating();
9205 return treeForkCount;
9206 }
9207 function getTreeId() {
9208 var overflow = treeContextOverflow;
9209 var idWithLeadingBit = treeContextId;
9210 var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
9211 return id.toString(32) + overflow;
9212 }
9213 function pushTreeFork(workInProgress2, totalChildren) {
9214 warnIfNotHydrating();
9215 forkStack[forkStackIndex++] = treeForkCount;
9216 forkStack[forkStackIndex++] = treeForkProvider;
9217 treeForkProvider = workInProgress2;
9218 treeForkCount = totalChildren;
9219 }
9220 function pushTreeId(workInProgress2, totalChildren, index2) {
9221 warnIfNotHydrating();
9222 idStack[idStackIndex++] = treeContextId;
9223 idStack[idStackIndex++] = treeContextOverflow;
9224 idStack[idStackIndex++] = treeContextProvider;
9225 treeContextProvider = workInProgress2;
9226 var baseIdWithLeadingBit = treeContextId;
9227 var baseOverflow = treeContextOverflow;
9228 var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
9229 var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
9230 var slot = index2 + 1;
9231 var length = getBitLength(totalChildren) + baseLength;
9232 if (length > 30) {
9233 var numberOfOverflowBits = baseLength - baseLength % 5;
9234 var newOverflowBits = (1 << numberOfOverflowBits) - 1;
9235 var newOverflow = (baseId & newOverflowBits).toString(32);
9236 var restOfBaseId = baseId >> numberOfOverflowBits;
9237 var restOfBaseLength = baseLength - numberOfOverflowBits;
9238 var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
9239 var restOfNewBits = slot << restOfBaseLength;
9240 var id = restOfNewBits | restOfBaseId;
9241 var overflow = newOverflow + baseOverflow;
9242 treeContextId = 1 << restOfLength | id;
9243 treeContextOverflow = overflow;
9244 } else {
9245 var newBits = slot << baseLength;
9246 var _id = newBits | baseId;
9247 var _overflow = baseOverflow;
9248 treeContextId = 1 << length | _id;
9249 treeContextOverflow = _overflow;
9250 }
9251 }
9252 function pushMaterializedTreeId(workInProgress2) {
9253 warnIfNotHydrating();
9254 var returnFiber = workInProgress2.return;
9255 if (returnFiber !== null) {
9256 var numberOfForks = 1;
9257 var slotIndex = 0;
9258 pushTreeFork(workInProgress2, numberOfForks);
9259 pushTreeId(workInProgress2, numberOfForks, slotIndex);
9260 }
9261 }
9262 function getBitLength(number) {
9263 return 32 - clz32(number);
9264 }
9265 function getLeadingBit(id) {
9266 return 1 << getBitLength(id) - 1;
9267 }
9268 function popTreeContext(workInProgress2) {
9269 while (workInProgress2 === treeForkProvider) {
9270 treeForkProvider = forkStack[--forkStackIndex];
9271 forkStack[forkStackIndex] = null;
9272 treeForkCount = forkStack[--forkStackIndex];
9273 forkStack[forkStackIndex] = null;
9274 }
9275 while (workInProgress2 === treeContextProvider) {
9276 treeContextProvider = idStack[--idStackIndex];
9277 idStack[idStackIndex] = null;
9278 treeContextOverflow = idStack[--idStackIndex];
9279 idStack[idStackIndex] = null;
9280 treeContextId = idStack[--idStackIndex];
9281 idStack[idStackIndex] = null;
9282 }
9283 }
9284 function getSuspendedTreeContext() {
9285 warnIfNotHydrating();
9286 if (treeContextProvider !== null) {
9287 return {
9288 id: treeContextId,
9289 overflow: treeContextOverflow
9290 };
9291 } else {
9292 return null;
9293 }
9294 }
9295 function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
9296 warnIfNotHydrating();
9297 idStack[idStackIndex++] = treeContextId;
9298 idStack[idStackIndex++] = treeContextOverflow;
9299 idStack[idStackIndex++] = treeContextProvider;
9300 treeContextId = suspendedContext.id;
9301 treeContextOverflow = suspendedContext.overflow;
9302 treeContextProvider = workInProgress2;
9303 }
9304 function warnIfNotHydrating() {
9305 {
9306 if (!getIsHydrating()) {
9307 error("Expected to be hydrating. This is a bug in React. Please file an issue.");
9308 }
9309 }
9310 }
9311 var hydrationParentFiber = null;
9312 var nextHydratableInstance = null;
9313 var isHydrating = false;
9314 var didSuspendOrErrorDEV = false;
9315 var hydrationErrors = null;
9316 function warnIfHydrating() {
9317 {
9318 if (isHydrating) {
9319 error("We should not be hydrating here. This is a bug in React. Please file a bug.");
9320 }
9321 }
9322 }
9323 function markDidThrowWhileHydratingDEV() {
9324 {
9325 didSuspendOrErrorDEV = true;
9326 }
9327 }
9328 function didSuspendOrErrorWhileHydratingDEV() {
9329 {
9330 return didSuspendOrErrorDEV;
9331 }
9332 }
9333 function enterHydrationState(fiber) {
9334 var parentInstance = fiber.stateNode.containerInfo;
9335 nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
9336 hydrationParentFiber = fiber;
9337 isHydrating = true;
9338 hydrationErrors = null;
9339 didSuspendOrErrorDEV = false;
9340 return true;
9341 }
9342 function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
9343 nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
9344 hydrationParentFiber = fiber;
9345 isHydrating = true;
9346 hydrationErrors = null;
9347 didSuspendOrErrorDEV = false;
9348 if (treeContext !== null) {
9349 restoreSuspendedTreeContext(fiber, treeContext);
9350 }
9351 return true;
9352 }
9353 function warnUnhydratedInstance(returnFiber, instance) {
9354 {
9355 switch (returnFiber.tag) {
9356 case HostRoot: {
9357 didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
9358 break;
9359 }
9360 case HostComponent: {
9361 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9362 didNotHydrateInstance(
9363 returnFiber.type,
9364 returnFiber.memoizedProps,
9365 returnFiber.stateNode,
9366 instance,
9367 // TODO: Delete this argument when we remove the legacy root API.
9368 isConcurrentMode
9369 );
9370 break;
9371 }
9372 case SuspenseComponent: {
9373 var suspenseState = returnFiber.memoizedState;
9374 if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
9375 break;
9376 }
9377 }
9378 }
9379 }
9380 function deleteHydratableInstance(returnFiber, instance) {
9381 warnUnhydratedInstance(returnFiber, instance);
9382 var childToDelete = createFiberFromHostInstanceForDeletion();
9383 childToDelete.stateNode = instance;
9384 childToDelete.return = returnFiber;
9385 var deletions = returnFiber.deletions;
9386 if (deletions === null) {
9387 returnFiber.deletions = [childToDelete];
9388 returnFiber.flags |= ChildDeletion;
9389 } else {
9390 deletions.push(childToDelete);
9391 }
9392 }
9393 function warnNonhydratedInstance(returnFiber, fiber) {
9394 {
9395 if (didSuspendOrErrorDEV) {
9396 return;
9397 }
9398 switch (returnFiber.tag) {
9399 case HostRoot: {
9400 var parentContainer = returnFiber.stateNode.containerInfo;
9401 switch (fiber.tag) {
9402 case HostComponent:
9403 var type = fiber.type;
9404 var props = fiber.pendingProps;
9405 didNotFindHydratableInstanceWithinContainer(parentContainer, type);
9406 break;
9407 case HostText:
9408 var text = fiber.pendingProps;
9409 didNotFindHydratableTextInstanceWithinContainer(parentContainer, text);
9410 break;
9411 }
9412 break;
9413 }
9414 case HostComponent: {
9415 var parentType = returnFiber.type;
9416 var parentProps = returnFiber.memoizedProps;
9417 var parentInstance = returnFiber.stateNode;
9418 switch (fiber.tag) {
9419 case HostComponent: {
9420 var _type = fiber.type;
9421 var _props = fiber.pendingProps;
9422 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9423 didNotFindHydratableInstance(
9424 parentType,
9425 parentProps,
9426 parentInstance,
9427 _type,
9428 _props,
9429 // TODO: Delete this argument when we remove the legacy root API.
9430 isConcurrentMode
9431 );
9432 break;
9433 }
9434 case HostText: {
9435 var _text = fiber.pendingProps;
9436 var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9437 didNotFindHydratableTextInstance(
9438 parentType,
9439 parentProps,
9440 parentInstance,
9441 _text,
9442 // TODO: Delete this argument when we remove the legacy root API.
9443 _isConcurrentMode
9444 );
9445 break;
9446 }
9447 }
9448 break;
9449 }
9450 case SuspenseComponent: {
9451 var suspenseState = returnFiber.memoizedState;
9452 var _parentInstance = suspenseState.dehydrated;
9453 if (_parentInstance !== null) switch (fiber.tag) {
9454 case HostComponent:
9455 var _type2 = fiber.type;
9456 var _props2 = fiber.pendingProps;
9457 didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
9458 break;
9459 case HostText:
9460 var _text2 = fiber.pendingProps;
9461 didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
9462 break;
9463 }
9464 break;
9465 }
9466 default:
9467 return;
9468 }
9469 }
9470 }
9471 function insertNonHydratedInstance(returnFiber, fiber) {
9472 fiber.flags = fiber.flags & ~Hydrating | Placement;
9473 warnNonhydratedInstance(returnFiber, fiber);
9474 }
9475 function tryHydrate(fiber, nextInstance) {
9476 switch (fiber.tag) {
9477 case HostComponent: {
9478 var type = fiber.type;
9479 var props = fiber.pendingProps;
9480 var instance = canHydrateInstance(nextInstance, type);
9481 if (instance !== null) {
9482 fiber.stateNode = instance;
9483 hydrationParentFiber = fiber;
9484 nextHydratableInstance = getFirstHydratableChild(instance);
9485 return true;
9486 }
9487 return false;
9488 }
9489 case HostText: {
9490 var text = fiber.pendingProps;
9491 var textInstance = canHydrateTextInstance(nextInstance, text);
9492 if (textInstance !== null) {
9493 fiber.stateNode = textInstance;
9494 hydrationParentFiber = fiber;
9495 nextHydratableInstance = null;
9496 return true;
9497 }
9498 return false;
9499 }
9500 case SuspenseComponent: {
9501 var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
9502 if (suspenseInstance !== null) {
9503 var suspenseState = {
9504 dehydrated: suspenseInstance,
9505 treeContext: getSuspendedTreeContext(),
9506 retryLane: OffscreenLane
9507 };
9508 fiber.memoizedState = suspenseState;
9509 var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
9510 dehydratedFragment.return = fiber;
9511 fiber.child = dehydratedFragment;
9512 hydrationParentFiber = fiber;
9513 nextHydratableInstance = null;
9514 return true;
9515 }
9516 return false;
9517 }
9518 default:
9519 return false;
9520 }
9521 }
9522 function shouldClientRenderOnMismatch(fiber) {
9523 return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
9524 }
9525 function throwOnHydrationMismatch(fiber) {
9526 throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
9527 }
9528 function tryToClaimNextHydratableInstance(fiber) {
9529 if (!isHydrating) {
9530 return;
9531 }
9532 var nextInstance = nextHydratableInstance;
9533 if (!nextInstance) {
9534 if (shouldClientRenderOnMismatch(fiber)) {
9535 warnNonhydratedInstance(hydrationParentFiber, fiber);
9536 throwOnHydrationMismatch();
9537 }
9538 insertNonHydratedInstance(hydrationParentFiber, fiber);
9539 isHydrating = false;
9540 hydrationParentFiber = fiber;
9541 return;
9542 }
9543 var firstAttemptedInstance = nextInstance;
9544 if (!tryHydrate(fiber, nextInstance)) {
9545 if (shouldClientRenderOnMismatch(fiber)) {
9546 warnNonhydratedInstance(hydrationParentFiber, fiber);
9547 throwOnHydrationMismatch();
9548 }
9549 nextInstance = getNextHydratableSibling(firstAttemptedInstance);
9550 var prevHydrationParentFiber = hydrationParentFiber;
9551 if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
9552 insertNonHydratedInstance(hydrationParentFiber, fiber);
9553 isHydrating = false;
9554 hydrationParentFiber = fiber;
9555 return;
9556 }
9557 deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
9558 }
9559 }
9560 function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
9561 var instance = fiber.stateNode;
9562 var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
9563 var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
9564 fiber.updateQueue = updatePayload;
9565 if (updatePayload !== null) {
9566 return true;
9567 }
9568 return false;
9569 }
9570 function prepareToHydrateHostTextInstance(fiber) {
9571 var textInstance = fiber.stateNode;
9572 var textContent = fiber.memoizedProps;
9573 var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
9574 if (shouldUpdate) {
9575 var returnFiber = hydrationParentFiber;
9576 if (returnFiber !== null) {
9577 switch (returnFiber.tag) {
9578 case HostRoot: {
9579 var parentContainer = returnFiber.stateNode.containerInfo;
9580 var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
9581 didNotMatchHydratedContainerTextInstance(
9582 parentContainer,
9583 textInstance,
9584 textContent,
9585 // TODO: Delete this argument when we remove the legacy root API.
9586 isConcurrentMode
9587 );
9588 break;
9589 }
9590 case HostComponent: {
9591 var parentType = returnFiber.type;
9592 var parentProps = returnFiber.memoizedProps;
9593 var parentInstance = returnFiber.stateNode;
9594 var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
9595 didNotMatchHydratedTextInstance(
9596 parentType,
9597 parentProps,
9598 parentInstance,
9599 textInstance,
9600 textContent,
9601 // TODO: Delete this argument when we remove the legacy root API.
9602 _isConcurrentMode2
9603 );
9604 break;
9605 }
9606 }
9607 }
9608 }
9609 return shouldUpdate;
9610 }
9611 function prepareToHydrateHostSuspenseInstance(fiber) {
9612 var suspenseState = fiber.memoizedState;
9613 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
9614 if (!suspenseInstance) {
9615 throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
9616 }
9617 hydrateSuspenseInstance(suspenseInstance, fiber);
9618 }
9619 function skipPastDehydratedSuspenseInstance(fiber) {
9620 var suspenseState = fiber.memoizedState;
9621 var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
9622 if (!suspenseInstance) {
9623 throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
9624 }
9625 return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
9626 }
9627 function popToNextHostParent(fiber) {
9628 var parent = fiber.return;
9629 while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
9630 parent = parent.return;
9631 }
9632 hydrationParentFiber = parent;
9633 }
9634 function popHydrationState(fiber) {
9635 if (fiber !== hydrationParentFiber) {
9636 return false;
9637 }
9638 if (!isHydrating) {
9639 popToNextHostParent(fiber);
9640 isHydrating = true;
9641 return false;
9642 }
9643 if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
9644 var nextInstance = nextHydratableInstance;
9645 if (nextInstance) {
9646 if (shouldClientRenderOnMismatch(fiber)) {
9647 warnIfUnhydratedTailNodes(fiber);
9648 throwOnHydrationMismatch();
9649 } else {
9650 while (nextInstance) {
9651 deleteHydratableInstance(fiber, nextInstance);
9652 nextInstance = getNextHydratableSibling(nextInstance);
9653 }
9654 }
9655 }
9656 }
9657 popToNextHostParent(fiber);
9658 if (fiber.tag === SuspenseComponent) {
9659 nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
9660 } else {
9661 nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
9662 }
9663 return true;
9664 }
9665 function hasUnhydratedTailNodes() {
9666 return isHydrating && nextHydratableInstance !== null;
9667 }
9668 function warnIfUnhydratedTailNodes(fiber) {
9669 var nextInstance = nextHydratableInstance;
9670 while (nextInstance) {
9671 warnUnhydratedInstance(fiber, nextInstance);
9672 nextInstance = getNextHydratableSibling(nextInstance);
9673 }
9674 }
9675 function resetHydrationState() {
9676 hydrationParentFiber = null;
9677 nextHydratableInstance = null;
9678 isHydrating = false;
9679 didSuspendOrErrorDEV = false;
9680 }
9681 function upgradeHydrationErrorsToRecoverable() {
9682 if (hydrationErrors !== null) {
9683 queueRecoverableErrors(hydrationErrors);
9684 hydrationErrors = null;
9685 }
9686 }
9687 function getIsHydrating() {
9688 return isHydrating;
9689 }
9690 function queueHydrationError(error2) {
9691 if (hydrationErrors === null) {
9692 hydrationErrors = [error2];
9693 } else {
9694 hydrationErrors.push(error2);
9695 }
9696 }
9697 var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
9698 var NoTransition = null;
9699 function requestCurrentTransition() {
9700 return ReactCurrentBatchConfig$1.transition;
9701 }
9702 var ReactStrictModeWarnings = {
9703 recordUnsafeLifecycleWarnings: function(fiber, instance) {
9704 },
9705 flushPendingUnsafeLifecycleWarnings: function() {
9706 },
9707 recordLegacyContextWarning: function(fiber, instance) {
9708 },
9709 flushLegacyContextWarning: function() {
9710 },
9711 discardPendingWarnings: function() {
9712 }
9713 };
9714 {
9715 var findStrictRoot = function(fiber) {
9716 var maybeStrictRoot = null;
9717 var node = fiber;
9718 while (node !== null) {
9719 if (node.mode & StrictLegacyMode) {
9720 maybeStrictRoot = node;
9721 }
9722 node = node.return;
9723 }
9724 return maybeStrictRoot;
9725 };
9726 var setToSortedString = function(set2) {
9727 var array = [];
9728 set2.forEach(function(value) {
9729 array.push(value);
9730 });
9731 return array.sort().join(", ");
9732 };
9733 var pendingComponentWillMountWarnings = [];
9734 var pendingUNSAFE_ComponentWillMountWarnings = [];
9735 var pendingComponentWillReceivePropsWarnings = [];
9736 var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9737 var pendingComponentWillUpdateWarnings = [];
9738 var pendingUNSAFE_ComponentWillUpdateWarnings = [];
9739 var didWarnAboutUnsafeLifecycles = /* @__PURE__ */ new Set();
9740 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function(fiber, instance) {
9741 if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
9742 return;
9743 }
9744 if (typeof instance.componentWillMount === "function" && // Don't warn about react-lifecycles-compat polyfilled components.
9745 instance.componentWillMount.__suppressDeprecationWarning !== true) {
9746 pendingComponentWillMountWarnings.push(fiber);
9747 }
9748 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
9749 pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
9750 }
9751 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
9752 pendingComponentWillReceivePropsWarnings.push(fiber);
9753 }
9754 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
9755 pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
9756 }
9757 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
9758 pendingComponentWillUpdateWarnings.push(fiber);
9759 }
9760 if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === "function") {
9761 pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
9762 }
9763 };
9764 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function() {
9765 var componentWillMountUniqueNames = /* @__PURE__ */ new Set();
9766 if (pendingComponentWillMountWarnings.length > 0) {
9767 pendingComponentWillMountWarnings.forEach(function(fiber) {
9768 componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9769 didWarnAboutUnsafeLifecycles.add(fiber.type);
9770 });
9771 pendingComponentWillMountWarnings = [];
9772 }
9773 var UNSAFE_componentWillMountUniqueNames = /* @__PURE__ */ new Set();
9774 if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
9775 pendingUNSAFE_ComponentWillMountWarnings.forEach(function(fiber) {
9776 UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9777 didWarnAboutUnsafeLifecycles.add(fiber.type);
9778 });
9779 pendingUNSAFE_ComponentWillMountWarnings = [];
9780 }
9781 var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
9782 if (pendingComponentWillReceivePropsWarnings.length > 0) {
9783 pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
9784 componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9785 didWarnAboutUnsafeLifecycles.add(fiber.type);
9786 });
9787 pendingComponentWillReceivePropsWarnings = [];
9788 }
9789 var UNSAFE_componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
9790 if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
9791 pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function(fiber) {
9792 UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9793 didWarnAboutUnsafeLifecycles.add(fiber.type);
9794 });
9795 pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9796 }
9797 var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
9798 if (pendingComponentWillUpdateWarnings.length > 0) {
9799 pendingComponentWillUpdateWarnings.forEach(function(fiber) {
9800 componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9801 didWarnAboutUnsafeLifecycles.add(fiber.type);
9802 });
9803 pendingComponentWillUpdateWarnings = [];
9804 }
9805 var UNSAFE_componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
9806 if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
9807 pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function(fiber) {
9808 UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9809 didWarnAboutUnsafeLifecycles.add(fiber.type);
9810 });
9811 pendingUNSAFE_ComponentWillUpdateWarnings = [];
9812 }
9813 if (UNSAFE_componentWillMountUniqueNames.size > 0) {
9814 var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
9815 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);
9816 }
9817 if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
9818 var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
9819 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);
9820 }
9821 if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
9822 var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
9823 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);
9824 }
9825 if (componentWillMountUniqueNames.size > 0) {
9826 var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
9827 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);
9828 }
9829 if (componentWillReceivePropsUniqueNames.size > 0) {
9830 var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
9831 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);
9832 }
9833 if (componentWillUpdateUniqueNames.size > 0) {
9834 var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
9835 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);
9836 }
9837 };
9838 var pendingLegacyContextWarning = /* @__PURE__ */ new Map();
9839 var didWarnAboutLegacyContext = /* @__PURE__ */ new Set();
9840 ReactStrictModeWarnings.recordLegacyContextWarning = function(fiber, instance) {
9841 var strictRoot = findStrictRoot(fiber);
9842 if (strictRoot === null) {
9843 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.");
9844 return;
9845 }
9846 if (didWarnAboutLegacyContext.has(fiber.type)) {
9847 return;
9848 }
9849 var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
9850 if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === "function") {
9851 if (warningsForRoot === void 0) {
9852 warningsForRoot = [];
9853 pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
9854 }
9855 warningsForRoot.push(fiber);
9856 }
9857 };
9858 ReactStrictModeWarnings.flushLegacyContextWarning = function() {
9859 pendingLegacyContextWarning.forEach(function(fiberArray, strictRoot) {
9860 if (fiberArray.length === 0) {
9861 return;
9862 }
9863 var firstFiber = fiberArray[0];
9864 var uniqueNames = /* @__PURE__ */ new Set();
9865 fiberArray.forEach(function(fiber) {
9866 uniqueNames.add(getComponentNameFromFiber(fiber) || "Component");
9867 didWarnAboutLegacyContext.add(fiber.type);
9868 });
9869 var sortedNames = setToSortedString(uniqueNames);
9870 try {
9871 setCurrentFiber(firstFiber);
9872 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);
9873 } finally {
9874 resetCurrentFiber();
9875 }
9876 });
9877 };
9878 ReactStrictModeWarnings.discardPendingWarnings = function() {
9879 pendingComponentWillMountWarnings = [];
9880 pendingUNSAFE_ComponentWillMountWarnings = [];
9881 pendingComponentWillReceivePropsWarnings = [];
9882 pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
9883 pendingComponentWillUpdateWarnings = [];
9884 pendingUNSAFE_ComponentWillUpdateWarnings = [];
9885 pendingLegacyContextWarning = /* @__PURE__ */ new Map();
9886 };
9887 }
9888 var didWarnAboutMaps;
9889 var didWarnAboutGenerators;
9890 var didWarnAboutStringRefs;
9891 var ownerHasKeyUseWarning;
9892 var ownerHasFunctionTypeWarning;
9893 var warnForMissingKey = function(child, returnFiber) {
9894 };
9895 {
9896 didWarnAboutMaps = false;
9897 didWarnAboutGenerators = false;
9898 didWarnAboutStringRefs = {};
9899 ownerHasKeyUseWarning = {};
9900 ownerHasFunctionTypeWarning = {};
9901 warnForMissingKey = function(child, returnFiber) {
9902 if (child === null || typeof child !== "object") {
9903 return;
9904 }
9905 if (!child._store || child._store.validated || child.key != null) {
9906 return;
9907 }
9908 if (typeof child._store !== "object") {
9909 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.");
9910 }
9911 child._store.validated = true;
9912 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9913 if (ownerHasKeyUseWarning[componentName]) {
9914 return;
9915 }
9916 ownerHasKeyUseWarning[componentName] = true;
9917 error('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.');
9918 };
9919 }
9920 function isReactClass(type) {
9921 return type.prototype && type.prototype.isReactComponent;
9922 }
9923 function coerceRef(returnFiber, current2, element) {
9924 var mixedRef = element.ref;
9925 if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
9926 {
9927 if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
9928 // because these cannot be automatically converted to an arrow function
9929 // using a codemod. Therefore, we don't have to warn about string refs again.
9930 !(element._owner && element._self && element._owner.stateNode !== element._self) && // Will already throw with "Function components cannot have string refs"
9931 !(element._owner && element._owner.tag !== ClassComponent) && // Will already warn with "Function components cannot be given refs"
9932 !(typeof element.type === "function" && !isReactClass(element.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set"
9933 element._owner) {
9934 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9935 if (!didWarnAboutStringRefs[componentName]) {
9936 {
9937 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);
9938 }
9939 didWarnAboutStringRefs[componentName] = true;
9940 }
9941 }
9942 }
9943 if (element._owner) {
9944 var owner = element._owner;
9945 var inst;
9946 if (owner) {
9947 var ownerFiber = owner;
9948 if (ownerFiber.tag !== ClassComponent) {
9949 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");
9950 }
9951 inst = ownerFiber.stateNode;
9952 }
9953 if (!inst) {
9954 throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
9955 }
9956 var resolvedInst = inst;
9957 {
9958 checkPropStringCoercion(mixedRef, "ref");
9959 }
9960 var stringRef = "" + mixedRef;
9961 if (current2 !== null && current2.ref !== null && typeof current2.ref === "function" && current2.ref._stringRef === stringRef) {
9962 return current2.ref;
9963 }
9964 var ref = function(value) {
9965 var refs = resolvedInst.refs;
9966 if (value === null) {
9967 delete refs[stringRef];
9968 } else {
9969 refs[stringRef] = value;
9970 }
9971 };
9972 ref._stringRef = stringRef;
9973 return ref;
9974 } else {
9975 if (typeof mixedRef !== "string") {
9976 throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
9977 }
9978 if (!element._owner) {
9979 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.");
9980 }
9981 }
9982 }
9983 return mixedRef;
9984 }
9985 function throwOnInvalidObjectType(returnFiber, newChild) {
9986 var childString = Object.prototype.toString.call(newChild);
9987 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.");
9988 }
9989 function warnOnFunctionType(returnFiber) {
9990 {
9991 var componentName = getComponentNameFromFiber(returnFiber) || "Component";
9992 if (ownerHasFunctionTypeWarning[componentName]) {
9993 return;
9994 }
9995 ownerHasFunctionTypeWarning[componentName] = true;
9996 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.");
9997 }
9998 }
9999 function resolveLazy(lazyType) {
10000 var payload = lazyType._payload;
10001 var init = lazyType._init;
10002 return init(payload);
10003 }
10004 function ChildReconciler(shouldTrackSideEffects) {
10005 function deleteChild(returnFiber, childToDelete) {
10006 if (!shouldTrackSideEffects) {
10007 return;
10008 }
10009 var deletions = returnFiber.deletions;
10010 if (deletions === null) {
10011 returnFiber.deletions = [childToDelete];
10012 returnFiber.flags |= ChildDeletion;
10013 } else {
10014 deletions.push(childToDelete);
10015 }
10016 }
10017 function deleteRemainingChildren(returnFiber, currentFirstChild) {
10018 if (!shouldTrackSideEffects) {
10019 return null;
10020 }
10021 var childToDelete = currentFirstChild;
10022 while (childToDelete !== null) {
10023 deleteChild(returnFiber, childToDelete);
10024 childToDelete = childToDelete.sibling;
10025 }
10026 return null;
10027 }
10028 function mapRemainingChildren(returnFiber, currentFirstChild) {
10029 var existingChildren = /* @__PURE__ */ new Map();
10030 var existingChild = currentFirstChild;
10031 while (existingChild !== null) {
10032 if (existingChild.key !== null) {
10033 existingChildren.set(existingChild.key, existingChild);
10034 } else {
10035 existingChildren.set(existingChild.index, existingChild);
10036 }
10037 existingChild = existingChild.sibling;
10038 }
10039 return existingChildren;
10040 }
10041 function useFiber(fiber, pendingProps) {
10042 var clone = createWorkInProgress(fiber, pendingProps);
10043 clone.index = 0;
10044 clone.sibling = null;
10045 return clone;
10046 }
10047 function placeChild(newFiber, lastPlacedIndex, newIndex) {
10048 newFiber.index = newIndex;
10049 if (!shouldTrackSideEffects) {
10050 newFiber.flags |= Forked;
10051 return lastPlacedIndex;
10052 }
10053 var current2 = newFiber.alternate;
10054 if (current2 !== null) {
10055 var oldIndex = current2.index;
10056 if (oldIndex < lastPlacedIndex) {
10057 newFiber.flags |= Placement;
10058 return lastPlacedIndex;
10059 } else {
10060 return oldIndex;
10061 }
10062 } else {
10063 newFiber.flags |= Placement;
10064 return lastPlacedIndex;
10065 }
10066 }
10067 function placeSingleChild(newFiber) {
10068 if (shouldTrackSideEffects && newFiber.alternate === null) {
10069 newFiber.flags |= Placement;
10070 }
10071 return newFiber;
10072 }
10073 function updateTextNode(returnFiber, current2, textContent, lanes) {
10074 if (current2 === null || current2.tag !== HostText) {
10075 var created = createFiberFromText(textContent, returnFiber.mode, lanes);
10076 created.return = returnFiber;
10077 return created;
10078 } else {
10079 var existing = useFiber(current2, textContent);
10080 existing.return = returnFiber;
10081 return existing;
10082 }
10083 }
10084 function updateElement(returnFiber, current2, element, lanes) {
10085 var elementType = element.type;
10086 if (elementType === REACT_FRAGMENT_TYPE) {
10087 return updateFragment2(returnFiber, current2, element.props.children, lanes, element.key);
10088 }
10089 if (current2 !== null) {
10090 if (current2.elementType === elementType || // Keep this check inline so it only runs on the false path:
10091 isCompatibleFamilyForHotReloading(current2, element) || // Lazy types should reconcile their resolved type.
10092 // We need to do this after the Hot Reloading check above,
10093 // because hot reloading has different semantics than prod because
10094 // it doesn't resuspend. So we can't let the call below suspend.
10095 typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
10096 var existing = useFiber(current2, element.props);
10097 existing.ref = coerceRef(returnFiber, current2, element);
10098 existing.return = returnFiber;
10099 {
10100 existing._debugSource = element._source;
10101 existing._debugOwner = element._owner;
10102 }
10103 return existing;
10104 }
10105 }
10106 var created = createFiberFromElement(element, returnFiber.mode, lanes);
10107 created.ref = coerceRef(returnFiber, current2, element);
10108 created.return = returnFiber;
10109 return created;
10110 }
10111 function updatePortal(returnFiber, current2, portal, lanes) {
10112 if (current2 === null || current2.tag !== HostPortal || current2.stateNode.containerInfo !== portal.containerInfo || current2.stateNode.implementation !== portal.implementation) {
10113 var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
10114 created.return = returnFiber;
10115 return created;
10116 } else {
10117 var existing = useFiber(current2, portal.children || []);
10118 existing.return = returnFiber;
10119 return existing;
10120 }
10121 }
10122 function updateFragment2(returnFiber, current2, fragment, lanes, key) {
10123 if (current2 === null || current2.tag !== Fragment) {
10124 var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);
10125 created.return = returnFiber;
10126 return created;
10127 } else {
10128 var existing = useFiber(current2, fragment);
10129 existing.return = returnFiber;
10130 return existing;
10131 }
10132 }
10133 function createChild(returnFiber, newChild, lanes) {
10134 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10135 var created = createFiberFromText("" + newChild, returnFiber.mode, lanes);
10136 created.return = returnFiber;
10137 return created;
10138 }
10139 if (typeof newChild === "object" && newChild !== null) {
10140 switch (newChild.$$typeof) {
10141 case REACT_ELEMENT_TYPE: {
10142 var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);
10143 _created.ref = coerceRef(returnFiber, null, newChild);
10144 _created.return = returnFiber;
10145 return _created;
10146 }
10147 case REACT_PORTAL_TYPE: {
10148 var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);
10149 _created2.return = returnFiber;
10150 return _created2;
10151 }
10152 case REACT_LAZY_TYPE: {
10153 var payload = newChild._payload;
10154 var init = newChild._init;
10155 return createChild(returnFiber, init(payload), lanes);
10156 }
10157 }
10158 if (isArray(newChild) || getIteratorFn(newChild)) {
10159 var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
10160 _created3.return = returnFiber;
10161 return _created3;
10162 }
10163 throwOnInvalidObjectType(returnFiber, newChild);
10164 }
10165 {
10166 if (typeof newChild === "function") {
10167 warnOnFunctionType(returnFiber);
10168 }
10169 }
10170 return null;
10171 }
10172 function updateSlot(returnFiber, oldFiber, newChild, lanes) {
10173 var key = oldFiber !== null ? oldFiber.key : null;
10174 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10175 if (key !== null) {
10176 return null;
10177 }
10178 return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
10179 }
10180 if (typeof newChild === "object" && newChild !== null) {
10181 switch (newChild.$$typeof) {
10182 case REACT_ELEMENT_TYPE: {
10183 if (newChild.key === key) {
10184 return updateElement(returnFiber, oldFiber, newChild, lanes);
10185 } else {
10186 return null;
10187 }
10188 }
10189 case REACT_PORTAL_TYPE: {
10190 if (newChild.key === key) {
10191 return updatePortal(returnFiber, oldFiber, newChild, lanes);
10192 } else {
10193 return null;
10194 }
10195 }
10196 case REACT_LAZY_TYPE: {
10197 var payload = newChild._payload;
10198 var init = newChild._init;
10199 return updateSlot(returnFiber, oldFiber, init(payload), lanes);
10200 }
10201 }
10202 if (isArray(newChild) || getIteratorFn(newChild)) {
10203 if (key !== null) {
10204 return null;
10205 }
10206 return updateFragment2(returnFiber, oldFiber, newChild, lanes, null);
10207 }
10208 throwOnInvalidObjectType(returnFiber, newChild);
10209 }
10210 {
10211 if (typeof newChild === "function") {
10212 warnOnFunctionType(returnFiber);
10213 }
10214 }
10215 return null;
10216 }
10217 function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
10218 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10219 var matchedFiber = existingChildren.get(newIdx) || null;
10220 return updateTextNode(returnFiber, matchedFiber, "" + newChild, lanes);
10221 }
10222 if (typeof newChild === "object" && newChild !== null) {
10223 switch (newChild.$$typeof) {
10224 case REACT_ELEMENT_TYPE: {
10225 var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
10226 return updateElement(returnFiber, _matchedFiber, newChild, lanes);
10227 }
10228 case REACT_PORTAL_TYPE: {
10229 var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
10230 return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);
10231 }
10232 case REACT_LAZY_TYPE:
10233 var payload = newChild._payload;
10234 var init = newChild._init;
10235 return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
10236 }
10237 if (isArray(newChild) || getIteratorFn(newChild)) {
10238 var _matchedFiber3 = existingChildren.get(newIdx) || null;
10239 return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
10240 }
10241 throwOnInvalidObjectType(returnFiber, newChild);
10242 }
10243 {
10244 if (typeof newChild === "function") {
10245 warnOnFunctionType(returnFiber);
10246 }
10247 }
10248 return null;
10249 }
10250 function warnOnInvalidKey(child, knownKeys, returnFiber) {
10251 {
10252 if (typeof child !== "object" || child === null) {
10253 return knownKeys;
10254 }
10255 switch (child.$$typeof) {
10256 case REACT_ELEMENT_TYPE:
10257 case REACT_PORTAL_TYPE:
10258 warnForMissingKey(child, returnFiber);
10259 var key = child.key;
10260 if (typeof key !== "string") {
10261 break;
10262 }
10263 if (knownKeys === null) {
10264 knownKeys = /* @__PURE__ */ new Set();
10265 knownKeys.add(key);
10266 break;
10267 }
10268 if (!knownKeys.has(key)) {
10269 knownKeys.add(key);
10270 break;
10271 }
10272 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);
10273 break;
10274 case REACT_LAZY_TYPE:
10275 var payload = child._payload;
10276 var init = child._init;
10277 warnOnInvalidKey(init(payload), knownKeys, returnFiber);
10278 break;
10279 }
10280 }
10281 return knownKeys;
10282 }
10283 function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
10284 {
10285 var knownKeys = null;
10286 for (var i = 0; i < newChildren.length; i++) {
10287 var child = newChildren[i];
10288 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
10289 }
10290 }
10291 var resultingFirstChild = null;
10292 var previousNewFiber = null;
10293 var oldFiber = currentFirstChild;
10294 var lastPlacedIndex = 0;
10295 var newIdx = 0;
10296 var nextOldFiber = null;
10297 for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
10298 if (oldFiber.index > newIdx) {
10299 nextOldFiber = oldFiber;
10300 oldFiber = null;
10301 } else {
10302 nextOldFiber = oldFiber.sibling;
10303 }
10304 var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);
10305 if (newFiber === null) {
10306 if (oldFiber === null) {
10307 oldFiber = nextOldFiber;
10308 }
10309 break;
10310 }
10311 if (shouldTrackSideEffects) {
10312 if (oldFiber && newFiber.alternate === null) {
10313 deleteChild(returnFiber, oldFiber);
10314 }
10315 }
10316 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
10317 if (previousNewFiber === null) {
10318 resultingFirstChild = newFiber;
10319 } else {
10320 previousNewFiber.sibling = newFiber;
10321 }
10322 previousNewFiber = newFiber;
10323 oldFiber = nextOldFiber;
10324 }
10325 if (newIdx === newChildren.length) {
10326 deleteRemainingChildren(returnFiber, oldFiber);
10327 if (getIsHydrating()) {
10328 var numberOfForks = newIdx;
10329 pushTreeFork(returnFiber, numberOfForks);
10330 }
10331 return resultingFirstChild;
10332 }
10333 if (oldFiber === null) {
10334 for (; newIdx < newChildren.length; newIdx++) {
10335 var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);
10336 if (_newFiber === null) {
10337 continue;
10338 }
10339 lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
10340 if (previousNewFiber === null) {
10341 resultingFirstChild = _newFiber;
10342 } else {
10343 previousNewFiber.sibling = _newFiber;
10344 }
10345 previousNewFiber = _newFiber;
10346 }
10347 if (getIsHydrating()) {
10348 var _numberOfForks = newIdx;
10349 pushTreeFork(returnFiber, _numberOfForks);
10350 }
10351 return resultingFirstChild;
10352 }
10353 var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
10354 for (; newIdx < newChildren.length; newIdx++) {
10355 var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);
10356 if (_newFiber2 !== null) {
10357 if (shouldTrackSideEffects) {
10358 if (_newFiber2.alternate !== null) {
10359 existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
10360 }
10361 }
10362 lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
10363 if (previousNewFiber === null) {
10364 resultingFirstChild = _newFiber2;
10365 } else {
10366 previousNewFiber.sibling = _newFiber2;
10367 }
10368 previousNewFiber = _newFiber2;
10369 }
10370 }
10371 if (shouldTrackSideEffects) {
10372 existingChildren.forEach(function(child2) {
10373 return deleteChild(returnFiber, child2);
10374 });
10375 }
10376 if (getIsHydrating()) {
10377 var _numberOfForks2 = newIdx;
10378 pushTreeFork(returnFiber, _numberOfForks2);
10379 }
10380 return resultingFirstChild;
10381 }
10382 function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
10383 var iteratorFn = getIteratorFn(newChildrenIterable);
10384 if (typeof iteratorFn !== "function") {
10385 throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
10386 }
10387 {
10388 if (typeof Symbol === "function" && // $FlowFixMe Flow doesn't know about toStringTag
10389 newChildrenIterable[Symbol.toStringTag] === "Generator") {
10390 if (!didWarnAboutGenerators) {
10391 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.");
10392 }
10393 didWarnAboutGenerators = true;
10394 }
10395 if (newChildrenIterable.entries === iteratorFn) {
10396 if (!didWarnAboutMaps) {
10397 error("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
10398 }
10399 didWarnAboutMaps = true;
10400 }
10401 var _newChildren = iteratorFn.call(newChildrenIterable);
10402 if (_newChildren) {
10403 var knownKeys = null;
10404 var _step = _newChildren.next();
10405 for (; !_step.done; _step = _newChildren.next()) {
10406 var child = _step.value;
10407 knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
10408 }
10409 }
10410 }
10411 var newChildren = iteratorFn.call(newChildrenIterable);
10412 if (newChildren == null) {
10413 throw new Error("An iterable object provided no iterator.");
10414 }
10415 var resultingFirstChild = null;
10416 var previousNewFiber = null;
10417 var oldFiber = currentFirstChild;
10418 var lastPlacedIndex = 0;
10419 var newIdx = 0;
10420 var nextOldFiber = null;
10421 var step = newChildren.next();
10422 for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
10423 if (oldFiber.index > newIdx) {
10424 nextOldFiber = oldFiber;
10425 oldFiber = null;
10426 } else {
10427 nextOldFiber = oldFiber.sibling;
10428 }
10429 var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
10430 if (newFiber === null) {
10431 if (oldFiber === null) {
10432 oldFiber = nextOldFiber;
10433 }
10434 break;
10435 }
10436 if (shouldTrackSideEffects) {
10437 if (oldFiber && newFiber.alternate === null) {
10438 deleteChild(returnFiber, oldFiber);
10439 }
10440 }
10441 lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
10442 if (previousNewFiber === null) {
10443 resultingFirstChild = newFiber;
10444 } else {
10445 previousNewFiber.sibling = newFiber;
10446 }
10447 previousNewFiber = newFiber;
10448 oldFiber = nextOldFiber;
10449 }
10450 if (step.done) {
10451 deleteRemainingChildren(returnFiber, oldFiber);
10452 if (getIsHydrating()) {
10453 var numberOfForks = newIdx;
10454 pushTreeFork(returnFiber, numberOfForks);
10455 }
10456 return resultingFirstChild;
10457 }
10458 if (oldFiber === null) {
10459 for (; !step.done; newIdx++, step = newChildren.next()) {
10460 var _newFiber3 = createChild(returnFiber, step.value, lanes);
10461 if (_newFiber3 === null) {
10462 continue;
10463 }
10464 lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
10465 if (previousNewFiber === null) {
10466 resultingFirstChild = _newFiber3;
10467 } else {
10468 previousNewFiber.sibling = _newFiber3;
10469 }
10470 previousNewFiber = _newFiber3;
10471 }
10472 if (getIsHydrating()) {
10473 var _numberOfForks3 = newIdx;
10474 pushTreeFork(returnFiber, _numberOfForks3);
10475 }
10476 return resultingFirstChild;
10477 }
10478 var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
10479 for (; !step.done; newIdx++, step = newChildren.next()) {
10480 var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);
10481 if (_newFiber4 !== null) {
10482 if (shouldTrackSideEffects) {
10483 if (_newFiber4.alternate !== null) {
10484 existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
10485 }
10486 }
10487 lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
10488 if (previousNewFiber === null) {
10489 resultingFirstChild = _newFiber4;
10490 } else {
10491 previousNewFiber.sibling = _newFiber4;
10492 }
10493 previousNewFiber = _newFiber4;
10494 }
10495 }
10496 if (shouldTrackSideEffects) {
10497 existingChildren.forEach(function(child2) {
10498 return deleteChild(returnFiber, child2);
10499 });
10500 }
10501 if (getIsHydrating()) {
10502 var _numberOfForks4 = newIdx;
10503 pushTreeFork(returnFiber, _numberOfForks4);
10504 }
10505 return resultingFirstChild;
10506 }
10507 function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {
10508 if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
10509 deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
10510 var existing = useFiber(currentFirstChild, textContent);
10511 existing.return = returnFiber;
10512 return existing;
10513 }
10514 deleteRemainingChildren(returnFiber, currentFirstChild);
10515 var created = createFiberFromText(textContent, returnFiber.mode, lanes);
10516 created.return = returnFiber;
10517 return created;
10518 }
10519 function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
10520 var key = element.key;
10521 var child = currentFirstChild;
10522 while (child !== null) {
10523 if (child.key === key) {
10524 var elementType = element.type;
10525 if (elementType === REACT_FRAGMENT_TYPE) {
10526 if (child.tag === Fragment) {
10527 deleteRemainingChildren(returnFiber, child.sibling);
10528 var existing = useFiber(child, element.props.children);
10529 existing.return = returnFiber;
10530 {
10531 existing._debugSource = element._source;
10532 existing._debugOwner = element._owner;
10533 }
10534 return existing;
10535 }
10536 } else {
10537 if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
10538 isCompatibleFamilyForHotReloading(child, element) || // Lazy types should reconcile their resolved type.
10539 // We need to do this after the Hot Reloading check above,
10540 // because hot reloading has different semantics than prod because
10541 // it doesn't resuspend. So we can't let the call below suspend.
10542 typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
10543 deleteRemainingChildren(returnFiber, child.sibling);
10544 var _existing = useFiber(child, element.props);
10545 _existing.ref = coerceRef(returnFiber, child, element);
10546 _existing.return = returnFiber;
10547 {
10548 _existing._debugSource = element._source;
10549 _existing._debugOwner = element._owner;
10550 }
10551 return _existing;
10552 }
10553 }
10554 deleteRemainingChildren(returnFiber, child);
10555 break;
10556 } else {
10557 deleteChild(returnFiber, child);
10558 }
10559 child = child.sibling;
10560 }
10561 if (element.type === REACT_FRAGMENT_TYPE) {
10562 var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
10563 created.return = returnFiber;
10564 return created;
10565 } else {
10566 var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);
10567 _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
10568 _created4.return = returnFiber;
10569 return _created4;
10570 }
10571 }
10572 function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
10573 var key = portal.key;
10574 var child = currentFirstChild;
10575 while (child !== null) {
10576 if (child.key === key) {
10577 if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
10578 deleteRemainingChildren(returnFiber, child.sibling);
10579 var existing = useFiber(child, portal.children || []);
10580 existing.return = returnFiber;
10581 return existing;
10582 } else {
10583 deleteRemainingChildren(returnFiber, child);
10584 break;
10585 }
10586 } else {
10587 deleteChild(returnFiber, child);
10588 }
10589 child = child.sibling;
10590 }
10591 var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
10592 created.return = returnFiber;
10593 return created;
10594 }
10595 function reconcileChildFibers2(returnFiber, currentFirstChild, newChild, lanes) {
10596 var isUnkeyedTopLevelFragment = typeof newChild === "object" && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
10597 if (isUnkeyedTopLevelFragment) {
10598 newChild = newChild.props.children;
10599 }
10600 if (typeof newChild === "object" && newChild !== null) {
10601 switch (newChild.$$typeof) {
10602 case REACT_ELEMENT_TYPE:
10603 return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));
10604 case REACT_PORTAL_TYPE:
10605 return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));
10606 case REACT_LAZY_TYPE:
10607 var payload = newChild._payload;
10608 var init = newChild._init;
10609 return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
10610 }
10611 if (isArray(newChild)) {
10612 return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
10613 }
10614 if (getIteratorFn(newChild)) {
10615 return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
10616 }
10617 throwOnInvalidObjectType(returnFiber, newChild);
10618 }
10619 if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
10620 return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
10621 }
10622 {
10623 if (typeof newChild === "function") {
10624 warnOnFunctionType(returnFiber);
10625 }
10626 }
10627 return deleteRemainingChildren(returnFiber, currentFirstChild);
10628 }
10629 return reconcileChildFibers2;
10630 }
10631 var reconcileChildFibers = ChildReconciler(true);
10632 var mountChildFibers = ChildReconciler(false);
10633 function cloneChildFibers(current2, workInProgress2) {
10634 if (current2 !== null && workInProgress2.child !== current2.child) {
10635 throw new Error("Resuming work not yet implemented.");
10636 }
10637 if (workInProgress2.child === null) {
10638 return;
10639 }
10640 var currentChild = workInProgress2.child;
10641 var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
10642 workInProgress2.child = newChild;
10643 newChild.return = workInProgress2;
10644 while (currentChild.sibling !== null) {
10645 currentChild = currentChild.sibling;
10646 newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
10647 newChild.return = workInProgress2;
10648 }
10649 newChild.sibling = null;
10650 }
10651 function resetChildFibers(workInProgress2, lanes) {
10652 var child = workInProgress2.child;
10653 while (child !== null) {
10654 resetWorkInProgress(child, lanes);
10655 child = child.sibling;
10656 }
10657 }
10658 var valueCursor = createCursor(null);
10659 var rendererSigil;
10660 {
10661 rendererSigil = {};
10662 }
10663 var currentlyRenderingFiber = null;
10664 var lastContextDependency = null;
10665 var lastFullyObservedContext = null;
10666 var isDisallowedContextReadInDEV = false;
10667 function resetContextDependencies() {
10668 currentlyRenderingFiber = null;
10669 lastContextDependency = null;
10670 lastFullyObservedContext = null;
10671 {
10672 isDisallowedContextReadInDEV = false;
10673 }
10674 }
10675 function enterDisallowedContextReadInDEV() {
10676 {
10677 isDisallowedContextReadInDEV = true;
10678 }
10679 }
10680 function exitDisallowedContextReadInDEV() {
10681 {
10682 isDisallowedContextReadInDEV = false;
10683 }
10684 }
10685 function pushProvider(providerFiber, context, nextValue) {
10686 {
10687 push(valueCursor, context._currentValue, providerFiber);
10688 context._currentValue = nextValue;
10689 {
10690 if (context._currentRenderer !== void 0 && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
10691 error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
10692 }
10693 context._currentRenderer = rendererSigil;
10694 }
10695 }
10696 }
10697 function popProvider(context, providerFiber) {
10698 var currentValue = valueCursor.current;
10699 pop(valueCursor, providerFiber);
10700 {
10701 {
10702 context._currentValue = currentValue;
10703 }
10704 }
10705 }
10706 function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
10707 var node = parent;
10708 while (node !== null) {
10709 var alternate = node.alternate;
10710 if (!isSubsetOfLanes(node.childLanes, renderLanes2)) {
10711 node.childLanes = mergeLanes(node.childLanes, renderLanes2);
10712 if (alternate !== null) {
10713 alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
10714 }
10715 } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes2)) {
10716 alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes2);
10717 }
10718 if (node === propagationRoot) {
10719 break;
10720 }
10721 node = node.return;
10722 }
10723 {
10724 if (node !== propagationRoot) {
10725 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.");
10726 }
10727 }
10728 }
10729 function propagateContextChange(workInProgress2, context, renderLanes2) {
10730 {
10731 propagateContextChange_eager(workInProgress2, context, renderLanes2);
10732 }
10733 }
10734 function propagateContextChange_eager(workInProgress2, context, renderLanes2) {
10735 var fiber = workInProgress2.child;
10736 if (fiber !== null) {
10737 fiber.return = workInProgress2;
10738 }
10739 while (fiber !== null) {
10740 var nextFiber = void 0;
10741 var list = fiber.dependencies;
10742 if (list !== null) {
10743 nextFiber = fiber.child;
10744 var dependency = list.firstContext;
10745 while (dependency !== null) {
10746 if (dependency.context === context) {
10747 if (fiber.tag === ClassComponent) {
10748 var lane = pickArbitraryLane(renderLanes2);
10749 var update = createUpdate(NoTimestamp, lane);
10750 update.tag = ForceUpdate;
10751 var updateQueue = fiber.updateQueue;
10752 if (updateQueue === null) ;
10753 else {
10754 var sharedQueue = updateQueue.shared;
10755 var pending = sharedQueue.pending;
10756 if (pending === null) {
10757 update.next = update;
10758 } else {
10759 update.next = pending.next;
10760 pending.next = update;
10761 }
10762 sharedQueue.pending = update;
10763 }
10764 }
10765 fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
10766 var alternate = fiber.alternate;
10767 if (alternate !== null) {
10768 alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
10769 }
10770 scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
10771 list.lanes = mergeLanes(list.lanes, renderLanes2);
10772 break;
10773 }
10774 dependency = dependency.next;
10775 }
10776 } else if (fiber.tag === ContextProvider) {
10777 nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
10778 } else if (fiber.tag === DehydratedFragment) {
10779 var parentSuspense = fiber.return;
10780 if (parentSuspense === null) {
10781 throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
10782 }
10783 parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
10784 var _alternate = parentSuspense.alternate;
10785 if (_alternate !== null) {
10786 _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
10787 }
10788 scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
10789 nextFiber = fiber.sibling;
10790 } else {
10791 nextFiber = fiber.child;
10792 }
10793 if (nextFiber !== null) {
10794 nextFiber.return = fiber;
10795 } else {
10796 nextFiber = fiber;
10797 while (nextFiber !== null) {
10798 if (nextFiber === workInProgress2) {
10799 nextFiber = null;
10800 break;
10801 }
10802 var sibling = nextFiber.sibling;
10803 if (sibling !== null) {
10804 sibling.return = nextFiber.return;
10805 nextFiber = sibling;
10806 break;
10807 }
10808 nextFiber = nextFiber.return;
10809 }
10810 }
10811 fiber = nextFiber;
10812 }
10813 }
10814 function prepareToReadContext(workInProgress2, renderLanes2) {
10815 currentlyRenderingFiber = workInProgress2;
10816 lastContextDependency = null;
10817 lastFullyObservedContext = null;
10818 var dependencies = workInProgress2.dependencies;
10819 if (dependencies !== null) {
10820 {
10821 var firstContext = dependencies.firstContext;
10822 if (firstContext !== null) {
10823 if (includesSomeLane(dependencies.lanes, renderLanes2)) {
10824 markWorkInProgressReceivedUpdate();
10825 }
10826 dependencies.firstContext = null;
10827 }
10828 }
10829 }
10830 }
10831 function readContext(context) {
10832 {
10833 if (isDisallowedContextReadInDEV) {
10834 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().");
10835 }
10836 }
10837 var value = context._currentValue;
10838 if (lastFullyObservedContext === context) ;
10839 else {
10840 var contextItem = {
10841 context,
10842 memoizedValue: value,
10843 next: null
10844 };
10845 if (lastContextDependency === null) {
10846 if (currentlyRenderingFiber === null) {
10847 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().");
10848 }
10849 lastContextDependency = contextItem;
10850 currentlyRenderingFiber.dependencies = {
10851 lanes: NoLanes,
10852 firstContext: contextItem
10853 };
10854 } else {
10855 lastContextDependency = lastContextDependency.next = contextItem;
10856 }
10857 }
10858 return value;
10859 }
10860 var concurrentQueues = null;
10861 function pushConcurrentUpdateQueue(queue) {
10862 if (concurrentQueues === null) {
10863 concurrentQueues = [queue];
10864 } else {
10865 concurrentQueues.push(queue);
10866 }
10867 }
10868 function finishQueueingConcurrentUpdates() {
10869 if (concurrentQueues !== null) {
10870 for (var i = 0; i < concurrentQueues.length; i++) {
10871 var queue = concurrentQueues[i];
10872 var lastInterleavedUpdate = queue.interleaved;
10873 if (lastInterleavedUpdate !== null) {
10874 queue.interleaved = null;
10875 var firstInterleavedUpdate = lastInterleavedUpdate.next;
10876 var lastPendingUpdate = queue.pending;
10877 if (lastPendingUpdate !== null) {
10878 var firstPendingUpdate = lastPendingUpdate.next;
10879 lastPendingUpdate.next = firstInterleavedUpdate;
10880 lastInterleavedUpdate.next = firstPendingUpdate;
10881 }
10882 queue.pending = lastInterleavedUpdate;
10883 }
10884 }
10885 concurrentQueues = null;
10886 }
10887 }
10888 function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
10889 var interleaved = queue.interleaved;
10890 if (interleaved === null) {
10891 update.next = update;
10892 pushConcurrentUpdateQueue(queue);
10893 } else {
10894 update.next = interleaved.next;
10895 interleaved.next = update;
10896 }
10897 queue.interleaved = update;
10898 return markUpdateLaneFromFiberToRoot(fiber, lane);
10899 }
10900 function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
10901 var interleaved = queue.interleaved;
10902 if (interleaved === null) {
10903 update.next = update;
10904 pushConcurrentUpdateQueue(queue);
10905 } else {
10906 update.next = interleaved.next;
10907 interleaved.next = update;
10908 }
10909 queue.interleaved = update;
10910 }
10911 function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
10912 var interleaved = queue.interleaved;
10913 if (interleaved === null) {
10914 update.next = update;
10915 pushConcurrentUpdateQueue(queue);
10916 } else {
10917 update.next = interleaved.next;
10918 interleaved.next = update;
10919 }
10920 queue.interleaved = update;
10921 return markUpdateLaneFromFiberToRoot(fiber, lane);
10922 }
10923 function enqueueConcurrentRenderForLane(fiber, lane) {
10924 return markUpdateLaneFromFiberToRoot(fiber, lane);
10925 }
10926 var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
10927 function markUpdateLaneFromFiberToRoot(sourceFiber, lane) {
10928 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);
10929 var alternate = sourceFiber.alternate;
10930 if (alternate !== null) {
10931 alternate.lanes = mergeLanes(alternate.lanes, lane);
10932 }
10933 {
10934 if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {
10935 warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
10936 }
10937 }
10938 var node = sourceFiber;
10939 var parent = sourceFiber.return;
10940 while (parent !== null) {
10941 parent.childLanes = mergeLanes(parent.childLanes, lane);
10942 alternate = parent.alternate;
10943 if (alternate !== null) {
10944 alternate.childLanes = mergeLanes(alternate.childLanes, lane);
10945 } else {
10946 {
10947 if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {
10948 warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);
10949 }
10950 }
10951 }
10952 node = parent;
10953 parent = parent.return;
10954 }
10955 if (node.tag === HostRoot) {
10956 var root2 = node.stateNode;
10957 return root2;
10958 } else {
10959 return null;
10960 }
10961 }
10962 var UpdateState = 0;
10963 var ReplaceState = 1;
10964 var ForceUpdate = 2;
10965 var CaptureUpdate = 3;
10966 var hasForceUpdate = false;
10967 var didWarnUpdateInsideUpdate;
10968 var currentlyProcessingQueue;
10969 {
10970 didWarnUpdateInsideUpdate = false;
10971 currentlyProcessingQueue = null;
10972 }
10973 function initializeUpdateQueue(fiber) {
10974 var queue = {
10975 baseState: fiber.memoizedState,
10976 firstBaseUpdate: null,
10977 lastBaseUpdate: null,
10978 shared: {
10979 pending: null,
10980 interleaved: null,
10981 lanes: NoLanes
10982 },
10983 effects: null
10984 };
10985 fiber.updateQueue = queue;
10986 }
10987 function cloneUpdateQueue(current2, workInProgress2) {
10988 var queue = workInProgress2.updateQueue;
10989 var currentQueue = current2.updateQueue;
10990 if (queue === currentQueue) {
10991 var clone = {
10992 baseState: currentQueue.baseState,
10993 firstBaseUpdate: currentQueue.firstBaseUpdate,
10994 lastBaseUpdate: currentQueue.lastBaseUpdate,
10995 shared: currentQueue.shared,
10996 effects: currentQueue.effects
10997 };
10998 workInProgress2.updateQueue = clone;
10999 }
11000 }
11001 function createUpdate(eventTime, lane) {
11002 var update = {
11003 eventTime,
11004 lane,
11005 tag: UpdateState,
11006 payload: null,
11007 callback: null,
11008 next: null
11009 };
11010 return update;
11011 }
11012 function enqueueUpdate(fiber, update, lane) {
11013 var updateQueue = fiber.updateQueue;
11014 if (updateQueue === null) {
11015 return null;
11016 }
11017 var sharedQueue = updateQueue.shared;
11018 {
11019 if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
11020 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.");
11021 didWarnUpdateInsideUpdate = true;
11022 }
11023 }
11024 if (isUnsafeClassRenderPhaseUpdate()) {
11025 var pending = sharedQueue.pending;
11026 if (pending === null) {
11027 update.next = update;
11028 } else {
11029 update.next = pending.next;
11030 pending.next = update;
11031 }
11032 sharedQueue.pending = update;
11033 return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
11034 } else {
11035 return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
11036 }
11037 }
11038 function entangleTransitions(root2, fiber, lane) {
11039 var updateQueue = fiber.updateQueue;
11040 if (updateQueue === null) {
11041 return;
11042 }
11043 var sharedQueue = updateQueue.shared;
11044 if (isTransitionLane(lane)) {
11045 var queueLanes = sharedQueue.lanes;
11046 queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
11047 var newQueueLanes = mergeLanes(queueLanes, lane);
11048 sharedQueue.lanes = newQueueLanes;
11049 markRootEntangled(root2, newQueueLanes);
11050 }
11051 }
11052 function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
11053 var queue = workInProgress2.updateQueue;
11054 var current2 = workInProgress2.alternate;
11055 if (current2 !== null) {
11056 var currentQueue = current2.updateQueue;
11057 if (queue === currentQueue) {
11058 var newFirst = null;
11059 var newLast = null;
11060 var firstBaseUpdate = queue.firstBaseUpdate;
11061 if (firstBaseUpdate !== null) {
11062 var update = firstBaseUpdate;
11063 do {
11064 var clone = {
11065 eventTime: update.eventTime,
11066 lane: update.lane,
11067 tag: update.tag,
11068 payload: update.payload,
11069 callback: update.callback,
11070 next: null
11071 };
11072 if (newLast === null) {
11073 newFirst = newLast = clone;
11074 } else {
11075 newLast.next = clone;
11076 newLast = clone;
11077 }
11078 update = update.next;
11079 } while (update !== null);
11080 if (newLast === null) {
11081 newFirst = newLast = capturedUpdate;
11082 } else {
11083 newLast.next = capturedUpdate;
11084 newLast = capturedUpdate;
11085 }
11086 } else {
11087 newFirst = newLast = capturedUpdate;
11088 }
11089 queue = {
11090 baseState: currentQueue.baseState,
11091 firstBaseUpdate: newFirst,
11092 lastBaseUpdate: newLast,
11093 shared: currentQueue.shared,
11094 effects: currentQueue.effects
11095 };
11096 workInProgress2.updateQueue = queue;
11097 return;
11098 }
11099 }
11100 var lastBaseUpdate = queue.lastBaseUpdate;
11101 if (lastBaseUpdate === null) {
11102 queue.firstBaseUpdate = capturedUpdate;
11103 } else {
11104 lastBaseUpdate.next = capturedUpdate;
11105 }
11106 queue.lastBaseUpdate = capturedUpdate;
11107 }
11108 function getStateFromUpdate(workInProgress2, queue, update, prevState, nextProps, instance) {
11109 switch (update.tag) {
11110 case ReplaceState: {
11111 var payload = update.payload;
11112 if (typeof payload === "function") {
11113 {
11114 enterDisallowedContextReadInDEV();
11115 }
11116 var nextState = payload.call(instance, prevState, nextProps);
11117 {
11118 if (workInProgress2.mode & StrictLegacyMode) {
11119 setIsStrictModeForDevtools(true);
11120 try {
11121 payload.call(instance, prevState, nextProps);
11122 } finally {
11123 setIsStrictModeForDevtools(false);
11124 }
11125 }
11126 exitDisallowedContextReadInDEV();
11127 }
11128 return nextState;
11129 }
11130 return payload;
11131 }
11132 case CaptureUpdate: {
11133 workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
11134 }
11135 // Intentional fallthrough
11136 case UpdateState: {
11137 var _payload = update.payload;
11138 var partialState;
11139 if (typeof _payload === "function") {
11140 {
11141 enterDisallowedContextReadInDEV();
11142 }
11143 partialState = _payload.call(instance, prevState, nextProps);
11144 {
11145 if (workInProgress2.mode & StrictLegacyMode) {
11146 setIsStrictModeForDevtools(true);
11147 try {
11148 _payload.call(instance, prevState, nextProps);
11149 } finally {
11150 setIsStrictModeForDevtools(false);
11151 }
11152 }
11153 exitDisallowedContextReadInDEV();
11154 }
11155 } else {
11156 partialState = _payload;
11157 }
11158 if (partialState === null || partialState === void 0) {
11159 return prevState;
11160 }
11161 return assign({}, prevState, partialState);
11162 }
11163 case ForceUpdate: {
11164 hasForceUpdate = true;
11165 return prevState;
11166 }
11167 }
11168 return prevState;
11169 }
11170 function processUpdateQueue(workInProgress2, props, instance, renderLanes2) {
11171 var queue = workInProgress2.updateQueue;
11172 hasForceUpdate = false;
11173 {
11174 currentlyProcessingQueue = queue.shared;
11175 }
11176 var firstBaseUpdate = queue.firstBaseUpdate;
11177 var lastBaseUpdate = queue.lastBaseUpdate;
11178 var pendingQueue = queue.shared.pending;
11179 if (pendingQueue !== null) {
11180 queue.shared.pending = null;
11181 var lastPendingUpdate = pendingQueue;
11182 var firstPendingUpdate = lastPendingUpdate.next;
11183 lastPendingUpdate.next = null;
11184 if (lastBaseUpdate === null) {
11185 firstBaseUpdate = firstPendingUpdate;
11186 } else {
11187 lastBaseUpdate.next = firstPendingUpdate;
11188 }
11189 lastBaseUpdate = lastPendingUpdate;
11190 var current2 = workInProgress2.alternate;
11191 if (current2 !== null) {
11192 var currentQueue = current2.updateQueue;
11193 var currentLastBaseUpdate = currentQueue.lastBaseUpdate;
11194 if (currentLastBaseUpdate !== lastBaseUpdate) {
11195 if (currentLastBaseUpdate === null) {
11196 currentQueue.firstBaseUpdate = firstPendingUpdate;
11197 } else {
11198 currentLastBaseUpdate.next = firstPendingUpdate;
11199 }
11200 currentQueue.lastBaseUpdate = lastPendingUpdate;
11201 }
11202 }
11203 }
11204 if (firstBaseUpdate !== null) {
11205 var newState = queue.baseState;
11206 var newLanes = NoLanes;
11207 var newBaseState = null;
11208 var newFirstBaseUpdate = null;
11209 var newLastBaseUpdate = null;
11210 var update = firstBaseUpdate;
11211 do {
11212 var updateLane = update.lane;
11213 var updateEventTime = update.eventTime;
11214 if (!isSubsetOfLanes(renderLanes2, updateLane)) {
11215 var clone = {
11216 eventTime: updateEventTime,
11217 lane: updateLane,
11218 tag: update.tag,
11219 payload: update.payload,
11220 callback: update.callback,
11221 next: null
11222 };
11223 if (newLastBaseUpdate === null) {
11224 newFirstBaseUpdate = newLastBaseUpdate = clone;
11225 newBaseState = newState;
11226 } else {
11227 newLastBaseUpdate = newLastBaseUpdate.next = clone;
11228 }
11229 newLanes = mergeLanes(newLanes, updateLane);
11230 } else {
11231 if (newLastBaseUpdate !== null) {
11232 var _clone = {
11233 eventTime: updateEventTime,
11234 // This update is going to be committed so we never want uncommit
11235 // it. Using NoLane works because 0 is a subset of all bitmasks, so
11236 // this will never be skipped by the check above.
11237 lane: NoLane,
11238 tag: update.tag,
11239 payload: update.payload,
11240 callback: update.callback,
11241 next: null
11242 };
11243 newLastBaseUpdate = newLastBaseUpdate.next = _clone;
11244 }
11245 newState = getStateFromUpdate(workInProgress2, queue, update, newState, props, instance);
11246 var callback = update.callback;
11247 if (callback !== null && // If the update was already committed, we should not queue its
11248 // callback again.
11249 update.lane !== NoLane) {
11250 workInProgress2.flags |= Callback;
11251 var effects = queue.effects;
11252 if (effects === null) {
11253 queue.effects = [update];
11254 } else {
11255 effects.push(update);
11256 }
11257 }
11258 }
11259 update = update.next;
11260 if (update === null) {
11261 pendingQueue = queue.shared.pending;
11262 if (pendingQueue === null) {
11263 break;
11264 } else {
11265 var _lastPendingUpdate = pendingQueue;
11266 var _firstPendingUpdate = _lastPendingUpdate.next;
11267 _lastPendingUpdate.next = null;
11268 update = _firstPendingUpdate;
11269 queue.lastBaseUpdate = _lastPendingUpdate;
11270 queue.shared.pending = null;
11271 }
11272 }
11273 } while (true);
11274 if (newLastBaseUpdate === null) {
11275 newBaseState = newState;
11276 }
11277 queue.baseState = newBaseState;
11278 queue.firstBaseUpdate = newFirstBaseUpdate;
11279 queue.lastBaseUpdate = newLastBaseUpdate;
11280 var lastInterleaved = queue.shared.interleaved;
11281 if (lastInterleaved !== null) {
11282 var interleaved = lastInterleaved;
11283 do {
11284 newLanes = mergeLanes(newLanes, interleaved.lane);
11285 interleaved = interleaved.next;
11286 } while (interleaved !== lastInterleaved);
11287 } else if (firstBaseUpdate === null) {
11288 queue.shared.lanes = NoLanes;
11289 }
11290 markSkippedUpdateLanes(newLanes);
11291 workInProgress2.lanes = newLanes;
11292 workInProgress2.memoizedState = newState;
11293 }
11294 {
11295 currentlyProcessingQueue = null;
11296 }
11297 }
11298 function callCallback(callback, context) {
11299 if (typeof callback !== "function") {
11300 throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
11301 }
11302 callback.call(context);
11303 }
11304 function resetHasForceUpdateBeforeProcessing() {
11305 hasForceUpdate = false;
11306 }
11307 function checkHasForceUpdateAfterProcessing() {
11308 return hasForceUpdate;
11309 }
11310 function commitUpdateQueue(finishedWork, finishedQueue, instance) {
11311 var effects = finishedQueue.effects;
11312 finishedQueue.effects = null;
11313 if (effects !== null) {
11314 for (var i = 0; i < effects.length; i++) {
11315 var effect = effects[i];
11316 var callback = effect.callback;
11317 if (callback !== null) {
11318 effect.callback = null;
11319 callCallback(callback, instance);
11320 }
11321 }
11322 }
11323 }
11324 var NO_CONTEXT = {};
11325 var contextStackCursor$1 = createCursor(NO_CONTEXT);
11326 var contextFiberStackCursor = createCursor(NO_CONTEXT);
11327 var rootInstanceStackCursor = createCursor(NO_CONTEXT);
11328 function requiredContext(c) {
11329 if (c === NO_CONTEXT) {
11330 throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
11331 }
11332 return c;
11333 }
11334 function getRootHostContainer() {
11335 var rootInstance = requiredContext(rootInstanceStackCursor.current);
11336 return rootInstance;
11337 }
11338 function pushHostContainer(fiber, nextRootInstance) {
11339 push(rootInstanceStackCursor, nextRootInstance, fiber);
11340 push(contextFiberStackCursor, fiber, fiber);
11341 push(contextStackCursor$1, NO_CONTEXT, fiber);
11342 var nextRootContext = getRootHostContext(nextRootInstance);
11343 pop(contextStackCursor$1, fiber);
11344 push(contextStackCursor$1, nextRootContext, fiber);
11345 }
11346 function popHostContainer(fiber) {
11347 pop(contextStackCursor$1, fiber);
11348 pop(contextFiberStackCursor, fiber);
11349 pop(rootInstanceStackCursor, fiber);
11350 }
11351 function getHostContext() {
11352 var context = requiredContext(contextStackCursor$1.current);
11353 return context;
11354 }
11355 function pushHostContext(fiber) {
11356 var rootInstance = requiredContext(rootInstanceStackCursor.current);
11357 var context = requiredContext(contextStackCursor$1.current);
11358 var nextContext = getChildHostContext(context, fiber.type);
11359 if (context === nextContext) {
11360 return;
11361 }
11362 push(contextFiberStackCursor, fiber, fiber);
11363 push(contextStackCursor$1, nextContext, fiber);
11364 }
11365 function popHostContext(fiber) {
11366 if (contextFiberStackCursor.current !== fiber) {
11367 return;
11368 }
11369 pop(contextStackCursor$1, fiber);
11370 pop(contextFiberStackCursor, fiber);
11371 }
11372 var DefaultSuspenseContext = 0;
11373 var SubtreeSuspenseContextMask = 1;
11374 var InvisibleParentSuspenseContext = 1;
11375 var ForceSuspenseFallback = 2;
11376 var suspenseStackCursor = createCursor(DefaultSuspenseContext);
11377 function hasSuspenseContext(parentContext, flag) {
11378 return (parentContext & flag) !== 0;
11379 }
11380 function setDefaultShallowSuspenseContext(parentContext) {
11381 return parentContext & SubtreeSuspenseContextMask;
11382 }
11383 function setShallowSuspenseContext(parentContext, shallowContext) {
11384 return parentContext & SubtreeSuspenseContextMask | shallowContext;
11385 }
11386 function addSubtreeSuspenseContext(parentContext, subtreeContext) {
11387 return parentContext | subtreeContext;
11388 }
11389 function pushSuspenseContext(fiber, newContext) {
11390 push(suspenseStackCursor, newContext, fiber);
11391 }
11392 function popSuspenseContext(fiber) {
11393 pop(suspenseStackCursor, fiber);
11394 }
11395 function shouldCaptureSuspense(workInProgress2, hasInvisibleParent) {
11396 var nextState = workInProgress2.memoizedState;
11397 if (nextState !== null) {
11398 if (nextState.dehydrated !== null) {
11399 return true;
11400 }
11401 return false;
11402 }
11403 var props = workInProgress2.memoizedProps;
11404 {
11405 return true;
11406 }
11407 }
11408 function findFirstSuspended(row) {
11409 var node = row;
11410 while (node !== null) {
11411 if (node.tag === SuspenseComponent) {
11412 var state = node.memoizedState;
11413 if (state !== null) {
11414 var dehydrated = state.dehydrated;
11415 if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
11416 return node;
11417 }
11418 }
11419 } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
11420 // keep track of whether it suspended or not.
11421 node.memoizedProps.revealOrder !== void 0) {
11422 var didSuspend = (node.flags & DidCapture) !== NoFlags;
11423 if (didSuspend) {
11424 return node;
11425 }
11426 } else if (node.child !== null) {
11427 node.child.return = node;
11428 node = node.child;
11429 continue;
11430 }
11431 if (node === row) {
11432 return null;
11433 }
11434 while (node.sibling === null) {
11435 if (node.return === null || node.return === row) {
11436 return null;
11437 }
11438 node = node.return;
11439 }
11440 node.sibling.return = node.return;
11441 node = node.sibling;
11442 }
11443 return null;
11444 }
11445 var NoFlags$1 = (
11446 /* */
11447 0
11448 );
11449 var HasEffect = (
11450 /* */
11451 1
11452 );
11453 var Insertion = (
11454 /* */
11455 2
11456 );
11457 var Layout = (
11458 /* */
11459 4
11460 );
11461 var Passive$1 = (
11462 /* */
11463 8
11464 );
11465 var workInProgressSources = [];
11466 function resetWorkInProgressVersions() {
11467 for (var i = 0; i < workInProgressSources.length; i++) {
11468 var mutableSource = workInProgressSources[i];
11469 {
11470 mutableSource._workInProgressVersionPrimary = null;
11471 }
11472 }
11473 workInProgressSources.length = 0;
11474 }
11475 function registerMutableSourceForHydration(root2, mutableSource) {
11476 var getVersion = mutableSource._getVersion;
11477 var version = getVersion(mutableSource._source);
11478 if (root2.mutableSourceEagerHydrationData == null) {
11479 root2.mutableSourceEagerHydrationData = [mutableSource, version];
11480 } else {
11481 root2.mutableSourceEagerHydrationData.push(mutableSource, version);
11482 }
11483 }
11484 var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
11485 var didWarnAboutMismatchedHooksForComponent;
11486 var didWarnUncachedGetSnapshot;
11487 {
11488 didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
11489 }
11490 var renderLanes = NoLanes;
11491 var currentlyRenderingFiber$1 = null;
11492 var currentHook = null;
11493 var workInProgressHook = null;
11494 var didScheduleRenderPhaseUpdate = false;
11495 var didScheduleRenderPhaseUpdateDuringThisPass = false;
11496 var localIdCounter = 0;
11497 var globalClientIdCounter = 0;
11498 var RE_RENDER_LIMIT = 25;
11499 var currentHookNameInDev = null;
11500 var hookTypesDev = null;
11501 var hookTypesUpdateIndexDev = -1;
11502 var ignorePreviousDependencies = false;
11503 function mountHookTypesDev() {
11504 {
11505 var hookName = currentHookNameInDev;
11506 if (hookTypesDev === null) {
11507 hookTypesDev = [hookName];
11508 } else {
11509 hookTypesDev.push(hookName);
11510 }
11511 }
11512 }
11513 function updateHookTypesDev() {
11514 {
11515 var hookName = currentHookNameInDev;
11516 if (hookTypesDev !== null) {
11517 hookTypesUpdateIndexDev++;
11518 if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
11519 warnOnHookMismatchInDev(hookName);
11520 }
11521 }
11522 }
11523 }
11524 function checkDepsAreArrayDev(deps) {
11525 {
11526 if (deps !== void 0 && deps !== null && !isArray(deps)) {
11527 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);
11528 }
11529 }
11530 }
11531 function warnOnHookMismatchInDev(currentHookName) {
11532 {
11533 var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1);
11534 if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
11535 didWarnAboutMismatchedHooksForComponent.add(componentName);
11536 if (hookTypesDev !== null) {
11537 var table = "";
11538 var secondColumnStart = 30;
11539 for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
11540 var oldHookName = hookTypesDev[i];
11541 var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
11542 var row = i + 1 + ". " + oldHookName;
11543 while (row.length < secondColumnStart) {
11544 row += " ";
11545 }
11546 row += newHookName + "\n";
11547 table += row;
11548 }
11549 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);
11550 }
11551 }
11552 }
11553 }
11554 function throwInvalidHookError() {
11555 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.");
11556 }
11557 function areHookInputsEqual(nextDeps, prevDeps) {
11558 {
11559 if (ignorePreviousDependencies) {
11560 return false;
11561 }
11562 }
11563 if (prevDeps === null) {
11564 {
11565 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);
11566 }
11567 return false;
11568 }
11569 {
11570 if (nextDeps.length !== prevDeps.length) {
11571 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(", ") + "]");
11572 }
11573 }
11574 for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
11575 if (objectIs(nextDeps[i], prevDeps[i])) {
11576 continue;
11577 }
11578 return false;
11579 }
11580 return true;
11581 }
11582 function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) {
11583 renderLanes = nextRenderLanes;
11584 currentlyRenderingFiber$1 = workInProgress2;
11585 {
11586 hookTypesDev = current2 !== null ? current2._debugHookTypes : null;
11587 hookTypesUpdateIndexDev = -1;
11588 ignorePreviousDependencies = current2 !== null && current2.type !== workInProgress2.type;
11589 }
11590 workInProgress2.memoizedState = null;
11591 workInProgress2.updateQueue = null;
11592 workInProgress2.lanes = NoLanes;
11593 {
11594 if (current2 !== null && current2.memoizedState !== null) {
11595 ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
11596 } else if (hookTypesDev !== null) {
11597 ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
11598 } else {
11599 ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
11600 }
11601 }
11602 var children = Component(props, secondArg);
11603 if (didScheduleRenderPhaseUpdateDuringThisPass) {
11604 var numberOfReRenders = 0;
11605 do {
11606 didScheduleRenderPhaseUpdateDuringThisPass = false;
11607 localIdCounter = 0;
11608 if (numberOfReRenders >= RE_RENDER_LIMIT) {
11609 throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
11610 }
11611 numberOfReRenders += 1;
11612 {
11613 ignorePreviousDependencies = false;
11614 }
11615 currentHook = null;
11616 workInProgressHook = null;
11617 workInProgress2.updateQueue = null;
11618 {
11619 hookTypesUpdateIndexDev = -1;
11620 }
11621 ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV;
11622 children = Component(props, secondArg);
11623 } while (didScheduleRenderPhaseUpdateDuringThisPass);
11624 }
11625 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
11626 {
11627 workInProgress2._debugHookTypes = hookTypesDev;
11628 }
11629 var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
11630 renderLanes = NoLanes;
11631 currentlyRenderingFiber$1 = null;
11632 currentHook = null;
11633 workInProgressHook = null;
11634 {
11635 currentHookNameInDev = null;
11636 hookTypesDev = null;
11637 hookTypesUpdateIndexDev = -1;
11638 if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird
11639 // and creates false positives. To make this work in legacy mode, we'd
11640 // need to mark fibers that commit in an incomplete state, somehow. For
11641 // now I'll disable the warning that most of the bugs that would trigger
11642 // it are either exclusive to concurrent mode or exist in both.
11643 (current2.mode & ConcurrentMode) !== NoMode) {
11644 error("Internal React error: Expected static flag was missing. Please notify the React team.");
11645 }
11646 }
11647 didScheduleRenderPhaseUpdate = false;
11648 if (didRenderTooFewHooks) {
11649 throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
11650 }
11651 return children;
11652 }
11653 function checkDidRenderIdHook() {
11654 var didRenderIdHook = localIdCounter !== 0;
11655 localIdCounter = 0;
11656 return didRenderIdHook;
11657 }
11658 function bailoutHooks(current2, workInProgress2, lanes) {
11659 workInProgress2.updateQueue = current2.updateQueue;
11660 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
11661 workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
11662 } else {
11663 workInProgress2.flags &= ~(Passive | Update);
11664 }
11665 current2.lanes = removeLanes(current2.lanes, lanes);
11666 }
11667 function resetHooksAfterThrow() {
11668 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
11669 if (didScheduleRenderPhaseUpdate) {
11670 var hook = currentlyRenderingFiber$1.memoizedState;
11671 while (hook !== null) {
11672 var queue = hook.queue;
11673 if (queue !== null) {
11674 queue.pending = null;
11675 }
11676 hook = hook.next;
11677 }
11678 didScheduleRenderPhaseUpdate = false;
11679 }
11680 renderLanes = NoLanes;
11681 currentlyRenderingFiber$1 = null;
11682 currentHook = null;
11683 workInProgressHook = null;
11684 {
11685 hookTypesDev = null;
11686 hookTypesUpdateIndexDev = -1;
11687 currentHookNameInDev = null;
11688 isUpdatingOpaqueValueInRenderPhase = false;
11689 }
11690 didScheduleRenderPhaseUpdateDuringThisPass = false;
11691 localIdCounter = 0;
11692 }
11693 function mountWorkInProgressHook() {
11694 var hook = {
11695 memoizedState: null,
11696 baseState: null,
11697 baseQueue: null,
11698 queue: null,
11699 next: null
11700 };
11701 if (workInProgressHook === null) {
11702 currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
11703 } else {
11704 workInProgressHook = workInProgressHook.next = hook;
11705 }
11706 return workInProgressHook;
11707 }
11708 function updateWorkInProgressHook() {
11709 var nextCurrentHook;
11710 if (currentHook === null) {
11711 var current2 = currentlyRenderingFiber$1.alternate;
11712 if (current2 !== null) {
11713 nextCurrentHook = current2.memoizedState;
11714 } else {
11715 nextCurrentHook = null;
11716 }
11717 } else {
11718 nextCurrentHook = currentHook.next;
11719 }
11720 var nextWorkInProgressHook;
11721 if (workInProgressHook === null) {
11722 nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
11723 } else {
11724 nextWorkInProgressHook = workInProgressHook.next;
11725 }
11726 if (nextWorkInProgressHook !== null) {
11727 workInProgressHook = nextWorkInProgressHook;
11728 nextWorkInProgressHook = workInProgressHook.next;
11729 currentHook = nextCurrentHook;
11730 } else {
11731 if (nextCurrentHook === null) {
11732 throw new Error("Rendered more hooks than during the previous render.");
11733 }
11734 currentHook = nextCurrentHook;
11735 var newHook = {
11736 memoizedState: currentHook.memoizedState,
11737 baseState: currentHook.baseState,
11738 baseQueue: currentHook.baseQueue,
11739 queue: currentHook.queue,
11740 next: null
11741 };
11742 if (workInProgressHook === null) {
11743 currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
11744 } else {
11745 workInProgressHook = workInProgressHook.next = newHook;
11746 }
11747 }
11748 return workInProgressHook;
11749 }
11750 function createFunctionComponentUpdateQueue() {
11751 return {
11752 lastEffect: null,
11753 stores: null
11754 };
11755 }
11756 function basicStateReducer(state, action) {
11757 return typeof action === "function" ? action(state) : action;
11758 }
11759 function mountReducer(reducer, initialArg, init) {
11760 var hook = mountWorkInProgressHook();
11761 var initialState;
11762 if (init !== void 0) {
11763 initialState = init(initialArg);
11764 } else {
11765 initialState = initialArg;
11766 }
11767 hook.memoizedState = hook.baseState = initialState;
11768 var queue = {
11769 pending: null,
11770 interleaved: null,
11771 lanes: NoLanes,
11772 dispatch: null,
11773 lastRenderedReducer: reducer,
11774 lastRenderedState: initialState
11775 };
11776 hook.queue = queue;
11777 var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue);
11778 return [hook.memoizedState, dispatch];
11779 }
11780 function updateReducer(reducer, initialArg, init) {
11781 var hook = updateWorkInProgressHook();
11782 var queue = hook.queue;
11783 if (queue === null) {
11784 throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
11785 }
11786 queue.lastRenderedReducer = reducer;
11787 var current2 = currentHook;
11788 var baseQueue = current2.baseQueue;
11789 var pendingQueue = queue.pending;
11790 if (pendingQueue !== null) {
11791 if (baseQueue !== null) {
11792 var baseFirst = baseQueue.next;
11793 var pendingFirst = pendingQueue.next;
11794 baseQueue.next = pendingFirst;
11795 pendingQueue.next = baseFirst;
11796 }
11797 {
11798 if (current2.baseQueue !== baseQueue) {
11799 error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.");
11800 }
11801 }
11802 current2.baseQueue = baseQueue = pendingQueue;
11803 queue.pending = null;
11804 }
11805 if (baseQueue !== null) {
11806 var first = baseQueue.next;
11807 var newState = current2.baseState;
11808 var newBaseState = null;
11809 var newBaseQueueFirst = null;
11810 var newBaseQueueLast = null;
11811 var update = first;
11812 do {
11813 var updateLane = update.lane;
11814 if (!isSubsetOfLanes(renderLanes, updateLane)) {
11815 var clone = {
11816 lane: updateLane,
11817 action: update.action,
11818 hasEagerState: update.hasEagerState,
11819 eagerState: update.eagerState,
11820 next: null
11821 };
11822 if (newBaseQueueLast === null) {
11823 newBaseQueueFirst = newBaseQueueLast = clone;
11824 newBaseState = newState;
11825 } else {
11826 newBaseQueueLast = newBaseQueueLast.next = clone;
11827 }
11828 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
11829 markSkippedUpdateLanes(updateLane);
11830 } else {
11831 if (newBaseQueueLast !== null) {
11832 var _clone = {
11833 // This update is going to be committed so we never want uncommit
11834 // it. Using NoLane works because 0 is a subset of all bitmasks, so
11835 // this will never be skipped by the check above.
11836 lane: NoLane,
11837 action: update.action,
11838 hasEagerState: update.hasEagerState,
11839 eagerState: update.eagerState,
11840 next: null
11841 };
11842 newBaseQueueLast = newBaseQueueLast.next = _clone;
11843 }
11844 if (update.hasEagerState) {
11845 newState = update.eagerState;
11846 } else {
11847 var action = update.action;
11848 newState = reducer(newState, action);
11849 }
11850 }
11851 update = update.next;
11852 } while (update !== null && update !== first);
11853 if (newBaseQueueLast === null) {
11854 newBaseState = newState;
11855 } else {
11856 newBaseQueueLast.next = newBaseQueueFirst;
11857 }
11858 if (!objectIs(newState, hook.memoizedState)) {
11859 markWorkInProgressReceivedUpdate();
11860 }
11861 hook.memoizedState = newState;
11862 hook.baseState = newBaseState;
11863 hook.baseQueue = newBaseQueueLast;
11864 queue.lastRenderedState = newState;
11865 }
11866 var lastInterleaved = queue.interleaved;
11867 if (lastInterleaved !== null) {
11868 var interleaved = lastInterleaved;
11869 do {
11870 var interleavedLane = interleaved.lane;
11871 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
11872 markSkippedUpdateLanes(interleavedLane);
11873 interleaved = interleaved.next;
11874 } while (interleaved !== lastInterleaved);
11875 } else if (baseQueue === null) {
11876 queue.lanes = NoLanes;
11877 }
11878 var dispatch = queue.dispatch;
11879 return [hook.memoizedState, dispatch];
11880 }
11881 function rerenderReducer(reducer, initialArg, init) {
11882 var hook = updateWorkInProgressHook();
11883 var queue = hook.queue;
11884 if (queue === null) {
11885 throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
11886 }
11887 queue.lastRenderedReducer = reducer;
11888 var dispatch = queue.dispatch;
11889 var lastRenderPhaseUpdate = queue.pending;
11890 var newState = hook.memoizedState;
11891 if (lastRenderPhaseUpdate !== null) {
11892 queue.pending = null;
11893 var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
11894 var update = firstRenderPhaseUpdate;
11895 do {
11896 var action = update.action;
11897 newState = reducer(newState, action);
11898 update = update.next;
11899 } while (update !== firstRenderPhaseUpdate);
11900 if (!objectIs(newState, hook.memoizedState)) {
11901 markWorkInProgressReceivedUpdate();
11902 }
11903 hook.memoizedState = newState;
11904 if (hook.baseQueue === null) {
11905 hook.baseState = newState;
11906 }
11907 queue.lastRenderedState = newState;
11908 }
11909 return [newState, dispatch];
11910 }
11911 function mountMutableSource(source, getSnapshot, subscribe) {
11912 {
11913 return void 0;
11914 }
11915 }
11916 function updateMutableSource(source, getSnapshot, subscribe) {
11917 {
11918 return void 0;
11919 }
11920 }
11921 function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
11922 var fiber = currentlyRenderingFiber$1;
11923 var hook = mountWorkInProgressHook();
11924 var nextSnapshot;
11925 var isHydrating2 = getIsHydrating();
11926 if (isHydrating2) {
11927 if (getServerSnapshot === void 0) {
11928 throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
11929 }
11930 nextSnapshot = getServerSnapshot();
11931 {
11932 if (!didWarnUncachedGetSnapshot) {
11933 if (nextSnapshot !== getServerSnapshot()) {
11934 error("The result of getServerSnapshot should be cached to avoid an infinite loop");
11935 didWarnUncachedGetSnapshot = true;
11936 }
11937 }
11938 }
11939 } else {
11940 nextSnapshot = getSnapshot();
11941 {
11942 if (!didWarnUncachedGetSnapshot) {
11943 var cachedSnapshot = getSnapshot();
11944 if (!objectIs(nextSnapshot, cachedSnapshot)) {
11945 error("The result of getSnapshot should be cached to avoid an infinite loop");
11946 didWarnUncachedGetSnapshot = true;
11947 }
11948 }
11949 }
11950 var root2 = getWorkInProgressRoot();
11951 if (root2 === null) {
11952 throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
11953 }
11954 if (!includesBlockingLane(root2, renderLanes)) {
11955 pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
11956 }
11957 }
11958 hook.memoizedState = nextSnapshot;
11959 var inst = {
11960 value: nextSnapshot,
11961 getSnapshot
11962 };
11963 hook.queue = inst;
11964 mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
11965 fiber.flags |= Passive;
11966 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
11967 return nextSnapshot;
11968 }
11969 function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
11970 var fiber = currentlyRenderingFiber$1;
11971 var hook = updateWorkInProgressHook();
11972 var nextSnapshot = getSnapshot();
11973 {
11974 if (!didWarnUncachedGetSnapshot) {
11975 var cachedSnapshot = getSnapshot();
11976 if (!objectIs(nextSnapshot, cachedSnapshot)) {
11977 error("The result of getSnapshot should be cached to avoid an infinite loop");
11978 didWarnUncachedGetSnapshot = true;
11979 }
11980 }
11981 }
11982 var prevSnapshot = hook.memoizedState;
11983 var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
11984 if (snapshotChanged) {
11985 hook.memoizedState = nextSnapshot;
11986 markWorkInProgressReceivedUpdate();
11987 }
11988 var inst = hook.queue;
11989 updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
11990 if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
11991 // checking whether we scheduled a subscription effect above.
11992 workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
11993 fiber.flags |= Passive;
11994 pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
11995 var root2 = getWorkInProgressRoot();
11996 if (root2 === null) {
11997 throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
11998 }
11999 if (!includesBlockingLane(root2, renderLanes)) {
12000 pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
12001 }
12002 }
12003 return nextSnapshot;
12004 }
12005 function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
12006 fiber.flags |= StoreConsistency;
12007 var check = {
12008 getSnapshot,
12009 value: renderedSnapshot
12010 };
12011 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
12012 if (componentUpdateQueue === null) {
12013 componentUpdateQueue = createFunctionComponentUpdateQueue();
12014 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
12015 componentUpdateQueue.stores = [check];
12016 } else {
12017 var stores = componentUpdateQueue.stores;
12018 if (stores === null) {
12019 componentUpdateQueue.stores = [check];
12020 } else {
12021 stores.push(check);
12022 }
12023 }
12024 }
12025 function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
12026 inst.value = nextSnapshot;
12027 inst.getSnapshot = getSnapshot;
12028 if (checkIfSnapshotChanged(inst)) {
12029 forceStoreRerender(fiber);
12030 }
12031 }
12032 function subscribeToStore(fiber, inst, subscribe) {
12033 var handleStoreChange = function() {
12034 if (checkIfSnapshotChanged(inst)) {
12035 forceStoreRerender(fiber);
12036 }
12037 };
12038 return subscribe(handleStoreChange);
12039 }
12040 function checkIfSnapshotChanged(inst) {
12041 var latestGetSnapshot = inst.getSnapshot;
12042 var prevValue = inst.value;
12043 try {
12044 var nextValue = latestGetSnapshot();
12045 return !objectIs(prevValue, nextValue);
12046 } catch (error2) {
12047 return true;
12048 }
12049 }
12050 function forceStoreRerender(fiber) {
12051 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
12052 if (root2 !== null) {
12053 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
12054 }
12055 }
12056 function mountState(initialState) {
12057 var hook = mountWorkInProgressHook();
12058 if (typeof initialState === "function") {
12059 initialState = initialState();
12060 }
12061 hook.memoizedState = hook.baseState = initialState;
12062 var queue = {
12063 pending: null,
12064 interleaved: null,
12065 lanes: NoLanes,
12066 dispatch: null,
12067 lastRenderedReducer: basicStateReducer,
12068 lastRenderedState: initialState
12069 };
12070 hook.queue = queue;
12071 var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
12072 return [hook.memoizedState, dispatch];
12073 }
12074 function updateState(initialState) {
12075 return updateReducer(basicStateReducer);
12076 }
12077 function rerenderState(initialState) {
12078 return rerenderReducer(basicStateReducer);
12079 }
12080 function pushEffect(tag, create, destroy, deps) {
12081 var effect = {
12082 tag,
12083 create,
12084 destroy,
12085 deps,
12086 // Circular
12087 next: null
12088 };
12089 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
12090 if (componentUpdateQueue === null) {
12091 componentUpdateQueue = createFunctionComponentUpdateQueue();
12092 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
12093 componentUpdateQueue.lastEffect = effect.next = effect;
12094 } else {
12095 var lastEffect = componentUpdateQueue.lastEffect;
12096 if (lastEffect === null) {
12097 componentUpdateQueue.lastEffect = effect.next = effect;
12098 } else {
12099 var firstEffect = lastEffect.next;
12100 lastEffect.next = effect;
12101 effect.next = firstEffect;
12102 componentUpdateQueue.lastEffect = effect;
12103 }
12104 }
12105 return effect;
12106 }
12107 function mountRef(initialValue) {
12108 var hook = mountWorkInProgressHook();
12109 {
12110 var _ref2 = {
12111 current: initialValue
12112 };
12113 hook.memoizedState = _ref2;
12114 return _ref2;
12115 }
12116 }
12117 function updateRef(initialValue) {
12118 var hook = updateWorkInProgressHook();
12119 return hook.memoizedState;
12120 }
12121 function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
12122 var hook = mountWorkInProgressHook();
12123 var nextDeps = deps === void 0 ? null : deps;
12124 currentlyRenderingFiber$1.flags |= fiberFlags;
12125 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, void 0, nextDeps);
12126 }
12127 function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
12128 var hook = updateWorkInProgressHook();
12129 var nextDeps = deps === void 0 ? null : deps;
12130 var destroy = void 0;
12131 if (currentHook !== null) {
12132 var prevEffect = currentHook.memoizedState;
12133 destroy = prevEffect.destroy;
12134 if (nextDeps !== null) {
12135 var prevDeps = prevEffect.deps;
12136 if (areHookInputsEqual(nextDeps, prevDeps)) {
12137 hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps);
12138 return;
12139 }
12140 }
12141 }
12142 currentlyRenderingFiber$1.flags |= fiberFlags;
12143 hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);
12144 }
12145 function mountEffect(create, deps) {
12146 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12147 return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
12148 } else {
12149 return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
12150 }
12151 }
12152 function updateEffect(create, deps) {
12153 return updateEffectImpl(Passive, Passive$1, create, deps);
12154 }
12155 function mountInsertionEffect(create, deps) {
12156 return mountEffectImpl(Update, Insertion, create, deps);
12157 }
12158 function updateInsertionEffect(create, deps) {
12159 return updateEffectImpl(Update, Insertion, create, deps);
12160 }
12161 function mountLayoutEffect(create, deps) {
12162 var fiberFlags = Update;
12163 {
12164 fiberFlags |= LayoutStatic;
12165 }
12166 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12167 fiberFlags |= MountLayoutDev;
12168 }
12169 return mountEffectImpl(fiberFlags, Layout, create, deps);
12170 }
12171 function updateLayoutEffect(create, deps) {
12172 return updateEffectImpl(Update, Layout, create, deps);
12173 }
12174 function imperativeHandleEffect(create, ref) {
12175 if (typeof ref === "function") {
12176 var refCallback = ref;
12177 var _inst = create();
12178 refCallback(_inst);
12179 return function() {
12180 refCallback(null);
12181 };
12182 } else if (ref !== null && ref !== void 0) {
12183 var refObject = ref;
12184 {
12185 if (!refObject.hasOwnProperty("current")) {
12186 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(", ") + "}");
12187 }
12188 }
12189 var _inst2 = create();
12190 refObject.current = _inst2;
12191 return function() {
12192 refObject.current = null;
12193 };
12194 }
12195 }
12196 function mountImperativeHandle(ref, create, deps) {
12197 {
12198 if (typeof create !== "function") {
12199 error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
12200 }
12201 }
12202 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
12203 var fiberFlags = Update;
12204 {
12205 fiberFlags |= LayoutStatic;
12206 }
12207 if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
12208 fiberFlags |= MountLayoutDev;
12209 }
12210 return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
12211 }
12212 function updateImperativeHandle(ref, create, deps) {
12213 {
12214 if (typeof create !== "function") {
12215 error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create !== null ? typeof create : "null");
12216 }
12217 }
12218 var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
12219 return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
12220 }
12221 function mountDebugValue(value, formatterFn) {
12222 }
12223 var updateDebugValue = mountDebugValue;
12224 function mountCallback(callback, deps) {
12225 var hook = mountWorkInProgressHook();
12226 var nextDeps = deps === void 0 ? null : deps;
12227 hook.memoizedState = [callback, nextDeps];
12228 return callback;
12229 }
12230 function updateCallback(callback, deps) {
12231 var hook = updateWorkInProgressHook();
12232 var nextDeps = deps === void 0 ? null : deps;
12233 var prevState = hook.memoizedState;
12234 if (prevState !== null) {
12235 if (nextDeps !== null) {
12236 var prevDeps = prevState[1];
12237 if (areHookInputsEqual(nextDeps, prevDeps)) {
12238 return prevState[0];
12239 }
12240 }
12241 }
12242 hook.memoizedState = [callback, nextDeps];
12243 return callback;
12244 }
12245 function mountMemo(nextCreate, deps) {
12246 var hook = mountWorkInProgressHook();
12247 var nextDeps = deps === void 0 ? null : deps;
12248 var nextValue = nextCreate();
12249 hook.memoizedState = [nextValue, nextDeps];
12250 return nextValue;
12251 }
12252 function updateMemo(nextCreate, deps) {
12253 var hook = updateWorkInProgressHook();
12254 var nextDeps = deps === void 0 ? null : deps;
12255 var prevState = hook.memoizedState;
12256 if (prevState !== null) {
12257 if (nextDeps !== null) {
12258 var prevDeps = prevState[1];
12259 if (areHookInputsEqual(nextDeps, prevDeps)) {
12260 return prevState[0];
12261 }
12262 }
12263 }
12264 var nextValue = nextCreate();
12265 hook.memoizedState = [nextValue, nextDeps];
12266 return nextValue;
12267 }
12268 function mountDeferredValue(value) {
12269 var hook = mountWorkInProgressHook();
12270 hook.memoizedState = value;
12271 return value;
12272 }
12273 function updateDeferredValue(value) {
12274 var hook = updateWorkInProgressHook();
12275 var resolvedCurrentHook = currentHook;
12276 var prevValue = resolvedCurrentHook.memoizedState;
12277 return updateDeferredValueImpl(hook, prevValue, value);
12278 }
12279 function rerenderDeferredValue(value) {
12280 var hook = updateWorkInProgressHook();
12281 if (currentHook === null) {
12282 hook.memoizedState = value;
12283 return value;
12284 } else {
12285 var prevValue = currentHook.memoizedState;
12286 return updateDeferredValueImpl(hook, prevValue, value);
12287 }
12288 }
12289 function updateDeferredValueImpl(hook, prevValue, value) {
12290 var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
12291 if (shouldDeferValue) {
12292 if (!objectIs(value, prevValue)) {
12293 var deferredLane = claimNextTransitionLane();
12294 currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
12295 markSkippedUpdateLanes(deferredLane);
12296 hook.baseState = true;
12297 }
12298 return prevValue;
12299 } else {
12300 if (hook.baseState) {
12301 hook.baseState = false;
12302 markWorkInProgressReceivedUpdate();
12303 }
12304 hook.memoizedState = value;
12305 return value;
12306 }
12307 }
12308 function startTransition(setPending, callback, options2) {
12309 var previousPriority = getCurrentUpdatePriority();
12310 setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
12311 setPending(true);
12312 var prevTransition = ReactCurrentBatchConfig$2.transition;
12313 ReactCurrentBatchConfig$2.transition = {};
12314 var currentTransition = ReactCurrentBatchConfig$2.transition;
12315 {
12316 ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
12317 }
12318 try {
12319 setPending(false);
12320 callback();
12321 } finally {
12322 setCurrentUpdatePriority(previousPriority);
12323 ReactCurrentBatchConfig$2.transition = prevTransition;
12324 {
12325 if (prevTransition === null && currentTransition._updatedFibers) {
12326 var updatedFibersCount = currentTransition._updatedFibers.size;
12327 if (updatedFibersCount > 10) {
12328 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.");
12329 }
12330 currentTransition._updatedFibers.clear();
12331 }
12332 }
12333 }
12334 }
12335 function mountTransition() {
12336 var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
12337 var start = startTransition.bind(null, setPending);
12338 var hook = mountWorkInProgressHook();
12339 hook.memoizedState = start;
12340 return [isPending, start];
12341 }
12342 function updateTransition() {
12343 var _updateState = updateState(), isPending = _updateState[0];
12344 var hook = updateWorkInProgressHook();
12345 var start = hook.memoizedState;
12346 return [isPending, start];
12347 }
12348 function rerenderTransition() {
12349 var _rerenderState = rerenderState(), isPending = _rerenderState[0];
12350 var hook = updateWorkInProgressHook();
12351 var start = hook.memoizedState;
12352 return [isPending, start];
12353 }
12354 var isUpdatingOpaqueValueInRenderPhase = false;
12355 function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
12356 {
12357 return isUpdatingOpaqueValueInRenderPhase;
12358 }
12359 }
12360 function mountId() {
12361 var hook = mountWorkInProgressHook();
12362 var root2 = getWorkInProgressRoot();
12363 var identifierPrefix = root2.identifierPrefix;
12364 var id;
12365 if (getIsHydrating()) {
12366 var treeId = getTreeId();
12367 id = ":" + identifierPrefix + "R" + treeId;
12368 var localId = localIdCounter++;
12369 if (localId > 0) {
12370 id += "H" + localId.toString(32);
12371 }
12372 id += ":";
12373 } else {
12374 var globalClientId = globalClientIdCounter++;
12375 id = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
12376 }
12377 hook.memoizedState = id;
12378 return id;
12379 }
12380 function updateId() {
12381 var hook = updateWorkInProgressHook();
12382 var id = hook.memoizedState;
12383 return id;
12384 }
12385 function dispatchReducerAction(fiber, queue, action) {
12386 {
12387 if (typeof arguments[3] === "function") {
12388 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().");
12389 }
12390 }
12391 var lane = requestUpdateLane(fiber);
12392 var update = {
12393 lane,
12394 action,
12395 hasEagerState: false,
12396 eagerState: null,
12397 next: null
12398 };
12399 if (isRenderPhaseUpdate(fiber)) {
12400 enqueueRenderPhaseUpdate(queue, update);
12401 } else {
12402 var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
12403 if (root2 !== null) {
12404 var eventTime = requestEventTime();
12405 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
12406 entangleTransitionUpdate(root2, queue, lane);
12407 }
12408 }
12409 markUpdateInDevTools(fiber, lane);
12410 }
12411 function dispatchSetState(fiber, queue, action) {
12412 {
12413 if (typeof arguments[3] === "function") {
12414 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().");
12415 }
12416 }
12417 var lane = requestUpdateLane(fiber);
12418 var update = {
12419 lane,
12420 action,
12421 hasEagerState: false,
12422 eagerState: null,
12423 next: null
12424 };
12425 if (isRenderPhaseUpdate(fiber)) {
12426 enqueueRenderPhaseUpdate(queue, update);
12427 } else {
12428 var alternate = fiber.alternate;
12429 if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
12430 var lastRenderedReducer = queue.lastRenderedReducer;
12431 if (lastRenderedReducer !== null) {
12432 var prevDispatcher;
12433 {
12434 prevDispatcher = ReactCurrentDispatcher$1.current;
12435 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12436 }
12437 try {
12438 var currentState = queue.lastRenderedState;
12439 var eagerState = lastRenderedReducer(currentState, action);
12440 update.hasEagerState = true;
12441 update.eagerState = eagerState;
12442 if (objectIs(eagerState, currentState)) {
12443 enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
12444 return;
12445 }
12446 } catch (error2) {
12447 } finally {
12448 {
12449 ReactCurrentDispatcher$1.current = prevDispatcher;
12450 }
12451 }
12452 }
12453 }
12454 var root2 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
12455 if (root2 !== null) {
12456 var eventTime = requestEventTime();
12457 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
12458 entangleTransitionUpdate(root2, queue, lane);
12459 }
12460 }
12461 markUpdateInDevTools(fiber, lane);
12462 }
12463 function isRenderPhaseUpdate(fiber) {
12464 var alternate = fiber.alternate;
12465 return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
12466 }
12467 function enqueueRenderPhaseUpdate(queue, update) {
12468 didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
12469 var pending = queue.pending;
12470 if (pending === null) {
12471 update.next = update;
12472 } else {
12473 update.next = pending.next;
12474 pending.next = update;
12475 }
12476 queue.pending = update;
12477 }
12478 function entangleTransitionUpdate(root2, queue, lane) {
12479 if (isTransitionLane(lane)) {
12480 var queueLanes = queue.lanes;
12481 queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
12482 var newQueueLanes = mergeLanes(queueLanes, lane);
12483 queue.lanes = newQueueLanes;
12484 markRootEntangled(root2, newQueueLanes);
12485 }
12486 }
12487 function markUpdateInDevTools(fiber, lane, action) {
12488 {
12489 markStateUpdateScheduled(fiber, lane);
12490 }
12491 }
12492 var ContextOnlyDispatcher = {
12493 readContext,
12494 useCallback: throwInvalidHookError,
12495 useContext: throwInvalidHookError,
12496 useEffect: throwInvalidHookError,
12497 useImperativeHandle: throwInvalidHookError,
12498 useInsertionEffect: throwInvalidHookError,
12499 useLayoutEffect: throwInvalidHookError,
12500 useMemo: throwInvalidHookError,
12501 useReducer: throwInvalidHookError,
12502 useRef: throwInvalidHookError,
12503 useState: throwInvalidHookError,
12504 useDebugValue: throwInvalidHookError,
12505 useDeferredValue: throwInvalidHookError,
12506 useTransition: throwInvalidHookError,
12507 useMutableSource: throwInvalidHookError,
12508 useSyncExternalStore: throwInvalidHookError,
12509 useId: throwInvalidHookError,
12510 unstable_isNewReconciler: enableNewReconciler
12511 };
12512 var HooksDispatcherOnMountInDEV = null;
12513 var HooksDispatcherOnMountWithHookTypesInDEV = null;
12514 var HooksDispatcherOnUpdateInDEV = null;
12515 var HooksDispatcherOnRerenderInDEV = null;
12516 var InvalidNestedHooksDispatcherOnMountInDEV = null;
12517 var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
12518 var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
12519 {
12520 var warnInvalidContextAccess = function() {
12521 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().");
12522 };
12523 var warnInvalidHookAccess = function() {
12524 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");
12525 };
12526 HooksDispatcherOnMountInDEV = {
12527 readContext: function(context) {
12528 return readContext(context);
12529 },
12530 useCallback: function(callback, deps) {
12531 currentHookNameInDev = "useCallback";
12532 mountHookTypesDev();
12533 checkDepsAreArrayDev(deps);
12534 return mountCallback(callback, deps);
12535 },
12536 useContext: function(context) {
12537 currentHookNameInDev = "useContext";
12538 mountHookTypesDev();
12539 return readContext(context);
12540 },
12541 useEffect: function(create, deps) {
12542 currentHookNameInDev = "useEffect";
12543 mountHookTypesDev();
12544 checkDepsAreArrayDev(deps);
12545 return mountEffect(create, deps);
12546 },
12547 useImperativeHandle: function(ref, create, deps) {
12548 currentHookNameInDev = "useImperativeHandle";
12549 mountHookTypesDev();
12550 checkDepsAreArrayDev(deps);
12551 return mountImperativeHandle(ref, create, deps);
12552 },
12553 useInsertionEffect: function(create, deps) {
12554 currentHookNameInDev = "useInsertionEffect";
12555 mountHookTypesDev();
12556 checkDepsAreArrayDev(deps);
12557 return mountInsertionEffect(create, deps);
12558 },
12559 useLayoutEffect: function(create, deps) {
12560 currentHookNameInDev = "useLayoutEffect";
12561 mountHookTypesDev();
12562 checkDepsAreArrayDev(deps);
12563 return mountLayoutEffect(create, deps);
12564 },
12565 useMemo: function(create, deps) {
12566 currentHookNameInDev = "useMemo";
12567 mountHookTypesDev();
12568 checkDepsAreArrayDev(deps);
12569 var prevDispatcher = ReactCurrentDispatcher$1.current;
12570 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12571 try {
12572 return mountMemo(create, deps);
12573 } finally {
12574 ReactCurrentDispatcher$1.current = prevDispatcher;
12575 }
12576 },
12577 useReducer: function(reducer, initialArg, init) {
12578 currentHookNameInDev = "useReducer";
12579 mountHookTypesDev();
12580 var prevDispatcher = ReactCurrentDispatcher$1.current;
12581 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12582 try {
12583 return mountReducer(reducer, initialArg, init);
12584 } finally {
12585 ReactCurrentDispatcher$1.current = prevDispatcher;
12586 }
12587 },
12588 useRef: function(initialValue) {
12589 currentHookNameInDev = "useRef";
12590 mountHookTypesDev();
12591 return mountRef(initialValue);
12592 },
12593 useState: function(initialState) {
12594 currentHookNameInDev = "useState";
12595 mountHookTypesDev();
12596 var prevDispatcher = ReactCurrentDispatcher$1.current;
12597 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12598 try {
12599 return mountState(initialState);
12600 } finally {
12601 ReactCurrentDispatcher$1.current = prevDispatcher;
12602 }
12603 },
12604 useDebugValue: function(value, formatterFn) {
12605 currentHookNameInDev = "useDebugValue";
12606 mountHookTypesDev();
12607 return mountDebugValue();
12608 },
12609 useDeferredValue: function(value) {
12610 currentHookNameInDev = "useDeferredValue";
12611 mountHookTypesDev();
12612 return mountDeferredValue(value);
12613 },
12614 useTransition: function() {
12615 currentHookNameInDev = "useTransition";
12616 mountHookTypesDev();
12617 return mountTransition();
12618 },
12619 useMutableSource: function(source, getSnapshot, subscribe) {
12620 currentHookNameInDev = "useMutableSource";
12621 mountHookTypesDev();
12622 return mountMutableSource();
12623 },
12624 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12625 currentHookNameInDev = "useSyncExternalStore";
12626 mountHookTypesDev();
12627 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
12628 },
12629 useId: function() {
12630 currentHookNameInDev = "useId";
12631 mountHookTypesDev();
12632 return mountId();
12633 },
12634 unstable_isNewReconciler: enableNewReconciler
12635 };
12636 HooksDispatcherOnMountWithHookTypesInDEV = {
12637 readContext: function(context) {
12638 return readContext(context);
12639 },
12640 useCallback: function(callback, deps) {
12641 currentHookNameInDev = "useCallback";
12642 updateHookTypesDev();
12643 return mountCallback(callback, deps);
12644 },
12645 useContext: function(context) {
12646 currentHookNameInDev = "useContext";
12647 updateHookTypesDev();
12648 return readContext(context);
12649 },
12650 useEffect: function(create, deps) {
12651 currentHookNameInDev = "useEffect";
12652 updateHookTypesDev();
12653 return mountEffect(create, deps);
12654 },
12655 useImperativeHandle: function(ref, create, deps) {
12656 currentHookNameInDev = "useImperativeHandle";
12657 updateHookTypesDev();
12658 return mountImperativeHandle(ref, create, deps);
12659 },
12660 useInsertionEffect: function(create, deps) {
12661 currentHookNameInDev = "useInsertionEffect";
12662 updateHookTypesDev();
12663 return mountInsertionEffect(create, deps);
12664 },
12665 useLayoutEffect: function(create, deps) {
12666 currentHookNameInDev = "useLayoutEffect";
12667 updateHookTypesDev();
12668 return mountLayoutEffect(create, deps);
12669 },
12670 useMemo: function(create, deps) {
12671 currentHookNameInDev = "useMemo";
12672 updateHookTypesDev();
12673 var prevDispatcher = ReactCurrentDispatcher$1.current;
12674 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12675 try {
12676 return mountMemo(create, deps);
12677 } finally {
12678 ReactCurrentDispatcher$1.current = prevDispatcher;
12679 }
12680 },
12681 useReducer: function(reducer, initialArg, init) {
12682 currentHookNameInDev = "useReducer";
12683 updateHookTypesDev();
12684 var prevDispatcher = ReactCurrentDispatcher$1.current;
12685 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12686 try {
12687 return mountReducer(reducer, initialArg, init);
12688 } finally {
12689 ReactCurrentDispatcher$1.current = prevDispatcher;
12690 }
12691 },
12692 useRef: function(initialValue) {
12693 currentHookNameInDev = "useRef";
12694 updateHookTypesDev();
12695 return mountRef(initialValue);
12696 },
12697 useState: function(initialState) {
12698 currentHookNameInDev = "useState";
12699 updateHookTypesDev();
12700 var prevDispatcher = ReactCurrentDispatcher$1.current;
12701 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12702 try {
12703 return mountState(initialState);
12704 } finally {
12705 ReactCurrentDispatcher$1.current = prevDispatcher;
12706 }
12707 },
12708 useDebugValue: function(value, formatterFn) {
12709 currentHookNameInDev = "useDebugValue";
12710 updateHookTypesDev();
12711 return mountDebugValue();
12712 },
12713 useDeferredValue: function(value) {
12714 currentHookNameInDev = "useDeferredValue";
12715 updateHookTypesDev();
12716 return mountDeferredValue(value);
12717 },
12718 useTransition: function() {
12719 currentHookNameInDev = "useTransition";
12720 updateHookTypesDev();
12721 return mountTransition();
12722 },
12723 useMutableSource: function(source, getSnapshot, subscribe) {
12724 currentHookNameInDev = "useMutableSource";
12725 updateHookTypesDev();
12726 return mountMutableSource();
12727 },
12728 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12729 currentHookNameInDev = "useSyncExternalStore";
12730 updateHookTypesDev();
12731 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
12732 },
12733 useId: function() {
12734 currentHookNameInDev = "useId";
12735 updateHookTypesDev();
12736 return mountId();
12737 },
12738 unstable_isNewReconciler: enableNewReconciler
12739 };
12740 HooksDispatcherOnUpdateInDEV = {
12741 readContext: function(context) {
12742 return readContext(context);
12743 },
12744 useCallback: function(callback, deps) {
12745 currentHookNameInDev = "useCallback";
12746 updateHookTypesDev();
12747 return updateCallback(callback, deps);
12748 },
12749 useContext: function(context) {
12750 currentHookNameInDev = "useContext";
12751 updateHookTypesDev();
12752 return readContext(context);
12753 },
12754 useEffect: function(create, deps) {
12755 currentHookNameInDev = "useEffect";
12756 updateHookTypesDev();
12757 return updateEffect(create, deps);
12758 },
12759 useImperativeHandle: function(ref, create, deps) {
12760 currentHookNameInDev = "useImperativeHandle";
12761 updateHookTypesDev();
12762 return updateImperativeHandle(ref, create, deps);
12763 },
12764 useInsertionEffect: function(create, deps) {
12765 currentHookNameInDev = "useInsertionEffect";
12766 updateHookTypesDev();
12767 return updateInsertionEffect(create, deps);
12768 },
12769 useLayoutEffect: function(create, deps) {
12770 currentHookNameInDev = "useLayoutEffect";
12771 updateHookTypesDev();
12772 return updateLayoutEffect(create, deps);
12773 },
12774 useMemo: function(create, deps) {
12775 currentHookNameInDev = "useMemo";
12776 updateHookTypesDev();
12777 var prevDispatcher = ReactCurrentDispatcher$1.current;
12778 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12779 try {
12780 return updateMemo(create, deps);
12781 } finally {
12782 ReactCurrentDispatcher$1.current = prevDispatcher;
12783 }
12784 },
12785 useReducer: function(reducer, initialArg, init) {
12786 currentHookNameInDev = "useReducer";
12787 updateHookTypesDev();
12788 var prevDispatcher = ReactCurrentDispatcher$1.current;
12789 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12790 try {
12791 return updateReducer(reducer, initialArg, init);
12792 } finally {
12793 ReactCurrentDispatcher$1.current = prevDispatcher;
12794 }
12795 },
12796 useRef: function(initialValue) {
12797 currentHookNameInDev = "useRef";
12798 updateHookTypesDev();
12799 return updateRef();
12800 },
12801 useState: function(initialState) {
12802 currentHookNameInDev = "useState";
12803 updateHookTypesDev();
12804 var prevDispatcher = ReactCurrentDispatcher$1.current;
12805 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
12806 try {
12807 return updateState(initialState);
12808 } finally {
12809 ReactCurrentDispatcher$1.current = prevDispatcher;
12810 }
12811 },
12812 useDebugValue: function(value, formatterFn) {
12813 currentHookNameInDev = "useDebugValue";
12814 updateHookTypesDev();
12815 return updateDebugValue();
12816 },
12817 useDeferredValue: function(value) {
12818 currentHookNameInDev = "useDeferredValue";
12819 updateHookTypesDev();
12820 return updateDeferredValue(value);
12821 },
12822 useTransition: function() {
12823 currentHookNameInDev = "useTransition";
12824 updateHookTypesDev();
12825 return updateTransition();
12826 },
12827 useMutableSource: function(source, getSnapshot, subscribe) {
12828 currentHookNameInDev = "useMutableSource";
12829 updateHookTypesDev();
12830 return updateMutableSource();
12831 },
12832 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12833 currentHookNameInDev = "useSyncExternalStore";
12834 updateHookTypesDev();
12835 return updateSyncExternalStore(subscribe, getSnapshot);
12836 },
12837 useId: function() {
12838 currentHookNameInDev = "useId";
12839 updateHookTypesDev();
12840 return updateId();
12841 },
12842 unstable_isNewReconciler: enableNewReconciler
12843 };
12844 HooksDispatcherOnRerenderInDEV = {
12845 readContext: function(context) {
12846 return readContext(context);
12847 },
12848 useCallback: function(callback, deps) {
12849 currentHookNameInDev = "useCallback";
12850 updateHookTypesDev();
12851 return updateCallback(callback, deps);
12852 },
12853 useContext: function(context) {
12854 currentHookNameInDev = "useContext";
12855 updateHookTypesDev();
12856 return readContext(context);
12857 },
12858 useEffect: function(create, deps) {
12859 currentHookNameInDev = "useEffect";
12860 updateHookTypesDev();
12861 return updateEffect(create, deps);
12862 },
12863 useImperativeHandle: function(ref, create, deps) {
12864 currentHookNameInDev = "useImperativeHandle";
12865 updateHookTypesDev();
12866 return updateImperativeHandle(ref, create, deps);
12867 },
12868 useInsertionEffect: function(create, deps) {
12869 currentHookNameInDev = "useInsertionEffect";
12870 updateHookTypesDev();
12871 return updateInsertionEffect(create, deps);
12872 },
12873 useLayoutEffect: function(create, deps) {
12874 currentHookNameInDev = "useLayoutEffect";
12875 updateHookTypesDev();
12876 return updateLayoutEffect(create, deps);
12877 },
12878 useMemo: function(create, deps) {
12879 currentHookNameInDev = "useMemo";
12880 updateHookTypesDev();
12881 var prevDispatcher = ReactCurrentDispatcher$1.current;
12882 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12883 try {
12884 return updateMemo(create, deps);
12885 } finally {
12886 ReactCurrentDispatcher$1.current = prevDispatcher;
12887 }
12888 },
12889 useReducer: function(reducer, initialArg, init) {
12890 currentHookNameInDev = "useReducer";
12891 updateHookTypesDev();
12892 var prevDispatcher = ReactCurrentDispatcher$1.current;
12893 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12894 try {
12895 return rerenderReducer(reducer, initialArg, init);
12896 } finally {
12897 ReactCurrentDispatcher$1.current = prevDispatcher;
12898 }
12899 },
12900 useRef: function(initialValue) {
12901 currentHookNameInDev = "useRef";
12902 updateHookTypesDev();
12903 return updateRef();
12904 },
12905 useState: function(initialState) {
12906 currentHookNameInDev = "useState";
12907 updateHookTypesDev();
12908 var prevDispatcher = ReactCurrentDispatcher$1.current;
12909 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
12910 try {
12911 return rerenderState(initialState);
12912 } finally {
12913 ReactCurrentDispatcher$1.current = prevDispatcher;
12914 }
12915 },
12916 useDebugValue: function(value, formatterFn) {
12917 currentHookNameInDev = "useDebugValue";
12918 updateHookTypesDev();
12919 return updateDebugValue();
12920 },
12921 useDeferredValue: function(value) {
12922 currentHookNameInDev = "useDeferredValue";
12923 updateHookTypesDev();
12924 return rerenderDeferredValue(value);
12925 },
12926 useTransition: function() {
12927 currentHookNameInDev = "useTransition";
12928 updateHookTypesDev();
12929 return rerenderTransition();
12930 },
12931 useMutableSource: function(source, getSnapshot, subscribe) {
12932 currentHookNameInDev = "useMutableSource";
12933 updateHookTypesDev();
12934 return updateMutableSource();
12935 },
12936 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
12937 currentHookNameInDev = "useSyncExternalStore";
12938 updateHookTypesDev();
12939 return updateSyncExternalStore(subscribe, getSnapshot);
12940 },
12941 useId: function() {
12942 currentHookNameInDev = "useId";
12943 updateHookTypesDev();
12944 return updateId();
12945 },
12946 unstable_isNewReconciler: enableNewReconciler
12947 };
12948 InvalidNestedHooksDispatcherOnMountInDEV = {
12949 readContext: function(context) {
12950 warnInvalidContextAccess();
12951 return readContext(context);
12952 },
12953 useCallback: function(callback, deps) {
12954 currentHookNameInDev = "useCallback";
12955 warnInvalidHookAccess();
12956 mountHookTypesDev();
12957 return mountCallback(callback, deps);
12958 },
12959 useContext: function(context) {
12960 currentHookNameInDev = "useContext";
12961 warnInvalidHookAccess();
12962 mountHookTypesDev();
12963 return readContext(context);
12964 },
12965 useEffect: function(create, deps) {
12966 currentHookNameInDev = "useEffect";
12967 warnInvalidHookAccess();
12968 mountHookTypesDev();
12969 return mountEffect(create, deps);
12970 },
12971 useImperativeHandle: function(ref, create, deps) {
12972 currentHookNameInDev = "useImperativeHandle";
12973 warnInvalidHookAccess();
12974 mountHookTypesDev();
12975 return mountImperativeHandle(ref, create, deps);
12976 },
12977 useInsertionEffect: function(create, deps) {
12978 currentHookNameInDev = "useInsertionEffect";
12979 warnInvalidHookAccess();
12980 mountHookTypesDev();
12981 return mountInsertionEffect(create, deps);
12982 },
12983 useLayoutEffect: function(create, deps) {
12984 currentHookNameInDev = "useLayoutEffect";
12985 warnInvalidHookAccess();
12986 mountHookTypesDev();
12987 return mountLayoutEffect(create, deps);
12988 },
12989 useMemo: function(create, deps) {
12990 currentHookNameInDev = "useMemo";
12991 warnInvalidHookAccess();
12992 mountHookTypesDev();
12993 var prevDispatcher = ReactCurrentDispatcher$1.current;
12994 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
12995 try {
12996 return mountMemo(create, deps);
12997 } finally {
12998 ReactCurrentDispatcher$1.current = prevDispatcher;
12999 }
13000 },
13001 useReducer: function(reducer, initialArg, init) {
13002 currentHookNameInDev = "useReducer";
13003 warnInvalidHookAccess();
13004 mountHookTypesDev();
13005 var prevDispatcher = ReactCurrentDispatcher$1.current;
13006 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
13007 try {
13008 return mountReducer(reducer, initialArg, init);
13009 } finally {
13010 ReactCurrentDispatcher$1.current = prevDispatcher;
13011 }
13012 },
13013 useRef: function(initialValue) {
13014 currentHookNameInDev = "useRef";
13015 warnInvalidHookAccess();
13016 mountHookTypesDev();
13017 return mountRef(initialValue);
13018 },
13019 useState: function(initialState) {
13020 currentHookNameInDev = "useState";
13021 warnInvalidHookAccess();
13022 mountHookTypesDev();
13023 var prevDispatcher = ReactCurrentDispatcher$1.current;
13024 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
13025 try {
13026 return mountState(initialState);
13027 } finally {
13028 ReactCurrentDispatcher$1.current = prevDispatcher;
13029 }
13030 },
13031 useDebugValue: function(value, formatterFn) {
13032 currentHookNameInDev = "useDebugValue";
13033 warnInvalidHookAccess();
13034 mountHookTypesDev();
13035 return mountDebugValue();
13036 },
13037 useDeferredValue: function(value) {
13038 currentHookNameInDev = "useDeferredValue";
13039 warnInvalidHookAccess();
13040 mountHookTypesDev();
13041 return mountDeferredValue(value);
13042 },
13043 useTransition: function() {
13044 currentHookNameInDev = "useTransition";
13045 warnInvalidHookAccess();
13046 mountHookTypesDev();
13047 return mountTransition();
13048 },
13049 useMutableSource: function(source, getSnapshot, subscribe) {
13050 currentHookNameInDev = "useMutableSource";
13051 warnInvalidHookAccess();
13052 mountHookTypesDev();
13053 return mountMutableSource();
13054 },
13055 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13056 currentHookNameInDev = "useSyncExternalStore";
13057 warnInvalidHookAccess();
13058 mountHookTypesDev();
13059 return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
13060 },
13061 useId: function() {
13062 currentHookNameInDev = "useId";
13063 warnInvalidHookAccess();
13064 mountHookTypesDev();
13065 return mountId();
13066 },
13067 unstable_isNewReconciler: enableNewReconciler
13068 };
13069 InvalidNestedHooksDispatcherOnUpdateInDEV = {
13070 readContext: function(context) {
13071 warnInvalidContextAccess();
13072 return readContext(context);
13073 },
13074 useCallback: function(callback, deps) {
13075 currentHookNameInDev = "useCallback";
13076 warnInvalidHookAccess();
13077 updateHookTypesDev();
13078 return updateCallback(callback, deps);
13079 },
13080 useContext: function(context) {
13081 currentHookNameInDev = "useContext";
13082 warnInvalidHookAccess();
13083 updateHookTypesDev();
13084 return readContext(context);
13085 },
13086 useEffect: function(create, deps) {
13087 currentHookNameInDev = "useEffect";
13088 warnInvalidHookAccess();
13089 updateHookTypesDev();
13090 return updateEffect(create, deps);
13091 },
13092 useImperativeHandle: function(ref, create, deps) {
13093 currentHookNameInDev = "useImperativeHandle";
13094 warnInvalidHookAccess();
13095 updateHookTypesDev();
13096 return updateImperativeHandle(ref, create, deps);
13097 },
13098 useInsertionEffect: function(create, deps) {
13099 currentHookNameInDev = "useInsertionEffect";
13100 warnInvalidHookAccess();
13101 updateHookTypesDev();
13102 return updateInsertionEffect(create, deps);
13103 },
13104 useLayoutEffect: function(create, deps) {
13105 currentHookNameInDev = "useLayoutEffect";
13106 warnInvalidHookAccess();
13107 updateHookTypesDev();
13108 return updateLayoutEffect(create, deps);
13109 },
13110 useMemo: function(create, deps) {
13111 currentHookNameInDev = "useMemo";
13112 warnInvalidHookAccess();
13113 updateHookTypesDev();
13114 var prevDispatcher = ReactCurrentDispatcher$1.current;
13115 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13116 try {
13117 return updateMemo(create, deps);
13118 } finally {
13119 ReactCurrentDispatcher$1.current = prevDispatcher;
13120 }
13121 },
13122 useReducer: function(reducer, initialArg, init) {
13123 currentHookNameInDev = "useReducer";
13124 warnInvalidHookAccess();
13125 updateHookTypesDev();
13126 var prevDispatcher = ReactCurrentDispatcher$1.current;
13127 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13128 try {
13129 return updateReducer(reducer, initialArg, init);
13130 } finally {
13131 ReactCurrentDispatcher$1.current = prevDispatcher;
13132 }
13133 },
13134 useRef: function(initialValue) {
13135 currentHookNameInDev = "useRef";
13136 warnInvalidHookAccess();
13137 updateHookTypesDev();
13138 return updateRef();
13139 },
13140 useState: function(initialState) {
13141 currentHookNameInDev = "useState";
13142 warnInvalidHookAccess();
13143 updateHookTypesDev();
13144 var prevDispatcher = ReactCurrentDispatcher$1.current;
13145 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13146 try {
13147 return updateState(initialState);
13148 } finally {
13149 ReactCurrentDispatcher$1.current = prevDispatcher;
13150 }
13151 },
13152 useDebugValue: function(value, formatterFn) {
13153 currentHookNameInDev = "useDebugValue";
13154 warnInvalidHookAccess();
13155 updateHookTypesDev();
13156 return updateDebugValue();
13157 },
13158 useDeferredValue: function(value) {
13159 currentHookNameInDev = "useDeferredValue";
13160 warnInvalidHookAccess();
13161 updateHookTypesDev();
13162 return updateDeferredValue(value);
13163 },
13164 useTransition: function() {
13165 currentHookNameInDev = "useTransition";
13166 warnInvalidHookAccess();
13167 updateHookTypesDev();
13168 return updateTransition();
13169 },
13170 useMutableSource: function(source, getSnapshot, subscribe) {
13171 currentHookNameInDev = "useMutableSource";
13172 warnInvalidHookAccess();
13173 updateHookTypesDev();
13174 return updateMutableSource();
13175 },
13176 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13177 currentHookNameInDev = "useSyncExternalStore";
13178 warnInvalidHookAccess();
13179 updateHookTypesDev();
13180 return updateSyncExternalStore(subscribe, getSnapshot);
13181 },
13182 useId: function() {
13183 currentHookNameInDev = "useId";
13184 warnInvalidHookAccess();
13185 updateHookTypesDev();
13186 return updateId();
13187 },
13188 unstable_isNewReconciler: enableNewReconciler
13189 };
13190 InvalidNestedHooksDispatcherOnRerenderInDEV = {
13191 readContext: function(context) {
13192 warnInvalidContextAccess();
13193 return readContext(context);
13194 },
13195 useCallback: function(callback, deps) {
13196 currentHookNameInDev = "useCallback";
13197 warnInvalidHookAccess();
13198 updateHookTypesDev();
13199 return updateCallback(callback, deps);
13200 },
13201 useContext: function(context) {
13202 currentHookNameInDev = "useContext";
13203 warnInvalidHookAccess();
13204 updateHookTypesDev();
13205 return readContext(context);
13206 },
13207 useEffect: function(create, deps) {
13208 currentHookNameInDev = "useEffect";
13209 warnInvalidHookAccess();
13210 updateHookTypesDev();
13211 return updateEffect(create, deps);
13212 },
13213 useImperativeHandle: function(ref, create, deps) {
13214 currentHookNameInDev = "useImperativeHandle";
13215 warnInvalidHookAccess();
13216 updateHookTypesDev();
13217 return updateImperativeHandle(ref, create, deps);
13218 },
13219 useInsertionEffect: function(create, deps) {
13220 currentHookNameInDev = "useInsertionEffect";
13221 warnInvalidHookAccess();
13222 updateHookTypesDev();
13223 return updateInsertionEffect(create, deps);
13224 },
13225 useLayoutEffect: function(create, deps) {
13226 currentHookNameInDev = "useLayoutEffect";
13227 warnInvalidHookAccess();
13228 updateHookTypesDev();
13229 return updateLayoutEffect(create, deps);
13230 },
13231 useMemo: function(create, deps) {
13232 currentHookNameInDev = "useMemo";
13233 warnInvalidHookAccess();
13234 updateHookTypesDev();
13235 var prevDispatcher = ReactCurrentDispatcher$1.current;
13236 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13237 try {
13238 return updateMemo(create, deps);
13239 } finally {
13240 ReactCurrentDispatcher$1.current = prevDispatcher;
13241 }
13242 },
13243 useReducer: function(reducer, initialArg, init) {
13244 currentHookNameInDev = "useReducer";
13245 warnInvalidHookAccess();
13246 updateHookTypesDev();
13247 var prevDispatcher = ReactCurrentDispatcher$1.current;
13248 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13249 try {
13250 return rerenderReducer(reducer, initialArg, init);
13251 } finally {
13252 ReactCurrentDispatcher$1.current = prevDispatcher;
13253 }
13254 },
13255 useRef: function(initialValue) {
13256 currentHookNameInDev = "useRef";
13257 warnInvalidHookAccess();
13258 updateHookTypesDev();
13259 return updateRef();
13260 },
13261 useState: function(initialState) {
13262 currentHookNameInDev = "useState";
13263 warnInvalidHookAccess();
13264 updateHookTypesDev();
13265 var prevDispatcher = ReactCurrentDispatcher$1.current;
13266 ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
13267 try {
13268 return rerenderState(initialState);
13269 } finally {
13270 ReactCurrentDispatcher$1.current = prevDispatcher;
13271 }
13272 },
13273 useDebugValue: function(value, formatterFn) {
13274 currentHookNameInDev = "useDebugValue";
13275 warnInvalidHookAccess();
13276 updateHookTypesDev();
13277 return updateDebugValue();
13278 },
13279 useDeferredValue: function(value) {
13280 currentHookNameInDev = "useDeferredValue";
13281 warnInvalidHookAccess();
13282 updateHookTypesDev();
13283 return rerenderDeferredValue(value);
13284 },
13285 useTransition: function() {
13286 currentHookNameInDev = "useTransition";
13287 warnInvalidHookAccess();
13288 updateHookTypesDev();
13289 return rerenderTransition();
13290 },
13291 useMutableSource: function(source, getSnapshot, subscribe) {
13292 currentHookNameInDev = "useMutableSource";
13293 warnInvalidHookAccess();
13294 updateHookTypesDev();
13295 return updateMutableSource();
13296 },
13297 useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
13298 currentHookNameInDev = "useSyncExternalStore";
13299 warnInvalidHookAccess();
13300 updateHookTypesDev();
13301 return updateSyncExternalStore(subscribe, getSnapshot);
13302 },
13303 useId: function() {
13304 currentHookNameInDev = "useId";
13305 warnInvalidHookAccess();
13306 updateHookTypesDev();
13307 return updateId();
13308 },
13309 unstable_isNewReconciler: enableNewReconciler
13310 };
13311 }
13312 var now$1 = Scheduler.unstable_now;
13313 var commitTime = 0;
13314 var layoutEffectStartTime = -1;
13315 var profilerStartTime = -1;
13316 var passiveEffectStartTime = -1;
13317 var currentUpdateIsNested = false;
13318 var nestedUpdateScheduled = false;
13319 function isCurrentUpdateNested() {
13320 return currentUpdateIsNested;
13321 }
13322 function markNestedUpdateScheduled() {
13323 {
13324 nestedUpdateScheduled = true;
13325 }
13326 }
13327 function resetNestedUpdateFlag() {
13328 {
13329 currentUpdateIsNested = false;
13330 nestedUpdateScheduled = false;
13331 }
13332 }
13333 function syncNestedUpdateFlag() {
13334 {
13335 currentUpdateIsNested = nestedUpdateScheduled;
13336 nestedUpdateScheduled = false;
13337 }
13338 }
13339 function getCommitTime() {
13340 return commitTime;
13341 }
13342 function recordCommitTime() {
13343 commitTime = now$1();
13344 }
13345 function startProfilerTimer(fiber) {
13346 profilerStartTime = now$1();
13347 if (fiber.actualStartTime < 0) {
13348 fiber.actualStartTime = now$1();
13349 }
13350 }
13351 function stopProfilerTimerIfRunning(fiber) {
13352 profilerStartTime = -1;
13353 }
13354 function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
13355 if (profilerStartTime >= 0) {
13356 var elapsedTime = now$1() - profilerStartTime;
13357 fiber.actualDuration += elapsedTime;
13358 if (overrideBaseTime) {
13359 fiber.selfBaseDuration = elapsedTime;
13360 }
13361 profilerStartTime = -1;
13362 }
13363 }
13364 function recordLayoutEffectDuration(fiber) {
13365 if (layoutEffectStartTime >= 0) {
13366 var elapsedTime = now$1() - layoutEffectStartTime;
13367 layoutEffectStartTime = -1;
13368 var parentFiber = fiber.return;
13369 while (parentFiber !== null) {
13370 switch (parentFiber.tag) {
13371 case HostRoot:
13372 var root2 = parentFiber.stateNode;
13373 root2.effectDuration += elapsedTime;
13374 return;
13375 case Profiler:
13376 var parentStateNode = parentFiber.stateNode;
13377 parentStateNode.effectDuration += elapsedTime;
13378 return;
13379 }
13380 parentFiber = parentFiber.return;
13381 }
13382 }
13383 }
13384 function recordPassiveEffectDuration(fiber) {
13385 if (passiveEffectStartTime >= 0) {
13386 var elapsedTime = now$1() - passiveEffectStartTime;
13387 passiveEffectStartTime = -1;
13388 var parentFiber = fiber.return;
13389 while (parentFiber !== null) {
13390 switch (parentFiber.tag) {
13391 case HostRoot:
13392 var root2 = parentFiber.stateNode;
13393 if (root2 !== null) {
13394 root2.passiveEffectDuration += elapsedTime;
13395 }
13396 return;
13397 case Profiler:
13398 var parentStateNode = parentFiber.stateNode;
13399 if (parentStateNode !== null) {
13400 parentStateNode.passiveEffectDuration += elapsedTime;
13401 }
13402 return;
13403 }
13404 parentFiber = parentFiber.return;
13405 }
13406 }
13407 }
13408 function startLayoutEffectTimer() {
13409 layoutEffectStartTime = now$1();
13410 }
13411 function startPassiveEffectTimer() {
13412 passiveEffectStartTime = now$1();
13413 }
13414 function transferActualDuration(fiber) {
13415 var child = fiber.child;
13416 while (child) {
13417 fiber.actualDuration += child.actualDuration;
13418 child = child.sibling;
13419 }
13420 }
13421 function resolveDefaultProps(Component, baseProps) {
13422 if (Component && Component.defaultProps) {
13423 var props = assign({}, baseProps);
13424 var defaultProps = Component.defaultProps;
13425 for (var propName in defaultProps) {
13426 if (props[propName] === void 0) {
13427 props[propName] = defaultProps[propName];
13428 }
13429 }
13430 return props;
13431 }
13432 return baseProps;
13433 }
13434 var fakeInternalInstance = {};
13435 var didWarnAboutStateAssignmentForComponent;
13436 var didWarnAboutUninitializedState;
13437 var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
13438 var didWarnAboutLegacyLifecyclesAndDerivedState;
13439 var didWarnAboutUndefinedDerivedState;
13440 var warnOnUndefinedDerivedState;
13441 var warnOnInvalidCallback;
13442 var didWarnAboutDirectlyAssigningPropsToState;
13443 var didWarnAboutContextTypeAndContextTypes;
13444 var didWarnAboutInvalidateContextType;
13445 var didWarnAboutLegacyContext$1;
13446 {
13447 didWarnAboutStateAssignmentForComponent = /* @__PURE__ */ new Set();
13448 didWarnAboutUninitializedState = /* @__PURE__ */ new Set();
13449 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = /* @__PURE__ */ new Set();
13450 didWarnAboutLegacyLifecyclesAndDerivedState = /* @__PURE__ */ new Set();
13451 didWarnAboutDirectlyAssigningPropsToState = /* @__PURE__ */ new Set();
13452 didWarnAboutUndefinedDerivedState = /* @__PURE__ */ new Set();
13453 didWarnAboutContextTypeAndContextTypes = /* @__PURE__ */ new Set();
13454 didWarnAboutInvalidateContextType = /* @__PURE__ */ new Set();
13455 didWarnAboutLegacyContext$1 = /* @__PURE__ */ new Set();
13456 var didWarnOnInvalidCallback = /* @__PURE__ */ new Set();
13457 warnOnInvalidCallback = function(callback, callerName) {
13458 if (callback === null || typeof callback === "function") {
13459 return;
13460 }
13461 var key = callerName + "_" + callback;
13462 if (!didWarnOnInvalidCallback.has(key)) {
13463 didWarnOnInvalidCallback.add(key);
13464 error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
13465 }
13466 };
13467 warnOnUndefinedDerivedState = function(type, partialState) {
13468 if (partialState === void 0) {
13469 var componentName = getComponentNameFromType(type) || "Component";
13470 if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
13471 didWarnAboutUndefinedDerivedState.add(componentName);
13472 error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName);
13473 }
13474 }
13475 };
13476 Object.defineProperty(fakeInternalInstance, "_processChildContext", {
13477 enumerable: false,
13478 value: function() {
13479 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).");
13480 }
13481 });
13482 Object.freeze(fakeInternalInstance);
13483 }
13484 function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
13485 var prevState = workInProgress2.memoizedState;
13486 var partialState = getDerivedStateFromProps(nextProps, prevState);
13487 {
13488 if (workInProgress2.mode & StrictLegacyMode) {
13489 setIsStrictModeForDevtools(true);
13490 try {
13491 partialState = getDerivedStateFromProps(nextProps, prevState);
13492 } finally {
13493 setIsStrictModeForDevtools(false);
13494 }
13495 }
13496 warnOnUndefinedDerivedState(ctor, partialState);
13497 }
13498 var memoizedState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState);
13499 workInProgress2.memoizedState = memoizedState;
13500 if (workInProgress2.lanes === NoLanes) {
13501 var updateQueue = workInProgress2.updateQueue;
13502 updateQueue.baseState = memoizedState;
13503 }
13504 }
13505 var classComponentUpdater = {
13506 isMounted,
13507 enqueueSetState: function(inst, payload, callback) {
13508 var fiber = get(inst);
13509 var eventTime = requestEventTime();
13510 var lane = requestUpdateLane(fiber);
13511 var update = createUpdate(eventTime, lane);
13512 update.payload = payload;
13513 if (callback !== void 0 && callback !== null) {
13514 {
13515 warnOnInvalidCallback(callback, "setState");
13516 }
13517 update.callback = callback;
13518 }
13519 var root2 = enqueueUpdate(fiber, update, lane);
13520 if (root2 !== null) {
13521 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13522 entangleTransitions(root2, fiber, lane);
13523 }
13524 {
13525 markStateUpdateScheduled(fiber, lane);
13526 }
13527 },
13528 enqueueReplaceState: function(inst, payload, callback) {
13529 var fiber = get(inst);
13530 var eventTime = requestEventTime();
13531 var lane = requestUpdateLane(fiber);
13532 var update = createUpdate(eventTime, lane);
13533 update.tag = ReplaceState;
13534 update.payload = payload;
13535 if (callback !== void 0 && callback !== null) {
13536 {
13537 warnOnInvalidCallback(callback, "replaceState");
13538 }
13539 update.callback = callback;
13540 }
13541 var root2 = enqueueUpdate(fiber, update, lane);
13542 if (root2 !== null) {
13543 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13544 entangleTransitions(root2, fiber, lane);
13545 }
13546 {
13547 markStateUpdateScheduled(fiber, lane);
13548 }
13549 },
13550 enqueueForceUpdate: function(inst, callback) {
13551 var fiber = get(inst);
13552 var eventTime = requestEventTime();
13553 var lane = requestUpdateLane(fiber);
13554 var update = createUpdate(eventTime, lane);
13555 update.tag = ForceUpdate;
13556 if (callback !== void 0 && callback !== null) {
13557 {
13558 warnOnInvalidCallback(callback, "forceUpdate");
13559 }
13560 update.callback = callback;
13561 }
13562 var root2 = enqueueUpdate(fiber, update, lane);
13563 if (root2 !== null) {
13564 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
13565 entangleTransitions(root2, fiber, lane);
13566 }
13567 {
13568 markForceUpdateScheduled(fiber, lane);
13569 }
13570 }
13571 };
13572 function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
13573 var instance = workInProgress2.stateNode;
13574 if (typeof instance.shouldComponentUpdate === "function") {
13575 var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
13576 {
13577 if (workInProgress2.mode & StrictLegacyMode) {
13578 setIsStrictModeForDevtools(true);
13579 try {
13580 shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
13581 } finally {
13582 setIsStrictModeForDevtools(false);
13583 }
13584 }
13585 if (shouldUpdate === void 0) {
13586 error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
13587 }
13588 }
13589 return shouldUpdate;
13590 }
13591 if (ctor.prototype && ctor.prototype.isPureReactComponent) {
13592 return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
13593 }
13594 return true;
13595 }
13596 function checkClassInstance(workInProgress2, ctor, newProps) {
13597 var instance = workInProgress2.stateNode;
13598 {
13599 var name = getComponentNameFromType(ctor) || "Component";
13600 var renderPresent = instance.render;
13601 if (!renderPresent) {
13602 if (ctor.prototype && typeof ctor.prototype.render === "function") {
13603 error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name);
13604 } else {
13605 error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name);
13606 }
13607 }
13608 if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
13609 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);
13610 }
13611 if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
13612 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);
13613 }
13614 if (instance.propTypes) {
13615 error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name);
13616 }
13617 if (instance.contextType) {
13618 error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name);
13619 }
13620 {
13621 if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
13622 // this one.
13623 (workInProgress2.mode & StrictLegacyMode) === NoMode) {
13624 didWarnAboutLegacyContext$1.add(ctor);
13625 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);
13626 }
13627 if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip
13628 // this one.
13629 (workInProgress2.mode & StrictLegacyMode) === NoMode) {
13630 didWarnAboutLegacyContext$1.add(ctor);
13631 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);
13632 }
13633 if (instance.contextTypes) {
13634 error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name);
13635 }
13636 if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
13637 didWarnAboutContextTypeAndContextTypes.add(ctor);
13638 error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name);
13639 }
13640 }
13641 if (typeof instance.componentShouldUpdate === "function") {
13642 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);
13643 }
13644 if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") {
13645 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");
13646 }
13647 if (typeof instance.componentDidUnmount === "function") {
13648 error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name);
13649 }
13650 if (typeof instance.componentDidReceiveProps === "function") {
13651 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);
13652 }
13653 if (typeof instance.componentWillRecieveProps === "function") {
13654 error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name);
13655 }
13656 if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
13657 error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name);
13658 }
13659 var hasMutatedProps = instance.props !== newProps;
13660 if (instance.props !== void 0 && hasMutatedProps) {
13661 error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name);
13662 }
13663 if (instance.defaultProps) {
13664 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);
13665 }
13666 if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
13667 didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
13668 error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor));
13669 }
13670 if (typeof instance.getDerivedStateFromProps === "function") {
13671 error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
13672 }
13673 if (typeof instance.getDerivedStateFromError === "function") {
13674 error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name);
13675 }
13676 if (typeof ctor.getSnapshotBeforeUpdate === "function") {
13677 error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name);
13678 }
13679 var _state = instance.state;
13680 if (_state && (typeof _state !== "object" || isArray(_state))) {
13681 error("%s.state: must be set to an object or null", name);
13682 }
13683 if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
13684 error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name);
13685 }
13686 }
13687 }
13688 function adoptClassInstance(workInProgress2, instance) {
13689 instance.updater = classComponentUpdater;
13690 workInProgress2.stateNode = instance;
13691 set(instance, workInProgress2);
13692 {
13693 instance._reactInternalInstance = fakeInternalInstance;
13694 }
13695 }
13696 function constructClassInstance(workInProgress2, ctor, props) {
13697 var isLegacyContextConsumer = false;
13698 var unmaskedContext = emptyContextObject;
13699 var context = emptyContextObject;
13700 var contextType = ctor.contextType;
13701 {
13702 if ("contextType" in ctor) {
13703 var isValid = (
13704 // Allow null for conditional declaration
13705 contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0
13706 );
13707 if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
13708 didWarnAboutInvalidateContextType.add(ctor);
13709 var addendum = "";
13710 if (contextType === void 0) {
13711 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.";
13712 } else if (typeof contextType !== "object") {
13713 addendum = " However, it is set to a " + typeof contextType + ".";
13714 } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
13715 addendum = " Did you accidentally pass the Context.Provider instead?";
13716 } else if (contextType._context !== void 0) {
13717 addendum = " Did you accidentally pass the Context.Consumer instead?";
13718 } else {
13719 addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}.";
13720 }
13721 error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum);
13722 }
13723 }
13724 }
13725 if (typeof contextType === "object" && contextType !== null) {
13726 context = readContext(contextType);
13727 } else {
13728 unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13729 var contextTypes = ctor.contextTypes;
13730 isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
13731 context = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
13732 }
13733 var instance = new ctor(props, context);
13734 {
13735 if (workInProgress2.mode & StrictLegacyMode) {
13736 setIsStrictModeForDevtools(true);
13737 try {
13738 instance = new ctor(props, context);
13739 } finally {
13740 setIsStrictModeForDevtools(false);
13741 }
13742 }
13743 }
13744 var state = workInProgress2.memoizedState = instance.state !== null && instance.state !== void 0 ? instance.state : null;
13745 adoptClassInstance(workInProgress2, instance);
13746 {
13747 if (typeof ctor.getDerivedStateFromProps === "function" && state === null) {
13748 var componentName = getComponentNameFromType(ctor) || "Component";
13749 if (!didWarnAboutUninitializedState.has(componentName)) {
13750 didWarnAboutUninitializedState.add(componentName);
13751 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);
13752 }
13753 }
13754 if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") {
13755 var foundWillMountName = null;
13756 var foundWillReceivePropsName = null;
13757 var foundWillUpdateName = null;
13758 if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) {
13759 foundWillMountName = "componentWillMount";
13760 } else if (typeof instance.UNSAFE_componentWillMount === "function") {
13761 foundWillMountName = "UNSAFE_componentWillMount";
13762 }
13763 if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
13764 foundWillReceivePropsName = "componentWillReceiveProps";
13765 } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
13766 foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
13767 }
13768 if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
13769 foundWillUpdateName = "componentWillUpdate";
13770 } else if (typeof instance.UNSAFE_componentWillUpdate === "function") {
13771 foundWillUpdateName = "UNSAFE_componentWillUpdate";
13772 }
13773 if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
13774 var _componentName = getComponentNameFromType(ctor) || "Component";
13775 var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
13776 if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
13777 didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
13778 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 : "");
13779 }
13780 }
13781 }
13782 }
13783 if (isLegacyContextConsumer) {
13784 cacheContext(workInProgress2, unmaskedContext, context);
13785 }
13786 return instance;
13787 }
13788 function callComponentWillMount(workInProgress2, instance) {
13789 var oldState = instance.state;
13790 if (typeof instance.componentWillMount === "function") {
13791 instance.componentWillMount();
13792 }
13793 if (typeof instance.UNSAFE_componentWillMount === "function") {
13794 instance.UNSAFE_componentWillMount();
13795 }
13796 if (oldState !== instance.state) {
13797 {
13798 error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromFiber(workInProgress2) || "Component");
13799 }
13800 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
13801 }
13802 }
13803 function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
13804 var oldState = instance.state;
13805 if (typeof instance.componentWillReceiveProps === "function") {
13806 instance.componentWillReceiveProps(newProps, nextContext);
13807 }
13808 if (typeof instance.UNSAFE_componentWillReceiveProps === "function") {
13809 instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
13810 }
13811 if (instance.state !== oldState) {
13812 {
13813 var componentName = getComponentNameFromFiber(workInProgress2) || "Component";
13814 if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
13815 didWarnAboutStateAssignmentForComponent.add(componentName);
13816 error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", componentName);
13817 }
13818 }
13819 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
13820 }
13821 }
13822 function mountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
13823 {
13824 checkClassInstance(workInProgress2, ctor, newProps);
13825 }
13826 var instance = workInProgress2.stateNode;
13827 instance.props = newProps;
13828 instance.state = workInProgress2.memoizedState;
13829 instance.refs = {};
13830 initializeUpdateQueue(workInProgress2);
13831 var contextType = ctor.contextType;
13832 if (typeof contextType === "object" && contextType !== null) {
13833 instance.context = readContext(contextType);
13834 } else {
13835 var unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13836 instance.context = getMaskedContext(workInProgress2, unmaskedContext);
13837 }
13838 {
13839 if (instance.state === newProps) {
13840 var componentName = getComponentNameFromType(ctor) || "Component";
13841 if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
13842 didWarnAboutDirectlyAssigningPropsToState.add(componentName);
13843 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);
13844 }
13845 }
13846 if (workInProgress2.mode & StrictLegacyMode) {
13847 ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
13848 }
13849 {
13850 ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
13851 }
13852 }
13853 instance.state = workInProgress2.memoizedState;
13854 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13855 if (typeof getDerivedStateFromProps === "function") {
13856 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
13857 instance.state = workInProgress2.memoizedState;
13858 }
13859 if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
13860 callComponentWillMount(workInProgress2, instance);
13861 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13862 instance.state = workInProgress2.memoizedState;
13863 }
13864 if (typeof instance.componentDidMount === "function") {
13865 var fiberFlags = Update;
13866 {
13867 fiberFlags |= LayoutStatic;
13868 }
13869 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13870 fiberFlags |= MountLayoutDev;
13871 }
13872 workInProgress2.flags |= fiberFlags;
13873 }
13874 }
13875 function resumeMountClassInstance(workInProgress2, ctor, newProps, renderLanes2) {
13876 var instance = workInProgress2.stateNode;
13877 var oldProps = workInProgress2.memoizedProps;
13878 instance.props = oldProps;
13879 var oldContext = instance.context;
13880 var contextType = ctor.contextType;
13881 var nextContext = emptyContextObject;
13882 if (typeof contextType === "object" && contextType !== null) {
13883 nextContext = readContext(contextType);
13884 } else {
13885 var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13886 nextContext = getMaskedContext(workInProgress2, nextLegacyUnmaskedContext);
13887 }
13888 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13889 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
13890 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
13891 if (oldProps !== newProps || oldContext !== nextContext) {
13892 callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
13893 }
13894 }
13895 resetHasForceUpdateBeforeProcessing();
13896 var oldState = workInProgress2.memoizedState;
13897 var newState = instance.state = oldState;
13898 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13899 newState = workInProgress2.memoizedState;
13900 if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
13901 if (typeof instance.componentDidMount === "function") {
13902 var fiberFlags = Update;
13903 {
13904 fiberFlags |= LayoutStatic;
13905 }
13906 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13907 fiberFlags |= MountLayoutDev;
13908 }
13909 workInProgress2.flags |= fiberFlags;
13910 }
13911 return false;
13912 }
13913 if (typeof getDerivedStateFromProps === "function") {
13914 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
13915 newState = workInProgress2.memoizedState;
13916 }
13917 var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext);
13918 if (shouldUpdate) {
13919 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) {
13920 if (typeof instance.componentWillMount === "function") {
13921 instance.componentWillMount();
13922 }
13923 if (typeof instance.UNSAFE_componentWillMount === "function") {
13924 instance.UNSAFE_componentWillMount();
13925 }
13926 }
13927 if (typeof instance.componentDidMount === "function") {
13928 var _fiberFlags = Update;
13929 {
13930 _fiberFlags |= LayoutStatic;
13931 }
13932 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13933 _fiberFlags |= MountLayoutDev;
13934 }
13935 workInProgress2.flags |= _fiberFlags;
13936 }
13937 } else {
13938 if (typeof instance.componentDidMount === "function") {
13939 var _fiberFlags2 = Update;
13940 {
13941 _fiberFlags2 |= LayoutStatic;
13942 }
13943 if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
13944 _fiberFlags2 |= MountLayoutDev;
13945 }
13946 workInProgress2.flags |= _fiberFlags2;
13947 }
13948 workInProgress2.memoizedProps = newProps;
13949 workInProgress2.memoizedState = newState;
13950 }
13951 instance.props = newProps;
13952 instance.state = newState;
13953 instance.context = nextContext;
13954 return shouldUpdate;
13955 }
13956 function updateClassInstance(current2, workInProgress2, ctor, newProps, renderLanes2) {
13957 var instance = workInProgress2.stateNode;
13958 cloneUpdateQueue(current2, workInProgress2);
13959 var unresolvedOldProps = workInProgress2.memoizedProps;
13960 var oldProps = workInProgress2.type === workInProgress2.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress2.type, unresolvedOldProps);
13961 instance.props = oldProps;
13962 var unresolvedNewProps = workInProgress2.pendingProps;
13963 var oldContext = instance.context;
13964 var contextType = ctor.contextType;
13965 var nextContext = emptyContextObject;
13966 if (typeof contextType === "object" && contextType !== null) {
13967 nextContext = readContext(contextType);
13968 } else {
13969 var nextUnmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
13970 nextContext = getMaskedContext(workInProgress2, nextUnmaskedContext);
13971 }
13972 var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
13973 var hasNewLifecycles = typeof getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function";
13974 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === "function" || typeof instance.componentWillReceiveProps === "function")) {
13975 if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {
13976 callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext);
13977 }
13978 }
13979 resetHasForceUpdateBeforeProcessing();
13980 var oldState = workInProgress2.memoizedState;
13981 var newState = instance.state = oldState;
13982 processUpdateQueue(workInProgress2, newProps, instance, renderLanes2);
13983 newState = workInProgress2.memoizedState;
13984 if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !enableLazyContextPropagation) {
13985 if (typeof instance.componentDidUpdate === "function") {
13986 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
13987 workInProgress2.flags |= Update;
13988 }
13989 }
13990 if (typeof instance.getSnapshotBeforeUpdate === "function") {
13991 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
13992 workInProgress2.flags |= Snapshot;
13993 }
13994 }
13995 return false;
13996 }
13997 if (typeof getDerivedStateFromProps === "function") {
13998 applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, newProps);
13999 newState = workInProgress2.memoizedState;
14000 }
14001 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,
14002 // both before and after `shouldComponentUpdate` has been called. Not ideal,
14003 // but I'm loath to refactor this function. This only happens for memoized
14004 // components so it's not that common.
14005 enableLazyContextPropagation;
14006 if (shouldUpdate) {
14007 if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === "function" || typeof instance.componentWillUpdate === "function")) {
14008 if (typeof instance.componentWillUpdate === "function") {
14009 instance.componentWillUpdate(newProps, newState, nextContext);
14010 }
14011 if (typeof instance.UNSAFE_componentWillUpdate === "function") {
14012 instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
14013 }
14014 }
14015 if (typeof instance.componentDidUpdate === "function") {
14016 workInProgress2.flags |= Update;
14017 }
14018 if (typeof instance.getSnapshotBeforeUpdate === "function") {
14019 workInProgress2.flags |= Snapshot;
14020 }
14021 } else {
14022 if (typeof instance.componentDidUpdate === "function") {
14023 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
14024 workInProgress2.flags |= Update;
14025 }
14026 }
14027 if (typeof instance.getSnapshotBeforeUpdate === "function") {
14028 if (unresolvedOldProps !== current2.memoizedProps || oldState !== current2.memoizedState) {
14029 workInProgress2.flags |= Snapshot;
14030 }
14031 }
14032 workInProgress2.memoizedProps = newProps;
14033 workInProgress2.memoizedState = newState;
14034 }
14035 instance.props = newProps;
14036 instance.state = newState;
14037 instance.context = nextContext;
14038 return shouldUpdate;
14039 }
14040 function createCapturedValueAtFiber(value, source) {
14041 return {
14042 value,
14043 source,
14044 stack: getStackByFiberInDevAndProd(source),
14045 digest: null
14046 };
14047 }
14048 function createCapturedValue(value, digest, stack) {
14049 return {
14050 value,
14051 source: null,
14052 stack: stack != null ? stack : null,
14053 digest: digest != null ? digest : null
14054 };
14055 }
14056 function showErrorDialog(boundary, errorInfo) {
14057 return true;
14058 }
14059 function logCapturedError(boundary, errorInfo) {
14060 try {
14061 var logError = showErrorDialog(boundary, errorInfo);
14062 if (logError === false) {
14063 return;
14064 }
14065 var error2 = errorInfo.value;
14066 if (true) {
14067 var source = errorInfo.source;
14068 var stack = errorInfo.stack;
14069 var componentStack = stack !== null ? stack : "";
14070 if (error2 != null && error2._suppressLogging) {
14071 if (boundary.tag === ClassComponent) {
14072 return;
14073 }
14074 console["error"](error2);
14075 }
14076 var componentName = source ? getComponentNameFromFiber(source) : null;
14077 var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
14078 var errorBoundaryMessage;
14079 if (boundary.tag === HostRoot) {
14080 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.";
14081 } else {
14082 var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
14083 errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
14084 }
14085 var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
14086 console["error"](combinedMessage);
14087 } else {
14088 console["error"](error2);
14089 }
14090 } catch (e) {
14091 setTimeout(function() {
14092 throw e;
14093 });
14094 }
14095 }
14096 var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
14097 function createRootErrorUpdate(fiber, errorInfo, lane) {
14098 var update = createUpdate(NoTimestamp, lane);
14099 update.tag = CaptureUpdate;
14100 update.payload = {
14101 element: null
14102 };
14103 var error2 = errorInfo.value;
14104 update.callback = function() {
14105 onUncaughtError(error2);
14106 logCapturedError(fiber, errorInfo);
14107 };
14108 return update;
14109 }
14110 function createClassErrorUpdate(fiber, errorInfo, lane) {
14111 var update = createUpdate(NoTimestamp, lane);
14112 update.tag = CaptureUpdate;
14113 var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
14114 if (typeof getDerivedStateFromError === "function") {
14115 var error$1 = errorInfo.value;
14116 update.payload = function() {
14117 return getDerivedStateFromError(error$1);
14118 };
14119 update.callback = function() {
14120 {
14121 markFailedErrorBoundaryForHotReloading(fiber);
14122 }
14123 logCapturedError(fiber, errorInfo);
14124 };
14125 }
14126 var inst = fiber.stateNode;
14127 if (inst !== null && typeof inst.componentDidCatch === "function") {
14128 update.callback = function callback() {
14129 {
14130 markFailedErrorBoundaryForHotReloading(fiber);
14131 }
14132 logCapturedError(fiber, errorInfo);
14133 if (typeof getDerivedStateFromError !== "function") {
14134 markLegacyErrorBoundaryAsFailed(this);
14135 }
14136 var error$12 = errorInfo.value;
14137 var stack = errorInfo.stack;
14138 this.componentDidCatch(error$12, {
14139 componentStack: stack !== null ? stack : ""
14140 });
14141 {
14142 if (typeof getDerivedStateFromError !== "function") {
14143 if (!includesSomeLane(fiber.lanes, SyncLane)) {
14144 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");
14145 }
14146 }
14147 }
14148 };
14149 }
14150 return update;
14151 }
14152 function attachPingListener(root2, wakeable, lanes) {
14153 var pingCache = root2.pingCache;
14154 var threadIDs;
14155 if (pingCache === null) {
14156 pingCache = root2.pingCache = new PossiblyWeakMap$1();
14157 threadIDs = /* @__PURE__ */ new Set();
14158 pingCache.set(wakeable, threadIDs);
14159 } else {
14160 threadIDs = pingCache.get(wakeable);
14161 if (threadIDs === void 0) {
14162 threadIDs = /* @__PURE__ */ new Set();
14163 pingCache.set(wakeable, threadIDs);
14164 }
14165 }
14166 if (!threadIDs.has(lanes)) {
14167 threadIDs.add(lanes);
14168 var ping = pingSuspendedRoot.bind(null, root2, wakeable, lanes);
14169 {
14170 if (isDevToolsPresent) {
14171 restorePendingUpdaters(root2, lanes);
14172 }
14173 }
14174 wakeable.then(ping, ping);
14175 }
14176 }
14177 function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
14178 var wakeables = suspenseBoundary.updateQueue;
14179 if (wakeables === null) {
14180 var updateQueue = /* @__PURE__ */ new Set();
14181 updateQueue.add(wakeable);
14182 suspenseBoundary.updateQueue = updateQueue;
14183 } else {
14184 wakeables.add(wakeable);
14185 }
14186 }
14187 function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
14188 var tag = sourceFiber.tag;
14189 if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
14190 var currentSource = sourceFiber.alternate;
14191 if (currentSource) {
14192 sourceFiber.updateQueue = currentSource.updateQueue;
14193 sourceFiber.memoizedState = currentSource.memoizedState;
14194 sourceFiber.lanes = currentSource.lanes;
14195 } else {
14196 sourceFiber.updateQueue = null;
14197 sourceFiber.memoizedState = null;
14198 }
14199 }
14200 }
14201 function getNearestSuspenseBoundaryToCapture(returnFiber) {
14202 var node = returnFiber;
14203 do {
14204 if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
14205 return node;
14206 }
14207 node = node.return;
14208 } while (node !== null);
14209 return null;
14210 }
14211 function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
14212 if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
14213 if (suspenseBoundary === returnFiber) {
14214 suspenseBoundary.flags |= ShouldCapture;
14215 } else {
14216 suspenseBoundary.flags |= DidCapture;
14217 sourceFiber.flags |= ForceUpdateForLegacySuspense;
14218 sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
14219 if (sourceFiber.tag === ClassComponent) {
14220 var currentSourceFiber = sourceFiber.alternate;
14221 if (currentSourceFiber === null) {
14222 sourceFiber.tag = IncompleteClassComponent;
14223 } else {
14224 var update = createUpdate(NoTimestamp, SyncLane);
14225 update.tag = ForceUpdate;
14226 enqueueUpdate(sourceFiber, update, SyncLane);
14227 }
14228 }
14229 sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
14230 }
14231 return suspenseBoundary;
14232 }
14233 suspenseBoundary.flags |= ShouldCapture;
14234 suspenseBoundary.lanes = rootRenderLanes;
14235 return suspenseBoundary;
14236 }
14237 function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
14238 sourceFiber.flags |= Incomplete;
14239 {
14240 if (isDevToolsPresent) {
14241 restorePendingUpdaters(root2, rootRenderLanes);
14242 }
14243 }
14244 if (value !== null && typeof value === "object" && typeof value.then === "function") {
14245 var wakeable = value;
14246 resetSuspendedComponent(sourceFiber);
14247 {
14248 if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
14249 markDidThrowWhileHydratingDEV();
14250 }
14251 }
14252 var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
14253 if (suspenseBoundary !== null) {
14254 suspenseBoundary.flags &= ~ForceClientRender;
14255 markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
14256 if (suspenseBoundary.mode & ConcurrentMode) {
14257 attachPingListener(root2, wakeable, rootRenderLanes);
14258 }
14259 attachRetryListener(suspenseBoundary, root2, wakeable);
14260 return;
14261 } else {
14262 if (!includesSyncLane(rootRenderLanes)) {
14263 attachPingListener(root2, wakeable, rootRenderLanes);
14264 renderDidSuspendDelayIfPossible();
14265 return;
14266 }
14267 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.");
14268 value = uncaughtSuspenseError;
14269 }
14270 } else {
14271 if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
14272 markDidThrowWhileHydratingDEV();
14273 var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
14274 if (_suspenseBoundary !== null) {
14275 if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
14276 _suspenseBoundary.flags |= ForceClientRender;
14277 }
14278 markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
14279 queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
14280 return;
14281 }
14282 }
14283 }
14284 value = createCapturedValueAtFiber(value, sourceFiber);
14285 renderDidError(value);
14286 var workInProgress2 = returnFiber;
14287 do {
14288 switch (workInProgress2.tag) {
14289 case HostRoot: {
14290 var _errorInfo = value;
14291 workInProgress2.flags |= ShouldCapture;
14292 var lane = pickArbitraryLane(rootRenderLanes);
14293 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
14294 var update = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
14295 enqueueCapturedUpdate(workInProgress2, update);
14296 return;
14297 }
14298 case ClassComponent:
14299 var errorInfo = value;
14300 var ctor = workInProgress2.type;
14301 var instance = workInProgress2.stateNode;
14302 if ((workInProgress2.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === "function" || instance !== null && typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance))) {
14303 workInProgress2.flags |= ShouldCapture;
14304 var _lane = pickArbitraryLane(rootRenderLanes);
14305 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, _lane);
14306 var _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
14307 enqueueCapturedUpdate(workInProgress2, _update);
14308 return;
14309 }
14310 break;
14311 }
14312 workInProgress2 = workInProgress2.return;
14313 } while (workInProgress2 !== null);
14314 }
14315 function getSuspendedCache() {
14316 {
14317 return null;
14318 }
14319 }
14320 var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
14321 var didReceiveUpdate = false;
14322 var didWarnAboutBadClass;
14323 var didWarnAboutModulePatternComponent;
14324 var didWarnAboutContextTypeOnFunctionComponent;
14325 var didWarnAboutGetDerivedStateOnFunctionComponent;
14326 var didWarnAboutFunctionRefs;
14327 var didWarnAboutReassigningProps;
14328 var didWarnAboutRevealOrder;
14329 var didWarnAboutTailOptions;
14330 var didWarnAboutDefaultPropsOnFunctionComponent;
14331 {
14332 didWarnAboutBadClass = {};
14333 didWarnAboutModulePatternComponent = {};
14334 didWarnAboutContextTypeOnFunctionComponent = {};
14335 didWarnAboutGetDerivedStateOnFunctionComponent = {};
14336 didWarnAboutFunctionRefs = {};
14337 didWarnAboutReassigningProps = false;
14338 didWarnAboutRevealOrder = {};
14339 didWarnAboutTailOptions = {};
14340 didWarnAboutDefaultPropsOnFunctionComponent = {};
14341 }
14342 function reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2) {
14343 if (current2 === null) {
14344 workInProgress2.child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14345 } else {
14346 workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, nextChildren, renderLanes2);
14347 }
14348 }
14349 function forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2) {
14350 workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
14351 workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14352 }
14353 function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) {
14354 {
14355 if (workInProgress2.type !== workInProgress2.elementType) {
14356 var innerPropTypes = Component.propTypes;
14357 if (innerPropTypes) {
14358 checkPropTypes(
14359 innerPropTypes,
14360 nextProps,
14361 // Resolved props
14362 "prop",
14363 getComponentNameFromType(Component)
14364 );
14365 }
14366 }
14367 }
14368 var render2 = Component.render;
14369 var ref = workInProgress2.ref;
14370 var nextChildren;
14371 var hasId;
14372 prepareToReadContext(workInProgress2, renderLanes2);
14373 {
14374 markComponentRenderStarted(workInProgress2);
14375 }
14376 {
14377 ReactCurrentOwner$1.current = workInProgress2;
14378 setIsRendering(true);
14379 nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
14380 hasId = checkDidRenderIdHook();
14381 if (workInProgress2.mode & StrictLegacyMode) {
14382 setIsStrictModeForDevtools(true);
14383 try {
14384 nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
14385 hasId = checkDidRenderIdHook();
14386 } finally {
14387 setIsStrictModeForDevtools(false);
14388 }
14389 }
14390 setIsRendering(false);
14391 }
14392 {
14393 markComponentRenderStopped();
14394 }
14395 if (current2 !== null && !didReceiveUpdate) {
14396 bailoutHooks(current2, workInProgress2, renderLanes2);
14397 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14398 }
14399 if (getIsHydrating() && hasId) {
14400 pushMaterializedTreeId(workInProgress2);
14401 }
14402 workInProgress2.flags |= PerformedWork;
14403 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14404 return workInProgress2.child;
14405 }
14406 function updateMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14407 if (current2 === null) {
14408 var type = Component.type;
14409 if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
14410 Component.defaultProps === void 0) {
14411 var resolvedType = type;
14412 {
14413 resolvedType = resolveFunctionForHotReloading(type);
14414 }
14415 workInProgress2.tag = SimpleMemoComponent;
14416 workInProgress2.type = resolvedType;
14417 {
14418 validateFunctionComponentInDev(workInProgress2, type);
14419 }
14420 return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
14421 }
14422 {
14423 var innerPropTypes = type.propTypes;
14424 if (innerPropTypes) {
14425 checkPropTypes(
14426 innerPropTypes,
14427 nextProps,
14428 // Resolved props
14429 "prop",
14430 getComponentNameFromType(type)
14431 );
14432 }
14433 if (Component.defaultProps !== void 0) {
14434 var componentName = getComponentNameFromType(type) || "Unknown";
14435 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
14436 error("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", componentName);
14437 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
14438 }
14439 }
14440 }
14441 var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
14442 child.ref = workInProgress2.ref;
14443 child.return = workInProgress2;
14444 workInProgress2.child = child;
14445 return child;
14446 }
14447 {
14448 var _type = Component.type;
14449 var _innerPropTypes = _type.propTypes;
14450 if (_innerPropTypes) {
14451 checkPropTypes(
14452 _innerPropTypes,
14453 nextProps,
14454 // Resolved props
14455 "prop",
14456 getComponentNameFromType(_type)
14457 );
14458 }
14459 }
14460 var currentChild = current2.child;
14461 var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
14462 if (!hasScheduledUpdateOrContext) {
14463 var prevProps = currentChild.memoizedProps;
14464 var compare = Component.compare;
14465 compare = compare !== null ? compare : shallowEqual;
14466 if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) {
14467 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14468 }
14469 }
14470 workInProgress2.flags |= PerformedWork;
14471 var newChild = createWorkInProgress(currentChild, nextProps);
14472 newChild.ref = workInProgress2.ref;
14473 newChild.return = workInProgress2;
14474 workInProgress2.child = newChild;
14475 return newChild;
14476 }
14477 function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14478 {
14479 if (workInProgress2.type !== workInProgress2.elementType) {
14480 var outerMemoType = workInProgress2.elementType;
14481 if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
14482 var lazyComponent = outerMemoType;
14483 var payload = lazyComponent._payload;
14484 var init = lazyComponent._init;
14485 try {
14486 outerMemoType = init(payload);
14487 } catch (x) {
14488 outerMemoType = null;
14489 }
14490 var outerPropTypes = outerMemoType && outerMemoType.propTypes;
14491 if (outerPropTypes) {
14492 checkPropTypes(
14493 outerPropTypes,
14494 nextProps,
14495 // Resolved (SimpleMemoComponent has no defaultProps)
14496 "prop",
14497 getComponentNameFromType(outerMemoType)
14498 );
14499 }
14500 }
14501 }
14502 }
14503 if (current2 !== null) {
14504 var prevProps = current2.memoizedProps;
14505 if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
14506 workInProgress2.type === current2.type) {
14507 didReceiveUpdate = false;
14508 workInProgress2.pendingProps = nextProps = prevProps;
14509 if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
14510 workInProgress2.lanes = current2.lanes;
14511 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14512 } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
14513 didReceiveUpdate = true;
14514 }
14515 }
14516 }
14517 return updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2);
14518 }
14519 function updateOffscreenComponent(current2, workInProgress2, renderLanes2) {
14520 var nextProps = workInProgress2.pendingProps;
14521 var nextChildren = nextProps.children;
14522 var prevState = current2 !== null ? current2.memoizedState : null;
14523 if (nextProps.mode === "hidden" || enableLegacyHidden) {
14524 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
14525 var nextState = {
14526 baseLanes: NoLanes,
14527 cachePool: null,
14528 transitions: null
14529 };
14530 workInProgress2.memoizedState = nextState;
14531 pushRenderLanes(workInProgress2, renderLanes2);
14532 } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
14533 var spawnedCachePool = null;
14534 var nextBaseLanes;
14535 if (prevState !== null) {
14536 var prevBaseLanes = prevState.baseLanes;
14537 nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
14538 } else {
14539 nextBaseLanes = renderLanes2;
14540 }
14541 workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
14542 var _nextState = {
14543 baseLanes: nextBaseLanes,
14544 cachePool: spawnedCachePool,
14545 transitions: null
14546 };
14547 workInProgress2.memoizedState = _nextState;
14548 workInProgress2.updateQueue = null;
14549 pushRenderLanes(workInProgress2, nextBaseLanes);
14550 return null;
14551 } else {
14552 var _nextState2 = {
14553 baseLanes: NoLanes,
14554 cachePool: null,
14555 transitions: null
14556 };
14557 workInProgress2.memoizedState = _nextState2;
14558 var subtreeRenderLanes2 = prevState !== null ? prevState.baseLanes : renderLanes2;
14559 pushRenderLanes(workInProgress2, subtreeRenderLanes2);
14560 }
14561 } else {
14562 var _subtreeRenderLanes;
14563 if (prevState !== null) {
14564 _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes2);
14565 workInProgress2.memoizedState = null;
14566 } else {
14567 _subtreeRenderLanes = renderLanes2;
14568 }
14569 pushRenderLanes(workInProgress2, _subtreeRenderLanes);
14570 }
14571 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14572 return workInProgress2.child;
14573 }
14574 function updateFragment(current2, workInProgress2, renderLanes2) {
14575 var nextChildren = workInProgress2.pendingProps;
14576 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14577 return workInProgress2.child;
14578 }
14579 function updateMode(current2, workInProgress2, renderLanes2) {
14580 var nextChildren = workInProgress2.pendingProps.children;
14581 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14582 return workInProgress2.child;
14583 }
14584 function updateProfiler(current2, workInProgress2, renderLanes2) {
14585 {
14586 workInProgress2.flags |= Update;
14587 {
14588 var stateNode = workInProgress2.stateNode;
14589 stateNode.effectDuration = 0;
14590 stateNode.passiveEffectDuration = 0;
14591 }
14592 }
14593 var nextProps = workInProgress2.pendingProps;
14594 var nextChildren = nextProps.children;
14595 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14596 return workInProgress2.child;
14597 }
14598 function markRef(current2, workInProgress2) {
14599 var ref = workInProgress2.ref;
14600 if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
14601 workInProgress2.flags |= Ref;
14602 {
14603 workInProgress2.flags |= RefStatic;
14604 }
14605 }
14606 }
14607 function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14608 {
14609 if (workInProgress2.type !== workInProgress2.elementType) {
14610 var innerPropTypes = Component.propTypes;
14611 if (innerPropTypes) {
14612 checkPropTypes(
14613 innerPropTypes,
14614 nextProps,
14615 // Resolved props
14616 "prop",
14617 getComponentNameFromType(Component)
14618 );
14619 }
14620 }
14621 }
14622 var context;
14623 {
14624 var unmaskedContext = getUnmaskedContext(workInProgress2, Component, true);
14625 context = getMaskedContext(workInProgress2, unmaskedContext);
14626 }
14627 var nextChildren;
14628 var hasId;
14629 prepareToReadContext(workInProgress2, renderLanes2);
14630 {
14631 markComponentRenderStarted(workInProgress2);
14632 }
14633 {
14634 ReactCurrentOwner$1.current = workInProgress2;
14635 setIsRendering(true);
14636 nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
14637 hasId = checkDidRenderIdHook();
14638 if (workInProgress2.mode & StrictLegacyMode) {
14639 setIsStrictModeForDevtools(true);
14640 try {
14641 nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2);
14642 hasId = checkDidRenderIdHook();
14643 } finally {
14644 setIsStrictModeForDevtools(false);
14645 }
14646 }
14647 setIsRendering(false);
14648 }
14649 {
14650 markComponentRenderStopped();
14651 }
14652 if (current2 !== null && !didReceiveUpdate) {
14653 bailoutHooks(current2, workInProgress2, renderLanes2);
14654 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14655 }
14656 if (getIsHydrating() && hasId) {
14657 pushMaterializedTreeId(workInProgress2);
14658 }
14659 workInProgress2.flags |= PerformedWork;
14660 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14661 return workInProgress2.child;
14662 }
14663 function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) {
14664 {
14665 switch (shouldError(workInProgress2)) {
14666 case false: {
14667 var _instance = workInProgress2.stateNode;
14668 var ctor = workInProgress2.type;
14669 var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
14670 var state = tempInstance.state;
14671 _instance.updater.enqueueSetState(_instance, state, null);
14672 break;
14673 }
14674 case true: {
14675 workInProgress2.flags |= DidCapture;
14676 workInProgress2.flags |= ShouldCapture;
14677 var error$1 = new Error("Simulated error coming from DevTools");
14678 var lane = pickArbitraryLane(renderLanes2);
14679 workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
14680 var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
14681 enqueueCapturedUpdate(workInProgress2, update);
14682 break;
14683 }
14684 }
14685 if (workInProgress2.type !== workInProgress2.elementType) {
14686 var innerPropTypes = Component.propTypes;
14687 if (innerPropTypes) {
14688 checkPropTypes(
14689 innerPropTypes,
14690 nextProps,
14691 // Resolved props
14692 "prop",
14693 getComponentNameFromType(Component)
14694 );
14695 }
14696 }
14697 }
14698 var hasContext;
14699 if (isContextProvider(Component)) {
14700 hasContext = true;
14701 pushContextProvider(workInProgress2);
14702 } else {
14703 hasContext = false;
14704 }
14705 prepareToReadContext(workInProgress2, renderLanes2);
14706 var instance = workInProgress2.stateNode;
14707 var shouldUpdate;
14708 if (instance === null) {
14709 resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
14710 constructClassInstance(workInProgress2, Component, nextProps);
14711 mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14712 shouldUpdate = true;
14713 } else if (current2 === null) {
14714 shouldUpdate = resumeMountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14715 } else {
14716 shouldUpdate = updateClassInstance(current2, workInProgress2, Component, nextProps, renderLanes2);
14717 }
14718 var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2);
14719 {
14720 var inst = workInProgress2.stateNode;
14721 if (shouldUpdate && inst.props !== nextProps) {
14722 if (!didWarnAboutReassigningProps) {
14723 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");
14724 }
14725 didWarnAboutReassigningProps = true;
14726 }
14727 }
14728 return nextUnitOfWork;
14729 }
14730 function finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2) {
14731 markRef(current2, workInProgress2);
14732 var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
14733 if (!shouldUpdate && !didCaptureError) {
14734 if (hasContext) {
14735 invalidateContextProvider(workInProgress2, Component, false);
14736 }
14737 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14738 }
14739 var instance = workInProgress2.stateNode;
14740 ReactCurrentOwner$1.current = workInProgress2;
14741 var nextChildren;
14742 if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") {
14743 nextChildren = null;
14744 {
14745 stopProfilerTimerIfRunning();
14746 }
14747 } else {
14748 {
14749 markComponentRenderStarted(workInProgress2);
14750 }
14751 {
14752 setIsRendering(true);
14753 nextChildren = instance.render();
14754 if (workInProgress2.mode & StrictLegacyMode) {
14755 setIsStrictModeForDevtools(true);
14756 try {
14757 instance.render();
14758 } finally {
14759 setIsStrictModeForDevtools(false);
14760 }
14761 }
14762 setIsRendering(false);
14763 }
14764 {
14765 markComponentRenderStopped();
14766 }
14767 }
14768 workInProgress2.flags |= PerformedWork;
14769 if (current2 !== null && didCaptureError) {
14770 forceUnmountCurrentAndReconcile(current2, workInProgress2, nextChildren, renderLanes2);
14771 } else {
14772 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14773 }
14774 workInProgress2.memoizedState = instance.state;
14775 if (hasContext) {
14776 invalidateContextProvider(workInProgress2, Component, true);
14777 }
14778 return workInProgress2.child;
14779 }
14780 function pushHostRootContext(workInProgress2) {
14781 var root2 = workInProgress2.stateNode;
14782 if (root2.pendingContext) {
14783 pushTopLevelContextObject(workInProgress2, root2.pendingContext, root2.pendingContext !== root2.context);
14784 } else if (root2.context) {
14785 pushTopLevelContextObject(workInProgress2, root2.context, false);
14786 }
14787 pushHostContainer(workInProgress2, root2.containerInfo);
14788 }
14789 function updateHostRoot(current2, workInProgress2, renderLanes2) {
14790 pushHostRootContext(workInProgress2);
14791 if (current2 === null) {
14792 throw new Error("Should have a current fiber. This is a bug in React.");
14793 }
14794 var nextProps = workInProgress2.pendingProps;
14795 var prevState = workInProgress2.memoizedState;
14796 var prevChildren = prevState.element;
14797 cloneUpdateQueue(current2, workInProgress2);
14798 processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
14799 var nextState = workInProgress2.memoizedState;
14800 var root2 = workInProgress2.stateNode;
14801 var nextChildren = nextState.element;
14802 if (prevState.isDehydrated) {
14803 var overrideState = {
14804 element: nextChildren,
14805 isDehydrated: false,
14806 cache: nextState.cache,
14807 pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
14808 transitions: nextState.transitions
14809 };
14810 var updateQueue = workInProgress2.updateQueue;
14811 updateQueue.baseState = overrideState;
14812 workInProgress2.memoizedState = overrideState;
14813 if (workInProgress2.flags & ForceClientRender) {
14814 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);
14815 return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
14816 } else if (nextChildren !== prevChildren) {
14817 var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
14818 return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
14819 } else {
14820 enterHydrationState(workInProgress2);
14821 var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
14822 workInProgress2.child = child;
14823 var node = child;
14824 while (node) {
14825 node.flags = node.flags & ~Placement | Hydrating;
14826 node = node.sibling;
14827 }
14828 }
14829 } else {
14830 resetHydrationState();
14831 if (nextChildren === prevChildren) {
14832 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
14833 }
14834 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14835 }
14836 return workInProgress2.child;
14837 }
14838 function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
14839 resetHydrationState();
14840 queueHydrationError(recoverableError);
14841 workInProgress2.flags |= ForceClientRender;
14842 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14843 return workInProgress2.child;
14844 }
14845 function updateHostComponent(current2, workInProgress2, renderLanes2) {
14846 pushHostContext(workInProgress2);
14847 if (current2 === null) {
14848 tryToClaimNextHydratableInstance(workInProgress2);
14849 }
14850 var type = workInProgress2.type;
14851 var nextProps = workInProgress2.pendingProps;
14852 var prevProps = current2 !== null ? current2.memoizedProps : null;
14853 var nextChildren = nextProps.children;
14854 var isDirectTextChild = shouldSetTextContent(type, nextProps);
14855 if (isDirectTextChild) {
14856 nextChildren = null;
14857 } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
14858 workInProgress2.flags |= ContentReset;
14859 }
14860 markRef(current2, workInProgress2);
14861 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
14862 return workInProgress2.child;
14863 }
14864 function updateHostText(current2, workInProgress2) {
14865 if (current2 === null) {
14866 tryToClaimNextHydratableInstance(workInProgress2);
14867 }
14868 return null;
14869 }
14870 function mountLazyComponent(_current, workInProgress2, elementType, renderLanes2) {
14871 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14872 var props = workInProgress2.pendingProps;
14873 var lazyComponent = elementType;
14874 var payload = lazyComponent._payload;
14875 var init = lazyComponent._init;
14876 var Component = init(payload);
14877 workInProgress2.type = Component;
14878 var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component);
14879 var resolvedProps = resolveDefaultProps(Component, props);
14880 var child;
14881 switch (resolvedTag) {
14882 case FunctionComponent: {
14883 {
14884 validateFunctionComponentInDev(workInProgress2, Component);
14885 workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
14886 }
14887 child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
14888 return child;
14889 }
14890 case ClassComponent: {
14891 {
14892 workInProgress2.type = Component = resolveClassForHotReloading(Component);
14893 }
14894 child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
14895 return child;
14896 }
14897 case ForwardRef: {
14898 {
14899 workInProgress2.type = Component = resolveForwardRefForHotReloading(Component);
14900 }
14901 child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2);
14902 return child;
14903 }
14904 case MemoComponent: {
14905 {
14906 if (workInProgress2.type !== workInProgress2.elementType) {
14907 var outerPropTypes = Component.propTypes;
14908 if (outerPropTypes) {
14909 checkPropTypes(
14910 outerPropTypes,
14911 resolvedProps,
14912 // Resolved for outer only
14913 "prop",
14914 getComponentNameFromType(Component)
14915 );
14916 }
14917 }
14918 }
14919 child = updateMemoComponent(
14920 null,
14921 workInProgress2,
14922 Component,
14923 resolveDefaultProps(Component.type, resolvedProps),
14924 // The inner type can have defaults too
14925 renderLanes2
14926 );
14927 return child;
14928 }
14929 }
14930 var hint = "";
14931 {
14932 if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) {
14933 hint = " Did you wrap a component in React.lazy() more than once?";
14934 }
14935 }
14936 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));
14937 }
14938 function mountIncompleteClassComponent(_current, workInProgress2, Component, nextProps, renderLanes2) {
14939 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14940 workInProgress2.tag = ClassComponent;
14941 var hasContext;
14942 if (isContextProvider(Component)) {
14943 hasContext = true;
14944 pushContextProvider(workInProgress2);
14945 } else {
14946 hasContext = false;
14947 }
14948 prepareToReadContext(workInProgress2, renderLanes2);
14949 constructClassInstance(workInProgress2, Component, nextProps);
14950 mountClassInstance(workInProgress2, Component, nextProps, renderLanes2);
14951 return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
14952 }
14953 function mountIndeterminateComponent(_current, workInProgress2, Component, renderLanes2) {
14954 resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
14955 var props = workInProgress2.pendingProps;
14956 var context;
14957 {
14958 var unmaskedContext = getUnmaskedContext(workInProgress2, Component, false);
14959 context = getMaskedContext(workInProgress2, unmaskedContext);
14960 }
14961 prepareToReadContext(workInProgress2, renderLanes2);
14962 var value;
14963 var hasId;
14964 {
14965 markComponentRenderStarted(workInProgress2);
14966 }
14967 {
14968 if (Component.prototype && typeof Component.prototype.render === "function") {
14969 var componentName = getComponentNameFromType(Component) || "Unknown";
14970 if (!didWarnAboutBadClass[componentName]) {
14971 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);
14972 didWarnAboutBadClass[componentName] = true;
14973 }
14974 }
14975 if (workInProgress2.mode & StrictLegacyMode) {
14976 ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
14977 }
14978 setIsRendering(true);
14979 ReactCurrentOwner$1.current = workInProgress2;
14980 value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
14981 hasId = checkDidRenderIdHook();
14982 setIsRendering(false);
14983 }
14984 {
14985 markComponentRenderStopped();
14986 }
14987 workInProgress2.flags |= PerformedWork;
14988 {
14989 if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
14990 var _componentName = getComponentNameFromType(Component) || "Unknown";
14991 if (!didWarnAboutModulePatternComponent[_componentName]) {
14992 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);
14993 didWarnAboutModulePatternComponent[_componentName] = true;
14994 }
14995 }
14996 }
14997 if (
14998 // Run these checks in production only if the flag is off.
14999 // Eventually we'll delete this branch altogether.
15000 typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
15001 ) {
15002 {
15003 var _componentName2 = getComponentNameFromType(Component) || "Unknown";
15004 if (!didWarnAboutModulePatternComponent[_componentName2]) {
15005 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);
15006 didWarnAboutModulePatternComponent[_componentName2] = true;
15007 }
15008 }
15009 workInProgress2.tag = ClassComponent;
15010 workInProgress2.memoizedState = null;
15011 workInProgress2.updateQueue = null;
15012 var hasContext = false;
15013 if (isContextProvider(Component)) {
15014 hasContext = true;
15015 pushContextProvider(workInProgress2);
15016 } else {
15017 hasContext = false;
15018 }
15019 workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
15020 initializeUpdateQueue(workInProgress2);
15021 adoptClassInstance(workInProgress2, value);
15022 mountClassInstance(workInProgress2, Component, props, renderLanes2);
15023 return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2);
15024 } else {
15025 workInProgress2.tag = FunctionComponent;
15026 {
15027 if (workInProgress2.mode & StrictLegacyMode) {
15028 setIsStrictModeForDevtools(true);
15029 try {
15030 value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2);
15031 hasId = checkDidRenderIdHook();
15032 } finally {
15033 setIsStrictModeForDevtools(false);
15034 }
15035 }
15036 }
15037 if (getIsHydrating() && hasId) {
15038 pushMaterializedTreeId(workInProgress2);
15039 }
15040 reconcileChildren(null, workInProgress2, value, renderLanes2);
15041 {
15042 validateFunctionComponentInDev(workInProgress2, Component);
15043 }
15044 return workInProgress2.child;
15045 }
15046 }
15047 function validateFunctionComponentInDev(workInProgress2, Component) {
15048 {
15049 if (Component) {
15050 if (Component.childContextTypes) {
15051 error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component");
15052 }
15053 }
15054 if (workInProgress2.ref !== null) {
15055 var info = "";
15056 var ownerName = getCurrentFiberOwnerNameInDevOrNull();
15057 if (ownerName) {
15058 info += "\n\nCheck the render method of `" + ownerName + "`.";
15059 }
15060 var warningKey = ownerName || "";
15061 var debugSource = workInProgress2._debugSource;
15062 if (debugSource) {
15063 warningKey = debugSource.fileName + ":" + debugSource.lineNumber;
15064 }
15065 if (!didWarnAboutFunctionRefs[warningKey]) {
15066 didWarnAboutFunctionRefs[warningKey] = true;
15067 error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info);
15068 }
15069 }
15070 if (Component.defaultProps !== void 0) {
15071 var componentName = getComponentNameFromType(Component) || "Unknown";
15072 if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
15073 error("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", componentName);
15074 didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
15075 }
15076 }
15077 if (typeof Component.getDerivedStateFromProps === "function") {
15078 var _componentName3 = getComponentNameFromType(Component) || "Unknown";
15079 if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
15080 error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
15081 didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
15082 }
15083 }
15084 if (typeof Component.contextType === "object" && Component.contextType !== null) {
15085 var _componentName4 = getComponentNameFromType(Component) || "Unknown";
15086 if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
15087 error("%s: Function components do not support contextType.", _componentName4);
15088 didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
15089 }
15090 }
15091 }
15092 }
15093 var SUSPENDED_MARKER = {
15094 dehydrated: null,
15095 treeContext: null,
15096 retryLane: NoLane
15097 };
15098 function mountSuspenseOffscreenState(renderLanes2) {
15099 return {
15100 baseLanes: renderLanes2,
15101 cachePool: getSuspendedCache(),
15102 transitions: null
15103 };
15104 }
15105 function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
15106 var cachePool = null;
15107 return {
15108 baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
15109 cachePool,
15110 transitions: prevOffscreenState.transitions
15111 };
15112 }
15113 function shouldRemainOnFallback(suspenseContext, current2, workInProgress2, renderLanes2) {
15114 if (current2 !== null) {
15115 var suspenseState = current2.memoizedState;
15116 if (suspenseState === null) {
15117 return false;
15118 }
15119 }
15120 return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
15121 }
15122 function getRemainingWorkInPrimaryTree(current2, renderLanes2) {
15123 return removeLanes(current2.childLanes, renderLanes2);
15124 }
15125 function updateSuspenseComponent(current2, workInProgress2, renderLanes2) {
15126 var nextProps = workInProgress2.pendingProps;
15127 {
15128 if (shouldSuspend(workInProgress2)) {
15129 workInProgress2.flags |= DidCapture;
15130 }
15131 }
15132 var suspenseContext = suspenseStackCursor.current;
15133 var showFallback = false;
15134 var didSuspend = (workInProgress2.flags & DidCapture) !== NoFlags;
15135 if (didSuspend || shouldRemainOnFallback(suspenseContext, current2)) {
15136 showFallback = true;
15137 workInProgress2.flags &= ~DidCapture;
15138 } else {
15139 if (current2 === null || current2.memoizedState !== null) {
15140 {
15141 suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
15142 }
15143 }
15144 }
15145 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
15146 pushSuspenseContext(workInProgress2, suspenseContext);
15147 if (current2 === null) {
15148 tryToClaimNextHydratableInstance(workInProgress2);
15149 var suspenseState = workInProgress2.memoizedState;
15150 if (suspenseState !== null) {
15151 var dehydrated = suspenseState.dehydrated;
15152 if (dehydrated !== null) {
15153 return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
15154 }
15155 }
15156 var nextPrimaryChildren = nextProps.children;
15157 var nextFallbackChildren = nextProps.fallback;
15158 if (showFallback) {
15159 var fallbackFragment = mountSuspenseFallbackChildren(workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
15160 var primaryChildFragment = workInProgress2.child;
15161 primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes2);
15162 workInProgress2.memoizedState = SUSPENDED_MARKER;
15163 return fallbackFragment;
15164 } else {
15165 return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
15166 }
15167 } else {
15168 var prevState = current2.memoizedState;
15169 if (prevState !== null) {
15170 var _dehydrated = prevState.dehydrated;
15171 if (_dehydrated !== null) {
15172 return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
15173 }
15174 }
15175 if (showFallback) {
15176 var _nextFallbackChildren = nextProps.fallback;
15177 var _nextPrimaryChildren = nextProps.children;
15178 var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
15179 var _primaryChildFragment2 = workInProgress2.child;
15180 var prevOffscreenState = current2.child.memoizedState;
15181 _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
15182 _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
15183 workInProgress2.memoizedState = SUSPENDED_MARKER;
15184 return fallbackChildFragment;
15185 } else {
15186 var _nextPrimaryChildren2 = nextProps.children;
15187 var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
15188 workInProgress2.memoizedState = null;
15189 return _primaryChildFragment3;
15190 }
15191 }
15192 }
15193 function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
15194 var mode = workInProgress2.mode;
15195 var primaryChildProps = {
15196 mode: "visible",
15197 children: primaryChildren
15198 };
15199 var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
15200 primaryChildFragment.return = workInProgress2;
15201 workInProgress2.child = primaryChildFragment;
15202 return primaryChildFragment;
15203 }
15204 function mountSuspenseFallbackChildren(workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15205 var mode = workInProgress2.mode;
15206 var progressedPrimaryFragment = workInProgress2.child;
15207 var primaryChildProps = {
15208 mode: "hidden",
15209 children: primaryChildren
15210 };
15211 var primaryChildFragment;
15212 var fallbackChildFragment;
15213 if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) {
15214 primaryChildFragment = progressedPrimaryFragment;
15215 primaryChildFragment.childLanes = NoLanes;
15216 primaryChildFragment.pendingProps = primaryChildProps;
15217 if (workInProgress2.mode & ProfileMode) {
15218 primaryChildFragment.actualDuration = 0;
15219 primaryChildFragment.actualStartTime = -1;
15220 primaryChildFragment.selfBaseDuration = 0;
15221 primaryChildFragment.treeBaseDuration = 0;
15222 }
15223 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15224 } else {
15225 primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
15226 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15227 }
15228 primaryChildFragment.return = workInProgress2;
15229 fallbackChildFragment.return = workInProgress2;
15230 primaryChildFragment.sibling = fallbackChildFragment;
15231 workInProgress2.child = primaryChildFragment;
15232 return fallbackChildFragment;
15233 }
15234 function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
15235 return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
15236 }
15237 function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
15238 return createWorkInProgress(current2, offscreenProps);
15239 }
15240 function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
15241 var currentPrimaryChildFragment = current2.child;
15242 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
15243 var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
15244 mode: "visible",
15245 children: primaryChildren
15246 });
15247 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15248 primaryChildFragment.lanes = renderLanes2;
15249 }
15250 primaryChildFragment.return = workInProgress2;
15251 primaryChildFragment.sibling = null;
15252 if (currentFallbackChildFragment !== null) {
15253 var deletions = workInProgress2.deletions;
15254 if (deletions === null) {
15255 workInProgress2.deletions = [currentFallbackChildFragment];
15256 workInProgress2.flags |= ChildDeletion;
15257 } else {
15258 deletions.push(currentFallbackChildFragment);
15259 }
15260 }
15261 workInProgress2.child = primaryChildFragment;
15262 return primaryChildFragment;
15263 }
15264 function updateSuspenseFallbackChildren(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15265 var mode = workInProgress2.mode;
15266 var currentPrimaryChildFragment = current2.child;
15267 var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
15268 var primaryChildProps = {
15269 mode: "hidden",
15270 children: primaryChildren
15271 };
15272 var primaryChildFragment;
15273 if (
15274 // In legacy mode, we commit the primary tree as if it successfully
15275 // completed, even though it's in an inconsistent state.
15276 (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
15277 // already cloned. In legacy mode, the only case where this isn't true is
15278 // when DevTools forces us to display a fallback; we skip the first render
15279 // pass entirely and go straight to rendering the fallback. (In Concurrent
15280 // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
15281 // only codepath.)
15282 workInProgress2.child !== currentPrimaryChildFragment
15283 ) {
15284 var progressedPrimaryFragment = workInProgress2.child;
15285 primaryChildFragment = progressedPrimaryFragment;
15286 primaryChildFragment.childLanes = NoLanes;
15287 primaryChildFragment.pendingProps = primaryChildProps;
15288 if (workInProgress2.mode & ProfileMode) {
15289 primaryChildFragment.actualDuration = 0;
15290 primaryChildFragment.actualStartTime = -1;
15291 primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;
15292 primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;
15293 }
15294 workInProgress2.deletions = null;
15295 } else {
15296 primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
15297 primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
15298 }
15299 var fallbackChildFragment;
15300 if (currentFallbackChildFragment !== null) {
15301 fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);
15302 } else {
15303 fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
15304 fallbackChildFragment.flags |= Placement;
15305 }
15306 fallbackChildFragment.return = workInProgress2;
15307 primaryChildFragment.return = workInProgress2;
15308 primaryChildFragment.sibling = fallbackChildFragment;
15309 workInProgress2.child = primaryChildFragment;
15310 return fallbackChildFragment;
15311 }
15312 function retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
15313 if (recoverableError !== null) {
15314 queueHydrationError(recoverableError);
15315 }
15316 reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
15317 var nextProps = workInProgress2.pendingProps;
15318 var primaryChildren = nextProps.children;
15319 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
15320 primaryChildFragment.flags |= Placement;
15321 workInProgress2.memoizedState = null;
15322 return primaryChildFragment;
15323 }
15324 function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
15325 var fiberMode = workInProgress2.mode;
15326 var primaryChildProps = {
15327 mode: "visible",
15328 children: primaryChildren
15329 };
15330 var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
15331 var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
15332 fallbackChildFragment.flags |= Placement;
15333 primaryChildFragment.return = workInProgress2;
15334 fallbackChildFragment.return = workInProgress2;
15335 primaryChildFragment.sibling = fallbackChildFragment;
15336 workInProgress2.child = primaryChildFragment;
15337 if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
15338 reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
15339 }
15340 return fallbackChildFragment;
15341 }
15342 function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
15343 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15344 {
15345 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.");
15346 }
15347 workInProgress2.lanes = laneToLanes(SyncLane);
15348 } else if (isSuspenseInstanceFallback(suspenseInstance)) {
15349 workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
15350 } else {
15351 workInProgress2.lanes = laneToLanes(OffscreenLane);
15352 }
15353 return null;
15354 }
15355 function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
15356 if (!didSuspend) {
15357 warnIfHydrating();
15358 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15359 return retrySuspenseComponentWithoutHydrating(
15360 current2,
15361 workInProgress2,
15362 renderLanes2,
15363 // TODO: When we delete legacy mode, we should make this error argument
15364 // required — every concurrent mode path that causes hydration to
15365 // de-opt to client rendering should have an error message.
15366 null
15367 );
15368 }
15369 if (isSuspenseInstanceFallback(suspenseInstance)) {
15370 var digest, message, stack;
15371 {
15372 var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
15373 digest = _getSuspenseInstanceF.digest;
15374 message = _getSuspenseInstanceF.message;
15375 stack = _getSuspenseInstanceF.stack;
15376 }
15377 var error2;
15378 if (message) {
15379 error2 = new Error(message);
15380 } else {
15381 error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
15382 }
15383 var capturedValue = createCapturedValue(error2, digest, stack);
15384 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
15385 }
15386 var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
15387 if (didReceiveUpdate || hasContextChanged2) {
15388 var root2 = getWorkInProgressRoot();
15389 if (root2 !== null) {
15390 var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
15391 if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
15392 suspenseState.retryLane = attemptHydrationAtLane;
15393 var eventTime = NoTimestamp;
15394 enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
15395 scheduleUpdateOnFiber(root2, current2, attemptHydrationAtLane, eventTime);
15396 }
15397 }
15398 renderDidSuspendDelayIfPossible();
15399 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."));
15400 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
15401 } else if (isSuspenseInstancePending(suspenseInstance)) {
15402 workInProgress2.flags |= DidCapture;
15403 workInProgress2.child = current2.child;
15404 var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
15405 registerSuspenseInstanceRetry(suspenseInstance, retry);
15406 return null;
15407 } else {
15408 reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
15409 var primaryChildren = nextProps.children;
15410 var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
15411 primaryChildFragment.flags |= Hydrating;
15412 return primaryChildFragment;
15413 }
15414 } else {
15415 if (workInProgress2.flags & ForceClientRender) {
15416 workInProgress2.flags &= ~ForceClientRender;
15417 var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
15418 return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
15419 } else if (workInProgress2.memoizedState !== null) {
15420 workInProgress2.child = current2.child;
15421 workInProgress2.flags |= DidCapture;
15422 return null;
15423 } else {
15424 var nextPrimaryChildren = nextProps.children;
15425 var nextFallbackChildren = nextProps.fallback;
15426 var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
15427 var _primaryChildFragment4 = workInProgress2.child;
15428 _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
15429 workInProgress2.memoizedState = SUSPENDED_MARKER;
15430 return fallbackChildFragment;
15431 }
15432 }
15433 }
15434 function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
15435 fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
15436 var alternate = fiber.alternate;
15437 if (alternate !== null) {
15438 alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
15439 }
15440 scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
15441 }
15442 function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
15443 var node = firstChild;
15444 while (node !== null) {
15445 if (node.tag === SuspenseComponent) {
15446 var state = node.memoizedState;
15447 if (state !== null) {
15448 scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
15449 }
15450 } else if (node.tag === SuspenseListComponent) {
15451 scheduleSuspenseWorkOnFiber(node, renderLanes2, workInProgress2);
15452 } else if (node.child !== null) {
15453 node.child.return = node;
15454 node = node.child;
15455 continue;
15456 }
15457 if (node === workInProgress2) {
15458 return;
15459 }
15460 while (node.sibling === null) {
15461 if (node.return === null || node.return === workInProgress2) {
15462 return;
15463 }
15464 node = node.return;
15465 }
15466 node.sibling.return = node.return;
15467 node = node.sibling;
15468 }
15469 }
15470 function findLastContentRow(firstChild) {
15471 var row = firstChild;
15472 var lastContentRow = null;
15473 while (row !== null) {
15474 var currentRow = row.alternate;
15475 if (currentRow !== null && findFirstSuspended(currentRow) === null) {
15476 lastContentRow = row;
15477 }
15478 row = row.sibling;
15479 }
15480 return lastContentRow;
15481 }
15482 function validateRevealOrder(revealOrder) {
15483 {
15484 if (revealOrder !== void 0 && revealOrder !== "forwards" && revealOrder !== "backwards" && revealOrder !== "together" && !didWarnAboutRevealOrder[revealOrder]) {
15485 didWarnAboutRevealOrder[revealOrder] = true;
15486 if (typeof revealOrder === "string") {
15487 switch (revealOrder.toLowerCase()) {
15488 case "together":
15489 case "forwards":
15490 case "backwards": {
15491 error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
15492 break;
15493 }
15494 case "forward":
15495 case "backward": {
15496 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());
15497 break;
15498 }
15499 default:
15500 error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
15501 break;
15502 }
15503 } else {
15504 error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', revealOrder);
15505 }
15506 }
15507 }
15508 }
15509 function validateTailOptions(tailMode, revealOrder) {
15510 {
15511 if (tailMode !== void 0 && !didWarnAboutTailOptions[tailMode]) {
15512 if (tailMode !== "collapsed" && tailMode !== "hidden") {
15513 didWarnAboutTailOptions[tailMode] = true;
15514 error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', tailMode);
15515 } else if (revealOrder !== "forwards" && revealOrder !== "backwards") {
15516 didWarnAboutTailOptions[tailMode] = true;
15517 error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', tailMode);
15518 }
15519 }
15520 }
15521 }
15522 function validateSuspenseListNestedChild(childSlot, index2) {
15523 {
15524 var isAnArray = isArray(childSlot);
15525 var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
15526 if (isAnArray || isIterable) {
15527 var type = isAnArray ? "array" : "iterable";
15528 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);
15529 return false;
15530 }
15531 }
15532 return true;
15533 }
15534 function validateSuspenseListChildren(children, revealOrder) {
15535 {
15536 if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== void 0 && children !== null && children !== false) {
15537 if (isArray(children)) {
15538 for (var i = 0; i < children.length; i++) {
15539 if (!validateSuspenseListNestedChild(children[i], i)) {
15540 return;
15541 }
15542 }
15543 } else {
15544 var iteratorFn = getIteratorFn(children);
15545 if (typeof iteratorFn === "function") {
15546 var childrenIterator = iteratorFn.call(children);
15547 if (childrenIterator) {
15548 var step = childrenIterator.next();
15549 var _i = 0;
15550 for (; !step.done; step = childrenIterator.next()) {
15551 if (!validateSuspenseListNestedChild(step.value, _i)) {
15552 return;
15553 }
15554 _i++;
15555 }
15556 }
15557 } else {
15558 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);
15559 }
15560 }
15561 }
15562 }
15563 }
15564 function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
15565 var renderState = workInProgress2.memoizedState;
15566 if (renderState === null) {
15567 workInProgress2.memoizedState = {
15568 isBackwards,
15569 rendering: null,
15570 renderingStartTime: 0,
15571 last: lastContentRow,
15572 tail,
15573 tailMode
15574 };
15575 } else {
15576 renderState.isBackwards = isBackwards;
15577 renderState.rendering = null;
15578 renderState.renderingStartTime = 0;
15579 renderState.last = lastContentRow;
15580 renderState.tail = tail;
15581 renderState.tailMode = tailMode;
15582 }
15583 }
15584 function updateSuspenseListComponent(current2, workInProgress2, renderLanes2) {
15585 var nextProps = workInProgress2.pendingProps;
15586 var revealOrder = nextProps.revealOrder;
15587 var tailMode = nextProps.tail;
15588 var newChildren = nextProps.children;
15589 validateRevealOrder(revealOrder);
15590 validateTailOptions(tailMode, revealOrder);
15591 validateSuspenseListChildren(newChildren, revealOrder);
15592 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15593 var suspenseContext = suspenseStackCursor.current;
15594 var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
15595 if (shouldForceFallback) {
15596 suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
15597 workInProgress2.flags |= DidCapture;
15598 } else {
15599 var didSuspendBefore = current2 !== null && (current2.flags & DidCapture) !== NoFlags;
15600 if (didSuspendBefore) {
15601 propagateSuspenseContextChange(workInProgress2, workInProgress2.child, renderLanes2);
15602 }
15603 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
15604 }
15605 pushSuspenseContext(workInProgress2, suspenseContext);
15606 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15607 workInProgress2.memoizedState = null;
15608 } else {
15609 switch (revealOrder) {
15610 case "forwards": {
15611 var lastContentRow = findLastContentRow(workInProgress2.child);
15612 var tail;
15613 if (lastContentRow === null) {
15614 tail = workInProgress2.child;
15615 workInProgress2.child = null;
15616 } else {
15617 tail = lastContentRow.sibling;
15618 lastContentRow.sibling = null;
15619 }
15620 initSuspenseListRenderState(
15621 workInProgress2,
15622 false,
15623 // isBackwards
15624 tail,
15625 lastContentRow,
15626 tailMode
15627 );
15628 break;
15629 }
15630 case "backwards": {
15631 var _tail = null;
15632 var row = workInProgress2.child;
15633 workInProgress2.child = null;
15634 while (row !== null) {
15635 var currentRow = row.alternate;
15636 if (currentRow !== null && findFirstSuspended(currentRow) === null) {
15637 workInProgress2.child = row;
15638 break;
15639 }
15640 var nextRow = row.sibling;
15641 row.sibling = _tail;
15642 _tail = row;
15643 row = nextRow;
15644 }
15645 initSuspenseListRenderState(
15646 workInProgress2,
15647 true,
15648 // isBackwards
15649 _tail,
15650 null,
15651 // last
15652 tailMode
15653 );
15654 break;
15655 }
15656 case "together": {
15657 initSuspenseListRenderState(
15658 workInProgress2,
15659 false,
15660 // isBackwards
15661 null,
15662 // tail
15663 null,
15664 // last
15665 void 0
15666 );
15667 break;
15668 }
15669 default: {
15670 workInProgress2.memoizedState = null;
15671 }
15672 }
15673 }
15674 return workInProgress2.child;
15675 }
15676 function updatePortalComponent(current2, workInProgress2, renderLanes2) {
15677 pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
15678 var nextChildren = workInProgress2.pendingProps;
15679 if (current2 === null) {
15680 workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2);
15681 } else {
15682 reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
15683 }
15684 return workInProgress2.child;
15685 }
15686 var hasWarnedAboutUsingNoValuePropOnContextProvider = false;
15687 function updateContextProvider(current2, workInProgress2, renderLanes2) {
15688 var providerType = workInProgress2.type;
15689 var context = providerType._context;
15690 var newProps = workInProgress2.pendingProps;
15691 var oldProps = workInProgress2.memoizedProps;
15692 var newValue = newProps.value;
15693 {
15694 if (!("value" in newProps)) {
15695 if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
15696 hasWarnedAboutUsingNoValuePropOnContextProvider = true;
15697 error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?");
15698 }
15699 }
15700 var providerPropTypes = workInProgress2.type.propTypes;
15701 if (providerPropTypes) {
15702 checkPropTypes(providerPropTypes, newProps, "prop", "Context.Provider");
15703 }
15704 }
15705 pushProvider(workInProgress2, context, newValue);
15706 {
15707 if (oldProps !== null) {
15708 var oldValue = oldProps.value;
15709 if (objectIs(oldValue, newValue)) {
15710 if (oldProps.children === newProps.children && !hasContextChanged()) {
15711 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15712 }
15713 } else {
15714 propagateContextChange(workInProgress2, context, renderLanes2);
15715 }
15716 }
15717 }
15718 var newChildren = newProps.children;
15719 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15720 return workInProgress2.child;
15721 }
15722 var hasWarnedAboutUsingContextAsConsumer = false;
15723 function updateContextConsumer(current2, workInProgress2, renderLanes2) {
15724 var context = workInProgress2.type;
15725 {
15726 if (context._context === void 0) {
15727 if (context !== context.Consumer) {
15728 if (!hasWarnedAboutUsingContextAsConsumer) {
15729 hasWarnedAboutUsingContextAsConsumer = true;
15730 error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
15731 }
15732 }
15733 } else {
15734 context = context._context;
15735 }
15736 }
15737 var newProps = workInProgress2.pendingProps;
15738 var render2 = newProps.children;
15739 {
15740 if (typeof render2 !== "function") {
15741 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.");
15742 }
15743 }
15744 prepareToReadContext(workInProgress2, renderLanes2);
15745 var newValue = readContext(context);
15746 {
15747 markComponentRenderStarted(workInProgress2);
15748 }
15749 var newChildren;
15750 {
15751 ReactCurrentOwner$1.current = workInProgress2;
15752 setIsRendering(true);
15753 newChildren = render2(newValue);
15754 setIsRendering(false);
15755 }
15756 {
15757 markComponentRenderStopped();
15758 }
15759 workInProgress2.flags |= PerformedWork;
15760 reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
15761 return workInProgress2.child;
15762 }
15763 function markWorkInProgressReceivedUpdate() {
15764 didReceiveUpdate = true;
15765 }
15766 function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
15767 if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
15768 if (current2 !== null) {
15769 current2.alternate = null;
15770 workInProgress2.alternate = null;
15771 workInProgress2.flags |= Placement;
15772 }
15773 }
15774 }
15775 function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
15776 if (current2 !== null) {
15777 workInProgress2.dependencies = current2.dependencies;
15778 }
15779 {
15780 stopProfilerTimerIfRunning();
15781 }
15782 markSkippedUpdateLanes(workInProgress2.lanes);
15783 if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
15784 {
15785 return null;
15786 }
15787 }
15788 cloneChildFibers(current2, workInProgress2);
15789 return workInProgress2.child;
15790 }
15791 function remountFiber(current2, oldWorkInProgress, newWorkInProgress) {
15792 {
15793 var returnFiber = oldWorkInProgress.return;
15794 if (returnFiber === null) {
15795 throw new Error("Cannot swap the root fiber.");
15796 }
15797 current2.alternate = null;
15798 oldWorkInProgress.alternate = null;
15799 newWorkInProgress.index = oldWorkInProgress.index;
15800 newWorkInProgress.sibling = oldWorkInProgress.sibling;
15801 newWorkInProgress.return = oldWorkInProgress.return;
15802 newWorkInProgress.ref = oldWorkInProgress.ref;
15803 if (oldWorkInProgress === returnFiber.child) {
15804 returnFiber.child = newWorkInProgress;
15805 } else {
15806 var prevSibling = returnFiber.child;
15807 if (prevSibling === null) {
15808 throw new Error("Expected parent to have a child.");
15809 }
15810 while (prevSibling.sibling !== oldWorkInProgress) {
15811 prevSibling = prevSibling.sibling;
15812 if (prevSibling === null) {
15813 throw new Error("Expected to find the previous sibling.");
15814 }
15815 }
15816 prevSibling.sibling = newWorkInProgress;
15817 }
15818 var deletions = returnFiber.deletions;
15819 if (deletions === null) {
15820 returnFiber.deletions = [current2];
15821 returnFiber.flags |= ChildDeletion;
15822 } else {
15823 deletions.push(current2);
15824 }
15825 newWorkInProgress.flags |= Placement;
15826 return newWorkInProgress;
15827 }
15828 }
15829 function checkScheduledUpdateOrContext(current2, renderLanes2) {
15830 var updateLanes = current2.lanes;
15831 if (includesSomeLane(updateLanes, renderLanes2)) {
15832 return true;
15833 }
15834 return false;
15835 }
15836 function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
15837 switch (workInProgress2.tag) {
15838 case HostRoot:
15839 pushHostRootContext(workInProgress2);
15840 var root2 = workInProgress2.stateNode;
15841 resetHydrationState();
15842 break;
15843 case HostComponent:
15844 pushHostContext(workInProgress2);
15845 break;
15846 case ClassComponent: {
15847 var Component = workInProgress2.type;
15848 if (isContextProvider(Component)) {
15849 pushContextProvider(workInProgress2);
15850 }
15851 break;
15852 }
15853 case HostPortal:
15854 pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
15855 break;
15856 case ContextProvider: {
15857 var newValue = workInProgress2.memoizedProps.value;
15858 var context = workInProgress2.type._context;
15859 pushProvider(workInProgress2, context, newValue);
15860 break;
15861 }
15862 case Profiler:
15863 {
15864 var hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
15865 if (hasChildWork) {
15866 workInProgress2.flags |= Update;
15867 }
15868 {
15869 var stateNode = workInProgress2.stateNode;
15870 stateNode.effectDuration = 0;
15871 stateNode.passiveEffectDuration = 0;
15872 }
15873 }
15874 break;
15875 case SuspenseComponent: {
15876 var state = workInProgress2.memoizedState;
15877 if (state !== null) {
15878 if (state.dehydrated !== null) {
15879 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15880 workInProgress2.flags |= DidCapture;
15881 return null;
15882 }
15883 var primaryChildFragment = workInProgress2.child;
15884 var primaryChildLanes = primaryChildFragment.childLanes;
15885 if (includesSomeLane(renderLanes2, primaryChildLanes)) {
15886 return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
15887 } else {
15888 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15889 var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15890 if (child !== null) {
15891 return child.sibling;
15892 } else {
15893 return null;
15894 }
15895 }
15896 } else {
15897 pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
15898 }
15899 break;
15900 }
15901 case SuspenseListComponent: {
15902 var didSuspendBefore = (current2.flags & DidCapture) !== NoFlags;
15903 var _hasChildWork = includesSomeLane(renderLanes2, workInProgress2.childLanes);
15904 if (didSuspendBefore) {
15905 if (_hasChildWork) {
15906 return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
15907 }
15908 workInProgress2.flags |= DidCapture;
15909 }
15910 var renderState = workInProgress2.memoizedState;
15911 if (renderState !== null) {
15912 renderState.rendering = null;
15913 renderState.tail = null;
15914 renderState.lastEffect = null;
15915 }
15916 pushSuspenseContext(workInProgress2, suspenseStackCursor.current);
15917 if (_hasChildWork) {
15918 break;
15919 } else {
15920 return null;
15921 }
15922 }
15923 case OffscreenComponent:
15924 case LegacyHiddenComponent: {
15925 workInProgress2.lanes = NoLanes;
15926 return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
15927 }
15928 }
15929 return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
15930 }
15931 function beginWork(current2, workInProgress2, renderLanes2) {
15932 {
15933 if (workInProgress2._debugNeedsRemount && current2 !== null) {
15934 return remountFiber(current2, workInProgress2, createFiberFromTypeAndProps(workInProgress2.type, workInProgress2.key, workInProgress2.pendingProps, workInProgress2._debugOwner || null, workInProgress2.mode, workInProgress2.lanes));
15935 }
15936 }
15937 if (current2 !== null) {
15938 var oldProps = current2.memoizedProps;
15939 var newProps = workInProgress2.pendingProps;
15940 if (oldProps !== newProps || hasContextChanged() || // Force a re-render if the implementation changed due to hot reload:
15941 workInProgress2.type !== current2.type) {
15942 didReceiveUpdate = true;
15943 } else {
15944 var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
15945 if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there
15946 // may not be work scheduled on `current`, so we check for this flag.
15947 (workInProgress2.flags & DidCapture) === NoFlags) {
15948 didReceiveUpdate = false;
15949 return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
15950 }
15951 if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
15952 didReceiveUpdate = true;
15953 } else {
15954 didReceiveUpdate = false;
15955 }
15956 }
15957 } else {
15958 didReceiveUpdate = false;
15959 if (getIsHydrating() && isForkedChild(workInProgress2)) {
15960 var slotIndex = workInProgress2.index;
15961 var numberOfForks = getForksAtLevel();
15962 pushTreeId(workInProgress2, numberOfForks, slotIndex);
15963 }
15964 }
15965 workInProgress2.lanes = NoLanes;
15966 switch (workInProgress2.tag) {
15967 case IndeterminateComponent: {
15968 return mountIndeterminateComponent(current2, workInProgress2, workInProgress2.type, renderLanes2);
15969 }
15970 case LazyComponent: {
15971 var elementType = workInProgress2.elementType;
15972 return mountLazyComponent(current2, workInProgress2, elementType, renderLanes2);
15973 }
15974 case FunctionComponent: {
15975 var Component = workInProgress2.type;
15976 var unresolvedProps = workInProgress2.pendingProps;
15977 var resolvedProps = workInProgress2.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps);
15978 return updateFunctionComponent(current2, workInProgress2, Component, resolvedProps, renderLanes2);
15979 }
15980 case ClassComponent: {
15981 var _Component = workInProgress2.type;
15982 var _unresolvedProps = workInProgress2.pendingProps;
15983 var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
15984 return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
15985 }
15986 case HostRoot:
15987 return updateHostRoot(current2, workInProgress2, renderLanes2);
15988 case HostComponent:
15989 return updateHostComponent(current2, workInProgress2, renderLanes2);
15990 case HostText:
15991 return updateHostText(current2, workInProgress2);
15992 case SuspenseComponent:
15993 return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
15994 case HostPortal:
15995 return updatePortalComponent(current2, workInProgress2, renderLanes2);
15996 case ForwardRef: {
15997 var type = workInProgress2.type;
15998 var _unresolvedProps2 = workInProgress2.pendingProps;
15999 var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
16000 return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2);
16001 }
16002 case Fragment:
16003 return updateFragment(current2, workInProgress2, renderLanes2);
16004 case Mode:
16005 return updateMode(current2, workInProgress2, renderLanes2);
16006 case Profiler:
16007 return updateProfiler(current2, workInProgress2, renderLanes2);
16008 case ContextProvider:
16009 return updateContextProvider(current2, workInProgress2, renderLanes2);
16010 case ContextConsumer:
16011 return updateContextConsumer(current2, workInProgress2, renderLanes2);
16012 case MemoComponent: {
16013 var _type2 = workInProgress2.type;
16014 var _unresolvedProps3 = workInProgress2.pendingProps;
16015 var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
16016 {
16017 if (workInProgress2.type !== workInProgress2.elementType) {
16018 var outerPropTypes = _type2.propTypes;
16019 if (outerPropTypes) {
16020 checkPropTypes(
16021 outerPropTypes,
16022 _resolvedProps3,
16023 // Resolved for outer only
16024 "prop",
16025 getComponentNameFromType(_type2)
16026 );
16027 }
16028 }
16029 }
16030 _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
16031 return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
16032 }
16033 case SimpleMemoComponent: {
16034 return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
16035 }
16036 case IncompleteClassComponent: {
16037 var _Component2 = workInProgress2.type;
16038 var _unresolvedProps4 = workInProgress2.pendingProps;
16039 var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
16040 return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
16041 }
16042 case SuspenseListComponent: {
16043 return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
16044 }
16045 case ScopeComponent: {
16046 break;
16047 }
16048 case OffscreenComponent: {
16049 return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
16050 }
16051 }
16052 throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
16053 }
16054 function markUpdate(workInProgress2) {
16055 workInProgress2.flags |= Update;
16056 }
16057 function markRef$1(workInProgress2) {
16058 workInProgress2.flags |= Ref;
16059 {
16060 workInProgress2.flags |= RefStatic;
16061 }
16062 }
16063 var appendAllChildren;
16064 var updateHostContainer;
16065 var updateHostComponent$1;
16066 var updateHostText$1;
16067 {
16068 appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
16069 var node = workInProgress2.child;
16070 while (node !== null) {
16071 if (node.tag === HostComponent || node.tag === HostText) {
16072 appendInitialChild(parent, node.stateNode);
16073 } else if (node.tag === HostPortal) ;
16074 else if (node.child !== null) {
16075 node.child.return = node;
16076 node = node.child;
16077 continue;
16078 }
16079 if (node === workInProgress2) {
16080 return;
16081 }
16082 while (node.sibling === null) {
16083 if (node.return === null || node.return === workInProgress2) {
16084 return;
16085 }
16086 node = node.return;
16087 }
16088 node.sibling.return = node.return;
16089 node = node.sibling;
16090 }
16091 };
16092 updateHostContainer = function(current2, workInProgress2) {
16093 };
16094 updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
16095 var oldProps = current2.memoizedProps;
16096 if (oldProps === newProps) {
16097 return;
16098 }
16099 var instance = workInProgress2.stateNode;
16100 var currentHostContext = getHostContext();
16101 var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
16102 workInProgress2.updateQueue = updatePayload;
16103 if (updatePayload) {
16104 markUpdate(workInProgress2);
16105 }
16106 };
16107 updateHostText$1 = function(current2, workInProgress2, oldText, newText) {
16108 if (oldText !== newText) {
16109 markUpdate(workInProgress2);
16110 }
16111 };
16112 }
16113 function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
16114 if (getIsHydrating()) {
16115 return;
16116 }
16117 switch (renderState.tailMode) {
16118 case "hidden": {
16119 var tailNode = renderState.tail;
16120 var lastTailNode = null;
16121 while (tailNode !== null) {
16122 if (tailNode.alternate !== null) {
16123 lastTailNode = tailNode;
16124 }
16125 tailNode = tailNode.sibling;
16126 }
16127 if (lastTailNode === null) {
16128 renderState.tail = null;
16129 } else {
16130 lastTailNode.sibling = null;
16131 }
16132 break;
16133 }
16134 case "collapsed": {
16135 var _tailNode = renderState.tail;
16136 var _lastTailNode = null;
16137 while (_tailNode !== null) {
16138 if (_tailNode.alternate !== null) {
16139 _lastTailNode = _tailNode;
16140 }
16141 _tailNode = _tailNode.sibling;
16142 }
16143 if (_lastTailNode === null) {
16144 if (!hasRenderedATailFallback && renderState.tail !== null) {
16145 renderState.tail.sibling = null;
16146 } else {
16147 renderState.tail = null;
16148 }
16149 } else {
16150 _lastTailNode.sibling = null;
16151 }
16152 break;
16153 }
16154 }
16155 }
16156 function bubbleProperties(completedWork) {
16157 var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
16158 var newChildLanes = NoLanes;
16159 var subtreeFlags = NoFlags;
16160 if (!didBailout) {
16161 if ((completedWork.mode & ProfileMode) !== NoMode) {
16162 var actualDuration = completedWork.actualDuration;
16163 var treeBaseDuration = completedWork.selfBaseDuration;
16164 var child = completedWork.child;
16165 while (child !== null) {
16166 newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
16167 subtreeFlags |= child.subtreeFlags;
16168 subtreeFlags |= child.flags;
16169 actualDuration += child.actualDuration;
16170 treeBaseDuration += child.treeBaseDuration;
16171 child = child.sibling;
16172 }
16173 completedWork.actualDuration = actualDuration;
16174 completedWork.treeBaseDuration = treeBaseDuration;
16175 } else {
16176 var _child = completedWork.child;
16177 while (_child !== null) {
16178 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
16179 subtreeFlags |= _child.subtreeFlags;
16180 subtreeFlags |= _child.flags;
16181 _child.return = completedWork;
16182 _child = _child.sibling;
16183 }
16184 }
16185 completedWork.subtreeFlags |= subtreeFlags;
16186 } else {
16187 if ((completedWork.mode & ProfileMode) !== NoMode) {
16188 var _treeBaseDuration = completedWork.selfBaseDuration;
16189 var _child2 = completedWork.child;
16190 while (_child2 !== null) {
16191 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
16192 subtreeFlags |= _child2.subtreeFlags & StaticMask;
16193 subtreeFlags |= _child2.flags & StaticMask;
16194 _treeBaseDuration += _child2.treeBaseDuration;
16195 _child2 = _child2.sibling;
16196 }
16197 completedWork.treeBaseDuration = _treeBaseDuration;
16198 } else {
16199 var _child3 = completedWork.child;
16200 while (_child3 !== null) {
16201 newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
16202 subtreeFlags |= _child3.subtreeFlags & StaticMask;
16203 subtreeFlags |= _child3.flags & StaticMask;
16204 _child3.return = completedWork;
16205 _child3 = _child3.sibling;
16206 }
16207 }
16208 completedWork.subtreeFlags |= subtreeFlags;
16209 }
16210 completedWork.childLanes = newChildLanes;
16211 return didBailout;
16212 }
16213 function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
16214 if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
16215 warnIfUnhydratedTailNodes(workInProgress2);
16216 resetHydrationState();
16217 workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
16218 return false;
16219 }
16220 var wasHydrated = popHydrationState(workInProgress2);
16221 if (nextState !== null && nextState.dehydrated !== null) {
16222 if (current2 === null) {
16223 if (!wasHydrated) {
16224 throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
16225 }
16226 prepareToHydrateHostSuspenseInstance(workInProgress2);
16227 bubbleProperties(workInProgress2);
16228 {
16229 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16230 var isTimedOutSuspense = nextState !== null;
16231 if (isTimedOutSuspense) {
16232 var primaryChildFragment = workInProgress2.child;
16233 if (primaryChildFragment !== null) {
16234 workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
16235 }
16236 }
16237 }
16238 }
16239 return false;
16240 } else {
16241 resetHydrationState();
16242 if ((workInProgress2.flags & DidCapture) === NoFlags) {
16243 workInProgress2.memoizedState = null;
16244 }
16245 workInProgress2.flags |= Update;
16246 bubbleProperties(workInProgress2);
16247 {
16248 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16249 var _isTimedOutSuspense = nextState !== null;
16250 if (_isTimedOutSuspense) {
16251 var _primaryChildFragment = workInProgress2.child;
16252 if (_primaryChildFragment !== null) {
16253 workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
16254 }
16255 }
16256 }
16257 }
16258 return false;
16259 }
16260 } else {
16261 upgradeHydrationErrorsToRecoverable();
16262 return true;
16263 }
16264 }
16265 function completeWork(current2, workInProgress2, renderLanes2) {
16266 var newProps = workInProgress2.pendingProps;
16267 popTreeContext(workInProgress2);
16268 switch (workInProgress2.tag) {
16269 case IndeterminateComponent:
16270 case LazyComponent:
16271 case SimpleMemoComponent:
16272 case FunctionComponent:
16273 case ForwardRef:
16274 case Fragment:
16275 case Mode:
16276 case Profiler:
16277 case ContextConsumer:
16278 case MemoComponent:
16279 bubbleProperties(workInProgress2);
16280 return null;
16281 case ClassComponent: {
16282 var Component = workInProgress2.type;
16283 if (isContextProvider(Component)) {
16284 popContext(workInProgress2);
16285 }
16286 bubbleProperties(workInProgress2);
16287 return null;
16288 }
16289 case HostRoot: {
16290 var fiberRoot = workInProgress2.stateNode;
16291 popHostContainer(workInProgress2);
16292 popTopLevelContextObject(workInProgress2);
16293 resetWorkInProgressVersions();
16294 if (fiberRoot.pendingContext) {
16295 fiberRoot.context = fiberRoot.pendingContext;
16296 fiberRoot.pendingContext = null;
16297 }
16298 if (current2 === null || current2.child === null) {
16299 var wasHydrated = popHydrationState(workInProgress2);
16300 if (wasHydrated) {
16301 markUpdate(workInProgress2);
16302 } else {
16303 if (current2 !== null) {
16304 var prevState = current2.memoizedState;
16305 if (
16306 // Check if this is a client root
16307 !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
16308 (workInProgress2.flags & ForceClientRender) !== NoFlags
16309 ) {
16310 workInProgress2.flags |= Snapshot;
16311 upgradeHydrationErrorsToRecoverable();
16312 }
16313 }
16314 }
16315 }
16316 updateHostContainer(current2, workInProgress2);
16317 bubbleProperties(workInProgress2);
16318 return null;
16319 }
16320 case HostComponent: {
16321 popHostContext(workInProgress2);
16322 var rootContainerInstance = getRootHostContainer();
16323 var type = workInProgress2.type;
16324 if (current2 !== null && workInProgress2.stateNode != null) {
16325 updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance);
16326 if (current2.ref !== workInProgress2.ref) {
16327 markRef$1(workInProgress2);
16328 }
16329 } else {
16330 if (!newProps) {
16331 if (workInProgress2.stateNode === null) {
16332 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.");
16333 }
16334 bubbleProperties(workInProgress2);
16335 return null;
16336 }
16337 var currentHostContext = getHostContext();
16338 var _wasHydrated = popHydrationState(workInProgress2);
16339 if (_wasHydrated) {
16340 if (prepareToHydrateHostInstance(workInProgress2, rootContainerInstance, currentHostContext)) {
16341 markUpdate(workInProgress2);
16342 }
16343 } else {
16344 var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2);
16345 appendAllChildren(instance, workInProgress2, false, false);
16346 workInProgress2.stateNode = instance;
16347 if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
16348 markUpdate(workInProgress2);
16349 }
16350 }
16351 if (workInProgress2.ref !== null) {
16352 markRef$1(workInProgress2);
16353 }
16354 }
16355 bubbleProperties(workInProgress2);
16356 return null;
16357 }
16358 case HostText: {
16359 var newText = newProps;
16360 if (current2 && workInProgress2.stateNode != null) {
16361 var oldText = current2.memoizedProps;
16362 updateHostText$1(current2, workInProgress2, oldText, newText);
16363 } else {
16364 if (typeof newText !== "string") {
16365 if (workInProgress2.stateNode === null) {
16366 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.");
16367 }
16368 }
16369 var _rootContainerInstance = getRootHostContainer();
16370 var _currentHostContext = getHostContext();
16371 var _wasHydrated2 = popHydrationState(workInProgress2);
16372 if (_wasHydrated2) {
16373 if (prepareToHydrateHostTextInstance(workInProgress2)) {
16374 markUpdate(workInProgress2);
16375 }
16376 } else {
16377 workInProgress2.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress2);
16378 }
16379 }
16380 bubbleProperties(workInProgress2);
16381 return null;
16382 }
16383 case SuspenseComponent: {
16384 popSuspenseContext(workInProgress2);
16385 var nextState = workInProgress2.memoizedState;
16386 if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
16387 var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
16388 if (!fallthroughToNormalSuspensePath) {
16389 if (workInProgress2.flags & ShouldCapture) {
16390 return workInProgress2;
16391 } else {
16392 return null;
16393 }
16394 }
16395 }
16396 if ((workInProgress2.flags & DidCapture) !== NoFlags) {
16397 workInProgress2.lanes = renderLanes2;
16398 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16399 transferActualDuration(workInProgress2);
16400 }
16401 return workInProgress2;
16402 }
16403 var nextDidTimeout = nextState !== null;
16404 var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
16405 if (nextDidTimeout !== prevDidTimeout) {
16406 if (nextDidTimeout) {
16407 var _offscreenFiber2 = workInProgress2.child;
16408 _offscreenFiber2.flags |= Visibility;
16409 if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
16410 var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
16411 if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
16412 renderDidSuspend();
16413 } else {
16414 renderDidSuspendDelayIfPossible();
16415 }
16416 }
16417 }
16418 }
16419 var wakeables = workInProgress2.updateQueue;
16420 if (wakeables !== null) {
16421 workInProgress2.flags |= Update;
16422 }
16423 bubbleProperties(workInProgress2);
16424 {
16425 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16426 if (nextDidTimeout) {
16427 var primaryChildFragment = workInProgress2.child;
16428 if (primaryChildFragment !== null) {
16429 workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
16430 }
16431 }
16432 }
16433 }
16434 return null;
16435 }
16436 case HostPortal:
16437 popHostContainer(workInProgress2);
16438 updateHostContainer(current2, workInProgress2);
16439 if (current2 === null) {
16440 preparePortalMount(workInProgress2.stateNode.containerInfo);
16441 }
16442 bubbleProperties(workInProgress2);
16443 return null;
16444 case ContextProvider:
16445 var context = workInProgress2.type._context;
16446 popProvider(context, workInProgress2);
16447 bubbleProperties(workInProgress2);
16448 return null;
16449 case IncompleteClassComponent: {
16450 var _Component = workInProgress2.type;
16451 if (isContextProvider(_Component)) {
16452 popContext(workInProgress2);
16453 }
16454 bubbleProperties(workInProgress2);
16455 return null;
16456 }
16457 case SuspenseListComponent: {
16458 popSuspenseContext(workInProgress2);
16459 var renderState = workInProgress2.memoizedState;
16460 if (renderState === null) {
16461 bubbleProperties(workInProgress2);
16462 return null;
16463 }
16464 var didSuspendAlready = (workInProgress2.flags & DidCapture) !== NoFlags;
16465 var renderedTail = renderState.rendering;
16466 if (renderedTail === null) {
16467 if (!didSuspendAlready) {
16468 var cannotBeSuspended = renderHasNotSuspendedYet() && (current2 === null || (current2.flags & DidCapture) === NoFlags);
16469 if (!cannotBeSuspended) {
16470 var row = workInProgress2.child;
16471 while (row !== null) {
16472 var suspended = findFirstSuspended(row);
16473 if (suspended !== null) {
16474 didSuspendAlready = true;
16475 workInProgress2.flags |= DidCapture;
16476 cutOffTailIfNeeded(renderState, false);
16477 var newThenables = suspended.updateQueue;
16478 if (newThenables !== null) {
16479 workInProgress2.updateQueue = newThenables;
16480 workInProgress2.flags |= Update;
16481 }
16482 workInProgress2.subtreeFlags = NoFlags;
16483 resetChildFibers(workInProgress2, renderLanes2);
16484 pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
16485 return workInProgress2.child;
16486 }
16487 row = row.sibling;
16488 }
16489 }
16490 if (renderState.tail !== null && now() > getRenderTargetTime()) {
16491 workInProgress2.flags |= DidCapture;
16492 didSuspendAlready = true;
16493 cutOffTailIfNeeded(renderState, false);
16494 workInProgress2.lanes = SomeRetryLane;
16495 }
16496 } else {
16497 cutOffTailIfNeeded(renderState, false);
16498 }
16499 } else {
16500 if (!didSuspendAlready) {
16501 var _suspended = findFirstSuspended(renderedTail);
16502 if (_suspended !== null) {
16503 workInProgress2.flags |= DidCapture;
16504 didSuspendAlready = true;
16505 var _newThenables = _suspended.updateQueue;
16506 if (_newThenables !== null) {
16507 workInProgress2.updateQueue = _newThenables;
16508 workInProgress2.flags |= Update;
16509 }
16510 cutOffTailIfNeeded(renderState, true);
16511 if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
16512 bubbleProperties(workInProgress2);
16513 return null;
16514 }
16515 } else if (
16516 // The time it took to render last row is greater than the remaining
16517 // time we have to render. So rendering one more row would likely
16518 // exceed it.
16519 now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
16520 ) {
16521 workInProgress2.flags |= DidCapture;
16522 didSuspendAlready = true;
16523 cutOffTailIfNeeded(renderState, false);
16524 workInProgress2.lanes = SomeRetryLane;
16525 }
16526 }
16527 if (renderState.isBackwards) {
16528 renderedTail.sibling = workInProgress2.child;
16529 workInProgress2.child = renderedTail;
16530 } else {
16531 var previousSibling = renderState.last;
16532 if (previousSibling !== null) {
16533 previousSibling.sibling = renderedTail;
16534 } else {
16535 workInProgress2.child = renderedTail;
16536 }
16537 renderState.last = renderedTail;
16538 }
16539 }
16540 if (renderState.tail !== null) {
16541 var next = renderState.tail;
16542 renderState.rendering = next;
16543 renderState.tail = next.sibling;
16544 renderState.renderingStartTime = now();
16545 next.sibling = null;
16546 var suspenseContext = suspenseStackCursor.current;
16547 if (didSuspendAlready) {
16548 suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
16549 } else {
16550 suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
16551 }
16552 pushSuspenseContext(workInProgress2, suspenseContext);
16553 return next;
16554 }
16555 bubbleProperties(workInProgress2);
16556 return null;
16557 }
16558 case ScopeComponent: {
16559 break;
16560 }
16561 case OffscreenComponent:
16562 case LegacyHiddenComponent: {
16563 popRenderLanes(workInProgress2);
16564 var _nextState = workInProgress2.memoizedState;
16565 var nextIsHidden = _nextState !== null;
16566 if (current2 !== null) {
16567 var _prevState = current2.memoizedState;
16568 var prevIsHidden = _prevState !== null;
16569 if (prevIsHidden !== nextIsHidden && // LegacyHidden doesn't do any hiding — it only pre-renders.
16570 !enableLegacyHidden) {
16571 workInProgress2.flags |= Visibility;
16572 }
16573 }
16574 if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
16575 bubbleProperties(workInProgress2);
16576 } else {
16577 if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
16578 bubbleProperties(workInProgress2);
16579 {
16580 if (workInProgress2.subtreeFlags & (Placement | Update)) {
16581 workInProgress2.flags |= Visibility;
16582 }
16583 }
16584 }
16585 }
16586 return null;
16587 }
16588 case CacheComponent: {
16589 return null;
16590 }
16591 case TracingMarkerComponent: {
16592 return null;
16593 }
16594 }
16595 throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
16596 }
16597 function unwindWork(current2, workInProgress2, renderLanes2) {
16598 popTreeContext(workInProgress2);
16599 switch (workInProgress2.tag) {
16600 case ClassComponent: {
16601 var Component = workInProgress2.type;
16602 if (isContextProvider(Component)) {
16603 popContext(workInProgress2);
16604 }
16605 var flags = workInProgress2.flags;
16606 if (flags & ShouldCapture) {
16607 workInProgress2.flags = flags & ~ShouldCapture | DidCapture;
16608 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16609 transferActualDuration(workInProgress2);
16610 }
16611 return workInProgress2;
16612 }
16613 return null;
16614 }
16615 case HostRoot: {
16616 var root2 = workInProgress2.stateNode;
16617 popHostContainer(workInProgress2);
16618 popTopLevelContextObject(workInProgress2);
16619 resetWorkInProgressVersions();
16620 var _flags = workInProgress2.flags;
16621 if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
16622 workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
16623 return workInProgress2;
16624 }
16625 return null;
16626 }
16627 case HostComponent: {
16628 popHostContext(workInProgress2);
16629 return null;
16630 }
16631 case SuspenseComponent: {
16632 popSuspenseContext(workInProgress2);
16633 var suspenseState = workInProgress2.memoizedState;
16634 if (suspenseState !== null && suspenseState.dehydrated !== null) {
16635 if (workInProgress2.alternate === null) {
16636 throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
16637 }
16638 resetHydrationState();
16639 }
16640 var _flags2 = workInProgress2.flags;
16641 if (_flags2 & ShouldCapture) {
16642 workInProgress2.flags = _flags2 & ~ShouldCapture | DidCapture;
16643 if ((workInProgress2.mode & ProfileMode) !== NoMode) {
16644 transferActualDuration(workInProgress2);
16645 }
16646 return workInProgress2;
16647 }
16648 return null;
16649 }
16650 case SuspenseListComponent: {
16651 popSuspenseContext(workInProgress2);
16652 return null;
16653 }
16654 case HostPortal:
16655 popHostContainer(workInProgress2);
16656 return null;
16657 case ContextProvider:
16658 var context = workInProgress2.type._context;
16659 popProvider(context, workInProgress2);
16660 return null;
16661 case OffscreenComponent:
16662 case LegacyHiddenComponent:
16663 popRenderLanes(workInProgress2);
16664 return null;
16665 case CacheComponent:
16666 return null;
16667 default:
16668 return null;
16669 }
16670 }
16671 function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
16672 popTreeContext(interruptedWork);
16673 switch (interruptedWork.tag) {
16674 case ClassComponent: {
16675 var childContextTypes = interruptedWork.type.childContextTypes;
16676 if (childContextTypes !== null && childContextTypes !== void 0) {
16677 popContext(interruptedWork);
16678 }
16679 break;
16680 }
16681 case HostRoot: {
16682 var root2 = interruptedWork.stateNode;
16683 popHostContainer(interruptedWork);
16684 popTopLevelContextObject(interruptedWork);
16685 resetWorkInProgressVersions();
16686 break;
16687 }
16688 case HostComponent: {
16689 popHostContext(interruptedWork);
16690 break;
16691 }
16692 case HostPortal:
16693 popHostContainer(interruptedWork);
16694 break;
16695 case SuspenseComponent:
16696 popSuspenseContext(interruptedWork);
16697 break;
16698 case SuspenseListComponent:
16699 popSuspenseContext(interruptedWork);
16700 break;
16701 case ContextProvider:
16702 var context = interruptedWork.type._context;
16703 popProvider(context, interruptedWork);
16704 break;
16705 case OffscreenComponent:
16706 case LegacyHiddenComponent:
16707 popRenderLanes(interruptedWork);
16708 break;
16709 }
16710 }
16711 var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
16712 {
16713 didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
16714 }
16715 var offscreenSubtreeIsHidden = false;
16716 var offscreenSubtreeWasHidden = false;
16717 var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
16718 var nextEffect = null;
16719 var inProgressLanes = null;
16720 var inProgressRoot = null;
16721 function reportUncaughtErrorInDEV(error2) {
16722 {
16723 invokeGuardedCallback(null, function() {
16724 throw error2;
16725 });
16726 clearCaughtError();
16727 }
16728 }
16729 var callComponentWillUnmountWithTimer = function(current2, instance) {
16730 instance.props = current2.memoizedProps;
16731 instance.state = current2.memoizedState;
16732 if (current2.mode & ProfileMode) {
16733 try {
16734 startLayoutEffectTimer();
16735 instance.componentWillUnmount();
16736 } finally {
16737 recordLayoutEffectDuration(current2);
16738 }
16739 } else {
16740 instance.componentWillUnmount();
16741 }
16742 };
16743 function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
16744 try {
16745 commitHookEffectListMount(Layout, current2);
16746 } catch (error2) {
16747 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16748 }
16749 }
16750 function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
16751 try {
16752 callComponentWillUnmountWithTimer(current2, instance);
16753 } catch (error2) {
16754 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16755 }
16756 }
16757 function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
16758 try {
16759 instance.componentDidMount();
16760 } catch (error2) {
16761 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16762 }
16763 }
16764 function safelyAttachRef(current2, nearestMountedAncestor) {
16765 try {
16766 commitAttachRef(current2);
16767 } catch (error2) {
16768 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16769 }
16770 }
16771 function safelyDetachRef(current2, nearestMountedAncestor) {
16772 var ref = current2.ref;
16773 if (ref !== null) {
16774 if (typeof ref === "function") {
16775 var retVal;
16776 try {
16777 if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
16778 try {
16779 startLayoutEffectTimer();
16780 retVal = ref(null);
16781 } finally {
16782 recordLayoutEffectDuration(current2);
16783 }
16784 } else {
16785 retVal = ref(null);
16786 }
16787 } catch (error2) {
16788 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16789 }
16790 {
16791 if (typeof retVal === "function") {
16792 error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
16793 }
16794 }
16795 } else {
16796 ref.current = null;
16797 }
16798 }
16799 }
16800 function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
16801 try {
16802 destroy();
16803 } catch (error2) {
16804 captureCommitPhaseError(current2, nearestMountedAncestor, error2);
16805 }
16806 }
16807 var focusedInstanceHandle = null;
16808 var shouldFireAfterActiveInstanceBlur = false;
16809 function commitBeforeMutationEffects(root2, firstChild) {
16810 focusedInstanceHandle = prepareForCommit(root2.containerInfo);
16811 nextEffect = firstChild;
16812 commitBeforeMutationEffects_begin();
16813 var shouldFire = shouldFireAfterActiveInstanceBlur;
16814 shouldFireAfterActiveInstanceBlur = false;
16815 focusedInstanceHandle = null;
16816 return shouldFire;
16817 }
16818 function commitBeforeMutationEffects_begin() {
16819 while (nextEffect !== null) {
16820 var fiber = nextEffect;
16821 var child = fiber.child;
16822 if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
16823 child.return = fiber;
16824 nextEffect = child;
16825 } else {
16826 commitBeforeMutationEffects_complete();
16827 }
16828 }
16829 }
16830 function commitBeforeMutationEffects_complete() {
16831 while (nextEffect !== null) {
16832 var fiber = nextEffect;
16833 setCurrentFiber(fiber);
16834 try {
16835 commitBeforeMutationEffectsOnFiber(fiber);
16836 } catch (error2) {
16837 captureCommitPhaseError(fiber, fiber.return, error2);
16838 }
16839 resetCurrentFiber();
16840 var sibling = fiber.sibling;
16841 if (sibling !== null) {
16842 sibling.return = fiber.return;
16843 nextEffect = sibling;
16844 return;
16845 }
16846 nextEffect = fiber.return;
16847 }
16848 }
16849 function commitBeforeMutationEffectsOnFiber(finishedWork) {
16850 var current2 = finishedWork.alternate;
16851 var flags = finishedWork.flags;
16852 if ((flags & Snapshot) !== NoFlags) {
16853 setCurrentFiber(finishedWork);
16854 switch (finishedWork.tag) {
16855 case FunctionComponent:
16856 case ForwardRef:
16857 case SimpleMemoComponent: {
16858 break;
16859 }
16860 case ClassComponent: {
16861 if (current2 !== null) {
16862 var prevProps = current2.memoizedProps;
16863 var prevState = current2.memoizedState;
16864 var instance = finishedWork.stateNode;
16865 {
16866 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
16867 if (instance.props !== finishedWork.memoizedProps) {
16868 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");
16869 }
16870 if (instance.state !== finishedWork.memoizedState) {
16871 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");
16872 }
16873 }
16874 }
16875 var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
16876 {
16877 var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
16878 if (snapshot === void 0 && !didWarnSet.has(finishedWork.type)) {
16879 didWarnSet.add(finishedWork.type);
16880 error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", getComponentNameFromFiber(finishedWork));
16881 }
16882 }
16883 instance.__reactInternalSnapshotBeforeUpdate = snapshot;
16884 }
16885 break;
16886 }
16887 case HostRoot: {
16888 {
16889 var root2 = finishedWork.stateNode;
16890 clearContainer(root2.containerInfo);
16891 }
16892 break;
16893 }
16894 case HostComponent:
16895 case HostText:
16896 case HostPortal:
16897 case IncompleteClassComponent:
16898 break;
16899 default: {
16900 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.");
16901 }
16902 }
16903 resetCurrentFiber();
16904 }
16905 }
16906 function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
16907 var updateQueue = finishedWork.updateQueue;
16908 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
16909 if (lastEffect !== null) {
16910 var firstEffect = lastEffect.next;
16911 var effect = firstEffect;
16912 do {
16913 if ((effect.tag & flags) === flags) {
16914 var destroy = effect.destroy;
16915 effect.destroy = void 0;
16916 if (destroy !== void 0) {
16917 {
16918 if ((flags & Passive$1) !== NoFlags$1) {
16919 markComponentPassiveEffectUnmountStarted(finishedWork);
16920 } else if ((flags & Layout) !== NoFlags$1) {
16921 markComponentLayoutEffectUnmountStarted(finishedWork);
16922 }
16923 }
16924 {
16925 if ((flags & Insertion) !== NoFlags$1) {
16926 setIsRunningInsertionEffect(true);
16927 }
16928 }
16929 safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
16930 {
16931 if ((flags & Insertion) !== NoFlags$1) {
16932 setIsRunningInsertionEffect(false);
16933 }
16934 }
16935 {
16936 if ((flags & Passive$1) !== NoFlags$1) {
16937 markComponentPassiveEffectUnmountStopped();
16938 } else if ((flags & Layout) !== NoFlags$1) {
16939 markComponentLayoutEffectUnmountStopped();
16940 }
16941 }
16942 }
16943 }
16944 effect = effect.next;
16945 } while (effect !== firstEffect);
16946 }
16947 }
16948 function commitHookEffectListMount(flags, finishedWork) {
16949 var updateQueue = finishedWork.updateQueue;
16950 var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
16951 if (lastEffect !== null) {
16952 var firstEffect = lastEffect.next;
16953 var effect = firstEffect;
16954 do {
16955 if ((effect.tag & flags) === flags) {
16956 {
16957 if ((flags & Passive$1) !== NoFlags$1) {
16958 markComponentPassiveEffectMountStarted(finishedWork);
16959 } else if ((flags & Layout) !== NoFlags$1) {
16960 markComponentLayoutEffectMountStarted(finishedWork);
16961 }
16962 }
16963 var create = effect.create;
16964 {
16965 if ((flags & Insertion) !== NoFlags$1) {
16966 setIsRunningInsertionEffect(true);
16967 }
16968 }
16969 effect.destroy = create();
16970 {
16971 if ((flags & Insertion) !== NoFlags$1) {
16972 setIsRunningInsertionEffect(false);
16973 }
16974 }
16975 {
16976 if ((flags & Passive$1) !== NoFlags$1) {
16977 markComponentPassiveEffectMountStopped();
16978 } else if ((flags & Layout) !== NoFlags$1) {
16979 markComponentLayoutEffectMountStopped();
16980 }
16981 }
16982 {
16983 var destroy = effect.destroy;
16984 if (destroy !== void 0 && typeof destroy !== "function") {
16985 var hookName = void 0;
16986 if ((effect.tag & Layout) !== NoFlags) {
16987 hookName = "useLayoutEffect";
16988 } else if ((effect.tag & Insertion) !== NoFlags) {
16989 hookName = "useInsertionEffect";
16990 } else {
16991 hookName = "useEffect";
16992 }
16993 var addendum = void 0;
16994 if (destroy === null) {
16995 addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing).";
16996 } else if (typeof destroy.then === "function") {
16997 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";
16998 } else {
16999 addendum = " You returned: " + destroy;
17000 }
17001 error("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
17002 }
17003 }
17004 }
17005 effect = effect.next;
17006 } while (effect !== firstEffect);
17007 }
17008 }
17009 function commitPassiveEffectDurations(finishedRoot, finishedWork) {
17010 {
17011 if ((finishedWork.flags & Update) !== NoFlags) {
17012 switch (finishedWork.tag) {
17013 case Profiler: {
17014 var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
17015 var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
17016 var commitTime2 = getCommitTime();
17017 var phase = finishedWork.alternate === null ? "mount" : "update";
17018 {
17019 if (isCurrentUpdateNested()) {
17020 phase = "nested-update";
17021 }
17022 }
17023 if (typeof onPostCommit === "function") {
17024 onPostCommit(id, phase, passiveEffectDuration, commitTime2);
17025 }
17026 var parentFiber = finishedWork.return;
17027 outer: while (parentFiber !== null) {
17028 switch (parentFiber.tag) {
17029 case HostRoot:
17030 var root2 = parentFiber.stateNode;
17031 root2.passiveEffectDuration += passiveEffectDuration;
17032 break outer;
17033 case Profiler:
17034 var parentStateNode = parentFiber.stateNode;
17035 parentStateNode.passiveEffectDuration += passiveEffectDuration;
17036 break outer;
17037 }
17038 parentFiber = parentFiber.return;
17039 }
17040 break;
17041 }
17042 }
17043 }
17044 }
17045 }
17046 function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
17047 if ((finishedWork.flags & LayoutMask) !== NoFlags) {
17048 switch (finishedWork.tag) {
17049 case FunctionComponent:
17050 case ForwardRef:
17051 case SimpleMemoComponent: {
17052 if (!offscreenSubtreeWasHidden) {
17053 if (finishedWork.mode & ProfileMode) {
17054 try {
17055 startLayoutEffectTimer();
17056 commitHookEffectListMount(Layout | HasEffect, finishedWork);
17057 } finally {
17058 recordLayoutEffectDuration(finishedWork);
17059 }
17060 } else {
17061 commitHookEffectListMount(Layout | HasEffect, finishedWork);
17062 }
17063 }
17064 break;
17065 }
17066 case ClassComponent: {
17067 var instance = finishedWork.stateNode;
17068 if (finishedWork.flags & Update) {
17069 if (!offscreenSubtreeWasHidden) {
17070 if (current2 === null) {
17071 {
17072 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17073 if (instance.props !== finishedWork.memoizedProps) {
17074 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");
17075 }
17076 if (instance.state !== finishedWork.memoizedState) {
17077 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");
17078 }
17079 }
17080 }
17081 if (finishedWork.mode & ProfileMode) {
17082 try {
17083 startLayoutEffectTimer();
17084 instance.componentDidMount();
17085 } finally {
17086 recordLayoutEffectDuration(finishedWork);
17087 }
17088 } else {
17089 instance.componentDidMount();
17090 }
17091 } else {
17092 var prevProps = finishedWork.elementType === finishedWork.type ? current2.memoizedProps : resolveDefaultProps(finishedWork.type, current2.memoizedProps);
17093 var prevState = current2.memoizedState;
17094 {
17095 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17096 if (instance.props !== finishedWork.memoizedProps) {
17097 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");
17098 }
17099 if (instance.state !== finishedWork.memoizedState) {
17100 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");
17101 }
17102 }
17103 }
17104 if (finishedWork.mode & ProfileMode) {
17105 try {
17106 startLayoutEffectTimer();
17107 instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
17108 } finally {
17109 recordLayoutEffectDuration(finishedWork);
17110 }
17111 } else {
17112 instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
17113 }
17114 }
17115 }
17116 }
17117 var updateQueue = finishedWork.updateQueue;
17118 if (updateQueue !== null) {
17119 {
17120 if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
17121 if (instance.props !== finishedWork.memoizedProps) {
17122 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");
17123 }
17124 if (instance.state !== finishedWork.memoizedState) {
17125 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");
17126 }
17127 }
17128 }
17129 commitUpdateQueue(finishedWork, updateQueue, instance);
17130 }
17131 break;
17132 }
17133 case HostRoot: {
17134 var _updateQueue = finishedWork.updateQueue;
17135 if (_updateQueue !== null) {
17136 var _instance = null;
17137 if (finishedWork.child !== null) {
17138 switch (finishedWork.child.tag) {
17139 case HostComponent:
17140 _instance = getPublicInstance(finishedWork.child.stateNode);
17141 break;
17142 case ClassComponent:
17143 _instance = finishedWork.child.stateNode;
17144 break;
17145 }
17146 }
17147 commitUpdateQueue(finishedWork, _updateQueue, _instance);
17148 }
17149 break;
17150 }
17151 case HostComponent: {
17152 var _instance2 = finishedWork.stateNode;
17153 if (current2 === null && finishedWork.flags & Update) {
17154 var type = finishedWork.type;
17155 var props = finishedWork.memoizedProps;
17156 commitMount(_instance2, type, props);
17157 }
17158 break;
17159 }
17160 case HostText: {
17161 break;
17162 }
17163 case HostPortal: {
17164 break;
17165 }
17166 case Profiler: {
17167 {
17168 var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
17169 var effectDuration = finishedWork.stateNode.effectDuration;
17170 var commitTime2 = getCommitTime();
17171 var phase = current2 === null ? "mount" : "update";
17172 {
17173 if (isCurrentUpdateNested()) {
17174 phase = "nested-update";
17175 }
17176 }
17177 if (typeof onRender === "function") {
17178 onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
17179 }
17180 {
17181 if (typeof onCommit === "function") {
17182 onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
17183 }
17184 enqueuePendingPassiveProfilerEffect(finishedWork);
17185 var parentFiber = finishedWork.return;
17186 outer: while (parentFiber !== null) {
17187 switch (parentFiber.tag) {
17188 case HostRoot:
17189 var root2 = parentFiber.stateNode;
17190 root2.effectDuration += effectDuration;
17191 break outer;
17192 case Profiler:
17193 var parentStateNode = parentFiber.stateNode;
17194 parentStateNode.effectDuration += effectDuration;
17195 break outer;
17196 }
17197 parentFiber = parentFiber.return;
17198 }
17199 }
17200 }
17201 break;
17202 }
17203 case SuspenseComponent: {
17204 commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
17205 break;
17206 }
17207 case SuspenseListComponent:
17208 case IncompleteClassComponent:
17209 case ScopeComponent:
17210 case OffscreenComponent:
17211 case LegacyHiddenComponent:
17212 case TracingMarkerComponent: {
17213 break;
17214 }
17215 default:
17216 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.");
17217 }
17218 }
17219 if (!offscreenSubtreeWasHidden) {
17220 {
17221 if (finishedWork.flags & Ref) {
17222 commitAttachRef(finishedWork);
17223 }
17224 }
17225 }
17226 }
17227 function reappearLayoutEffectsOnFiber(node) {
17228 switch (node.tag) {
17229 case FunctionComponent:
17230 case ForwardRef:
17231 case SimpleMemoComponent: {
17232 if (node.mode & ProfileMode) {
17233 try {
17234 startLayoutEffectTimer();
17235 safelyCallCommitHookLayoutEffectListMount(node, node.return);
17236 } finally {
17237 recordLayoutEffectDuration(node);
17238 }
17239 } else {
17240 safelyCallCommitHookLayoutEffectListMount(node, node.return);
17241 }
17242 break;
17243 }
17244 case ClassComponent: {
17245 var instance = node.stateNode;
17246 if (typeof instance.componentDidMount === "function") {
17247 safelyCallComponentDidMount(node, node.return, instance);
17248 }
17249 safelyAttachRef(node, node.return);
17250 break;
17251 }
17252 case HostComponent: {
17253 safelyAttachRef(node, node.return);
17254 break;
17255 }
17256 }
17257 }
17258 function hideOrUnhideAllChildren(finishedWork, isHidden) {
17259 var hostSubtreeRoot = null;
17260 {
17261 var node = finishedWork;
17262 while (true) {
17263 if (node.tag === HostComponent) {
17264 if (hostSubtreeRoot === null) {
17265 hostSubtreeRoot = node;
17266 try {
17267 var instance = node.stateNode;
17268 if (isHidden) {
17269 hideInstance(instance);
17270 } else {
17271 unhideInstance(node.stateNode, node.memoizedProps);
17272 }
17273 } catch (error2) {
17274 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17275 }
17276 }
17277 } else if (node.tag === HostText) {
17278 if (hostSubtreeRoot === null) {
17279 try {
17280 var _instance3 = node.stateNode;
17281 if (isHidden) {
17282 hideTextInstance(_instance3);
17283 } else {
17284 unhideTextInstance(_instance3, node.memoizedProps);
17285 }
17286 } catch (error2) {
17287 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17288 }
17289 }
17290 } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ;
17291 else if (node.child !== null) {
17292 node.child.return = node;
17293 node = node.child;
17294 continue;
17295 }
17296 if (node === finishedWork) {
17297 return;
17298 }
17299 while (node.sibling === null) {
17300 if (node.return === null || node.return === finishedWork) {
17301 return;
17302 }
17303 if (hostSubtreeRoot === node) {
17304 hostSubtreeRoot = null;
17305 }
17306 node = node.return;
17307 }
17308 if (hostSubtreeRoot === node) {
17309 hostSubtreeRoot = null;
17310 }
17311 node.sibling.return = node.return;
17312 node = node.sibling;
17313 }
17314 }
17315 }
17316 function commitAttachRef(finishedWork) {
17317 var ref = finishedWork.ref;
17318 if (ref !== null) {
17319 var instance = finishedWork.stateNode;
17320 var instanceToUse;
17321 switch (finishedWork.tag) {
17322 case HostComponent:
17323 instanceToUse = getPublicInstance(instance);
17324 break;
17325 default:
17326 instanceToUse = instance;
17327 }
17328 if (typeof ref === "function") {
17329 var retVal;
17330 if (finishedWork.mode & ProfileMode) {
17331 try {
17332 startLayoutEffectTimer();
17333 retVal = ref(instanceToUse);
17334 } finally {
17335 recordLayoutEffectDuration(finishedWork);
17336 }
17337 } else {
17338 retVal = ref(instanceToUse);
17339 }
17340 {
17341 if (typeof retVal === "function") {
17342 error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
17343 }
17344 }
17345 } else {
17346 {
17347 if (!ref.hasOwnProperty("current")) {
17348 error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
17349 }
17350 }
17351 ref.current = instanceToUse;
17352 }
17353 }
17354 }
17355 function detachFiberMutation(fiber) {
17356 var alternate = fiber.alternate;
17357 if (alternate !== null) {
17358 alternate.return = null;
17359 }
17360 fiber.return = null;
17361 }
17362 function detachFiberAfterEffects(fiber) {
17363 var alternate = fiber.alternate;
17364 if (alternate !== null) {
17365 fiber.alternate = null;
17366 detachFiberAfterEffects(alternate);
17367 }
17368 {
17369 fiber.child = null;
17370 fiber.deletions = null;
17371 fiber.sibling = null;
17372 if (fiber.tag === HostComponent) {
17373 var hostInstance = fiber.stateNode;
17374 if (hostInstance !== null) {
17375 detachDeletedInstance(hostInstance);
17376 }
17377 }
17378 fiber.stateNode = null;
17379 {
17380 fiber._debugOwner = null;
17381 }
17382 {
17383 fiber.return = null;
17384 fiber.dependencies = null;
17385 fiber.memoizedProps = null;
17386 fiber.memoizedState = null;
17387 fiber.pendingProps = null;
17388 fiber.stateNode = null;
17389 fiber.updateQueue = null;
17390 }
17391 }
17392 }
17393 function getHostParentFiber(fiber) {
17394 var parent = fiber.return;
17395 while (parent !== null) {
17396 if (isHostParent(parent)) {
17397 return parent;
17398 }
17399 parent = parent.return;
17400 }
17401 throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
17402 }
17403 function isHostParent(fiber) {
17404 return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
17405 }
17406 function getHostSibling(fiber) {
17407 var node = fiber;
17408 siblings: while (true) {
17409 while (node.sibling === null) {
17410 if (node.return === null || isHostParent(node.return)) {
17411 return null;
17412 }
17413 node = node.return;
17414 }
17415 node.sibling.return = node.return;
17416 node = node.sibling;
17417 while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
17418 if (node.flags & Placement) {
17419 continue siblings;
17420 }
17421 if (node.child === null || node.tag === HostPortal) {
17422 continue siblings;
17423 } else {
17424 node.child.return = node;
17425 node = node.child;
17426 }
17427 }
17428 if (!(node.flags & Placement)) {
17429 return node.stateNode;
17430 }
17431 }
17432 }
17433 function commitPlacement(finishedWork) {
17434 var parentFiber = getHostParentFiber(finishedWork);
17435 switch (parentFiber.tag) {
17436 case HostComponent: {
17437 var parent = parentFiber.stateNode;
17438 if (parentFiber.flags & ContentReset) {
17439 resetTextContent(parent);
17440 parentFiber.flags &= ~ContentReset;
17441 }
17442 var before = getHostSibling(finishedWork);
17443 insertOrAppendPlacementNode(finishedWork, before, parent);
17444 break;
17445 }
17446 case HostRoot:
17447 case HostPortal: {
17448 var _parent = parentFiber.stateNode.containerInfo;
17449 var _before = getHostSibling(finishedWork);
17450 insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
17451 break;
17452 }
17453 // eslint-disable-next-line-no-fallthrough
17454 default:
17455 throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
17456 }
17457 }
17458 function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
17459 var tag = node.tag;
17460 var isHost = tag === HostComponent || tag === HostText;
17461 if (isHost) {
17462 var stateNode = node.stateNode;
17463 if (before) {
17464 insertInContainerBefore(parent, stateNode, before);
17465 } else {
17466 appendChildToContainer(parent, stateNode);
17467 }
17468 } else if (tag === HostPortal) ;
17469 else {
17470 var child = node.child;
17471 if (child !== null) {
17472 insertOrAppendPlacementNodeIntoContainer(child, before, parent);
17473 var sibling = child.sibling;
17474 while (sibling !== null) {
17475 insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
17476 sibling = sibling.sibling;
17477 }
17478 }
17479 }
17480 }
17481 function insertOrAppendPlacementNode(node, before, parent) {
17482 var tag = node.tag;
17483 var isHost = tag === HostComponent || tag === HostText;
17484 if (isHost) {
17485 var stateNode = node.stateNode;
17486 if (before) {
17487 insertBefore(parent, stateNode, before);
17488 } else {
17489 appendChild(parent, stateNode);
17490 }
17491 } else if (tag === HostPortal) ;
17492 else {
17493 var child = node.child;
17494 if (child !== null) {
17495 insertOrAppendPlacementNode(child, before, parent);
17496 var sibling = child.sibling;
17497 while (sibling !== null) {
17498 insertOrAppendPlacementNode(sibling, before, parent);
17499 sibling = sibling.sibling;
17500 }
17501 }
17502 }
17503 }
17504 var hostParent = null;
17505 var hostParentIsContainer = false;
17506 function commitDeletionEffects(root2, returnFiber, deletedFiber) {
17507 {
17508 var parent = returnFiber;
17509 findParent: while (parent !== null) {
17510 switch (parent.tag) {
17511 case HostComponent: {
17512 hostParent = parent.stateNode;
17513 hostParentIsContainer = false;
17514 break findParent;
17515 }
17516 case HostRoot: {
17517 hostParent = parent.stateNode.containerInfo;
17518 hostParentIsContainer = true;
17519 break findParent;
17520 }
17521 case HostPortal: {
17522 hostParent = parent.stateNode.containerInfo;
17523 hostParentIsContainer = true;
17524 break findParent;
17525 }
17526 }
17527 parent = parent.return;
17528 }
17529 if (hostParent === null) {
17530 throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
17531 }
17532 commitDeletionEffectsOnFiber(root2, returnFiber, deletedFiber);
17533 hostParent = null;
17534 hostParentIsContainer = false;
17535 }
17536 detachFiberMutation(deletedFiber);
17537 }
17538 function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
17539 var child = parent.child;
17540 while (child !== null) {
17541 commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
17542 child = child.sibling;
17543 }
17544 }
17545 function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
17546 onCommitUnmount(deletedFiber);
17547 switch (deletedFiber.tag) {
17548 case HostComponent: {
17549 if (!offscreenSubtreeWasHidden) {
17550 safelyDetachRef(deletedFiber, nearestMountedAncestor);
17551 }
17552 }
17553 // eslint-disable-next-line-no-fallthrough
17554 case HostText: {
17555 {
17556 var prevHostParent = hostParent;
17557 var prevHostParentIsContainer = hostParentIsContainer;
17558 hostParent = null;
17559 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17560 hostParent = prevHostParent;
17561 hostParentIsContainer = prevHostParentIsContainer;
17562 if (hostParent !== null) {
17563 if (hostParentIsContainer) {
17564 removeChildFromContainer(hostParent, deletedFiber.stateNode);
17565 } else {
17566 removeChild(hostParent, deletedFiber.stateNode);
17567 }
17568 }
17569 }
17570 return;
17571 }
17572 case DehydratedFragment: {
17573 {
17574 if (hostParent !== null) {
17575 if (hostParentIsContainer) {
17576 clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
17577 } else {
17578 clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
17579 }
17580 }
17581 }
17582 return;
17583 }
17584 case HostPortal: {
17585 {
17586 var _prevHostParent = hostParent;
17587 var _prevHostParentIsContainer = hostParentIsContainer;
17588 hostParent = deletedFiber.stateNode.containerInfo;
17589 hostParentIsContainer = true;
17590 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17591 hostParent = _prevHostParent;
17592 hostParentIsContainer = _prevHostParentIsContainer;
17593 }
17594 return;
17595 }
17596 case FunctionComponent:
17597 case ForwardRef:
17598 case MemoComponent:
17599 case SimpleMemoComponent: {
17600 if (!offscreenSubtreeWasHidden) {
17601 var updateQueue = deletedFiber.updateQueue;
17602 if (updateQueue !== null) {
17603 var lastEffect = updateQueue.lastEffect;
17604 if (lastEffect !== null) {
17605 var firstEffect = lastEffect.next;
17606 var effect = firstEffect;
17607 do {
17608 var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
17609 if (destroy !== void 0) {
17610 if ((tag & Insertion) !== NoFlags$1) {
17611 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17612 } else if ((tag & Layout) !== NoFlags$1) {
17613 {
17614 markComponentLayoutEffectUnmountStarted(deletedFiber);
17615 }
17616 if (deletedFiber.mode & ProfileMode) {
17617 startLayoutEffectTimer();
17618 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17619 recordLayoutEffectDuration(deletedFiber);
17620 } else {
17621 safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
17622 }
17623 {
17624 markComponentLayoutEffectUnmountStopped();
17625 }
17626 }
17627 }
17628 effect = effect.next;
17629 } while (effect !== firstEffect);
17630 }
17631 }
17632 }
17633 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17634 return;
17635 }
17636 case ClassComponent: {
17637 if (!offscreenSubtreeWasHidden) {
17638 safelyDetachRef(deletedFiber, nearestMountedAncestor);
17639 var instance = deletedFiber.stateNode;
17640 if (typeof instance.componentWillUnmount === "function") {
17641 safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
17642 }
17643 }
17644 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17645 return;
17646 }
17647 case ScopeComponent: {
17648 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17649 return;
17650 }
17651 case OffscreenComponent: {
17652 if (
17653 // TODO: Remove this dead flag
17654 deletedFiber.mode & ConcurrentMode
17655 ) {
17656 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17657 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
17658 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17659 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
17660 } else {
17661 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17662 }
17663 break;
17664 }
17665 default: {
17666 recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
17667 return;
17668 }
17669 }
17670 }
17671 function commitSuspenseCallback(finishedWork) {
17672 var newState = finishedWork.memoizedState;
17673 }
17674 function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
17675 var newState = finishedWork.memoizedState;
17676 if (newState === null) {
17677 var current2 = finishedWork.alternate;
17678 if (current2 !== null) {
17679 var prevState = current2.memoizedState;
17680 if (prevState !== null) {
17681 var suspenseInstance = prevState.dehydrated;
17682 if (suspenseInstance !== null) {
17683 commitHydratedSuspenseInstance(suspenseInstance);
17684 }
17685 }
17686 }
17687 }
17688 }
17689 function attachSuspenseRetryListeners(finishedWork) {
17690 var wakeables = finishedWork.updateQueue;
17691 if (wakeables !== null) {
17692 finishedWork.updateQueue = null;
17693 var retryCache = finishedWork.stateNode;
17694 if (retryCache === null) {
17695 retryCache = finishedWork.stateNode = new PossiblyWeakSet();
17696 }
17697 wakeables.forEach(function(wakeable) {
17698 var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
17699 if (!retryCache.has(wakeable)) {
17700 retryCache.add(wakeable);
17701 {
17702 if (isDevToolsPresent) {
17703 if (inProgressLanes !== null && inProgressRoot !== null) {
17704 restorePendingUpdaters(inProgressRoot, inProgressLanes);
17705 } else {
17706 throw Error("Expected finished root and lanes to be set. This is a bug in React.");
17707 }
17708 }
17709 }
17710 wakeable.then(retry, retry);
17711 }
17712 });
17713 }
17714 }
17715 function commitMutationEffects(root2, finishedWork, committedLanes) {
17716 inProgressLanes = committedLanes;
17717 inProgressRoot = root2;
17718 setCurrentFiber(finishedWork);
17719 commitMutationEffectsOnFiber(finishedWork, root2);
17720 setCurrentFiber(finishedWork);
17721 inProgressLanes = null;
17722 inProgressRoot = null;
17723 }
17724 function recursivelyTraverseMutationEffects(root2, parentFiber, lanes) {
17725 var deletions = parentFiber.deletions;
17726 if (deletions !== null) {
17727 for (var i = 0; i < deletions.length; i++) {
17728 var childToDelete = deletions[i];
17729 try {
17730 commitDeletionEffects(root2, parentFiber, childToDelete);
17731 } catch (error2) {
17732 captureCommitPhaseError(childToDelete, parentFiber, error2);
17733 }
17734 }
17735 }
17736 var prevDebugFiber = getCurrentFiber();
17737 if (parentFiber.subtreeFlags & MutationMask) {
17738 var child = parentFiber.child;
17739 while (child !== null) {
17740 setCurrentFiber(child);
17741 commitMutationEffectsOnFiber(child, root2);
17742 child = child.sibling;
17743 }
17744 }
17745 setCurrentFiber(prevDebugFiber);
17746 }
17747 function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
17748 var current2 = finishedWork.alternate;
17749 var flags = finishedWork.flags;
17750 switch (finishedWork.tag) {
17751 case FunctionComponent:
17752 case ForwardRef:
17753 case MemoComponent:
17754 case SimpleMemoComponent: {
17755 recursivelyTraverseMutationEffects(root2, finishedWork);
17756 commitReconciliationEffects(finishedWork);
17757 if (flags & Update) {
17758 try {
17759 commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return);
17760 commitHookEffectListMount(Insertion | HasEffect, finishedWork);
17761 } catch (error2) {
17762 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17763 }
17764 if (finishedWork.mode & ProfileMode) {
17765 try {
17766 startLayoutEffectTimer();
17767 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
17768 } catch (error2) {
17769 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17770 }
17771 recordLayoutEffectDuration(finishedWork);
17772 } else {
17773 try {
17774 commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return);
17775 } catch (error2) {
17776 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17777 }
17778 }
17779 }
17780 return;
17781 }
17782 case ClassComponent: {
17783 recursivelyTraverseMutationEffects(root2, finishedWork);
17784 commitReconciliationEffects(finishedWork);
17785 if (flags & Ref) {
17786 if (current2 !== null) {
17787 safelyDetachRef(current2, current2.return);
17788 }
17789 }
17790 return;
17791 }
17792 case HostComponent: {
17793 recursivelyTraverseMutationEffects(root2, finishedWork);
17794 commitReconciliationEffects(finishedWork);
17795 if (flags & Ref) {
17796 if (current2 !== null) {
17797 safelyDetachRef(current2, current2.return);
17798 }
17799 }
17800 {
17801 if (finishedWork.flags & ContentReset) {
17802 var instance = finishedWork.stateNode;
17803 try {
17804 resetTextContent(instance);
17805 } catch (error2) {
17806 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17807 }
17808 }
17809 if (flags & Update) {
17810 var _instance4 = finishedWork.stateNode;
17811 if (_instance4 != null) {
17812 var newProps = finishedWork.memoizedProps;
17813 var oldProps = current2 !== null ? current2.memoizedProps : newProps;
17814 var type = finishedWork.type;
17815 var updatePayload = finishedWork.updateQueue;
17816 finishedWork.updateQueue = null;
17817 if (updatePayload !== null) {
17818 try {
17819 commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
17820 } catch (error2) {
17821 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17822 }
17823 }
17824 }
17825 }
17826 }
17827 return;
17828 }
17829 case HostText: {
17830 recursivelyTraverseMutationEffects(root2, finishedWork);
17831 commitReconciliationEffects(finishedWork);
17832 if (flags & Update) {
17833 {
17834 if (finishedWork.stateNode === null) {
17835 throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
17836 }
17837 var textInstance = finishedWork.stateNode;
17838 var newText = finishedWork.memoizedProps;
17839 var oldText = current2 !== null ? current2.memoizedProps : newText;
17840 try {
17841 commitTextUpdate(textInstance, oldText, newText);
17842 } catch (error2) {
17843 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17844 }
17845 }
17846 }
17847 return;
17848 }
17849 case HostRoot: {
17850 recursivelyTraverseMutationEffects(root2, finishedWork);
17851 commitReconciliationEffects(finishedWork);
17852 if (flags & Update) {
17853 {
17854 if (current2 !== null) {
17855 var prevRootState = current2.memoizedState;
17856 if (prevRootState.isDehydrated) {
17857 try {
17858 commitHydratedContainer(root2.containerInfo);
17859 } catch (error2) {
17860 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17861 }
17862 }
17863 }
17864 }
17865 }
17866 return;
17867 }
17868 case HostPortal: {
17869 recursivelyTraverseMutationEffects(root2, finishedWork);
17870 commitReconciliationEffects(finishedWork);
17871 return;
17872 }
17873 case SuspenseComponent: {
17874 recursivelyTraverseMutationEffects(root2, finishedWork);
17875 commitReconciliationEffects(finishedWork);
17876 var offscreenFiber = finishedWork.child;
17877 if (offscreenFiber.flags & Visibility) {
17878 var offscreenInstance = offscreenFiber.stateNode;
17879 var newState = offscreenFiber.memoizedState;
17880 var isHidden = newState !== null;
17881 offscreenInstance.isHidden = isHidden;
17882 if (isHidden) {
17883 var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
17884 if (!wasHidden) {
17885 markCommitTimeOfFallback();
17886 }
17887 }
17888 }
17889 if (flags & Update) {
17890 try {
17891 commitSuspenseCallback(finishedWork);
17892 } catch (error2) {
17893 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17894 }
17895 attachSuspenseRetryListeners(finishedWork);
17896 }
17897 return;
17898 }
17899 case OffscreenComponent: {
17900 var _wasHidden = current2 !== null && current2.memoizedState !== null;
17901 if (
17902 // TODO: Remove this dead flag
17903 finishedWork.mode & ConcurrentMode
17904 ) {
17905 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17906 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
17907 recursivelyTraverseMutationEffects(root2, finishedWork);
17908 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
17909 } else {
17910 recursivelyTraverseMutationEffects(root2, finishedWork);
17911 }
17912 commitReconciliationEffects(finishedWork);
17913 if (flags & Visibility) {
17914 var _offscreenInstance = finishedWork.stateNode;
17915 var _newState = finishedWork.memoizedState;
17916 var _isHidden = _newState !== null;
17917 var offscreenBoundary = finishedWork;
17918 _offscreenInstance.isHidden = _isHidden;
17919 {
17920 if (_isHidden) {
17921 if (!_wasHidden) {
17922 if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
17923 nextEffect = offscreenBoundary;
17924 var offscreenChild = offscreenBoundary.child;
17925 while (offscreenChild !== null) {
17926 nextEffect = offscreenChild;
17927 disappearLayoutEffects_begin(offscreenChild);
17928 offscreenChild = offscreenChild.sibling;
17929 }
17930 }
17931 }
17932 }
17933 }
17934 {
17935 hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
17936 }
17937 }
17938 return;
17939 }
17940 case SuspenseListComponent: {
17941 recursivelyTraverseMutationEffects(root2, finishedWork);
17942 commitReconciliationEffects(finishedWork);
17943 if (flags & Update) {
17944 attachSuspenseRetryListeners(finishedWork);
17945 }
17946 return;
17947 }
17948 case ScopeComponent: {
17949 return;
17950 }
17951 default: {
17952 recursivelyTraverseMutationEffects(root2, finishedWork);
17953 commitReconciliationEffects(finishedWork);
17954 return;
17955 }
17956 }
17957 }
17958 function commitReconciliationEffects(finishedWork) {
17959 var flags = finishedWork.flags;
17960 if (flags & Placement) {
17961 try {
17962 commitPlacement(finishedWork);
17963 } catch (error2) {
17964 captureCommitPhaseError(finishedWork, finishedWork.return, error2);
17965 }
17966 finishedWork.flags &= ~Placement;
17967 }
17968 if (flags & Hydrating) {
17969 finishedWork.flags &= ~Hydrating;
17970 }
17971 }
17972 function commitLayoutEffects(finishedWork, root2, committedLanes) {
17973 inProgressLanes = committedLanes;
17974 inProgressRoot = root2;
17975 nextEffect = finishedWork;
17976 commitLayoutEffects_begin(finishedWork, root2, committedLanes);
17977 inProgressLanes = null;
17978 inProgressRoot = null;
17979 }
17980 function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
17981 var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
17982 while (nextEffect !== null) {
17983 var fiber = nextEffect;
17984 var firstChild = fiber.child;
17985 if (fiber.tag === OffscreenComponent && isModernRoot) {
17986 var isHidden = fiber.memoizedState !== null;
17987 var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
17988 if (newOffscreenSubtreeIsHidden) {
17989 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
17990 continue;
17991 } else {
17992 var current2 = fiber.alternate;
17993 var wasHidden = current2 !== null && current2.memoizedState !== null;
17994 var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
17995 var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
17996 var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
17997 offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
17998 offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
17999 if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
18000 nextEffect = fiber;
18001 reappearLayoutEffects_begin(fiber);
18002 }
18003 var child = firstChild;
18004 while (child !== null) {
18005 nextEffect = child;
18006 commitLayoutEffects_begin(
18007 child,
18008 // New root; bubble back up to here and stop.
18009 root2,
18010 committedLanes
18011 );
18012 child = child.sibling;
18013 }
18014 nextEffect = fiber;
18015 offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
18016 offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
18017 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
18018 continue;
18019 }
18020 }
18021 if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
18022 firstChild.return = fiber;
18023 nextEffect = firstChild;
18024 } else {
18025 commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
18026 }
18027 }
18028 }
18029 function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
18030 while (nextEffect !== null) {
18031 var fiber = nextEffect;
18032 if ((fiber.flags & LayoutMask) !== NoFlags) {
18033 var current2 = fiber.alternate;
18034 setCurrentFiber(fiber);
18035 try {
18036 commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
18037 } catch (error2) {
18038 captureCommitPhaseError(fiber, fiber.return, error2);
18039 }
18040 resetCurrentFiber();
18041 }
18042 if (fiber === subtreeRoot) {
18043 nextEffect = null;
18044 return;
18045 }
18046 var sibling = fiber.sibling;
18047 if (sibling !== null) {
18048 sibling.return = fiber.return;
18049 nextEffect = sibling;
18050 return;
18051 }
18052 nextEffect = fiber.return;
18053 }
18054 }
18055 function disappearLayoutEffects_begin(subtreeRoot) {
18056 while (nextEffect !== null) {
18057 var fiber = nextEffect;
18058 var firstChild = fiber.child;
18059 switch (fiber.tag) {
18060 case FunctionComponent:
18061 case ForwardRef:
18062 case MemoComponent:
18063 case SimpleMemoComponent: {
18064 if (fiber.mode & ProfileMode) {
18065 try {
18066 startLayoutEffectTimer();
18067 commitHookEffectListUnmount(Layout, fiber, fiber.return);
18068 } finally {
18069 recordLayoutEffectDuration(fiber);
18070 }
18071 } else {
18072 commitHookEffectListUnmount(Layout, fiber, fiber.return);
18073 }
18074 break;
18075 }
18076 case ClassComponent: {
18077 safelyDetachRef(fiber, fiber.return);
18078 var instance = fiber.stateNode;
18079 if (typeof instance.componentWillUnmount === "function") {
18080 safelyCallComponentWillUnmount(fiber, fiber.return, instance);
18081 }
18082 break;
18083 }
18084 case HostComponent: {
18085 safelyDetachRef(fiber, fiber.return);
18086 break;
18087 }
18088 case OffscreenComponent: {
18089 var isHidden = fiber.memoizedState !== null;
18090 if (isHidden) {
18091 disappearLayoutEffects_complete(subtreeRoot);
18092 continue;
18093 }
18094 break;
18095 }
18096 }
18097 if (firstChild !== null) {
18098 firstChild.return = fiber;
18099 nextEffect = firstChild;
18100 } else {
18101 disappearLayoutEffects_complete(subtreeRoot);
18102 }
18103 }
18104 }
18105 function disappearLayoutEffects_complete(subtreeRoot) {
18106 while (nextEffect !== null) {
18107 var fiber = nextEffect;
18108 if (fiber === subtreeRoot) {
18109 nextEffect = null;
18110 return;
18111 }
18112 var sibling = fiber.sibling;
18113 if (sibling !== null) {
18114 sibling.return = fiber.return;
18115 nextEffect = sibling;
18116 return;
18117 }
18118 nextEffect = fiber.return;
18119 }
18120 }
18121 function reappearLayoutEffects_begin(subtreeRoot) {
18122 while (nextEffect !== null) {
18123 var fiber = nextEffect;
18124 var firstChild = fiber.child;
18125 if (fiber.tag === OffscreenComponent) {
18126 var isHidden = fiber.memoizedState !== null;
18127 if (isHidden) {
18128 reappearLayoutEffects_complete(subtreeRoot);
18129 continue;
18130 }
18131 }
18132 if (firstChild !== null) {
18133 firstChild.return = fiber;
18134 nextEffect = firstChild;
18135 } else {
18136 reappearLayoutEffects_complete(subtreeRoot);
18137 }
18138 }
18139 }
18140 function reappearLayoutEffects_complete(subtreeRoot) {
18141 while (nextEffect !== null) {
18142 var fiber = nextEffect;
18143 setCurrentFiber(fiber);
18144 try {
18145 reappearLayoutEffectsOnFiber(fiber);
18146 } catch (error2) {
18147 captureCommitPhaseError(fiber, fiber.return, error2);
18148 }
18149 resetCurrentFiber();
18150 if (fiber === subtreeRoot) {
18151 nextEffect = null;
18152 return;
18153 }
18154 var sibling = fiber.sibling;
18155 if (sibling !== null) {
18156 sibling.return = fiber.return;
18157 nextEffect = sibling;
18158 return;
18159 }
18160 nextEffect = fiber.return;
18161 }
18162 }
18163 function commitPassiveMountEffects(root2, finishedWork, committedLanes, committedTransitions) {
18164 nextEffect = finishedWork;
18165 commitPassiveMountEffects_begin(finishedWork, root2, committedLanes, committedTransitions);
18166 }
18167 function commitPassiveMountEffects_begin(subtreeRoot, root2, committedLanes, committedTransitions) {
18168 while (nextEffect !== null) {
18169 var fiber = nextEffect;
18170 var firstChild = fiber.child;
18171 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
18172 firstChild.return = fiber;
18173 nextEffect = firstChild;
18174 } else {
18175 commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions);
18176 }
18177 }
18178 }
18179 function commitPassiveMountEffects_complete(subtreeRoot, root2, committedLanes, committedTransitions) {
18180 while (nextEffect !== null) {
18181 var fiber = nextEffect;
18182 if ((fiber.flags & Passive) !== NoFlags) {
18183 setCurrentFiber(fiber);
18184 try {
18185 commitPassiveMountOnFiber(root2, fiber, committedLanes, committedTransitions);
18186 } catch (error2) {
18187 captureCommitPhaseError(fiber, fiber.return, error2);
18188 }
18189 resetCurrentFiber();
18190 }
18191 if (fiber === subtreeRoot) {
18192 nextEffect = null;
18193 return;
18194 }
18195 var sibling = fiber.sibling;
18196 if (sibling !== null) {
18197 sibling.return = fiber.return;
18198 nextEffect = sibling;
18199 return;
18200 }
18201 nextEffect = fiber.return;
18202 }
18203 }
18204 function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
18205 switch (finishedWork.tag) {
18206 case FunctionComponent:
18207 case ForwardRef:
18208 case SimpleMemoComponent: {
18209 if (finishedWork.mode & ProfileMode) {
18210 startPassiveEffectTimer();
18211 try {
18212 commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
18213 } finally {
18214 recordPassiveEffectDuration(finishedWork);
18215 }
18216 } else {
18217 commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
18218 }
18219 break;
18220 }
18221 }
18222 }
18223 function commitPassiveUnmountEffects(firstChild) {
18224 nextEffect = firstChild;
18225 commitPassiveUnmountEffects_begin();
18226 }
18227 function commitPassiveUnmountEffects_begin() {
18228 while (nextEffect !== null) {
18229 var fiber = nextEffect;
18230 var child = fiber.child;
18231 if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
18232 var deletions = fiber.deletions;
18233 if (deletions !== null) {
18234 for (var i = 0; i < deletions.length; i++) {
18235 var fiberToDelete = deletions[i];
18236 nextEffect = fiberToDelete;
18237 commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
18238 }
18239 {
18240 var previousFiber = fiber.alternate;
18241 if (previousFiber !== null) {
18242 var detachedChild = previousFiber.child;
18243 if (detachedChild !== null) {
18244 previousFiber.child = null;
18245 do {
18246 var detachedSibling = detachedChild.sibling;
18247 detachedChild.sibling = null;
18248 detachedChild = detachedSibling;
18249 } while (detachedChild !== null);
18250 }
18251 }
18252 }
18253 nextEffect = fiber;
18254 }
18255 }
18256 if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
18257 child.return = fiber;
18258 nextEffect = child;
18259 } else {
18260 commitPassiveUnmountEffects_complete();
18261 }
18262 }
18263 }
18264 function commitPassiveUnmountEffects_complete() {
18265 while (nextEffect !== null) {
18266 var fiber = nextEffect;
18267 if ((fiber.flags & Passive) !== NoFlags) {
18268 setCurrentFiber(fiber);
18269 commitPassiveUnmountOnFiber(fiber);
18270 resetCurrentFiber();
18271 }
18272 var sibling = fiber.sibling;
18273 if (sibling !== null) {
18274 sibling.return = fiber.return;
18275 nextEffect = sibling;
18276 return;
18277 }
18278 nextEffect = fiber.return;
18279 }
18280 }
18281 function commitPassiveUnmountOnFiber(finishedWork) {
18282 switch (finishedWork.tag) {
18283 case FunctionComponent:
18284 case ForwardRef:
18285 case SimpleMemoComponent: {
18286 if (finishedWork.mode & ProfileMode) {
18287 startPassiveEffectTimer();
18288 commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
18289 recordPassiveEffectDuration(finishedWork);
18290 } else {
18291 commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
18292 }
18293 break;
18294 }
18295 }
18296 }
18297 function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
18298 while (nextEffect !== null) {
18299 var fiber = nextEffect;
18300 setCurrentFiber(fiber);
18301 commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
18302 resetCurrentFiber();
18303 var child = fiber.child;
18304 if (child !== null) {
18305 child.return = fiber;
18306 nextEffect = child;
18307 } else {
18308 commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
18309 }
18310 }
18311 }
18312 function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
18313 while (nextEffect !== null) {
18314 var fiber = nextEffect;
18315 var sibling = fiber.sibling;
18316 var returnFiber = fiber.return;
18317 {
18318 detachFiberAfterEffects(fiber);
18319 if (fiber === deletedSubtreeRoot) {
18320 nextEffect = null;
18321 return;
18322 }
18323 }
18324 if (sibling !== null) {
18325 sibling.return = returnFiber;
18326 nextEffect = sibling;
18327 return;
18328 }
18329 nextEffect = returnFiber;
18330 }
18331 }
18332 function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
18333 switch (current2.tag) {
18334 case FunctionComponent:
18335 case ForwardRef:
18336 case SimpleMemoComponent: {
18337 if (current2.mode & ProfileMode) {
18338 startPassiveEffectTimer();
18339 commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
18340 recordPassiveEffectDuration(current2);
18341 } else {
18342 commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
18343 }
18344 break;
18345 }
18346 }
18347 }
18348 function invokeLayoutEffectMountInDEV(fiber) {
18349 {
18350 switch (fiber.tag) {
18351 case FunctionComponent:
18352 case ForwardRef:
18353 case SimpleMemoComponent: {
18354 try {
18355 commitHookEffectListMount(Layout | HasEffect, fiber);
18356 } catch (error2) {
18357 captureCommitPhaseError(fiber, fiber.return, error2);
18358 }
18359 break;
18360 }
18361 case ClassComponent: {
18362 var instance = fiber.stateNode;
18363 try {
18364 instance.componentDidMount();
18365 } catch (error2) {
18366 captureCommitPhaseError(fiber, fiber.return, error2);
18367 }
18368 break;
18369 }
18370 }
18371 }
18372 }
18373 function invokePassiveEffectMountInDEV(fiber) {
18374 {
18375 switch (fiber.tag) {
18376 case FunctionComponent:
18377 case ForwardRef:
18378 case SimpleMemoComponent: {
18379 try {
18380 commitHookEffectListMount(Passive$1 | HasEffect, fiber);
18381 } catch (error2) {
18382 captureCommitPhaseError(fiber, fiber.return, error2);
18383 }
18384 break;
18385 }
18386 }
18387 }
18388 }
18389 function invokeLayoutEffectUnmountInDEV(fiber) {
18390 {
18391 switch (fiber.tag) {
18392 case FunctionComponent:
18393 case ForwardRef:
18394 case SimpleMemoComponent: {
18395 try {
18396 commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return);
18397 } catch (error2) {
18398 captureCommitPhaseError(fiber, fiber.return, error2);
18399 }
18400 break;
18401 }
18402 case ClassComponent: {
18403 var instance = fiber.stateNode;
18404 if (typeof instance.componentWillUnmount === "function") {
18405 safelyCallComponentWillUnmount(fiber, fiber.return, instance);
18406 }
18407 break;
18408 }
18409 }
18410 }
18411 }
18412 function invokePassiveEffectUnmountInDEV(fiber) {
18413 {
18414 switch (fiber.tag) {
18415 case FunctionComponent:
18416 case ForwardRef:
18417 case SimpleMemoComponent: {
18418 try {
18419 commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
18420 } catch (error2) {
18421 captureCommitPhaseError(fiber, fiber.return, error2);
18422 }
18423 }
18424 }
18425 }
18426 }
18427 var COMPONENT_TYPE = 0;
18428 var HAS_PSEUDO_CLASS_TYPE = 1;
18429 var ROLE_TYPE = 2;
18430 var TEST_NAME_TYPE = 3;
18431 var TEXT_TYPE = 4;
18432 if (typeof Symbol === "function" && Symbol.for) {
18433 var symbolFor = Symbol.for;
18434 COMPONENT_TYPE = symbolFor("selector.component");
18435 HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
18436 ROLE_TYPE = symbolFor("selector.role");
18437 TEST_NAME_TYPE = symbolFor("selector.test_id");
18438 TEXT_TYPE = symbolFor("selector.text");
18439 }
18440 var commitHooks = [];
18441 function onCommitRoot$1() {
18442 {
18443 commitHooks.forEach(function(commitHook) {
18444 return commitHook();
18445 });
18446 }
18447 }
18448 var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
18449 function isLegacyActEnvironment(fiber) {
18450 {
18451 var isReactActEnvironmentGlobal = (
18452 // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
18453 typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
18454 );
18455 var jestIsDefined = typeof jest !== "undefined";
18456 return jestIsDefined && isReactActEnvironmentGlobal !== false;
18457 }
18458 }
18459 function isConcurrentActEnvironment() {
18460 {
18461 var isReactActEnvironmentGlobal = (
18462 // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
18463 typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
18464 );
18465 if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
18466 error("The current testing environment is not configured to support act(...)");
18467 }
18468 return isReactActEnvironmentGlobal;
18469 }
18470 }
18471 var ceil = Math.ceil;
18472 var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
18473 var NoContext = (
18474 /* */
18475 0
18476 );
18477 var BatchedContext = (
18478 /* */
18479 1
18480 );
18481 var RenderContext = (
18482 /* */
18483 2
18484 );
18485 var CommitContext = (
18486 /* */
18487 4
18488 );
18489 var RootInProgress = 0;
18490 var RootFatalErrored = 1;
18491 var RootErrored = 2;
18492 var RootSuspended = 3;
18493 var RootSuspendedWithDelay = 4;
18494 var RootCompleted = 5;
18495 var RootDidNotComplete = 6;
18496 var executionContext = NoContext;
18497 var workInProgressRoot = null;
18498 var workInProgress = null;
18499 var workInProgressRootRenderLanes = NoLanes;
18500 var subtreeRenderLanes = NoLanes;
18501 var subtreeRenderLanesCursor = createCursor(NoLanes);
18502 var workInProgressRootExitStatus = RootInProgress;
18503 var workInProgressRootFatalError = null;
18504 var workInProgressRootIncludedLanes = NoLanes;
18505 var workInProgressRootSkippedLanes = NoLanes;
18506 var workInProgressRootInterleavedUpdatedLanes = NoLanes;
18507 var workInProgressRootPingedLanes = NoLanes;
18508 var workInProgressRootConcurrentErrors = null;
18509 var workInProgressRootRecoverableErrors = null;
18510 var globalMostRecentFallbackTime = 0;
18511 var FALLBACK_THROTTLE_MS = 500;
18512 var workInProgressRootRenderTargetTime = Infinity;
18513 var RENDER_TIMEOUT_MS = 500;
18514 var workInProgressTransitions = null;
18515 function resetRenderTimer() {
18516 workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;
18517 }
18518 function getRenderTargetTime() {
18519 return workInProgressRootRenderTargetTime;
18520 }
18521 var hasUncaughtError = false;
18522 var firstUncaughtError = null;
18523 var legacyErrorBoundariesThatAlreadyFailed = null;
18524 var rootDoesHavePassiveEffects = false;
18525 var rootWithPendingPassiveEffects = null;
18526 var pendingPassiveEffectsLanes = NoLanes;
18527 var pendingPassiveProfilerEffects = [];
18528 var pendingPassiveTransitions = null;
18529 var NESTED_UPDATE_LIMIT = 50;
18530 var nestedUpdateCount = 0;
18531 var rootWithNestedUpdates = null;
18532 var isFlushingPassiveEffects = false;
18533 var didScheduleUpdateDuringPassiveEffects = false;
18534 var NESTED_PASSIVE_UPDATE_LIMIT = 50;
18535 var nestedPassiveUpdateCount = 0;
18536 var rootWithPassiveNestedUpdates = null;
18537 var currentEventTime = NoTimestamp;
18538 var currentEventTransitionLane = NoLanes;
18539 var isRunningInsertionEffect = false;
18540 function getWorkInProgressRoot() {
18541 return workInProgressRoot;
18542 }
18543 function requestEventTime() {
18544 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18545 return now();
18546 }
18547 if (currentEventTime !== NoTimestamp) {
18548 return currentEventTime;
18549 }
18550 currentEventTime = now();
18551 return currentEventTime;
18552 }
18553 function requestUpdateLane(fiber) {
18554 var mode = fiber.mode;
18555 if ((mode & ConcurrentMode) === NoMode) {
18556 return SyncLane;
18557 } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
18558 return pickArbitraryLane(workInProgressRootRenderLanes);
18559 }
18560 var isTransition = requestCurrentTransition() !== NoTransition;
18561 if (isTransition) {
18562 if (ReactCurrentBatchConfig$3.transition !== null) {
18563 var transition = ReactCurrentBatchConfig$3.transition;
18564 if (!transition._updatedFibers) {
18565 transition._updatedFibers = /* @__PURE__ */ new Set();
18566 }
18567 transition._updatedFibers.add(fiber);
18568 }
18569 if (currentEventTransitionLane === NoLane) {
18570 currentEventTransitionLane = claimNextTransitionLane();
18571 }
18572 return currentEventTransitionLane;
18573 }
18574 var updateLane = getCurrentUpdatePriority();
18575 if (updateLane !== NoLane) {
18576 return updateLane;
18577 }
18578 var eventLane = getCurrentEventPriority();
18579 return eventLane;
18580 }
18581 function requestRetryLane(fiber) {
18582 var mode = fiber.mode;
18583 if ((mode & ConcurrentMode) === NoMode) {
18584 return SyncLane;
18585 }
18586 return claimNextRetryLane();
18587 }
18588 function scheduleUpdateOnFiber(root2, fiber, lane, eventTime) {
18589 checkForNestedUpdates();
18590 {
18591 if (isRunningInsertionEffect) {
18592 error("useInsertionEffect must not schedule updates.");
18593 }
18594 }
18595 {
18596 if (isFlushingPassiveEffects) {
18597 didScheduleUpdateDuringPassiveEffects = true;
18598 }
18599 }
18600 markRootUpdated(root2, lane, eventTime);
18601 if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
18602 warnAboutRenderPhaseUpdatesInDEV(fiber);
18603 } else {
18604 {
18605 if (isDevToolsPresent) {
18606 addFiberToLanesMap(root2, fiber, lane);
18607 }
18608 }
18609 warnIfUpdatesNotWrappedWithActDEV(fiber);
18610 if (root2 === workInProgressRoot) {
18611 if ((executionContext & RenderContext) === NoContext) {
18612 workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
18613 }
18614 if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
18615 markRootSuspended$1(root2, workInProgressRootRenderLanes);
18616 }
18617 }
18618 ensureRootIsScheduled(root2, eventTime);
18619 if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
18620 !ReactCurrentActQueue$1.isBatchingLegacy) {
18621 resetRenderTimer();
18622 flushSyncCallbacksOnlyInLegacyMode();
18623 }
18624 }
18625 }
18626 function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
18627 var current2 = root2.current;
18628 current2.lanes = lane;
18629 markRootUpdated(root2, lane, eventTime);
18630 ensureRootIsScheduled(root2, eventTime);
18631 }
18632 function isUnsafeClassRenderPhaseUpdate(fiber) {
18633 return (
18634 // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
18635 // decided not to enable it.
18636 (executionContext & RenderContext) !== NoContext
18637 );
18638 }
18639 function ensureRootIsScheduled(root2, currentTime) {
18640 var existingCallbackNode = root2.callbackNode;
18641 markStarvedLanesAsExpired(root2, currentTime);
18642 var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
18643 if (nextLanes === NoLanes) {
18644 if (existingCallbackNode !== null) {
18645 cancelCallback$1(existingCallbackNode);
18646 }
18647 root2.callbackNode = null;
18648 root2.callbackPriority = NoLane;
18649 return;
18650 }
18651 var newCallbackPriority = getHighestPriorityLane(nextLanes);
18652 var existingCallbackPriority = root2.callbackPriority;
18653 if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a
18654 // Scheduler task, rather than an `act` task, cancel it and re-scheduled
18655 // on the `act` queue.
18656 !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
18657 {
18658 if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
18659 error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
18660 }
18661 }
18662 return;
18663 }
18664 if (existingCallbackNode != null) {
18665 cancelCallback$1(existingCallbackNode);
18666 }
18667 var newCallbackNode;
18668 if (newCallbackPriority === SyncLane) {
18669 if (root2.tag === LegacyRoot) {
18670 if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
18671 ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
18672 }
18673 scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
18674 } else {
18675 scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
18676 }
18677 {
18678 if (ReactCurrentActQueue$1.current !== null) {
18679 ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
18680 } else {
18681 scheduleMicrotask(function() {
18682 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
18683 flushSyncCallbacks();
18684 }
18685 });
18686 }
18687 }
18688 newCallbackNode = null;
18689 } else {
18690 var schedulerPriorityLevel;
18691 switch (lanesToEventPriority(nextLanes)) {
18692 case DiscreteEventPriority:
18693 schedulerPriorityLevel = ImmediatePriority;
18694 break;
18695 case ContinuousEventPriority:
18696 schedulerPriorityLevel = UserBlockingPriority;
18697 break;
18698 case DefaultEventPriority:
18699 schedulerPriorityLevel = NormalPriority;
18700 break;
18701 case IdleEventPriority:
18702 schedulerPriorityLevel = IdlePriority;
18703 break;
18704 default:
18705 schedulerPriorityLevel = NormalPriority;
18706 break;
18707 }
18708 newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
18709 }
18710 root2.callbackPriority = newCallbackPriority;
18711 root2.callbackNode = newCallbackNode;
18712 }
18713 function performConcurrentWorkOnRoot(root2, didTimeout) {
18714 {
18715 resetNestedUpdateFlag();
18716 }
18717 currentEventTime = NoTimestamp;
18718 currentEventTransitionLane = NoLanes;
18719 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18720 throw new Error("Should not already be working.");
18721 }
18722 var originalCallbackNode = root2.callbackNode;
18723 var didFlushPassiveEffects = flushPassiveEffects();
18724 if (didFlushPassiveEffects) {
18725 if (root2.callbackNode !== originalCallbackNode) {
18726 return null;
18727 }
18728 }
18729 var lanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
18730 if (lanes === NoLanes) {
18731 return null;
18732 }
18733 var shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
18734 var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
18735 if (exitStatus !== RootInProgress) {
18736 if (exitStatus === RootErrored) {
18737 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18738 if (errorRetryLanes !== NoLanes) {
18739 lanes = errorRetryLanes;
18740 exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
18741 }
18742 }
18743 if (exitStatus === RootFatalErrored) {
18744 var fatalError = workInProgressRootFatalError;
18745 prepareFreshStack(root2, NoLanes);
18746 markRootSuspended$1(root2, lanes);
18747 ensureRootIsScheduled(root2, now());
18748 throw fatalError;
18749 }
18750 if (exitStatus === RootDidNotComplete) {
18751 markRootSuspended$1(root2, lanes);
18752 } else {
18753 var renderWasConcurrent = !includesBlockingLane(root2, lanes);
18754 var finishedWork = root2.current.alternate;
18755 if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
18756 exitStatus = renderRootSync(root2, lanes);
18757 if (exitStatus === RootErrored) {
18758 var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18759 if (_errorRetryLanes !== NoLanes) {
18760 lanes = _errorRetryLanes;
18761 exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
18762 }
18763 }
18764 if (exitStatus === RootFatalErrored) {
18765 var _fatalError = workInProgressRootFatalError;
18766 prepareFreshStack(root2, NoLanes);
18767 markRootSuspended$1(root2, lanes);
18768 ensureRootIsScheduled(root2, now());
18769 throw _fatalError;
18770 }
18771 }
18772 root2.finishedWork = finishedWork;
18773 root2.finishedLanes = lanes;
18774 finishConcurrentRender(root2, exitStatus, lanes);
18775 }
18776 }
18777 ensureRootIsScheduled(root2, now());
18778 if (root2.callbackNode === originalCallbackNode) {
18779 return performConcurrentWorkOnRoot.bind(null, root2);
18780 }
18781 return null;
18782 }
18783 function recoverFromConcurrentError(root2, errorRetryLanes) {
18784 var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
18785 if (isRootDehydrated(root2)) {
18786 var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
18787 rootWorkInProgress.flags |= ForceClientRender;
18788 {
18789 errorHydratingContainer(root2.containerInfo);
18790 }
18791 }
18792 var exitStatus = renderRootSync(root2, errorRetryLanes);
18793 if (exitStatus !== RootErrored) {
18794 var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
18795 workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
18796 if (errorsFromSecondAttempt !== null) {
18797 queueRecoverableErrors(errorsFromSecondAttempt);
18798 }
18799 }
18800 return exitStatus;
18801 }
18802 function queueRecoverableErrors(errors) {
18803 if (workInProgressRootRecoverableErrors === null) {
18804 workInProgressRootRecoverableErrors = errors;
18805 } else {
18806 workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
18807 }
18808 }
18809 function finishConcurrentRender(root2, exitStatus, lanes) {
18810 switch (exitStatus) {
18811 case RootInProgress:
18812 case RootFatalErrored: {
18813 throw new Error("Root did not complete. This is a bug in React.");
18814 }
18815 // Flow knows about invariant, so it complains if I add a break
18816 // statement, but eslint doesn't know about invariant, so it complains
18817 // if I do. eslint-disable-next-line no-fallthrough
18818 case RootErrored: {
18819 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18820 break;
18821 }
18822 case RootSuspended: {
18823 markRootSuspended$1(root2, lanes);
18824 if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
18825 !shouldForceFlushFallbacksInDEV()) {
18826 var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
18827 if (msUntilTimeout > 10) {
18828 var nextLanes = getNextLanes(root2, NoLanes);
18829 if (nextLanes !== NoLanes) {
18830 break;
18831 }
18832 var suspendedLanes = root2.suspendedLanes;
18833 if (!isSubsetOfLanes(suspendedLanes, lanes)) {
18834 var eventTime = requestEventTime();
18835 markRootPinged(root2, suspendedLanes);
18836 break;
18837 }
18838 root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
18839 break;
18840 }
18841 }
18842 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18843 break;
18844 }
18845 case RootSuspendedWithDelay: {
18846 markRootSuspended$1(root2, lanes);
18847 if (includesOnlyTransitions(lanes)) {
18848 break;
18849 }
18850 if (!shouldForceFlushFallbacksInDEV()) {
18851 var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
18852 var eventTimeMs = mostRecentEventTime;
18853 var timeElapsedMs = now() - eventTimeMs;
18854 var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
18855 if (_msUntilTimeout > 10) {
18856 root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
18857 break;
18858 }
18859 }
18860 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18861 break;
18862 }
18863 case RootCompleted: {
18864 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18865 break;
18866 }
18867 default: {
18868 throw new Error("Unknown root exit status.");
18869 }
18870 }
18871 }
18872 function isRenderConsistentWithExternalStores(finishedWork) {
18873 var node = finishedWork;
18874 while (true) {
18875 if (node.flags & StoreConsistency) {
18876 var updateQueue = node.updateQueue;
18877 if (updateQueue !== null) {
18878 var checks = updateQueue.stores;
18879 if (checks !== null) {
18880 for (var i = 0; i < checks.length; i++) {
18881 var check = checks[i];
18882 var getSnapshot = check.getSnapshot;
18883 var renderedValue = check.value;
18884 try {
18885 if (!objectIs(getSnapshot(), renderedValue)) {
18886 return false;
18887 }
18888 } catch (error2) {
18889 return false;
18890 }
18891 }
18892 }
18893 }
18894 }
18895 var child = node.child;
18896 if (node.subtreeFlags & StoreConsistency && child !== null) {
18897 child.return = node;
18898 node = child;
18899 continue;
18900 }
18901 if (node === finishedWork) {
18902 return true;
18903 }
18904 while (node.sibling === null) {
18905 if (node.return === null || node.return === finishedWork) {
18906 return true;
18907 }
18908 node = node.return;
18909 }
18910 node.sibling.return = node.return;
18911 node = node.sibling;
18912 }
18913 return true;
18914 }
18915 function markRootSuspended$1(root2, suspendedLanes) {
18916 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
18917 suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
18918 markRootSuspended(root2, suspendedLanes);
18919 }
18920 function performSyncWorkOnRoot(root2) {
18921 {
18922 syncNestedUpdateFlag();
18923 }
18924 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
18925 throw new Error("Should not already be working.");
18926 }
18927 flushPassiveEffects();
18928 var lanes = getNextLanes(root2, NoLanes);
18929 if (!includesSomeLane(lanes, SyncLane)) {
18930 ensureRootIsScheduled(root2, now());
18931 return null;
18932 }
18933 var exitStatus = renderRootSync(root2, lanes);
18934 if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
18935 var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
18936 if (errorRetryLanes !== NoLanes) {
18937 lanes = errorRetryLanes;
18938 exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
18939 }
18940 }
18941 if (exitStatus === RootFatalErrored) {
18942 var fatalError = workInProgressRootFatalError;
18943 prepareFreshStack(root2, NoLanes);
18944 markRootSuspended$1(root2, lanes);
18945 ensureRootIsScheduled(root2, now());
18946 throw fatalError;
18947 }
18948 if (exitStatus === RootDidNotComplete) {
18949 throw new Error("Root did not complete. This is a bug in React.");
18950 }
18951 var finishedWork = root2.current.alternate;
18952 root2.finishedWork = finishedWork;
18953 root2.finishedLanes = lanes;
18954 commitRoot(root2, workInProgressRootRecoverableErrors, workInProgressTransitions);
18955 ensureRootIsScheduled(root2, now());
18956 return null;
18957 }
18958 function flushRoot(root2, lanes) {
18959 if (lanes !== NoLanes) {
18960 markRootEntangled(root2, mergeLanes(lanes, SyncLane));
18961 ensureRootIsScheduled(root2, now());
18962 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
18963 resetRenderTimer();
18964 flushSyncCallbacks();
18965 }
18966 }
18967 }
18968 function batchedUpdates$1(fn, a) {
18969 var prevExecutionContext = executionContext;
18970 executionContext |= BatchedContext;
18971 try {
18972 return fn(a);
18973 } finally {
18974 executionContext = prevExecutionContext;
18975 if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
18976 !ReactCurrentActQueue$1.isBatchingLegacy) {
18977 resetRenderTimer();
18978 flushSyncCallbacksOnlyInLegacyMode();
18979 }
18980 }
18981 }
18982 function discreteUpdates(fn, a, b, c, d) {
18983 var previousPriority = getCurrentUpdatePriority();
18984 var prevTransition = ReactCurrentBatchConfig$3.transition;
18985 try {
18986 ReactCurrentBatchConfig$3.transition = null;
18987 setCurrentUpdatePriority(DiscreteEventPriority);
18988 return fn(a, b, c, d);
18989 } finally {
18990 setCurrentUpdatePriority(previousPriority);
18991 ReactCurrentBatchConfig$3.transition = prevTransition;
18992 if (executionContext === NoContext) {
18993 resetRenderTimer();
18994 }
18995 }
18996 }
18997 function flushSync(fn) {
18998 if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
18999 flushPassiveEffects();
19000 }
19001 var prevExecutionContext = executionContext;
19002 executionContext |= BatchedContext;
19003 var prevTransition = ReactCurrentBatchConfig$3.transition;
19004 var previousPriority = getCurrentUpdatePriority();
19005 try {
19006 ReactCurrentBatchConfig$3.transition = null;
19007 setCurrentUpdatePriority(DiscreteEventPriority);
19008 if (fn) {
19009 return fn();
19010 } else {
19011 return void 0;
19012 }
19013 } finally {
19014 setCurrentUpdatePriority(previousPriority);
19015 ReactCurrentBatchConfig$3.transition = prevTransition;
19016 executionContext = prevExecutionContext;
19017 if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
19018 flushSyncCallbacks();
19019 }
19020 }
19021 }
19022 function isAlreadyRendering() {
19023 return (executionContext & (RenderContext | CommitContext)) !== NoContext;
19024 }
19025 function pushRenderLanes(fiber, lanes) {
19026 push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);
19027 subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);
19028 workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);
19029 }
19030 function popRenderLanes(fiber) {
19031 subtreeRenderLanes = subtreeRenderLanesCursor.current;
19032 pop(subtreeRenderLanesCursor, fiber);
19033 }
19034 function prepareFreshStack(root2, lanes) {
19035 root2.finishedWork = null;
19036 root2.finishedLanes = NoLanes;
19037 var timeoutHandle = root2.timeoutHandle;
19038 if (timeoutHandle !== noTimeout) {
19039 root2.timeoutHandle = noTimeout;
19040 cancelTimeout(timeoutHandle);
19041 }
19042 if (workInProgress !== null) {
19043 var interruptedWork = workInProgress.return;
19044 while (interruptedWork !== null) {
19045 var current2 = interruptedWork.alternate;
19046 unwindInterruptedWork(current2, interruptedWork);
19047 interruptedWork = interruptedWork.return;
19048 }
19049 }
19050 workInProgressRoot = root2;
19051 var rootWorkInProgress = createWorkInProgress(root2.current, null);
19052 workInProgress = rootWorkInProgress;
19053 workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
19054 workInProgressRootExitStatus = RootInProgress;
19055 workInProgressRootFatalError = null;
19056 workInProgressRootSkippedLanes = NoLanes;
19057 workInProgressRootInterleavedUpdatedLanes = NoLanes;
19058 workInProgressRootPingedLanes = NoLanes;
19059 workInProgressRootConcurrentErrors = null;
19060 workInProgressRootRecoverableErrors = null;
19061 finishQueueingConcurrentUpdates();
19062 {
19063 ReactStrictModeWarnings.discardPendingWarnings();
19064 }
19065 return rootWorkInProgress;
19066 }
19067 function handleError(root2, thrownValue) {
19068 do {
19069 var erroredWork = workInProgress;
19070 try {
19071 resetContextDependencies();
19072 resetHooksAfterThrow();
19073 resetCurrentFiber();
19074 ReactCurrentOwner$2.current = null;
19075 if (erroredWork === null || erroredWork.return === null) {
19076 workInProgressRootExitStatus = RootFatalErrored;
19077 workInProgressRootFatalError = thrownValue;
19078 workInProgress = null;
19079 return;
19080 }
19081 if (enableProfilerTimer && erroredWork.mode & ProfileMode) {
19082 stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);
19083 }
19084 if (enableSchedulingProfiler) {
19085 markComponentRenderStopped();
19086 if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
19087 var wakeable = thrownValue;
19088 markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
19089 } else {
19090 markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
19091 }
19092 }
19093 throwException(root2, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);
19094 completeUnitOfWork(erroredWork);
19095 } catch (yetAnotherThrownValue) {
19096 thrownValue = yetAnotherThrownValue;
19097 if (workInProgress === erroredWork && erroredWork !== null) {
19098 erroredWork = erroredWork.return;
19099 workInProgress = erroredWork;
19100 } else {
19101 erroredWork = workInProgress;
19102 }
19103 continue;
19104 }
19105 return;
19106 } while (true);
19107 }
19108 function pushDispatcher() {
19109 var prevDispatcher = ReactCurrentDispatcher$2.current;
19110 ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;
19111 if (prevDispatcher === null) {
19112 return ContextOnlyDispatcher;
19113 } else {
19114 return prevDispatcher;
19115 }
19116 }
19117 function popDispatcher(prevDispatcher) {
19118 ReactCurrentDispatcher$2.current = prevDispatcher;
19119 }
19120 function markCommitTimeOfFallback() {
19121 globalMostRecentFallbackTime = now();
19122 }
19123 function markSkippedUpdateLanes(lane) {
19124 workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
19125 }
19126 function renderDidSuspend() {
19127 if (workInProgressRootExitStatus === RootInProgress) {
19128 workInProgressRootExitStatus = RootSuspended;
19129 }
19130 }
19131 function renderDidSuspendDelayIfPossible() {
19132 if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
19133 workInProgressRootExitStatus = RootSuspendedWithDelay;
19134 }
19135 if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
19136 markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
19137 }
19138 }
19139 function renderDidError(error2) {
19140 if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
19141 workInProgressRootExitStatus = RootErrored;
19142 }
19143 if (workInProgressRootConcurrentErrors === null) {
19144 workInProgressRootConcurrentErrors = [error2];
19145 } else {
19146 workInProgressRootConcurrentErrors.push(error2);
19147 }
19148 }
19149 function renderHasNotSuspendedYet() {
19150 return workInProgressRootExitStatus === RootInProgress;
19151 }
19152 function renderRootSync(root2, lanes) {
19153 var prevExecutionContext = executionContext;
19154 executionContext |= RenderContext;
19155 var prevDispatcher = pushDispatcher();
19156 if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
19157 {
19158 if (isDevToolsPresent) {
19159 var memoizedUpdaters = root2.memoizedUpdaters;
19160 if (memoizedUpdaters.size > 0) {
19161 restorePendingUpdaters(root2, workInProgressRootRenderLanes);
19162 memoizedUpdaters.clear();
19163 }
19164 movePendingFibersToMemoized(root2, lanes);
19165 }
19166 }
19167 workInProgressTransitions = getTransitionsForLanes();
19168 prepareFreshStack(root2, lanes);
19169 }
19170 {
19171 markRenderStarted(lanes);
19172 }
19173 do {
19174 try {
19175 workLoopSync();
19176 break;
19177 } catch (thrownValue) {
19178 handleError(root2, thrownValue);
19179 }
19180 } while (true);
19181 resetContextDependencies();
19182 executionContext = prevExecutionContext;
19183 popDispatcher(prevDispatcher);
19184 if (workInProgress !== null) {
19185 throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
19186 }
19187 {
19188 markRenderStopped();
19189 }
19190 workInProgressRoot = null;
19191 workInProgressRootRenderLanes = NoLanes;
19192 return workInProgressRootExitStatus;
19193 }
19194 function workLoopSync() {
19195 while (workInProgress !== null) {
19196 performUnitOfWork(workInProgress);
19197 }
19198 }
19199 function renderRootConcurrent(root2, lanes) {
19200 var prevExecutionContext = executionContext;
19201 executionContext |= RenderContext;
19202 var prevDispatcher = pushDispatcher();
19203 if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
19204 {
19205 if (isDevToolsPresent) {
19206 var memoizedUpdaters = root2.memoizedUpdaters;
19207 if (memoizedUpdaters.size > 0) {
19208 restorePendingUpdaters(root2, workInProgressRootRenderLanes);
19209 memoizedUpdaters.clear();
19210 }
19211 movePendingFibersToMemoized(root2, lanes);
19212 }
19213 }
19214 workInProgressTransitions = getTransitionsForLanes();
19215 resetRenderTimer();
19216 prepareFreshStack(root2, lanes);
19217 }
19218 {
19219 markRenderStarted(lanes);
19220 }
19221 do {
19222 try {
19223 workLoopConcurrent();
19224 break;
19225 } catch (thrownValue) {
19226 handleError(root2, thrownValue);
19227 }
19228 } while (true);
19229 resetContextDependencies();
19230 popDispatcher(prevDispatcher);
19231 executionContext = prevExecutionContext;
19232 if (workInProgress !== null) {
19233 {
19234 markRenderYielded();
19235 }
19236 return RootInProgress;
19237 } else {
19238 {
19239 markRenderStopped();
19240 }
19241 workInProgressRoot = null;
19242 workInProgressRootRenderLanes = NoLanes;
19243 return workInProgressRootExitStatus;
19244 }
19245 }
19246 function workLoopConcurrent() {
19247 while (workInProgress !== null && !shouldYield()) {
19248 performUnitOfWork(workInProgress);
19249 }
19250 }
19251 function performUnitOfWork(unitOfWork) {
19252 var current2 = unitOfWork.alternate;
19253 setCurrentFiber(unitOfWork);
19254 var next;
19255 if ((unitOfWork.mode & ProfileMode) !== NoMode) {
19256 startProfilerTimer(unitOfWork);
19257 next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
19258 stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
19259 } else {
19260 next = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
19261 }
19262 resetCurrentFiber();
19263 unitOfWork.memoizedProps = unitOfWork.pendingProps;
19264 if (next === null) {
19265 completeUnitOfWork(unitOfWork);
19266 } else {
19267 workInProgress = next;
19268 }
19269 ReactCurrentOwner$2.current = null;
19270 }
19271 function completeUnitOfWork(unitOfWork) {
19272 var completedWork = unitOfWork;
19273 do {
19274 var current2 = completedWork.alternate;
19275 var returnFiber = completedWork.return;
19276 if ((completedWork.flags & Incomplete) === NoFlags) {
19277 setCurrentFiber(completedWork);
19278 var next = void 0;
19279 if ((completedWork.mode & ProfileMode) === NoMode) {
19280 next = completeWork(current2, completedWork, subtreeRenderLanes);
19281 } else {
19282 startProfilerTimer(completedWork);
19283 next = completeWork(current2, completedWork, subtreeRenderLanes);
19284 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
19285 }
19286 resetCurrentFiber();
19287 if (next !== null) {
19288 workInProgress = next;
19289 return;
19290 }
19291 } else {
19292 var _next = unwindWork(current2, completedWork);
19293 if (_next !== null) {
19294 _next.flags &= HostEffectMask;
19295 workInProgress = _next;
19296 return;
19297 }
19298 if ((completedWork.mode & ProfileMode) !== NoMode) {
19299 stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
19300 var actualDuration = completedWork.actualDuration;
19301 var child = completedWork.child;
19302 while (child !== null) {
19303 actualDuration += child.actualDuration;
19304 child = child.sibling;
19305 }
19306 completedWork.actualDuration = actualDuration;
19307 }
19308 if (returnFiber !== null) {
19309 returnFiber.flags |= Incomplete;
19310 returnFiber.subtreeFlags = NoFlags;
19311 returnFiber.deletions = null;
19312 } else {
19313 workInProgressRootExitStatus = RootDidNotComplete;
19314 workInProgress = null;
19315 return;
19316 }
19317 }
19318 var siblingFiber = completedWork.sibling;
19319 if (siblingFiber !== null) {
19320 workInProgress = siblingFiber;
19321 return;
19322 }
19323 completedWork = returnFiber;
19324 workInProgress = completedWork;
19325 } while (completedWork !== null);
19326 if (workInProgressRootExitStatus === RootInProgress) {
19327 workInProgressRootExitStatus = RootCompleted;
19328 }
19329 }
19330 function commitRoot(root2, recoverableErrors, transitions) {
19331 var previousUpdateLanePriority = getCurrentUpdatePriority();
19332 var prevTransition = ReactCurrentBatchConfig$3.transition;
19333 try {
19334 ReactCurrentBatchConfig$3.transition = null;
19335 setCurrentUpdatePriority(DiscreteEventPriority);
19336 commitRootImpl(root2, recoverableErrors, transitions, previousUpdateLanePriority);
19337 } finally {
19338 ReactCurrentBatchConfig$3.transition = prevTransition;
19339 setCurrentUpdatePriority(previousUpdateLanePriority);
19340 }
19341 return null;
19342 }
19343 function commitRootImpl(root2, recoverableErrors, transitions, renderPriorityLevel) {
19344 do {
19345 flushPassiveEffects();
19346 } while (rootWithPendingPassiveEffects !== null);
19347 flushRenderPhaseStrictModeWarningsInDEV();
19348 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
19349 throw new Error("Should not already be working.");
19350 }
19351 var finishedWork = root2.finishedWork;
19352 var lanes = root2.finishedLanes;
19353 {
19354 markCommitStarted(lanes);
19355 }
19356 if (finishedWork === null) {
19357 {
19358 markCommitStopped();
19359 }
19360 return null;
19361 } else {
19362 {
19363 if (lanes === NoLanes) {
19364 error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
19365 }
19366 }
19367 }
19368 root2.finishedWork = null;
19369 root2.finishedLanes = NoLanes;
19370 if (finishedWork === root2.current) {
19371 throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
19372 }
19373 root2.callbackNode = null;
19374 root2.callbackPriority = NoLane;
19375 var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
19376 markRootFinished(root2, remainingLanes);
19377 if (root2 === workInProgressRoot) {
19378 workInProgressRoot = null;
19379 workInProgress = null;
19380 workInProgressRootRenderLanes = NoLanes;
19381 }
19382 if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
19383 if (!rootDoesHavePassiveEffects) {
19384 rootDoesHavePassiveEffects = true;
19385 pendingPassiveTransitions = transitions;
19386 scheduleCallback$1(NormalPriority, function() {
19387 flushPassiveEffects();
19388 return null;
19389 });
19390 }
19391 }
19392 var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
19393 var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
19394 if (subtreeHasEffects || rootHasEffect) {
19395 var prevTransition = ReactCurrentBatchConfig$3.transition;
19396 ReactCurrentBatchConfig$3.transition = null;
19397 var previousPriority = getCurrentUpdatePriority();
19398 setCurrentUpdatePriority(DiscreteEventPriority);
19399 var prevExecutionContext = executionContext;
19400 executionContext |= CommitContext;
19401 ReactCurrentOwner$2.current = null;
19402 var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
19403 {
19404 recordCommitTime();
19405 }
19406 commitMutationEffects(root2, finishedWork, lanes);
19407 resetAfterCommit(root2.containerInfo);
19408 root2.current = finishedWork;
19409 {
19410 markLayoutEffectsStarted(lanes);
19411 }
19412 commitLayoutEffects(finishedWork, root2, lanes);
19413 {
19414 markLayoutEffectsStopped();
19415 }
19416 requestPaint();
19417 executionContext = prevExecutionContext;
19418 setCurrentUpdatePriority(previousPriority);
19419 ReactCurrentBatchConfig$3.transition = prevTransition;
19420 } else {
19421 root2.current = finishedWork;
19422 {
19423 recordCommitTime();
19424 }
19425 }
19426 var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
19427 if (rootDoesHavePassiveEffects) {
19428 rootDoesHavePassiveEffects = false;
19429 rootWithPendingPassiveEffects = root2;
19430 pendingPassiveEffectsLanes = lanes;
19431 } else {
19432 {
19433 nestedPassiveUpdateCount = 0;
19434 rootWithPassiveNestedUpdates = null;
19435 }
19436 }
19437 remainingLanes = root2.pendingLanes;
19438 if (remainingLanes === NoLanes) {
19439 legacyErrorBoundariesThatAlreadyFailed = null;
19440 }
19441 {
19442 if (!rootDidHavePassiveEffects) {
19443 commitDoubleInvokeEffectsInDEV(root2.current, false);
19444 }
19445 }
19446 onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
19447 {
19448 if (isDevToolsPresent) {
19449 root2.memoizedUpdaters.clear();
19450 }
19451 }
19452 {
19453 onCommitRoot$1();
19454 }
19455 ensureRootIsScheduled(root2, now());
19456 if (recoverableErrors !== null) {
19457 var onRecoverableError = root2.onRecoverableError;
19458 for (var i = 0; i < recoverableErrors.length; i++) {
19459 var recoverableError = recoverableErrors[i];
19460 var componentStack = recoverableError.stack;
19461 var digest = recoverableError.digest;
19462 onRecoverableError(recoverableError.value, {
19463 componentStack,
19464 digest
19465 });
19466 }
19467 }
19468 if (hasUncaughtError) {
19469 hasUncaughtError = false;
19470 var error$1 = firstUncaughtError;
19471 firstUncaughtError = null;
19472 throw error$1;
19473 }
19474 if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
19475 flushPassiveEffects();
19476 }
19477 remainingLanes = root2.pendingLanes;
19478 if (includesSomeLane(remainingLanes, SyncLane)) {
19479 {
19480 markNestedUpdateScheduled();
19481 }
19482 if (root2 === rootWithNestedUpdates) {
19483 nestedUpdateCount++;
19484 } else {
19485 nestedUpdateCount = 0;
19486 rootWithNestedUpdates = root2;
19487 }
19488 } else {
19489 nestedUpdateCount = 0;
19490 }
19491 flushSyncCallbacks();
19492 {
19493 markCommitStopped();
19494 }
19495 return null;
19496 }
19497 function flushPassiveEffects() {
19498 if (rootWithPendingPassiveEffects !== null) {
19499 var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
19500 var priority = lowerEventPriority(DefaultEventPriority, renderPriority);
19501 var prevTransition = ReactCurrentBatchConfig$3.transition;
19502 var previousPriority = getCurrentUpdatePriority();
19503 try {
19504 ReactCurrentBatchConfig$3.transition = null;
19505 setCurrentUpdatePriority(priority);
19506 return flushPassiveEffectsImpl();
19507 } finally {
19508 setCurrentUpdatePriority(previousPriority);
19509 ReactCurrentBatchConfig$3.transition = prevTransition;
19510 }
19511 }
19512 return false;
19513 }
19514 function enqueuePendingPassiveProfilerEffect(fiber) {
19515 {
19516 pendingPassiveProfilerEffects.push(fiber);
19517 if (!rootDoesHavePassiveEffects) {
19518 rootDoesHavePassiveEffects = true;
19519 scheduleCallback$1(NormalPriority, function() {
19520 flushPassiveEffects();
19521 return null;
19522 });
19523 }
19524 }
19525 }
19526 function flushPassiveEffectsImpl() {
19527 if (rootWithPendingPassiveEffects === null) {
19528 return false;
19529 }
19530 var transitions = pendingPassiveTransitions;
19531 pendingPassiveTransitions = null;
19532 var root2 = rootWithPendingPassiveEffects;
19533 var lanes = pendingPassiveEffectsLanes;
19534 rootWithPendingPassiveEffects = null;
19535 pendingPassiveEffectsLanes = NoLanes;
19536 if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
19537 throw new Error("Cannot flush passive effects while already rendering.");
19538 }
19539 {
19540 isFlushingPassiveEffects = true;
19541 didScheduleUpdateDuringPassiveEffects = false;
19542 }
19543 {
19544 markPassiveEffectsStarted(lanes);
19545 }
19546 var prevExecutionContext = executionContext;
19547 executionContext |= CommitContext;
19548 commitPassiveUnmountEffects(root2.current);
19549 commitPassiveMountEffects(root2, root2.current, lanes, transitions);
19550 {
19551 var profilerEffects = pendingPassiveProfilerEffects;
19552 pendingPassiveProfilerEffects = [];
19553 for (var i = 0; i < profilerEffects.length; i++) {
19554 var _fiber = profilerEffects[i];
19555 commitPassiveEffectDurations(root2, _fiber);
19556 }
19557 }
19558 {
19559 markPassiveEffectsStopped();
19560 }
19561 {
19562 commitDoubleInvokeEffectsInDEV(root2.current, true);
19563 }
19564 executionContext = prevExecutionContext;
19565 flushSyncCallbacks();
19566 {
19567 if (didScheduleUpdateDuringPassiveEffects) {
19568 if (root2 === rootWithPassiveNestedUpdates) {
19569 nestedPassiveUpdateCount++;
19570 } else {
19571 nestedPassiveUpdateCount = 0;
19572 rootWithPassiveNestedUpdates = root2;
19573 }
19574 } else {
19575 nestedPassiveUpdateCount = 0;
19576 }
19577 isFlushingPassiveEffects = false;
19578 didScheduleUpdateDuringPassiveEffects = false;
19579 }
19580 onPostCommitRoot(root2);
19581 {
19582 var stateNode = root2.current.stateNode;
19583 stateNode.effectDuration = 0;
19584 stateNode.passiveEffectDuration = 0;
19585 }
19586 return true;
19587 }
19588 function isAlreadyFailedLegacyErrorBoundary(instance) {
19589 return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
19590 }
19591 function markLegacyErrorBoundaryAsFailed(instance) {
19592 if (legacyErrorBoundariesThatAlreadyFailed === null) {
19593 legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([instance]);
19594 } else {
19595 legacyErrorBoundariesThatAlreadyFailed.add(instance);
19596 }
19597 }
19598 function prepareToThrowUncaughtError(error2) {
19599 if (!hasUncaughtError) {
19600 hasUncaughtError = true;
19601 firstUncaughtError = error2;
19602 }
19603 }
19604 var onUncaughtError = prepareToThrowUncaughtError;
19605 function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
19606 var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
19607 var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
19608 var root2 = enqueueUpdate(rootFiber, update, SyncLane);
19609 var eventTime = requestEventTime();
19610 if (root2 !== null) {
19611 markRootUpdated(root2, SyncLane, eventTime);
19612 ensureRootIsScheduled(root2, eventTime);
19613 }
19614 }
19615 function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
19616 {
19617 reportUncaughtErrorInDEV(error$1);
19618 setIsRunningInsertionEffect(false);
19619 }
19620 if (sourceFiber.tag === HostRoot) {
19621 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
19622 return;
19623 }
19624 var fiber = null;
19625 {
19626 fiber = nearestMountedAncestor;
19627 }
19628 while (fiber !== null) {
19629 if (fiber.tag === HostRoot) {
19630 captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
19631 return;
19632 } else if (fiber.tag === ClassComponent) {
19633 var ctor = fiber.type;
19634 var instance = fiber.stateNode;
19635 if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
19636 var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
19637 var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
19638 var root2 = enqueueUpdate(fiber, update, SyncLane);
19639 var eventTime = requestEventTime();
19640 if (root2 !== null) {
19641 markRootUpdated(root2, SyncLane, eventTime);
19642 ensureRootIsScheduled(root2, eventTime);
19643 }
19644 return;
19645 }
19646 }
19647 fiber = fiber.return;
19648 }
19649 {
19650 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);
19651 }
19652 }
19653 function pingSuspendedRoot(root2, wakeable, pingedLanes) {
19654 var pingCache = root2.pingCache;
19655 if (pingCache !== null) {
19656 pingCache.delete(wakeable);
19657 }
19658 var eventTime = requestEventTime();
19659 markRootPinged(root2, pingedLanes);
19660 warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
19661 if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
19662 if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
19663 prepareFreshStack(root2, NoLanes);
19664 } else {
19665 workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
19666 }
19667 }
19668 ensureRootIsScheduled(root2, eventTime);
19669 }
19670 function retryTimedOutBoundary(boundaryFiber, retryLane) {
19671 if (retryLane === NoLane) {
19672 retryLane = requestRetryLane(boundaryFiber);
19673 }
19674 var eventTime = requestEventTime();
19675 var root2 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
19676 if (root2 !== null) {
19677 markRootUpdated(root2, retryLane, eventTime);
19678 ensureRootIsScheduled(root2, eventTime);
19679 }
19680 }
19681 function retryDehydratedSuspenseBoundary(boundaryFiber) {
19682 var suspenseState = boundaryFiber.memoizedState;
19683 var retryLane = NoLane;
19684 if (suspenseState !== null) {
19685 retryLane = suspenseState.retryLane;
19686 }
19687 retryTimedOutBoundary(boundaryFiber, retryLane);
19688 }
19689 function resolveRetryWakeable(boundaryFiber, wakeable) {
19690 var retryLane = NoLane;
19691 var retryCache;
19692 switch (boundaryFiber.tag) {
19693 case SuspenseComponent:
19694 retryCache = boundaryFiber.stateNode;
19695 var suspenseState = boundaryFiber.memoizedState;
19696 if (suspenseState !== null) {
19697 retryLane = suspenseState.retryLane;
19698 }
19699 break;
19700 case SuspenseListComponent:
19701 retryCache = boundaryFiber.stateNode;
19702 break;
19703 default:
19704 throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
19705 }
19706 if (retryCache !== null) {
19707 retryCache.delete(wakeable);
19708 }
19709 retryTimedOutBoundary(boundaryFiber, retryLane);
19710 }
19711 function jnd(timeElapsed) {
19712 return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3e3 ? 3e3 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
19713 }
19714 function checkForNestedUpdates() {
19715 if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
19716 nestedUpdateCount = 0;
19717 rootWithNestedUpdates = null;
19718 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.");
19719 }
19720 {
19721 if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
19722 nestedPassiveUpdateCount = 0;
19723 rootWithPassiveNestedUpdates = null;
19724 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.");
19725 }
19726 }
19727 }
19728 function flushRenderPhaseStrictModeWarningsInDEV() {
19729 {
19730 ReactStrictModeWarnings.flushLegacyContextWarning();
19731 {
19732 ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
19733 }
19734 }
19735 }
19736 function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
19737 {
19738 setCurrentFiber(fiber);
19739 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
19740 if (hasPassiveEffects) {
19741 invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
19742 }
19743 invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
19744 if (hasPassiveEffects) {
19745 invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
19746 }
19747 resetCurrentFiber();
19748 }
19749 }
19750 function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
19751 {
19752 var current2 = firstChild;
19753 var subtreeRoot = null;
19754 while (current2 !== null) {
19755 var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
19756 if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
19757 current2 = current2.child;
19758 } else {
19759 if ((current2.flags & fiberFlags) !== NoFlags) {
19760 invokeEffectFn(current2);
19761 }
19762 if (current2.sibling !== null) {
19763 current2 = current2.sibling;
19764 } else {
19765 current2 = subtreeRoot = current2.return;
19766 }
19767 }
19768 }
19769 }
19770 }
19771 var didWarnStateUpdateForNotYetMountedComponent = null;
19772 function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
19773 {
19774 if ((executionContext & RenderContext) !== NoContext) {
19775 return;
19776 }
19777 if (!(fiber.mode & ConcurrentMode)) {
19778 return;
19779 }
19780 var tag = fiber.tag;
19781 if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
19782 return;
19783 }
19784 var componentName = getComponentNameFromFiber(fiber) || "ReactComponent";
19785 if (didWarnStateUpdateForNotYetMountedComponent !== null) {
19786 if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {
19787 return;
19788 }
19789 didWarnStateUpdateForNotYetMountedComponent.add(componentName);
19790 } else {
19791 didWarnStateUpdateForNotYetMountedComponent = /* @__PURE__ */ new Set([componentName]);
19792 }
19793 var previousFiber = current;
19794 try {
19795 setCurrentFiber(fiber);
19796 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.");
19797 } finally {
19798 if (previousFiber) {
19799 setCurrentFiber(fiber);
19800 } else {
19801 resetCurrentFiber();
19802 }
19803 }
19804 }
19805 }
19806 var beginWork$1;
19807 {
19808 var dummyFiber = null;
19809 beginWork$1 = function(current2, unitOfWork, lanes) {
19810 var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
19811 try {
19812 return beginWork(current2, unitOfWork, lanes);
19813 } catch (originalError) {
19814 if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
19815 throw originalError;
19816 }
19817 resetContextDependencies();
19818 resetHooksAfterThrow();
19819 unwindInterruptedWork(current2, unitOfWork);
19820 assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
19821 if (unitOfWork.mode & ProfileMode) {
19822 startProfilerTimer(unitOfWork);
19823 }
19824 invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
19825 if (hasCaughtError()) {
19826 var replayError = clearCaughtError();
19827 if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
19828 originalError._suppressLogging = true;
19829 }
19830 }
19831 throw originalError;
19832 }
19833 };
19834 }
19835 var didWarnAboutUpdateInRender = false;
19836 var didWarnAboutUpdateInRenderForAnotherComponent;
19837 {
19838 didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
19839 }
19840 function warnAboutRenderPhaseUpdatesInDEV(fiber) {
19841 {
19842 if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
19843 switch (fiber.tag) {
19844 case FunctionComponent:
19845 case ForwardRef:
19846 case SimpleMemoComponent: {
19847 var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
19848 var dedupeKey = renderingComponentName;
19849 if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
19850 didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
19851 var setStateComponentName = getComponentNameFromFiber(fiber) || "Unknown";
19852 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);
19853 }
19854 break;
19855 }
19856 case ClassComponent: {
19857 if (!didWarnAboutUpdateInRender) {
19858 error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state.");
19859 didWarnAboutUpdateInRender = true;
19860 }
19861 break;
19862 }
19863 }
19864 }
19865 }
19866 }
19867 function restorePendingUpdaters(root2, lanes) {
19868 {
19869 if (isDevToolsPresent) {
19870 var memoizedUpdaters = root2.memoizedUpdaters;
19871 memoizedUpdaters.forEach(function(schedulingFiber) {
19872 addFiberToLanesMap(root2, schedulingFiber, lanes);
19873 });
19874 }
19875 }
19876 }
19877 var fakeActCallbackNode = {};
19878 function scheduleCallback$1(priorityLevel, callback) {
19879 {
19880 var actQueue = ReactCurrentActQueue$1.current;
19881 if (actQueue !== null) {
19882 actQueue.push(callback);
19883 return fakeActCallbackNode;
19884 } else {
19885 return scheduleCallback(priorityLevel, callback);
19886 }
19887 }
19888 }
19889 function cancelCallback$1(callbackNode) {
19890 if (callbackNode === fakeActCallbackNode) {
19891 return;
19892 }
19893 return cancelCallback(callbackNode);
19894 }
19895 function shouldForceFlushFallbacksInDEV() {
19896 return ReactCurrentActQueue$1.current !== null;
19897 }
19898 function warnIfUpdatesNotWrappedWithActDEV(fiber) {
19899 {
19900 if (fiber.mode & ConcurrentMode) {
19901 if (!isConcurrentActEnvironment()) {
19902 return;
19903 }
19904 } else {
19905 if (!isLegacyActEnvironment()) {
19906 return;
19907 }
19908 if (executionContext !== NoContext) {
19909 return;
19910 }
19911 if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
19912 return;
19913 }
19914 }
19915 if (ReactCurrentActQueue$1.current === null) {
19916 var previousFiber = current;
19917 try {
19918 setCurrentFiber(fiber);
19919 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));
19920 } finally {
19921 if (previousFiber) {
19922 setCurrentFiber(fiber);
19923 } else {
19924 resetCurrentFiber();
19925 }
19926 }
19927 }
19928 }
19929 }
19930 function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
19931 {
19932 if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
19933 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");
19934 }
19935 }
19936 }
19937 function setIsRunningInsertionEffect(isRunning) {
19938 {
19939 isRunningInsertionEffect = isRunning;
19940 }
19941 }
19942 var resolveFamily = null;
19943 var failedBoundaries = null;
19944 var setRefreshHandler = function(handler) {
19945 {
19946 resolveFamily = handler;
19947 }
19948 };
19949 function resolveFunctionForHotReloading(type) {
19950 {
19951 if (resolveFamily === null) {
19952 return type;
19953 }
19954 var family = resolveFamily(type);
19955 if (family === void 0) {
19956 return type;
19957 }
19958 return family.current;
19959 }
19960 }
19961 function resolveClassForHotReloading(type) {
19962 return resolveFunctionForHotReloading(type);
19963 }
19964 function resolveForwardRefForHotReloading(type) {
19965 {
19966 if (resolveFamily === null) {
19967 return type;
19968 }
19969 var family = resolveFamily(type);
19970 if (family === void 0) {
19971 if (type !== null && type !== void 0 && typeof type.render === "function") {
19972 var currentRender = resolveFunctionForHotReloading(type.render);
19973 if (type.render !== currentRender) {
19974 var syntheticType = {
19975 $$typeof: REACT_FORWARD_REF_TYPE,
19976 render: currentRender
19977 };
19978 if (type.displayName !== void 0) {
19979 syntheticType.displayName = type.displayName;
19980 }
19981 return syntheticType;
19982 }
19983 }
19984 return type;
19985 }
19986 return family.current;
19987 }
19988 }
19989 function isCompatibleFamilyForHotReloading(fiber, element) {
19990 {
19991 if (resolveFamily === null) {
19992 return false;
19993 }
19994 var prevType = fiber.elementType;
19995 var nextType = element.type;
19996 var needsCompareFamilies = false;
19997 var $$typeofNextType = typeof nextType === "object" && nextType !== null ? nextType.$$typeof : null;
19998 switch (fiber.tag) {
19999 case ClassComponent: {
20000 if (typeof nextType === "function") {
20001 needsCompareFamilies = true;
20002 }
20003 break;
20004 }
20005 case FunctionComponent: {
20006 if (typeof nextType === "function") {
20007 needsCompareFamilies = true;
20008 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20009 needsCompareFamilies = true;
20010 }
20011 break;
20012 }
20013 case ForwardRef: {
20014 if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
20015 needsCompareFamilies = true;
20016 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20017 needsCompareFamilies = true;
20018 }
20019 break;
20020 }
20021 case MemoComponent:
20022 case SimpleMemoComponent: {
20023 if ($$typeofNextType === REACT_MEMO_TYPE) {
20024 needsCompareFamilies = true;
20025 } else if ($$typeofNextType === REACT_LAZY_TYPE) {
20026 needsCompareFamilies = true;
20027 }
20028 break;
20029 }
20030 default:
20031 return false;
20032 }
20033 if (needsCompareFamilies) {
20034 var prevFamily = resolveFamily(prevType);
20035 if (prevFamily !== void 0 && prevFamily === resolveFamily(nextType)) {
20036 return true;
20037 }
20038 }
20039 return false;
20040 }
20041 }
20042 function markFailedErrorBoundaryForHotReloading(fiber) {
20043 {
20044 if (resolveFamily === null) {
20045 return;
20046 }
20047 if (typeof WeakSet !== "function") {
20048 return;
20049 }
20050 if (failedBoundaries === null) {
20051 failedBoundaries = /* @__PURE__ */ new WeakSet();
20052 }
20053 failedBoundaries.add(fiber);
20054 }
20055 }
20056 var scheduleRefresh = function(root2, update) {
20057 {
20058 if (resolveFamily === null) {
20059 return;
20060 }
20061 var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
20062 flushPassiveEffects();
20063 flushSync(function() {
20064 scheduleFibersWithFamiliesRecursively(root2.current, updatedFamilies, staleFamilies);
20065 });
20066 }
20067 };
20068 var scheduleRoot = function(root2, element) {
20069 {
20070 if (root2.context !== emptyContextObject) {
20071 return;
20072 }
20073 flushPassiveEffects();
20074 flushSync(function() {
20075 updateContainer(element, root2, null, null);
20076 });
20077 }
20078 };
20079 function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
20080 {
20081 var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
20082 var candidateType = null;
20083 switch (tag) {
20084 case FunctionComponent:
20085 case SimpleMemoComponent:
20086 case ClassComponent:
20087 candidateType = type;
20088 break;
20089 case ForwardRef:
20090 candidateType = type.render;
20091 break;
20092 }
20093 if (resolveFamily === null) {
20094 throw new Error("Expected resolveFamily to be set during hot reload.");
20095 }
20096 var needsRender = false;
20097 var needsRemount = false;
20098 if (candidateType !== null) {
20099 var family = resolveFamily(candidateType);
20100 if (family !== void 0) {
20101 if (staleFamilies.has(family)) {
20102 needsRemount = true;
20103 } else if (updatedFamilies.has(family)) {
20104 if (tag === ClassComponent) {
20105 needsRemount = true;
20106 } else {
20107 needsRender = true;
20108 }
20109 }
20110 }
20111 }
20112 if (failedBoundaries !== null) {
20113 if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
20114 needsRemount = true;
20115 }
20116 }
20117 if (needsRemount) {
20118 fiber._debugNeedsRemount = true;
20119 }
20120 if (needsRemount || needsRender) {
20121 var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
20122 if (_root !== null) {
20123 scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
20124 }
20125 }
20126 if (child !== null && !needsRemount) {
20127 scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
20128 }
20129 if (sibling !== null) {
20130 scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
20131 }
20132 }
20133 }
20134 var findHostInstancesForRefresh = function(root2, families) {
20135 {
20136 var hostInstances = /* @__PURE__ */ new Set();
20137 var types = new Set(families.map(function(family) {
20138 return family.current;
20139 }));
20140 findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances);
20141 return hostInstances;
20142 }
20143 };
20144 function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
20145 {
20146 var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type;
20147 var candidateType = null;
20148 switch (tag) {
20149 case FunctionComponent:
20150 case SimpleMemoComponent:
20151 case ClassComponent:
20152 candidateType = type;
20153 break;
20154 case ForwardRef:
20155 candidateType = type.render;
20156 break;
20157 }
20158 var didMatch = false;
20159 if (candidateType !== null) {
20160 if (types.has(candidateType)) {
20161 didMatch = true;
20162 }
20163 }
20164 if (didMatch) {
20165 findHostInstancesForFiberShallowly(fiber, hostInstances);
20166 } else {
20167 if (child !== null) {
20168 findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
20169 }
20170 }
20171 if (sibling !== null) {
20172 findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
20173 }
20174 }
20175 }
20176 function findHostInstancesForFiberShallowly(fiber, hostInstances) {
20177 {
20178 var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
20179 if (foundHostInstances) {
20180 return;
20181 }
20182 var node = fiber;
20183 while (true) {
20184 switch (node.tag) {
20185 case HostComponent:
20186 hostInstances.add(node.stateNode);
20187 return;
20188 case HostPortal:
20189 hostInstances.add(node.stateNode.containerInfo);
20190 return;
20191 case HostRoot:
20192 hostInstances.add(node.stateNode.containerInfo);
20193 return;
20194 }
20195 if (node.return === null) {
20196 throw new Error("Expected to reach root first.");
20197 }
20198 node = node.return;
20199 }
20200 }
20201 }
20202 function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
20203 {
20204 var node = fiber;
20205 var foundHostInstances = false;
20206 while (true) {
20207 if (node.tag === HostComponent) {
20208 foundHostInstances = true;
20209 hostInstances.add(node.stateNode);
20210 } else if (node.child !== null) {
20211 node.child.return = node;
20212 node = node.child;
20213 continue;
20214 }
20215 if (node === fiber) {
20216 return foundHostInstances;
20217 }
20218 while (node.sibling === null) {
20219 if (node.return === null || node.return === fiber) {
20220 return foundHostInstances;
20221 }
20222 node = node.return;
20223 }
20224 node.sibling.return = node.return;
20225 node = node.sibling;
20226 }
20227 }
20228 return false;
20229 }
20230 var hasBadMapPolyfill;
20231 {
20232 hasBadMapPolyfill = false;
20233 try {
20234 var nonExtensibleObject = Object.preventExtensions({});
20235 /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
20236 /* @__PURE__ */ new Set([nonExtensibleObject]);
20237 } catch (e) {
20238 hasBadMapPolyfill = true;
20239 }
20240 }
20241 function FiberNode(tag, pendingProps, key, mode) {
20242 this.tag = tag;
20243 this.key = key;
20244 this.elementType = null;
20245 this.type = null;
20246 this.stateNode = null;
20247 this.return = null;
20248 this.child = null;
20249 this.sibling = null;
20250 this.index = 0;
20251 this.ref = null;
20252 this.pendingProps = pendingProps;
20253 this.memoizedProps = null;
20254 this.updateQueue = null;
20255 this.memoizedState = null;
20256 this.dependencies = null;
20257 this.mode = mode;
20258 this.flags = NoFlags;
20259 this.subtreeFlags = NoFlags;
20260 this.deletions = null;
20261 this.lanes = NoLanes;
20262 this.childLanes = NoLanes;
20263 this.alternate = null;
20264 {
20265 this.actualDuration = Number.NaN;
20266 this.actualStartTime = Number.NaN;
20267 this.selfBaseDuration = Number.NaN;
20268 this.treeBaseDuration = Number.NaN;
20269 this.actualDuration = 0;
20270 this.actualStartTime = -1;
20271 this.selfBaseDuration = 0;
20272 this.treeBaseDuration = 0;
20273 }
20274 {
20275 this._debugSource = null;
20276 this._debugOwner = null;
20277 this._debugNeedsRemount = false;
20278 this._debugHookTypes = null;
20279 if (!hasBadMapPolyfill && typeof Object.preventExtensions === "function") {
20280 Object.preventExtensions(this);
20281 }
20282 }
20283 }
20284 var createFiber = function(tag, pendingProps, key, mode) {
20285 return new FiberNode(tag, pendingProps, key, mode);
20286 };
20287 function shouldConstruct$1(Component) {
20288 var prototype = Component.prototype;
20289 return !!(prototype && prototype.isReactComponent);
20290 }
20291 function isSimpleFunctionComponent(type) {
20292 return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
20293 }
20294 function resolveLazyComponentTag(Component) {
20295 if (typeof Component === "function") {
20296 return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;
20297 } else if (Component !== void 0 && Component !== null) {
20298 var $$typeof = Component.$$typeof;
20299 if ($$typeof === REACT_FORWARD_REF_TYPE) {
20300 return ForwardRef;
20301 }
20302 if ($$typeof === REACT_MEMO_TYPE) {
20303 return MemoComponent;
20304 }
20305 }
20306 return IndeterminateComponent;
20307 }
20308 function createWorkInProgress(current2, pendingProps) {
20309 var workInProgress2 = current2.alternate;
20310 if (workInProgress2 === null) {
20311 workInProgress2 = createFiber(current2.tag, pendingProps, current2.key, current2.mode);
20312 workInProgress2.elementType = current2.elementType;
20313 workInProgress2.type = current2.type;
20314 workInProgress2.stateNode = current2.stateNode;
20315 {
20316 workInProgress2._debugSource = current2._debugSource;
20317 workInProgress2._debugOwner = current2._debugOwner;
20318 workInProgress2._debugHookTypes = current2._debugHookTypes;
20319 }
20320 workInProgress2.alternate = current2;
20321 current2.alternate = workInProgress2;
20322 } else {
20323 workInProgress2.pendingProps = pendingProps;
20324 workInProgress2.type = current2.type;
20325 workInProgress2.flags = NoFlags;
20326 workInProgress2.subtreeFlags = NoFlags;
20327 workInProgress2.deletions = null;
20328 {
20329 workInProgress2.actualDuration = 0;
20330 workInProgress2.actualStartTime = -1;
20331 }
20332 }
20333 workInProgress2.flags = current2.flags & StaticMask;
20334 workInProgress2.childLanes = current2.childLanes;
20335 workInProgress2.lanes = current2.lanes;
20336 workInProgress2.child = current2.child;
20337 workInProgress2.memoizedProps = current2.memoizedProps;
20338 workInProgress2.memoizedState = current2.memoizedState;
20339 workInProgress2.updateQueue = current2.updateQueue;
20340 var currentDependencies = current2.dependencies;
20341 workInProgress2.dependencies = currentDependencies === null ? null : {
20342 lanes: currentDependencies.lanes,
20343 firstContext: currentDependencies.firstContext
20344 };
20345 workInProgress2.sibling = current2.sibling;
20346 workInProgress2.index = current2.index;
20347 workInProgress2.ref = current2.ref;
20348 {
20349 workInProgress2.selfBaseDuration = current2.selfBaseDuration;
20350 workInProgress2.treeBaseDuration = current2.treeBaseDuration;
20351 }
20352 {
20353 workInProgress2._debugNeedsRemount = current2._debugNeedsRemount;
20354 switch (workInProgress2.tag) {
20355 case IndeterminateComponent:
20356 case FunctionComponent:
20357 case SimpleMemoComponent:
20358 workInProgress2.type = resolveFunctionForHotReloading(current2.type);
20359 break;
20360 case ClassComponent:
20361 workInProgress2.type = resolveClassForHotReloading(current2.type);
20362 break;
20363 case ForwardRef:
20364 workInProgress2.type = resolveForwardRefForHotReloading(current2.type);
20365 break;
20366 }
20367 }
20368 return workInProgress2;
20369 }
20370 function resetWorkInProgress(workInProgress2, renderLanes2) {
20371 workInProgress2.flags &= StaticMask | Placement;
20372 var current2 = workInProgress2.alternate;
20373 if (current2 === null) {
20374 workInProgress2.childLanes = NoLanes;
20375 workInProgress2.lanes = renderLanes2;
20376 workInProgress2.child = null;
20377 workInProgress2.subtreeFlags = NoFlags;
20378 workInProgress2.memoizedProps = null;
20379 workInProgress2.memoizedState = null;
20380 workInProgress2.updateQueue = null;
20381 workInProgress2.dependencies = null;
20382 workInProgress2.stateNode = null;
20383 {
20384 workInProgress2.selfBaseDuration = 0;
20385 workInProgress2.treeBaseDuration = 0;
20386 }
20387 } else {
20388 workInProgress2.childLanes = current2.childLanes;
20389 workInProgress2.lanes = current2.lanes;
20390 workInProgress2.child = current2.child;
20391 workInProgress2.subtreeFlags = NoFlags;
20392 workInProgress2.deletions = null;
20393 workInProgress2.memoizedProps = current2.memoizedProps;
20394 workInProgress2.memoizedState = current2.memoizedState;
20395 workInProgress2.updateQueue = current2.updateQueue;
20396 workInProgress2.type = current2.type;
20397 var currentDependencies = current2.dependencies;
20398 workInProgress2.dependencies = currentDependencies === null ? null : {
20399 lanes: currentDependencies.lanes,
20400 firstContext: currentDependencies.firstContext
20401 };
20402 {
20403 workInProgress2.selfBaseDuration = current2.selfBaseDuration;
20404 workInProgress2.treeBaseDuration = current2.treeBaseDuration;
20405 }
20406 }
20407 return workInProgress2;
20408 }
20409 function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) {
20410 var mode;
20411 if (tag === ConcurrentRoot) {
20412 mode = ConcurrentMode;
20413 if (isStrictMode === true) {
20414 mode |= StrictLegacyMode;
20415 {
20416 mode |= StrictEffectsMode;
20417 }
20418 }
20419 } else {
20420 mode = NoMode;
20421 }
20422 if (isDevToolsPresent) {
20423 mode |= ProfileMode;
20424 }
20425 return createFiber(HostRoot, null, null, mode);
20426 }
20427 function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
20428 var fiberTag = IndeterminateComponent;
20429 var resolvedType = type;
20430 if (typeof type === "function") {
20431 if (shouldConstruct$1(type)) {
20432 fiberTag = ClassComponent;
20433 {
20434 resolvedType = resolveClassForHotReloading(resolvedType);
20435 }
20436 } else {
20437 {
20438 resolvedType = resolveFunctionForHotReloading(resolvedType);
20439 }
20440 }
20441 } else if (typeof type === "string") {
20442 fiberTag = HostComponent;
20443 } else {
20444 getTag: switch (type) {
20445 case REACT_FRAGMENT_TYPE:
20446 return createFiberFromFragment(pendingProps.children, mode, lanes, key);
20447 case REACT_STRICT_MODE_TYPE:
20448 fiberTag = Mode;
20449 mode |= StrictLegacyMode;
20450 if ((mode & ConcurrentMode) !== NoMode) {
20451 mode |= StrictEffectsMode;
20452 }
20453 break;
20454 case REACT_PROFILER_TYPE:
20455 return createFiberFromProfiler(pendingProps, mode, lanes, key);
20456 case REACT_SUSPENSE_TYPE:
20457 return createFiberFromSuspense(pendingProps, mode, lanes, key);
20458 case REACT_SUSPENSE_LIST_TYPE:
20459 return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
20460 case REACT_OFFSCREEN_TYPE:
20461 return createFiberFromOffscreen(pendingProps, mode, lanes, key);
20462 case REACT_LEGACY_HIDDEN_TYPE:
20463 // eslint-disable-next-line no-fallthrough
20464 case REACT_SCOPE_TYPE:
20465 // eslint-disable-next-line no-fallthrough
20466 case REACT_CACHE_TYPE:
20467 // eslint-disable-next-line no-fallthrough
20468 case REACT_TRACING_MARKER_TYPE:
20469 // eslint-disable-next-line no-fallthrough
20470 case REACT_DEBUG_TRACING_MODE_TYPE:
20471 // eslint-disable-next-line no-fallthrough
20472 default: {
20473 if (typeof type === "object" && type !== null) {
20474 switch (type.$$typeof) {
20475 case REACT_PROVIDER_TYPE:
20476 fiberTag = ContextProvider;
20477 break getTag;
20478 case REACT_CONTEXT_TYPE:
20479 fiberTag = ContextConsumer;
20480 break getTag;
20481 case REACT_FORWARD_REF_TYPE:
20482 fiberTag = ForwardRef;
20483 {
20484 resolvedType = resolveForwardRefForHotReloading(resolvedType);
20485 }
20486 break getTag;
20487 case REACT_MEMO_TYPE:
20488 fiberTag = MemoComponent;
20489 break getTag;
20490 case REACT_LAZY_TYPE:
20491 fiberTag = LazyComponent;
20492 resolvedType = null;
20493 break getTag;
20494 }
20495 }
20496 var info = "";
20497 {
20498 if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
20499 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.";
20500 }
20501 var ownerName = owner ? getComponentNameFromFiber(owner) : null;
20502 if (ownerName) {
20503 info += "\n\nCheck the render method of `" + ownerName + "`.";
20504 }
20505 }
20506 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));
20507 }
20508 }
20509 }
20510 var fiber = createFiber(fiberTag, pendingProps, key, mode);
20511 fiber.elementType = type;
20512 fiber.type = resolvedType;
20513 fiber.lanes = lanes;
20514 {
20515 fiber._debugOwner = owner;
20516 }
20517 return fiber;
20518 }
20519 function createFiberFromElement(element, mode, lanes) {
20520 var owner = null;
20521 {
20522 owner = element._owner;
20523 }
20524 var type = element.type;
20525 var key = element.key;
20526 var pendingProps = element.props;
20527 var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
20528 {
20529 fiber._debugSource = element._source;
20530 fiber._debugOwner = element._owner;
20531 }
20532 return fiber;
20533 }
20534 function createFiberFromFragment(elements, mode, lanes, key) {
20535 var fiber = createFiber(Fragment, elements, key, mode);
20536 fiber.lanes = lanes;
20537 return fiber;
20538 }
20539 function createFiberFromProfiler(pendingProps, mode, lanes, key) {
20540 {
20541 if (typeof pendingProps.id !== "string") {
20542 error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
20543 }
20544 }
20545 var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
20546 fiber.elementType = REACT_PROFILER_TYPE;
20547 fiber.lanes = lanes;
20548 {
20549 fiber.stateNode = {
20550 effectDuration: 0,
20551 passiveEffectDuration: 0
20552 };
20553 }
20554 return fiber;
20555 }
20556 function createFiberFromSuspense(pendingProps, mode, lanes, key) {
20557 var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
20558 fiber.elementType = REACT_SUSPENSE_TYPE;
20559 fiber.lanes = lanes;
20560 return fiber;
20561 }
20562 function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
20563 var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
20564 fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
20565 fiber.lanes = lanes;
20566 return fiber;
20567 }
20568 function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
20569 var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
20570 fiber.elementType = REACT_OFFSCREEN_TYPE;
20571 fiber.lanes = lanes;
20572 var primaryChildInstance = {
20573 isHidden: false
20574 };
20575 fiber.stateNode = primaryChildInstance;
20576 return fiber;
20577 }
20578 function createFiberFromText(content, mode, lanes) {
20579 var fiber = createFiber(HostText, content, null, mode);
20580 fiber.lanes = lanes;
20581 return fiber;
20582 }
20583 function createFiberFromHostInstanceForDeletion() {
20584 var fiber = createFiber(HostComponent, null, null, NoMode);
20585 fiber.elementType = "DELETED";
20586 return fiber;
20587 }
20588 function createFiberFromDehydratedFragment(dehydratedNode) {
20589 var fiber = createFiber(DehydratedFragment, null, null, NoMode);
20590 fiber.stateNode = dehydratedNode;
20591 return fiber;
20592 }
20593 function createFiberFromPortal(portal, mode, lanes) {
20594 var pendingProps = portal.children !== null ? portal.children : [];
20595 var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
20596 fiber.lanes = lanes;
20597 fiber.stateNode = {
20598 containerInfo: portal.containerInfo,
20599 pendingChildren: null,
20600 // Used by persistent updates
20601 implementation: portal.implementation
20602 };
20603 return fiber;
20604 }
20605 function assignFiberPropertiesInDEV(target, source) {
20606 if (target === null) {
20607 target = createFiber(IndeterminateComponent, null, null, NoMode);
20608 }
20609 target.tag = source.tag;
20610 target.key = source.key;
20611 target.elementType = source.elementType;
20612 target.type = source.type;
20613 target.stateNode = source.stateNode;
20614 target.return = source.return;
20615 target.child = source.child;
20616 target.sibling = source.sibling;
20617 target.index = source.index;
20618 target.ref = source.ref;
20619 target.pendingProps = source.pendingProps;
20620 target.memoizedProps = source.memoizedProps;
20621 target.updateQueue = source.updateQueue;
20622 target.memoizedState = source.memoizedState;
20623 target.dependencies = source.dependencies;
20624 target.mode = source.mode;
20625 target.flags = source.flags;
20626 target.subtreeFlags = source.subtreeFlags;
20627 target.deletions = source.deletions;
20628 target.lanes = source.lanes;
20629 target.childLanes = source.childLanes;
20630 target.alternate = source.alternate;
20631 {
20632 target.actualDuration = source.actualDuration;
20633 target.actualStartTime = source.actualStartTime;
20634 target.selfBaseDuration = source.selfBaseDuration;
20635 target.treeBaseDuration = source.treeBaseDuration;
20636 }
20637 target._debugSource = source._debugSource;
20638 target._debugOwner = source._debugOwner;
20639 target._debugNeedsRemount = source._debugNeedsRemount;
20640 target._debugHookTypes = source._debugHookTypes;
20641 return target;
20642 }
20643 function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
20644 this.tag = tag;
20645 this.containerInfo = containerInfo;
20646 this.pendingChildren = null;
20647 this.current = null;
20648 this.pingCache = null;
20649 this.finishedWork = null;
20650 this.timeoutHandle = noTimeout;
20651 this.context = null;
20652 this.pendingContext = null;
20653 this.callbackNode = null;
20654 this.callbackPriority = NoLane;
20655 this.eventTimes = createLaneMap(NoLanes);
20656 this.expirationTimes = createLaneMap(NoTimestamp);
20657 this.pendingLanes = NoLanes;
20658 this.suspendedLanes = NoLanes;
20659 this.pingedLanes = NoLanes;
20660 this.expiredLanes = NoLanes;
20661 this.mutableReadLanes = NoLanes;
20662 this.finishedLanes = NoLanes;
20663 this.entangledLanes = NoLanes;
20664 this.entanglements = createLaneMap(NoLanes);
20665 this.identifierPrefix = identifierPrefix;
20666 this.onRecoverableError = onRecoverableError;
20667 {
20668 this.mutableSourceEagerHydrationData = null;
20669 }
20670 {
20671 this.effectDuration = 0;
20672 this.passiveEffectDuration = 0;
20673 }
20674 {
20675 this.memoizedUpdaters = /* @__PURE__ */ new Set();
20676 var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
20677 for (var _i = 0; _i < TotalLanes; _i++) {
20678 pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
20679 }
20680 }
20681 {
20682 switch (tag) {
20683 case ConcurrentRoot:
20684 this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
20685 break;
20686 case LegacyRoot:
20687 this._debugRootType = hydrate2 ? "hydrate()" : "render()";
20688 break;
20689 }
20690 }
20691 }
20692 function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20693 var root2 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
20694 var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
20695 root2.current = uninitializedFiber;
20696 uninitializedFiber.stateNode = root2;
20697 {
20698 var _initialState = {
20699 element: initialChildren,
20700 isDehydrated: hydrate2,
20701 cache: null,
20702 // not enabled yet
20703 transitions: null,
20704 pendingSuspenseBoundaries: null
20705 };
20706 uninitializedFiber.memoizedState = _initialState;
20707 }
20708 initializeUpdateQueue(uninitializedFiber);
20709 return root2;
20710 }
20711 var ReactVersion = "18.3.1";
20712 function createPortal(children, containerInfo, implementation) {
20713 var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
20714 {
20715 checkKeyStringCoercion(key);
20716 }
20717 return {
20718 // This tag allow us to uniquely identify this as a React Portal
20719 $$typeof: REACT_PORTAL_TYPE,
20720 key: key == null ? null : "" + key,
20721 children,
20722 containerInfo,
20723 implementation
20724 };
20725 }
20726 var didWarnAboutNestedUpdates;
20727 var didWarnAboutFindNodeInStrictMode;
20728 {
20729 didWarnAboutNestedUpdates = false;
20730 didWarnAboutFindNodeInStrictMode = {};
20731 }
20732 function getContextForSubtree(parentComponent) {
20733 if (!parentComponent) {
20734 return emptyContextObject;
20735 }
20736 var fiber = get(parentComponent);
20737 var parentContext = findCurrentUnmaskedContext(fiber);
20738 if (fiber.tag === ClassComponent) {
20739 var Component = fiber.type;
20740 if (isContextProvider(Component)) {
20741 return processChildContext(fiber, Component, parentContext);
20742 }
20743 }
20744 return parentContext;
20745 }
20746 function findHostInstanceWithWarning(component, methodName) {
20747 {
20748 var fiber = get(component);
20749 if (fiber === void 0) {
20750 if (typeof component.render === "function") {
20751 throw new Error("Unable to find node on an unmounted component.");
20752 } else {
20753 var keys = Object.keys(component).join(",");
20754 throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys);
20755 }
20756 }
20757 var hostFiber = findCurrentHostFiber(fiber);
20758 if (hostFiber === null) {
20759 return null;
20760 }
20761 if (hostFiber.mode & StrictLegacyMode) {
20762 var componentName = getComponentNameFromFiber(fiber) || "Component";
20763 if (!didWarnAboutFindNodeInStrictMode[componentName]) {
20764 didWarnAboutFindNodeInStrictMode[componentName] = true;
20765 var previousFiber = current;
20766 try {
20767 setCurrentFiber(hostFiber);
20768 if (fiber.mode & StrictLegacyMode) {
20769 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);
20770 } else {
20771 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);
20772 }
20773 } finally {
20774 if (previousFiber) {
20775 setCurrentFiber(previousFiber);
20776 } else {
20777 resetCurrentFiber();
20778 }
20779 }
20780 }
20781 }
20782 return hostFiber.stateNode;
20783 }
20784 }
20785 function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20786 var hydrate2 = false;
20787 var initialChildren = null;
20788 return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
20789 }
20790 function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
20791 var hydrate2 = true;
20792 var root2 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
20793 root2.context = getContextForSubtree(null);
20794 var current2 = root2.current;
20795 var eventTime = requestEventTime();
20796 var lane = requestUpdateLane(current2);
20797 var update = createUpdate(eventTime, lane);
20798 update.callback = callback !== void 0 && callback !== null ? callback : null;
20799 enqueueUpdate(current2, update, lane);
20800 scheduleInitialHydrationOnRoot(root2, lane, eventTime);
20801 return root2;
20802 }
20803 function updateContainer(element, container, parentComponent, callback) {
20804 {
20805 onScheduleRoot(container, element);
20806 }
20807 var current$1 = container.current;
20808 var eventTime = requestEventTime();
20809 var lane = requestUpdateLane(current$1);
20810 {
20811 markRenderScheduled(lane);
20812 }
20813 var context = getContextForSubtree(parentComponent);
20814 if (container.context === null) {
20815 container.context = context;
20816 } else {
20817 container.pendingContext = context;
20818 }
20819 {
20820 if (isRendering && current !== null && !didWarnAboutNestedUpdates) {
20821 didWarnAboutNestedUpdates = true;
20822 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");
20823 }
20824 }
20825 var update = createUpdate(eventTime, lane);
20826 update.payload = {
20827 element
20828 };
20829 callback = callback === void 0 ? null : callback;
20830 if (callback !== null) {
20831 {
20832 if (typeof callback !== "function") {
20833 error("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callback);
20834 }
20835 }
20836 update.callback = callback;
20837 }
20838 var root2 = enqueueUpdate(current$1, update, lane);
20839 if (root2 !== null) {
20840 scheduleUpdateOnFiber(root2, current$1, lane, eventTime);
20841 entangleTransitions(root2, current$1, lane);
20842 }
20843 return lane;
20844 }
20845 function getPublicRootInstance(container) {
20846 var containerFiber = container.current;
20847 if (!containerFiber.child) {
20848 return null;
20849 }
20850 switch (containerFiber.child.tag) {
20851 case HostComponent:
20852 return getPublicInstance(containerFiber.child.stateNode);
20853 default:
20854 return containerFiber.child.stateNode;
20855 }
20856 }
20857 function attemptSynchronousHydration$1(fiber) {
20858 switch (fiber.tag) {
20859 case HostRoot: {
20860 var root2 = fiber.stateNode;
20861 if (isRootDehydrated(root2)) {
20862 var lanes = getHighestPriorityPendingLanes(root2);
20863 flushRoot(root2, lanes);
20864 }
20865 break;
20866 }
20867 case SuspenseComponent: {
20868 flushSync(function() {
20869 var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
20870 if (root3 !== null) {
20871 var eventTime = requestEventTime();
20872 scheduleUpdateOnFiber(root3, fiber, SyncLane, eventTime);
20873 }
20874 });
20875 var retryLane = SyncLane;
20876 markRetryLaneIfNotHydrated(fiber, retryLane);
20877 break;
20878 }
20879 }
20880 }
20881 function markRetryLaneImpl(fiber, retryLane) {
20882 var suspenseState = fiber.memoizedState;
20883 if (suspenseState !== null && suspenseState.dehydrated !== null) {
20884 suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);
20885 }
20886 }
20887 function markRetryLaneIfNotHydrated(fiber, retryLane) {
20888 markRetryLaneImpl(fiber, retryLane);
20889 var alternate = fiber.alternate;
20890 if (alternate) {
20891 markRetryLaneImpl(alternate, retryLane);
20892 }
20893 }
20894 function attemptContinuousHydration$1(fiber) {
20895 if (fiber.tag !== SuspenseComponent) {
20896 return;
20897 }
20898 var lane = SelectiveHydrationLane;
20899 var root2 = enqueueConcurrentRenderForLane(fiber, lane);
20900 if (root2 !== null) {
20901 var eventTime = requestEventTime();
20902 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
20903 }
20904 markRetryLaneIfNotHydrated(fiber, lane);
20905 }
20906 function attemptHydrationAtCurrentPriority$1(fiber) {
20907 if (fiber.tag !== SuspenseComponent) {
20908 return;
20909 }
20910 var lane = requestUpdateLane(fiber);
20911 var root2 = enqueueConcurrentRenderForLane(fiber, lane);
20912 if (root2 !== null) {
20913 var eventTime = requestEventTime();
20914 scheduleUpdateOnFiber(root2, fiber, lane, eventTime);
20915 }
20916 markRetryLaneIfNotHydrated(fiber, lane);
20917 }
20918 function findHostInstanceWithNoPortals(fiber) {
20919 var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
20920 if (hostFiber === null) {
20921 return null;
20922 }
20923 return hostFiber.stateNode;
20924 }
20925 var shouldErrorImpl = function(fiber) {
20926 return null;
20927 };
20928 function shouldError(fiber) {
20929 return shouldErrorImpl(fiber);
20930 }
20931 var shouldSuspendImpl = function(fiber) {
20932 return false;
20933 };
20934 function shouldSuspend(fiber) {
20935 return shouldSuspendImpl(fiber);
20936 }
20937 var overrideHookState = null;
20938 var overrideHookStateDeletePath = null;
20939 var overrideHookStateRenamePath = null;
20940 var overrideProps = null;
20941 var overridePropsDeletePath = null;
20942 var overridePropsRenamePath = null;
20943 var scheduleUpdate = null;
20944 var setErrorHandler = null;
20945 var setSuspenseHandler = null;
20946 {
20947 var copyWithDeleteImpl = function(obj, path, index2) {
20948 var key = path[index2];
20949 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
20950 if (index2 + 1 === path.length) {
20951 if (isArray(updated)) {
20952 updated.splice(key, 1);
20953 } else {
20954 delete updated[key];
20955 }
20956 return updated;
20957 }
20958 updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1);
20959 return updated;
20960 };
20961 var copyWithDelete = function(obj, path) {
20962 return copyWithDeleteImpl(obj, path, 0);
20963 };
20964 var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
20965 var oldKey = oldPath[index2];
20966 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
20967 if (index2 + 1 === oldPath.length) {
20968 var newKey = newPath[index2];
20969 updated[newKey] = updated[oldKey];
20970 if (isArray(updated)) {
20971 updated.splice(oldKey, 1);
20972 } else {
20973 delete updated[oldKey];
20974 }
20975 } else {
20976 updated[oldKey] = copyWithRenameImpl(
20977 // $FlowFixMe number or string is fine here
20978 obj[oldKey],
20979 oldPath,
20980 newPath,
20981 index2 + 1
20982 );
20983 }
20984 return updated;
20985 };
20986 var copyWithRename = function(obj, oldPath, newPath) {
20987 if (oldPath.length !== newPath.length) {
20988 warn("copyWithRename() expects paths of the same length");
20989 return;
20990 } else {
20991 for (var i = 0; i < newPath.length - 1; i++) {
20992 if (oldPath[i] !== newPath[i]) {
20993 warn("copyWithRename() expects paths to be the same except for the deepest key");
20994 return;
20995 }
20996 }
20997 }
20998 return copyWithRenameImpl(obj, oldPath, newPath, 0);
20999 };
21000 var copyWithSetImpl = function(obj, path, index2, value) {
21001 if (index2 >= path.length) {
21002 return value;
21003 }
21004 var key = path[index2];
21005 var updated = isArray(obj) ? obj.slice() : assign({}, obj);
21006 updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value);
21007 return updated;
21008 };
21009 var copyWithSet = function(obj, path, value) {
21010 return copyWithSetImpl(obj, path, 0, value);
21011 };
21012 var findHook = function(fiber, id) {
21013 var currentHook2 = fiber.memoizedState;
21014 while (currentHook2 !== null && id > 0) {
21015 currentHook2 = currentHook2.next;
21016 id--;
21017 }
21018 return currentHook2;
21019 };
21020 overrideHookState = function(fiber, id, path, value) {
21021 var hook = findHook(fiber, id);
21022 if (hook !== null) {
21023 var newState = copyWithSet(hook.memoizedState, path, value);
21024 hook.memoizedState = newState;
21025 hook.baseState = newState;
21026 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21027 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21028 if (root2 !== null) {
21029 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21030 }
21031 }
21032 };
21033 overrideHookStateDeletePath = function(fiber, id, path) {
21034 var hook = findHook(fiber, id);
21035 if (hook !== null) {
21036 var newState = copyWithDelete(hook.memoizedState, path);
21037 hook.memoizedState = newState;
21038 hook.baseState = newState;
21039 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21040 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21041 if (root2 !== null) {
21042 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21043 }
21044 }
21045 };
21046 overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
21047 var hook = findHook(fiber, id);
21048 if (hook !== null) {
21049 var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
21050 hook.memoizedState = newState;
21051 hook.baseState = newState;
21052 fiber.memoizedProps = assign({}, fiber.memoizedProps);
21053 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21054 if (root2 !== null) {
21055 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21056 }
21057 }
21058 };
21059 overrideProps = function(fiber, path, value) {
21060 fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
21061 if (fiber.alternate) {
21062 fiber.alternate.pendingProps = fiber.pendingProps;
21063 }
21064 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21065 if (root2 !== null) {
21066 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21067 }
21068 };
21069 overridePropsDeletePath = function(fiber, path) {
21070 fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);
21071 if (fiber.alternate) {
21072 fiber.alternate.pendingProps = fiber.pendingProps;
21073 }
21074 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21075 if (root2 !== null) {
21076 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21077 }
21078 };
21079 overridePropsRenamePath = function(fiber, oldPath, newPath) {
21080 fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
21081 if (fiber.alternate) {
21082 fiber.alternate.pendingProps = fiber.pendingProps;
21083 }
21084 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21085 if (root2 !== null) {
21086 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21087 }
21088 };
21089 scheduleUpdate = function(fiber) {
21090 var root2 = enqueueConcurrentRenderForLane(fiber, SyncLane);
21091 if (root2 !== null) {
21092 scheduleUpdateOnFiber(root2, fiber, SyncLane, NoTimestamp);
21093 }
21094 };
21095 setErrorHandler = function(newShouldErrorImpl) {
21096 shouldErrorImpl = newShouldErrorImpl;
21097 };
21098 setSuspenseHandler = function(newShouldSuspendImpl) {
21099 shouldSuspendImpl = newShouldSuspendImpl;
21100 };
21101 }
21102 function findHostInstanceByFiber(fiber) {
21103 var hostFiber = findCurrentHostFiber(fiber);
21104 if (hostFiber === null) {
21105 return null;
21106 }
21107 return hostFiber.stateNode;
21108 }
21109 function emptyFindFiberByHostInstance(instance) {
21110 return null;
21111 }
21112 function getCurrentFiberForDevTools() {
21113 return current;
21114 }
21115 function injectIntoDevTools(devToolsConfig) {
21116 var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
21117 var ReactCurrentDispatcher2 = ReactSharedInternals.ReactCurrentDispatcher;
21118 return injectInternals({
21119 bundleType: devToolsConfig.bundleType,
21120 version: devToolsConfig.version,
21121 rendererPackageName: devToolsConfig.rendererPackageName,
21122 rendererConfig: devToolsConfig.rendererConfig,
21123 overrideHookState,
21124 overrideHookStateDeletePath,
21125 overrideHookStateRenamePath,
21126 overrideProps,
21127 overridePropsDeletePath,
21128 overridePropsRenamePath,
21129 setErrorHandler,
21130 setSuspenseHandler,
21131 scheduleUpdate,
21132 currentDispatcherRef: ReactCurrentDispatcher2,
21133 findHostInstanceByFiber,
21134 findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
21135 // React Refresh
21136 findHostInstancesForRefresh,
21137 scheduleRefresh,
21138 scheduleRoot,
21139 setRefreshHandler,
21140 // Enables DevTools to append owner stacks to error messages in DEV mode.
21141 getCurrentFiber: getCurrentFiberForDevTools,
21142 // Enables DevTools to detect reconciler version rather than renderer version
21143 // which may not match for third party renderers.
21144 reconcilerVersion: ReactVersion
21145 });
21146 }
21147 var defaultOnRecoverableError = typeof reportError === "function" ? (
21148 // In modern browsers, reportError will dispatch an error event,
21149 // emulating an uncaught JavaScript error.
21150 reportError
21151 ) : function(error2) {
21152 console["error"](error2);
21153 };
21154 function ReactDOMRoot(internalRoot) {
21155 this._internalRoot = internalRoot;
21156 }
21157 ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
21158 var root2 = this._internalRoot;
21159 if (root2 === null) {
21160 throw new Error("Cannot update an unmounted root.");
21161 }
21162 {
21163 if (typeof arguments[1] === "function") {
21164 error("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
21165 } else if (isValidContainer(arguments[1])) {
21166 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.");
21167 } else if (typeof arguments[1] !== "undefined") {
21168 error("You passed a second argument to root.render(...) but it only accepts one argument.");
21169 }
21170 var container = root2.containerInfo;
21171 if (container.nodeType !== COMMENT_NODE) {
21172 var hostInstance = findHostInstanceWithNoPortals(root2.current);
21173 if (hostInstance) {
21174 if (hostInstance.parentNode !== container) {
21175 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.");
21176 }
21177 }
21178 }
21179 }
21180 updateContainer(children, root2, null, null);
21181 };
21182 ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
21183 {
21184 if (typeof arguments[0] === "function") {
21185 error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
21186 }
21187 }
21188 var root2 = this._internalRoot;
21189 if (root2 !== null) {
21190 this._internalRoot = null;
21191 var container = root2.containerInfo;
21192 {
21193 if (isAlreadyRendering()) {
21194 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.");
21195 }
21196 }
21197 flushSync(function() {
21198 updateContainer(null, root2, null, null);
21199 });
21200 unmarkContainerAsRoot(container);
21201 }
21202 };
21203 function createRoot(container, options2) {
21204 if (!isValidContainer(container)) {
21205 throw new Error("createRoot(...): Target container is not a DOM element.");
21206 }
21207 warnIfReactDOMContainerInDEV(container);
21208 var isStrictMode = false;
21209 var concurrentUpdatesByDefaultOverride = false;
21210 var identifierPrefix = "";
21211 var onRecoverableError = defaultOnRecoverableError;
21212 var transitionCallbacks = null;
21213 if (options2 !== null && options2 !== void 0) {
21214 {
21215 if (options2.hydrate) {
21216 warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
21217 } else {
21218 if (typeof options2 === "object" && options2 !== null && options2.$$typeof === REACT_ELEMENT_TYPE) {
21219 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 />);");
21220 }
21221 }
21222 }
21223 if (options2.unstable_strictMode === true) {
21224 isStrictMode = true;
21225 }
21226 if (options2.identifierPrefix !== void 0) {
21227 identifierPrefix = options2.identifierPrefix;
21228 }
21229 if (options2.onRecoverableError !== void 0) {
21230 onRecoverableError = options2.onRecoverableError;
21231 }
21232 if (options2.transitionCallbacks !== void 0) {
21233 transitionCallbacks = options2.transitionCallbacks;
21234 }
21235 }
21236 var root2 = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
21237 markContainerAsRoot(root2.current, container);
21238 var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21239 listenToAllSupportedEvents(rootContainerElement);
21240 return new ReactDOMRoot(root2);
21241 }
21242 function ReactDOMHydrationRoot(internalRoot) {
21243 this._internalRoot = internalRoot;
21244 }
21245 function scheduleHydration(target) {
21246 if (target) {
21247 queueExplicitHydrationTarget(target);
21248 }
21249 }
21250 ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
21251 function hydrateRoot(container, initialChildren, options2) {
21252 if (!isValidContainer(container)) {
21253 throw new Error("hydrateRoot(...): Target container is not a DOM element.");
21254 }
21255 warnIfReactDOMContainerInDEV(container);
21256 {
21257 if (initialChildren === void 0) {
21258 error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
21259 }
21260 }
21261 var hydrationCallbacks = options2 != null ? options2 : null;
21262 var mutableSources = options2 != null && options2.hydratedSources || null;
21263 var isStrictMode = false;
21264 var concurrentUpdatesByDefaultOverride = false;
21265 var identifierPrefix = "";
21266 var onRecoverableError = defaultOnRecoverableError;
21267 if (options2 !== null && options2 !== void 0) {
21268 if (options2.unstable_strictMode === true) {
21269 isStrictMode = true;
21270 }
21271 if (options2.identifierPrefix !== void 0) {
21272 identifierPrefix = options2.identifierPrefix;
21273 }
21274 if (options2.onRecoverableError !== void 0) {
21275 onRecoverableError = options2.onRecoverableError;
21276 }
21277 }
21278 var root2 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
21279 markContainerAsRoot(root2.current, container);
21280 listenToAllSupportedEvents(container);
21281 if (mutableSources) {
21282 for (var i = 0; i < mutableSources.length; i++) {
21283 var mutableSource = mutableSources[i];
21284 registerMutableSourceForHydration(root2, mutableSource);
21285 }
21286 }
21287 return new ReactDOMHydrationRoot(root2);
21288 }
21289 function isValidContainer(node) {
21290 return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
21291 }
21292 function isValidContainerLegacy(node) {
21293 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 "));
21294 }
21295 function warnIfReactDOMContainerInDEV(container) {
21296 {
21297 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
21298 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.");
21299 }
21300 if (isContainerMarkedAsRoot(container)) {
21301 if (container._reactRootContainer) {
21302 error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
21303 } else {
21304 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.");
21305 }
21306 }
21307 }
21308 }
21309 var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
21310 var topLevelUpdateWarnings;
21311 {
21312 topLevelUpdateWarnings = function(container) {
21313 if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
21314 var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current);
21315 if (hostInstance) {
21316 if (hostInstance.parentNode !== container) {
21317 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.");
21318 }
21319 }
21320 }
21321 var isRootRenderedBySomeReact = !!container._reactRootContainer;
21322 var rootEl = getReactRootElementInContainer(container);
21323 var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));
21324 if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
21325 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.");
21326 }
21327 if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
21328 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.");
21329 }
21330 };
21331 }
21332 function getReactRootElementInContainer(container) {
21333 if (!container) {
21334 return null;
21335 }
21336 if (container.nodeType === DOCUMENT_NODE) {
21337 return container.documentElement;
21338 } else {
21339 return container.firstChild;
21340 }
21341 }
21342 function noopOnRecoverableError() {
21343 }
21344 function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
21345 if (isHydrationContainer) {
21346 if (typeof callback === "function") {
21347 var originalCallback = callback;
21348 callback = function() {
21349 var instance = getPublicRootInstance(root2);
21350 originalCallback.call(instance);
21351 };
21352 }
21353 var root2 = createHydrationContainer(
21354 initialChildren,
21355 callback,
21356 container,
21357 LegacyRoot,
21358 null,
21359 // hydrationCallbacks
21360 false,
21361 // isStrictMode
21362 false,
21363 // concurrentUpdatesByDefaultOverride,
21364 "",
21365 // identifierPrefix
21366 noopOnRecoverableError
21367 );
21368 container._reactRootContainer = root2;
21369 markContainerAsRoot(root2.current, container);
21370 var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21371 listenToAllSupportedEvents(rootContainerElement);
21372 flushSync();
21373 return root2;
21374 } else {
21375 var rootSibling;
21376 while (rootSibling = container.lastChild) {
21377 container.removeChild(rootSibling);
21378 }
21379 if (typeof callback === "function") {
21380 var _originalCallback = callback;
21381 callback = function() {
21382 var instance = getPublicRootInstance(_root);
21383 _originalCallback.call(instance);
21384 };
21385 }
21386 var _root = createContainer(
21387 container,
21388 LegacyRoot,
21389 null,
21390 // hydrationCallbacks
21391 false,
21392 // isStrictMode
21393 false,
21394 // concurrentUpdatesByDefaultOverride,
21395 "",
21396 // identifierPrefix
21397 noopOnRecoverableError
21398 );
21399 container._reactRootContainer = _root;
21400 markContainerAsRoot(_root.current, container);
21401 var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
21402 listenToAllSupportedEvents(_rootContainerElement);
21403 flushSync(function() {
21404 updateContainer(initialChildren, _root, parentComponent, callback);
21405 });
21406 return _root;
21407 }
21408 }
21409 function warnOnInvalidCallback$1(callback, callerName) {
21410 {
21411 if (callback !== null && typeof callback !== "function") {
21412 error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback);
21413 }
21414 }
21415 }
21416 function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
21417 {
21418 topLevelUpdateWarnings(container);
21419 warnOnInvalidCallback$1(callback === void 0 ? null : callback, "render");
21420 }
21421 var maybeRoot = container._reactRootContainer;
21422 var root2;
21423 if (!maybeRoot) {
21424 root2 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
21425 } else {
21426 root2 = maybeRoot;
21427 if (typeof callback === "function") {
21428 var originalCallback = callback;
21429 callback = function() {
21430 var instance = getPublicRootInstance(root2);
21431 originalCallback.call(instance);
21432 };
21433 }
21434 updateContainer(children, root2, parentComponent, callback);
21435 }
21436 return getPublicRootInstance(root2);
21437 }
21438 var didWarnAboutFindDOMNode = false;
21439 function findDOMNode(componentOrElement) {
21440 {
21441 if (!didWarnAboutFindDOMNode) {
21442 didWarnAboutFindDOMNode = true;
21443 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");
21444 }
21445 var owner = ReactCurrentOwner$3.current;
21446 if (owner !== null && owner.stateNode !== null) {
21447 var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
21448 if (!warnedAboutRefsInRender) {
21449 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");
21450 }
21451 owner.stateNode._warnedAboutRefsInRender = true;
21452 }
21453 }
21454 if (componentOrElement == null) {
21455 return null;
21456 }
21457 if (componentOrElement.nodeType === ELEMENT_NODE) {
21458 return componentOrElement;
21459 }
21460 {
21461 return findHostInstanceWithWarning(componentOrElement, "findDOMNode");
21462 }
21463 }
21464 function hydrate(element, container, callback) {
21465 {
21466 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");
21467 }
21468 if (!isValidContainerLegacy(container)) {
21469 throw new Error("Target container is not a DOM element.");
21470 }
21471 {
21472 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21473 if (isModernRoot) {
21474 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)?");
21475 }
21476 }
21477 return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
21478 }
21479 function render(element, container, callback) {
21480 {
21481 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");
21482 }
21483 if (!isValidContainerLegacy(container)) {
21484 throw new Error("Target container is not a DOM element.");
21485 }
21486 {
21487 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21488 if (isModernRoot) {
21489 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)?");
21490 }
21491 }
21492 return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
21493 }
21494 function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
21495 {
21496 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");
21497 }
21498 if (!isValidContainerLegacy(containerNode)) {
21499 throw new Error("Target container is not a DOM element.");
21500 }
21501 if (parentComponent == null || !has(parentComponent)) {
21502 throw new Error("parentComponent must be a valid React Component");
21503 }
21504 return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
21505 }
21506 var didWarnAboutUnmountComponentAtNode = false;
21507 function unmountComponentAtNode(container) {
21508 {
21509 if (!didWarnAboutUnmountComponentAtNode) {
21510 didWarnAboutUnmountComponentAtNode = true;
21511 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");
21512 }
21513 }
21514 if (!isValidContainerLegacy(container)) {
21515 throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
21516 }
21517 {
21518 var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === void 0;
21519 if (isModernRoot) {
21520 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()?");
21521 }
21522 }
21523 if (container._reactRootContainer) {
21524 {
21525 var rootEl = getReactRootElementInContainer(container);
21526 var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);
21527 if (renderedByDifferentReact) {
21528 error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
21529 }
21530 }
21531 flushSync(function() {
21532 legacyRenderSubtreeIntoContainer(null, null, container, false, function() {
21533 container._reactRootContainer = null;
21534 unmarkContainerAsRoot(container);
21535 });
21536 });
21537 return true;
21538 } else {
21539 {
21540 var _rootEl = getReactRootElementInContainer(container);
21541 var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl));
21542 var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer;
21543 if (hasNonRootReactChild) {
21544 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.");
21545 }
21546 }
21547 return false;
21548 }
21549 }
21550 setAttemptSynchronousHydration(attemptSynchronousHydration$1);
21551 setAttemptContinuousHydration(attemptContinuousHydration$1);
21552 setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
21553 setGetCurrentUpdatePriority(getCurrentUpdatePriority);
21554 setAttemptHydrationAtPriority(runWithPriority);
21555 {
21556 if (typeof Map !== "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
21557 Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
21558 Set.prototype == null || typeof Set.prototype.clear !== "function" || typeof Set.prototype.forEach !== "function") {
21559 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");
21560 }
21561 }
21562 setRestoreImplementation(restoreControlledState$3);
21563 setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync);
21564 function createPortal$1(children, container) {
21565 var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
21566 if (!isValidContainer(container)) {
21567 throw new Error("Target container is not a DOM element.");
21568 }
21569 return createPortal(children, container, null, key);
21570 }
21571 function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
21572 return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
21573 }
21574 var Internals = {
21575 usingClientEntryPoint: false,
21576 // Keep in sync with ReactTestUtils.js.
21577 // This is an array for better minification.
21578 Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
21579 };
21580 function createRoot$1(container, options2) {
21581 {
21582 if (!Internals.usingClientEntryPoint && true) {
21583 error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
21584 }
21585 }
21586 return createRoot(container, options2);
21587 }
21588 function hydrateRoot$1(container, initialChildren, options2) {
21589 {
21590 if (!Internals.usingClientEntryPoint && true) {
21591 error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
21592 }
21593 }
21594 return hydrateRoot(container, initialChildren, options2);
21595 }
21596 function flushSync$1(fn) {
21597 {
21598 if (isAlreadyRendering()) {
21599 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.");
21600 }
21601 }
21602 return flushSync(fn);
21603 }
21604 var foundDevTools = injectIntoDevTools({
21605 findFiberByHostInstance: getClosestInstanceFromNode,
21606 bundleType: 1,
21607 version: ReactVersion,
21608 rendererPackageName: "react-dom"
21609 });
21610 {
21611 if (!foundDevTools && canUseDOM && window.top === window.self) {
21612 if (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1) {
21613 var protocol = window.location.protocol;
21614 if (/^(https?|file):$/.test(protocol)) {
21615 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");
21616 }
21617 }
21618 }
21619 }
21620 exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
21621 exports.createPortal = createPortal$1;
21622 exports.createRoot = createRoot$1;
21623 exports.findDOMNode = findDOMNode;
21624 exports.flushSync = flushSync$1;
21625 exports.hydrate = hydrate;
21626 exports.hydrateRoot = hydrateRoot$1;
21627 exports.render = render;
21628 exports.unmountComponentAtNode = unmountComponentAtNode;
21629 exports.unstable_batchedUpdates = batchedUpdates$1;
21630 exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
21631 exports.version = ReactVersion;
21632 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
21633 __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
21634 }
21635 })();
21636 }
21637 }
21638 });
21639
21640 // ../../node_modules/react-dom/index.js
21641 var require_react_dom = __commonJS({
21642 "../../node_modules/react-dom/index.js"(exports, module) {
21643 "use strict";
21644 if (false) {
21645 checkDCE();
21646 module.exports = null;
21647 } else {
21648 module.exports = require_react_dom_development();
21649 }
21650 }
21651 });
21652
21653 // ../../node_modules/react-dom/client.js
21654 var require_client = __commonJS({
21655 "../../node_modules/react-dom/client.js"(exports) {
21656 "use strict";
21657 var m = require_react_dom();
21658 if (false) {
21659 exports.createRoot = m.createRoot;
21660 exports.hydrateRoot = m.hydrateRoot;
21661 } else {
21662 i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
21663 exports.createRoot = function(c, o) {
21664 i.usingClientEntryPoint = true;
21665 try {
21666 return m.createRoot(c, o);
21667 } finally {
21668 i.usingClientEntryPoint = false;
21669 }
21670 };
21671 exports.hydrateRoot = function(c, h, o) {
21672 i.usingClientEntryPoint = true;
21673 try {
21674 return m.hydrateRoot(c, h, o);
21675 } finally {
21676 i.usingClientEntryPoint = false;
21677 }
21678 };
21679 }
21680 var i;
21681 }
21682 });
21683
21684 // <stdin>
21685 var require_stdin = __commonJS({
21686 "<stdin>"(exports, module) {
21687 module.exports = {
21688 ...require_react_dom(),
21689 ...require_client()
21690 };
21691 }
21692 });
21693 return require_stdin();
21694 })();
21695 /*! Bundled license information:
21696
21697 scheduler/cjs/scheduler.development.js:
21698 (**
21699 * @license React
21700 * scheduler.development.js
21701 *
21702 * Copyright (c) Facebook, Inc. and its affiliates.
21703 *
21704 * This source code is licensed under the MIT license found in the
21705 * LICENSE file in the root directory of this source tree.
21706 *)
21707
21708 react-dom/cjs/react-dom.development.js:
21709 (**
21710 * @license React
21711 * react-dom.development.js
21712 *
21713 * Copyright (c) Facebook, Inc. and its affiliates.
21714 *
21715 * This source code is licensed under the MIT license found in the
21716 * LICENSE file in the root directory of this source tree.
21717 *)
21718 (**
21719 * Checks if an event is supported in the current execution environment.
21720 *
21721 * NOTE: This will not work correctly for non-generic events such as `change`,
21722 * `reset`, `load`, `error`, and `select`.
21723 *
21724 * Borrows from Modernizr.
21725 *
21726 * @param {string} eventNameSuffix Event name, e.g. "click".
21727 * @return {boolean} True if the event is supported.
21728 * @internal
21729 * @license Modernizr 3.0.0pre (Custom Build) | MIT
21730 *)
21731 */
21732