1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | (function (global, factory) {
|
10 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
11 | typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
12 | (global = global || self, factory(global.React = {}));
|
13 | }(this, (function (exports) { 'use strict';
|
14 |
|
15 | var ReactVersion = '18.0.0-rc.0-f2a59df48-20211208';
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | var REACT_ELEMENT_TYPE = 0xeac7;
|
23 | var REACT_PORTAL_TYPE = 0xeaca;
|
24 | exports.Fragment = 0xeacb;
|
25 | exports.StrictMode = 0xeacc;
|
26 | exports.Profiler = 0xead2;
|
27 | var REACT_PROVIDER_TYPE = 0xeacd;
|
28 | var REACT_CONTEXT_TYPE = 0xeace;
|
29 | var REACT_FORWARD_REF_TYPE = 0xead0;
|
30 | exports.Suspense = 0xead1;
|
31 | var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
32 | var REACT_MEMO_TYPE = 0xead3;
|
33 | var REACT_LAZY_TYPE = 0xead4;
|
34 | var REACT_SCOPE_TYPE = 0xead7;
|
35 | var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
36 | var REACT_OFFSCREEN_TYPE = 0xeae2;
|
37 | var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
38 | var REACT_CACHE_TYPE = 0xeae4;
|
39 |
|
40 | if (typeof Symbol === 'function' && Symbol.for) {
|
41 | var symbolFor = Symbol.for;
|
42 | REACT_ELEMENT_TYPE = symbolFor('react.element');
|
43 | REACT_PORTAL_TYPE = symbolFor('react.portal');
|
44 | exports.Fragment = symbolFor('react.fragment');
|
45 | exports.StrictMode = symbolFor('react.strict_mode');
|
46 | exports.Profiler = symbolFor('react.profiler');
|
47 | REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
48 | REACT_CONTEXT_TYPE = symbolFor('react.context');
|
49 | REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
50 | exports.Suspense = symbolFor('react.suspense');
|
51 | REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
52 | REACT_MEMO_TYPE = symbolFor('react.memo');
|
53 | REACT_LAZY_TYPE = symbolFor('react.lazy');
|
54 | REACT_SCOPE_TYPE = symbolFor('react.scope');
|
55 | REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
56 | REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
57 | REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
58 | REACT_CACHE_TYPE = symbolFor('react.cache');
|
59 | }
|
60 |
|
61 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
62 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
63 | function getIteratorFn(maybeIterable) {
|
64 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
65 | return null;
|
66 | }
|
67 |
|
68 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
69 |
|
70 | if (typeof maybeIterator === 'function') {
|
71 | return maybeIterator;
|
72 | }
|
73 |
|
74 | return null;
|
75 | }
|
76 |
|
77 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
78 |
|
79 | var _assign = function (to, from) {
|
80 | for (var key in from) {
|
81 | if (hasOwnProperty.call(from, key)) {
|
82 | to[key] = from[key];
|
83 | }
|
84 | }
|
85 | };
|
86 |
|
87 | var assign = Object.assign || function (target, sources) {
|
88 | if (target == null) {
|
89 | throw new TypeError('Object.assign target cannot be null or undefined');
|
90 | }
|
91 |
|
92 | var to = Object(target);
|
93 |
|
94 | for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
|
95 | var nextSource = arguments[nextIndex];
|
96 |
|
97 | if (nextSource != null) {
|
98 | _assign(to, Object(nextSource));
|
99 | }
|
100 | }
|
101 |
|
102 | return to;
|
103 | };
|
104 |
|
105 | |
106 |
|
107 |
|
108 | var ReactCurrentDispatcher = {
|
109 | |
110 |
|
111 |
|
112 |
|
113 | current: null
|
114 | };
|
115 |
|
116 | |
117 |
|
118 |
|
119 |
|
120 | var ReactCurrentBatchConfig = {
|
121 | transition: 0
|
122 | };
|
123 |
|
124 | {
|
125 | ReactCurrentBatchConfig._updatedFibers = new Set();
|
126 | }
|
127 |
|
128 | var ReactCurrentActQueue = {
|
129 | current: null,
|
130 |
|
131 | isBatchingLegacy: false,
|
132 | didScheduleLegacyUpdate: false
|
133 | };
|
134 |
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 | var ReactCurrentOwner = {
|
142 | |
143 |
|
144 |
|
145 |
|
146 | current: null
|
147 | };
|
148 |
|
149 | var ReactDebugCurrentFrame = {};
|
150 | var currentExtraStackFrame = null;
|
151 | function setExtraStackFrame(stack) {
|
152 | {
|
153 | currentExtraStackFrame = stack;
|
154 | }
|
155 | }
|
156 |
|
157 | {
|
158 | ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
159 | {
|
160 | currentExtraStackFrame = stack;
|
161 | }
|
162 | };
|
163 |
|
164 |
|
165 | ReactDebugCurrentFrame.getCurrentStack = null;
|
166 |
|
167 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
168 | var stack = '';
|
169 |
|
170 | if (currentExtraStackFrame) {
|
171 | stack += currentExtraStackFrame;
|
172 | }
|
173 |
|
174 |
|
175 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
176 |
|
177 | if (impl) {
|
178 | stack += impl() || '';
|
179 | }
|
180 |
|
181 | return stack;
|
182 | };
|
183 | }
|
184 |
|
185 | var ReactSharedInternals = {
|
186 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
187 | ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
188 | ReactCurrentOwner: ReactCurrentOwner,
|
189 |
|
190 | assign: assign
|
191 | };
|
192 |
|
193 | {
|
194 | ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
195 | ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
196 | }
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | function warn(format) {
|
204 | {
|
205 | {
|
206 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
207 | args[_key - 1] = arguments[_key];
|
208 | }
|
209 |
|
210 | printWarning('warn', format, args);
|
211 | }
|
212 | }
|
213 | }
|
214 | function error(format) {
|
215 | {
|
216 | {
|
217 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
218 | args[_key2 - 1] = arguments[_key2];
|
219 | }
|
220 |
|
221 | printWarning('error', format, args);
|
222 | }
|
223 | }
|
224 | }
|
225 |
|
226 | function printWarning(level, format, args) {
|
227 |
|
228 |
|
229 | {
|
230 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
231 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
232 |
|
233 | if (stack !== '') {
|
234 | format += '%s';
|
235 | args = args.concat([stack]);
|
236 | }
|
237 |
|
238 |
|
239 | var argsWithFormat = args.map(function (item) {
|
240 | return String(item);
|
241 | });
|
242 |
|
243 | argsWithFormat.unshift('Warning: ' + format);
|
244 |
|
245 |
|
246 |
|
247 | Function.prototype.apply.call(console[level], console, argsWithFormat);
|
248 | }
|
249 | }
|
250 |
|
251 | var didWarnStateUpdateForUnmountedComponent = {};
|
252 |
|
253 | function warnNoop(publicInstance, callerName) {
|
254 | {
|
255 | var _constructor = publicInstance.constructor;
|
256 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
257 | var warningKey = componentName + "." + callerName;
|
258 |
|
259 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
260 | return;
|
261 | }
|
262 |
|
263 | error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
264 |
|
265 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
266 | }
|
267 | }
|
268 | |
269 |
|
270 |
|
271 |
|
272 |
|
273 | var ReactNoopUpdateQueue = {
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 | isMounted: function (publicInstance) {
|
282 | return false;
|
283 | },
|
284 |
|
285 | |
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
301 | warnNoop(publicInstance, 'forceUpdate');
|
302 | },
|
303 |
|
304 | |
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
318 | warnNoop(publicInstance, 'replaceState');
|
319 | },
|
320 |
|
321 | |
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
334 | warnNoop(publicInstance, 'setState');
|
335 | }
|
336 | };
|
337 |
|
338 | var emptyObject = {};
|
339 |
|
340 | {
|
341 | Object.freeze(emptyObject);
|
342 | }
|
343 | |
344 |
|
345 |
|
346 |
|
347 |
|
348 | function Component(props, context, updater) {
|
349 | this.props = props;
|
350 | this.context = context;
|
351 |
|
352 | this.refs = emptyObject;
|
353 |
|
354 |
|
355 | this.updater = updater || ReactNoopUpdateQueue;
|
356 | }
|
357 |
|
358 | Component.prototype.isReactComponent = {};
|
359 | |
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 | Component.prototype.setState = function (partialState, callback) {
|
386 | if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
|
387 | throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
|
388 | }
|
389 |
|
390 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
391 | };
|
392 | |
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 | Component.prototype.forceUpdate = function (callback) {
|
409 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
410 | };
|
411 | |
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 | {
|
419 | var deprecatedAPIs = {
|
420 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
421 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
422 | };
|
423 |
|
424 | var defineDeprecationWarning = function (methodName, info) {
|
425 | Object.defineProperty(Component.prototype, methodName, {
|
426 | get: function () {
|
427 | warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
428 |
|
429 | return undefined;
|
430 | }
|
431 | });
|
432 | };
|
433 |
|
434 | for (var fnName in deprecatedAPIs) {
|
435 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
436 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
437 | }
|
438 | }
|
439 | }
|
440 |
|
441 | function ComponentDummy() {}
|
442 |
|
443 | ComponentDummy.prototype = Component.prototype;
|
444 | |
445 |
|
446 |
|
447 |
|
448 | function PureComponent(props, context, updater) {
|
449 | this.props = props;
|
450 | this.context = context;
|
451 |
|
452 | this.refs = emptyObject;
|
453 | this.updater = updater || ReactNoopUpdateQueue;
|
454 | }
|
455 |
|
456 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
457 | pureComponentPrototype.constructor = PureComponent;
|
458 |
|
459 | assign(pureComponentPrototype, Component.prototype);
|
460 |
|
461 | pureComponentPrototype.isPureReactComponent = true;
|
462 |
|
463 |
|
464 | function createRef() {
|
465 | var refObject = {
|
466 | current: null
|
467 | };
|
468 |
|
469 | {
|
470 | Object.seal(refObject);
|
471 | }
|
472 |
|
473 | return refObject;
|
474 | }
|
475 |
|
476 | var isArrayImpl = Array.isArray;
|
477 |
|
478 | function isArray(a) {
|
479 | return isArrayImpl(a);
|
480 | }
|
481 |
|
482 | |
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 | function typeName(value) {
|
493 | {
|
494 |
|
495 | var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
496 | var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
497 | return type;
|
498 | }
|
499 | }
|
500 |
|
501 |
|
502 | function willCoercionThrow(value) {
|
503 | {
|
504 | try {
|
505 | testStringCoercion(value);
|
506 | return false;
|
507 | } catch (e) {
|
508 | return true;
|
509 | }
|
510 | }
|
511 | }
|
512 |
|
513 | function testStringCoercion(value) {
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 | return '' + value;
|
538 | }
|
539 | function checkKeyStringCoercion(value) {
|
540 | {
|
541 | if (willCoercionThrow(value)) {
|
542 | error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
543 |
|
544 | return testStringCoercion(value);
|
545 | }
|
546 | }
|
547 | }
|
548 |
|
549 | function getWrappedName(outerType, innerType, wrapperName) {
|
550 | var displayName = outerType.displayName;
|
551 |
|
552 | if (displayName) {
|
553 | return displayName;
|
554 | }
|
555 |
|
556 | var functionName = innerType.displayName || innerType.name || '';
|
557 | return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
558 | }
|
559 |
|
560 |
|
561 | function getContextName(type) {
|
562 | return type.displayName || 'Context';
|
563 | }
|
564 |
|
565 |
|
566 | function getComponentNameFromType(type) {
|
567 | if (type == null) {
|
568 |
|
569 | return null;
|
570 | }
|
571 |
|
572 | {
|
573 | if (typeof type.tag === 'number') {
|
574 | error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
575 | }
|
576 | }
|
577 |
|
578 | if (typeof type === 'function') {
|
579 | return type.displayName || type.name || null;
|
580 | }
|
581 |
|
582 | if (typeof type === 'string') {
|
583 | return type;
|
584 | }
|
585 |
|
586 | switch (type) {
|
587 | case exports.Fragment:
|
588 | return 'Fragment';
|
589 |
|
590 | case REACT_PORTAL_TYPE:
|
591 | return 'Portal';
|
592 |
|
593 | case exports.Profiler:
|
594 | return 'Profiler';
|
595 |
|
596 | case exports.StrictMode:
|
597 | return 'StrictMode';
|
598 |
|
599 | case exports.Suspense:
|
600 | return 'Suspense';
|
601 |
|
602 | case REACT_SUSPENSE_LIST_TYPE:
|
603 | return 'SuspenseList';
|
604 |
|
605 | case REACT_CACHE_TYPE:
|
606 | return 'Cache';
|
607 | }
|
608 |
|
609 | if (typeof type === 'object') {
|
610 | switch (type.$$typeof) {
|
611 | case REACT_CONTEXT_TYPE:
|
612 | var context = type;
|
613 | return getContextName(context) + '.Consumer';
|
614 |
|
615 | case REACT_PROVIDER_TYPE:
|
616 | var provider = type;
|
617 | return getContextName(provider._context) + '.Provider';
|
618 |
|
619 | case REACT_FORWARD_REF_TYPE:
|
620 | return getWrappedName(type, type.render, 'ForwardRef');
|
621 |
|
622 | case REACT_MEMO_TYPE:
|
623 | var outerName = type.displayName || null;
|
624 |
|
625 | if (outerName !== null) {
|
626 | return outerName;
|
627 | }
|
628 |
|
629 | return getComponentNameFromType(type.type) || 'Memo';
|
630 |
|
631 | case REACT_LAZY_TYPE:
|
632 | {
|
633 | var lazyComponent = type;
|
634 | var payload = lazyComponent._payload;
|
635 | var init = lazyComponent._init;
|
636 |
|
637 | try {
|
638 | return getComponentNameFromType(init(payload));
|
639 | } catch (x) {
|
640 | return null;
|
641 | }
|
642 | }
|
643 | }
|
644 | }
|
645 |
|
646 | return null;
|
647 | }
|
648 |
|
649 | var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
650 |
|
651 | var RESERVED_PROPS = {
|
652 | key: true,
|
653 | ref: true,
|
654 | __self: true,
|
655 | __source: true
|
656 | };
|
657 | var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
658 |
|
659 | {
|
660 | didWarnAboutStringRefs = {};
|
661 | }
|
662 |
|
663 | function hasValidRef(config) {
|
664 | {
|
665 | if (hasOwnProperty$1.call(config, 'ref')) {
|
666 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
667 |
|
668 | if (getter && getter.isReactWarning) {
|
669 | return false;
|
670 | }
|
671 | }
|
672 | }
|
673 |
|
674 | return config.ref !== undefined;
|
675 | }
|
676 |
|
677 | function hasValidKey(config) {
|
678 | {
|
679 | if (hasOwnProperty$1.call(config, 'key')) {
|
680 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
681 |
|
682 | if (getter && getter.isReactWarning) {
|
683 | return false;
|
684 | }
|
685 | }
|
686 | }
|
687 |
|
688 | return config.key !== undefined;
|
689 | }
|
690 |
|
691 | function defineKeyPropWarningGetter(props, displayName) {
|
692 | var warnAboutAccessingKey = function () {
|
693 | {
|
694 | if (!specialPropKeyWarningShown) {
|
695 | specialPropKeyWarningShown = true;
|
696 |
|
697 | error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
698 | }
|
699 | }
|
700 | };
|
701 |
|
702 | warnAboutAccessingKey.isReactWarning = true;
|
703 | Object.defineProperty(props, 'key', {
|
704 | get: warnAboutAccessingKey,
|
705 | configurable: true
|
706 | });
|
707 | }
|
708 |
|
709 | function defineRefPropWarningGetter(props, displayName) {
|
710 | var warnAboutAccessingRef = function () {
|
711 | {
|
712 | if (!specialPropRefWarningShown) {
|
713 | specialPropRefWarningShown = true;
|
714 |
|
715 | error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
716 | }
|
717 | }
|
718 | };
|
719 |
|
720 | warnAboutAccessingRef.isReactWarning = true;
|
721 | Object.defineProperty(props, 'ref', {
|
722 | get: warnAboutAccessingRef,
|
723 | configurable: true
|
724 | });
|
725 | }
|
726 |
|
727 | function warnIfStringRefCannotBeAutoConverted(config) {
|
728 | {
|
729 | if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
730 | var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
731 |
|
732 | if (!didWarnAboutStringRefs[componentName]) {
|
733 | error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
734 |
|
735 | didWarnAboutStringRefs[componentName] = true;
|
736 | }
|
737 | }
|
738 | }
|
739 | }
|
740 | |
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
763 | var element = {
|
764 |
|
765 | $$typeof: REACT_ELEMENT_TYPE,
|
766 |
|
767 | type: type,
|
768 | key: key,
|
769 | ref: ref,
|
770 | props: props,
|
771 |
|
772 | _owner: owner
|
773 | };
|
774 |
|
775 | {
|
776 |
|
777 |
|
778 |
|
779 |
|
780 | element._store = {};
|
781 |
|
782 |
|
783 |
|
784 |
|
785 | Object.defineProperty(element._store, 'validated', {
|
786 | configurable: false,
|
787 | enumerable: false,
|
788 | writable: true,
|
789 | value: false
|
790 | });
|
791 |
|
792 | Object.defineProperty(element, '_self', {
|
793 | configurable: false,
|
794 | enumerable: false,
|
795 | writable: false,
|
796 | value: self
|
797 | });
|
798 |
|
799 |
|
800 | Object.defineProperty(element, '_source', {
|
801 | configurable: false,
|
802 | enumerable: false,
|
803 | writable: false,
|
804 | value: source
|
805 | });
|
806 |
|
807 | if (Object.freeze) {
|
808 | Object.freeze(element.props);
|
809 | Object.freeze(element);
|
810 | }
|
811 | }
|
812 |
|
813 | return element;
|
814 | };
|
815 | |
816 |
|
817 |
|
818 |
|
819 |
|
820 | function createElement(type, config, children) {
|
821 | var propName;
|
822 |
|
823 | var props = {};
|
824 | var key = null;
|
825 | var ref = null;
|
826 | var self = null;
|
827 | var source = null;
|
828 |
|
829 | if (config != null) {
|
830 | if (hasValidRef(config)) {
|
831 | ref = config.ref;
|
832 |
|
833 | {
|
834 | warnIfStringRefCannotBeAutoConverted(config);
|
835 | }
|
836 | }
|
837 |
|
838 | if (hasValidKey(config)) {
|
839 | {
|
840 | checkKeyStringCoercion(config.key);
|
841 | }
|
842 |
|
843 | key = '' + config.key;
|
844 | }
|
845 |
|
846 | self = config.__self === undefined ? null : config.__self;
|
847 | source = config.__source === undefined ? null : config.__source;
|
848 |
|
849 | for (propName in config) {
|
850 | if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
851 | props[propName] = config[propName];
|
852 | }
|
853 | }
|
854 | }
|
855 |
|
856 |
|
857 |
|
858 | var childrenLength = arguments.length - 2;
|
859 |
|
860 | if (childrenLength === 1) {
|
861 | props.children = children;
|
862 | } else if (childrenLength > 1) {
|
863 | var childArray = Array(childrenLength);
|
864 |
|
865 | for (var i = 0; i < childrenLength; i++) {
|
866 | childArray[i] = arguments[i + 2];
|
867 | }
|
868 |
|
869 | {
|
870 | if (Object.freeze) {
|
871 | Object.freeze(childArray);
|
872 | }
|
873 | }
|
874 |
|
875 | props.children = childArray;
|
876 | }
|
877 |
|
878 |
|
879 | if (type && type.defaultProps) {
|
880 | var defaultProps = type.defaultProps;
|
881 |
|
882 | for (propName in defaultProps) {
|
883 | if (props[propName] === undefined) {
|
884 | props[propName] = defaultProps[propName];
|
885 | }
|
886 | }
|
887 | }
|
888 |
|
889 | {
|
890 | if (key || ref) {
|
891 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
892 |
|
893 | if (key) {
|
894 | defineKeyPropWarningGetter(props, displayName);
|
895 | }
|
896 |
|
897 | if (ref) {
|
898 | defineRefPropWarningGetter(props, displayName);
|
899 | }
|
900 | }
|
901 | }
|
902 |
|
903 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
904 | }
|
905 | function cloneAndReplaceKey(oldElement, newKey) {
|
906 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
907 | return newElement;
|
908 | }
|
909 | |
910 |
|
911 |
|
912 |
|
913 |
|
914 | function cloneElement(element, config, children) {
|
915 | if (element === null || element === undefined) {
|
916 | throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
917 | }
|
918 |
|
919 | var propName;
|
920 |
|
921 | var props = assign({}, element.props);
|
922 |
|
923 |
|
924 | var key = element.key;
|
925 | var ref = element.ref;
|
926 |
|
927 | var self = element._self;
|
928 |
|
929 |
|
930 |
|
931 | var source = element._source;
|
932 |
|
933 | var owner = element._owner;
|
934 |
|
935 | if (config != null) {
|
936 | if (hasValidRef(config)) {
|
937 |
|
938 | ref = config.ref;
|
939 | owner = ReactCurrentOwner.current;
|
940 | }
|
941 |
|
942 | if (hasValidKey(config)) {
|
943 | {
|
944 | checkKeyStringCoercion(config.key);
|
945 | }
|
946 |
|
947 | key = '' + config.key;
|
948 | }
|
949 |
|
950 |
|
951 | var defaultProps;
|
952 |
|
953 | if (element.type && element.type.defaultProps) {
|
954 | defaultProps = element.type.defaultProps;
|
955 | }
|
956 |
|
957 | for (propName in config) {
|
958 | if (hasOwnProperty$1.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
959 | if (config[propName] === undefined && defaultProps !== undefined) {
|
960 |
|
961 | props[propName] = defaultProps[propName];
|
962 | } else {
|
963 | props[propName] = config[propName];
|
964 | }
|
965 | }
|
966 | }
|
967 | }
|
968 |
|
969 |
|
970 |
|
971 | var childrenLength = arguments.length - 2;
|
972 |
|
973 | if (childrenLength === 1) {
|
974 | props.children = children;
|
975 | } else if (childrenLength > 1) {
|
976 | var childArray = Array(childrenLength);
|
977 |
|
978 | for (var i = 0; i < childrenLength; i++) {
|
979 | childArray[i] = arguments[i + 2];
|
980 | }
|
981 |
|
982 | props.children = childArray;
|
983 | }
|
984 |
|
985 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
986 | }
|
987 | |
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 | function isValidElement(object) {
|
996 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
997 | }
|
998 |
|
999 | var SEPARATOR = '.';
|
1000 | var SUBSEPARATOR = ':';
|
1001 | |
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 | function escape(key) {
|
1009 | var escapeRegex = /[=:]/g;
|
1010 | var escaperLookup = {
|
1011 | '=': '=0',
|
1012 | ':': '=2'
|
1013 | };
|
1014 | var escapedString = key.replace(escapeRegex, function (match) {
|
1015 | return escaperLookup[match];
|
1016 | });
|
1017 | return '$' + escapedString;
|
1018 | }
|
1019 | |
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 | var didWarnAboutMaps = false;
|
1026 | var userProvidedKeyEscapeRegex = /\/+/g;
|
1027 |
|
1028 | function escapeUserProvidedKey(text) {
|
1029 | return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
1030 | }
|
1031 | |
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 | function getElementKey(element, index) {
|
1041 |
|
1042 |
|
1043 | if (typeof element === 'object' && element !== null && element.key != null) {
|
1044 |
|
1045 | {
|
1046 | checkKeyStringCoercion(element.key);
|
1047 | }
|
1048 |
|
1049 | return escape('' + element.key);
|
1050 | }
|
1051 |
|
1052 |
|
1053 | return index.toString(36);
|
1054 | }
|
1055 |
|
1056 | function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
1057 | var type = typeof children;
|
1058 |
|
1059 | if (type === 'undefined' || type === 'boolean') {
|
1060 |
|
1061 | children = null;
|
1062 | }
|
1063 |
|
1064 | var invokeCallback = false;
|
1065 |
|
1066 | if (children === null) {
|
1067 | invokeCallback = true;
|
1068 | } else {
|
1069 | switch (type) {
|
1070 | case 'string':
|
1071 | case 'number':
|
1072 | invokeCallback = true;
|
1073 | break;
|
1074 |
|
1075 | case 'object':
|
1076 | switch (children.$$typeof) {
|
1077 | case REACT_ELEMENT_TYPE:
|
1078 | case REACT_PORTAL_TYPE:
|
1079 | invokeCallback = true;
|
1080 | }
|
1081 |
|
1082 | }
|
1083 | }
|
1084 |
|
1085 | if (invokeCallback) {
|
1086 | var _child = children;
|
1087 | var mappedChild = callback(_child);
|
1088 |
|
1089 |
|
1090 | var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
1091 |
|
1092 | if (isArray(mappedChild)) {
|
1093 | var escapedChildKey = '';
|
1094 |
|
1095 | if (childKey != null) {
|
1096 | escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
1097 | }
|
1098 |
|
1099 | mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
|
1100 | return c;
|
1101 | });
|
1102 | } else if (mappedChild != null) {
|
1103 | if (isValidElement(mappedChild)) {
|
1104 | {
|
1105 |
|
1106 |
|
1107 |
|
1108 | if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
1109 | checkKeyStringCoercion(mappedChild.key);
|
1110 | }
|
1111 | }
|
1112 |
|
1113 | mappedChild = cloneAndReplaceKey(mappedChild,
|
1114 |
|
1115 | escapedPrefix + (
|
1116 | mappedChild.key && (!_child || _child.key !== mappedChild.key) ?
|
1117 |
|
1118 | escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
1119 | }
|
1120 |
|
1121 | array.push(mappedChild);
|
1122 | }
|
1123 |
|
1124 | return 1;
|
1125 | }
|
1126 |
|
1127 | var child;
|
1128 | var nextName;
|
1129 | var subtreeCount = 0;
|
1130 |
|
1131 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1132 |
|
1133 | if (isArray(children)) {
|
1134 | for (var i = 0; i < children.length; i++) {
|
1135 | child = children[i];
|
1136 | nextName = nextNamePrefix + getElementKey(child, i);
|
1137 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1138 | }
|
1139 | } else {
|
1140 | var iteratorFn = getIteratorFn(children);
|
1141 |
|
1142 | if (typeof iteratorFn === 'function') {
|
1143 | var iterableChildren = children;
|
1144 |
|
1145 | {
|
1146 |
|
1147 | if (iteratorFn === iterableChildren.entries) {
|
1148 | if (!didWarnAboutMaps) {
|
1149 | warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
1150 | }
|
1151 |
|
1152 | didWarnAboutMaps = true;
|
1153 | }
|
1154 | }
|
1155 |
|
1156 | var iterator = iteratorFn.call(iterableChildren);
|
1157 | var step;
|
1158 | var ii = 0;
|
1159 |
|
1160 | while (!(step = iterator.next()).done) {
|
1161 | child = step.value;
|
1162 | nextName = nextNamePrefix + getElementKey(child, ii++);
|
1163 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1164 | }
|
1165 | } else if (type === 'object') {
|
1166 |
|
1167 | var childrenString = String(children);
|
1168 | throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
|
1169 | }
|
1170 | }
|
1171 |
|
1172 | return subtreeCount;
|
1173 | }
|
1174 |
|
1175 | |
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 | function mapChildren(children, func, context) {
|
1189 | if (children == null) {
|
1190 | return children;
|
1191 | }
|
1192 |
|
1193 | var result = [];
|
1194 | var count = 0;
|
1195 | mapIntoArray(children, result, '', '', function (child) {
|
1196 | return func.call(context, child, count++);
|
1197 | });
|
1198 | return result;
|
1199 | }
|
1200 | |
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 | function countChildren(children) {
|
1212 | var n = 0;
|
1213 | mapChildren(children, function () {
|
1214 | n++;
|
1215 | });
|
1216 | return n;
|
1217 | }
|
1218 |
|
1219 | |
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 | function forEachChildren(children, forEachFunc, forEachContext) {
|
1232 | mapChildren(children, function () {
|
1233 | forEachFunc.apply(this, arguments);
|
1234 | }, forEachContext);
|
1235 | }
|
1236 | |
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 | function toArray(children) {
|
1245 | return mapChildren(children, function (child) {
|
1246 | return child;
|
1247 | }) || [];
|
1248 | }
|
1249 | |
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 | function onlyChild(children) {
|
1266 | if (!isValidElement(children)) {
|
1267 | throw new Error('React.Children.only expected to receive a single React element child.');
|
1268 | }
|
1269 |
|
1270 | return children;
|
1271 | }
|
1272 |
|
1273 | function createContext(defaultValue) {
|
1274 |
|
1275 |
|
1276 | var context = {
|
1277 | $$typeof: REACT_CONTEXT_TYPE,
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 | _currentValue: defaultValue,
|
1284 | _currentValue2: defaultValue,
|
1285 |
|
1286 |
|
1287 | _threadCount: 0,
|
1288 |
|
1289 | Provider: null,
|
1290 | Consumer: null
|
1291 | };
|
1292 | context.Provider = {
|
1293 | $$typeof: REACT_PROVIDER_TYPE,
|
1294 | _context: context
|
1295 | };
|
1296 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
1297 | var hasWarnedAboutUsingConsumerProvider = false;
|
1298 | var hasWarnedAboutDisplayNameOnConsumer = false;
|
1299 |
|
1300 | {
|
1301 |
|
1302 |
|
1303 |
|
1304 | var Consumer = {
|
1305 | $$typeof: REACT_CONTEXT_TYPE,
|
1306 | _context: context
|
1307 | };
|
1308 |
|
1309 | Object.defineProperties(Consumer, {
|
1310 | Provider: {
|
1311 | get: function () {
|
1312 | if (!hasWarnedAboutUsingConsumerProvider) {
|
1313 | hasWarnedAboutUsingConsumerProvider = true;
|
1314 |
|
1315 | error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
1316 | }
|
1317 |
|
1318 | return context.Provider;
|
1319 | },
|
1320 | set: function (_Provider) {
|
1321 | context.Provider = _Provider;
|
1322 | }
|
1323 | },
|
1324 | _currentValue: {
|
1325 | get: function () {
|
1326 | return context._currentValue;
|
1327 | },
|
1328 | set: function (_currentValue) {
|
1329 | context._currentValue = _currentValue;
|
1330 | }
|
1331 | },
|
1332 | _currentValue2: {
|
1333 | get: function () {
|
1334 | return context._currentValue2;
|
1335 | },
|
1336 | set: function (_currentValue2) {
|
1337 | context._currentValue2 = _currentValue2;
|
1338 | }
|
1339 | },
|
1340 | _threadCount: {
|
1341 | get: function () {
|
1342 | return context._threadCount;
|
1343 | },
|
1344 | set: function (_threadCount) {
|
1345 | context._threadCount = _threadCount;
|
1346 | }
|
1347 | },
|
1348 | Consumer: {
|
1349 | get: function () {
|
1350 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
1351 | hasWarnedAboutUsingNestedContextConsumers = true;
|
1352 |
|
1353 | error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
1354 | }
|
1355 |
|
1356 | return context.Consumer;
|
1357 | }
|
1358 | },
|
1359 | displayName: {
|
1360 | get: function () {
|
1361 | return context.displayName;
|
1362 | },
|
1363 | set: function (displayName) {
|
1364 | if (!hasWarnedAboutDisplayNameOnConsumer) {
|
1365 | warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
1366 |
|
1367 | hasWarnedAboutDisplayNameOnConsumer = true;
|
1368 | }
|
1369 | }
|
1370 | }
|
1371 | });
|
1372 |
|
1373 | context.Consumer = Consumer;
|
1374 | }
|
1375 |
|
1376 | {
|
1377 | context._currentRenderer = null;
|
1378 | context._currentRenderer2 = null;
|
1379 | }
|
1380 |
|
1381 | return context;
|
1382 | }
|
1383 |
|
1384 | var Uninitialized = -1;
|
1385 | var Pending = 0;
|
1386 | var Resolved = 1;
|
1387 | var Rejected = 2;
|
1388 |
|
1389 | function lazyInitializer(payload) {
|
1390 | if (payload._status === Uninitialized) {
|
1391 | var ctor = payload._result;
|
1392 | var thenable = ctor();
|
1393 |
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 | thenable.then(function (moduleObject) {
|
1399 | if (payload._status === Pending || payload._status === Uninitialized) {
|
1400 |
|
1401 | var resolved = payload;
|
1402 | resolved._status = Resolved;
|
1403 | resolved._result = moduleObject;
|
1404 | }
|
1405 | }, function (error) {
|
1406 | if (payload._status === Pending || payload._status === Uninitialized) {
|
1407 |
|
1408 | var rejected = payload;
|
1409 | rejected._status = Rejected;
|
1410 | rejected._result = error;
|
1411 | }
|
1412 | });
|
1413 |
|
1414 | if (payload._status === Uninitialized) {
|
1415 |
|
1416 |
|
1417 | var pending = payload;
|
1418 | pending._status = Pending;
|
1419 | pending._result = thenable;
|
1420 | }
|
1421 | }
|
1422 |
|
1423 | if (payload._status === Resolved) {
|
1424 | var moduleObject = payload._result;
|
1425 |
|
1426 | {
|
1427 | if (moduleObject === undefined) {
|
1428 | error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' +
|
1429 | 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
1430 | }
|
1431 | }
|
1432 |
|
1433 | {
|
1434 | if (!('default' in moduleObject)) {
|
1435 | error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' +
|
1436 | 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
1437 | }
|
1438 | }
|
1439 |
|
1440 | return moduleObject.default;
|
1441 | } else {
|
1442 | throw payload._result;
|
1443 | }
|
1444 | }
|
1445 |
|
1446 | function lazy(ctor) {
|
1447 | var payload = {
|
1448 |
|
1449 | _status: Uninitialized,
|
1450 | _result: ctor
|
1451 | };
|
1452 | var lazyType = {
|
1453 | $$typeof: REACT_LAZY_TYPE,
|
1454 | _payload: payload,
|
1455 | _init: lazyInitializer
|
1456 | };
|
1457 |
|
1458 | {
|
1459 |
|
1460 | var defaultProps;
|
1461 | var propTypes;
|
1462 |
|
1463 | Object.defineProperties(lazyType, {
|
1464 | defaultProps: {
|
1465 | configurable: true,
|
1466 | get: function () {
|
1467 | return defaultProps;
|
1468 | },
|
1469 | set: function (newDefaultProps) {
|
1470 | error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1471 |
|
1472 | defaultProps = newDefaultProps;
|
1473 |
|
1474 |
|
1475 | Object.defineProperty(lazyType, 'defaultProps', {
|
1476 | enumerable: true
|
1477 | });
|
1478 | }
|
1479 | },
|
1480 | propTypes: {
|
1481 | configurable: true,
|
1482 | get: function () {
|
1483 | return propTypes;
|
1484 | },
|
1485 | set: function (newPropTypes) {
|
1486 | error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1487 |
|
1488 | propTypes = newPropTypes;
|
1489 |
|
1490 |
|
1491 | Object.defineProperty(lazyType, 'propTypes', {
|
1492 | enumerable: true
|
1493 | });
|
1494 | }
|
1495 | }
|
1496 | });
|
1497 | }
|
1498 |
|
1499 | return lazyType;
|
1500 | }
|
1501 |
|
1502 | function forwardRef(render) {
|
1503 | {
|
1504 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1505 | error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1506 | } else if (typeof render !== 'function') {
|
1507 | error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1508 | } else {
|
1509 | if (render.length !== 0 && render.length !== 2) {
|
1510 | error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
|
1511 | }
|
1512 | }
|
1513 |
|
1514 | if (render != null) {
|
1515 | if (render.defaultProps != null || render.propTypes != null) {
|
1516 | error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
1517 | }
|
1518 | }
|
1519 | }
|
1520 |
|
1521 | var elementType = {
|
1522 | $$typeof: REACT_FORWARD_REF_TYPE,
|
1523 | render: render
|
1524 | };
|
1525 |
|
1526 | {
|
1527 | var ownName;
|
1528 | Object.defineProperty(elementType, 'displayName', {
|
1529 | enumerable: false,
|
1530 | configurable: true,
|
1531 | get: function () {
|
1532 | return ownName;
|
1533 | },
|
1534 | set: function (name) {
|
1535 | ownName = name;
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 | if (!render.name && !render.displayName) {
|
1544 | render.displayName = name;
|
1545 | }
|
1546 | }
|
1547 | });
|
1548 | }
|
1549 |
|
1550 | return elementType;
|
1551 | }
|
1552 |
|
1553 |
|
1554 | var enableCache = false;
|
1555 |
|
1556 | var enableScopeAPI = false;
|
1557 | var warnOnSubscriptionInsideStartTransition = false;
|
1558 |
|
1559 | var REACT_MODULE_REFERENCE = 0;
|
1560 |
|
1561 | if (typeof Symbol === 'function') {
|
1562 | REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
1563 | }
|
1564 |
|
1565 | function isValidElementType(type) {
|
1566 | if (typeof type === 'string' || typeof type === 'function') {
|
1567 | return true;
|
1568 | }
|
1569 |
|
1570 |
|
1571 | if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCache ) {
|
1572 | return true;
|
1573 | }
|
1574 |
|
1575 | if (typeof type === 'object' && type !== null) {
|
1576 | if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
1577 |
|
1578 |
|
1579 |
|
1580 | type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
1581 | return true;
|
1582 | }
|
1583 | }
|
1584 |
|
1585 | return false;
|
1586 | }
|
1587 |
|
1588 | function memo(type, compare) {
|
1589 | {
|
1590 | if (!isValidElementType(type)) {
|
1591 | error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
1592 | }
|
1593 | }
|
1594 |
|
1595 | var elementType = {
|
1596 | $$typeof: REACT_MEMO_TYPE,
|
1597 | type: type,
|
1598 | compare: compare === undefined ? null : compare
|
1599 | };
|
1600 |
|
1601 | {
|
1602 | var ownName;
|
1603 | Object.defineProperty(elementType, 'displayName', {
|
1604 | enumerable: false,
|
1605 | configurable: true,
|
1606 | get: function () {
|
1607 | return ownName;
|
1608 | },
|
1609 | set: function (name) {
|
1610 | ownName = name;
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 | if (!type.name && !type.displayName) {
|
1619 | type.displayName = name;
|
1620 | }
|
1621 | }
|
1622 | });
|
1623 | }
|
1624 |
|
1625 | return elementType;
|
1626 | }
|
1627 |
|
1628 | function resolveDispatcher() {
|
1629 | var dispatcher = ReactCurrentDispatcher.current;
|
1630 |
|
1631 | {
|
1632 | if (dispatcher === null) {
|
1633 | 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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
1634 | }
|
1635 | }
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 | return dispatcher;
|
1641 | }
|
1642 | function useContext(Context) {
|
1643 | var dispatcher = resolveDispatcher();
|
1644 |
|
1645 | {
|
1646 |
|
1647 | if (Context._context !== undefined) {
|
1648 | var realContext = Context._context;
|
1649 |
|
1650 |
|
1651 | if (realContext.Consumer === Context) {
|
1652 | error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
1653 | } else if (realContext.Provider === Context) {
|
1654 | error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
1655 | }
|
1656 | }
|
1657 | }
|
1658 |
|
1659 | return dispatcher.useContext(Context);
|
1660 | }
|
1661 | function useState(initialState) {
|
1662 | var dispatcher = resolveDispatcher();
|
1663 | return dispatcher.useState(initialState);
|
1664 | }
|
1665 | function useReducer(reducer, initialArg, init) {
|
1666 | var dispatcher = resolveDispatcher();
|
1667 | return dispatcher.useReducer(reducer, initialArg, init);
|
1668 | }
|
1669 | function useRef(initialValue) {
|
1670 | var dispatcher = resolveDispatcher();
|
1671 | return dispatcher.useRef(initialValue);
|
1672 | }
|
1673 | function useEffect(create, deps) {
|
1674 | var dispatcher = resolveDispatcher();
|
1675 | return dispatcher.useEffect(create, deps);
|
1676 | }
|
1677 | function useInsertionEffect(create, deps) {
|
1678 | var dispatcher = resolveDispatcher();
|
1679 | return dispatcher.useInsertionEffect(create, deps);
|
1680 | }
|
1681 | function useLayoutEffect(create, deps) {
|
1682 | var dispatcher = resolveDispatcher();
|
1683 | return dispatcher.useLayoutEffect(create, deps);
|
1684 | }
|
1685 | function useCallback(callback, deps) {
|
1686 | var dispatcher = resolveDispatcher();
|
1687 | return dispatcher.useCallback(callback, deps);
|
1688 | }
|
1689 | function useMemo(create, deps) {
|
1690 | var dispatcher = resolveDispatcher();
|
1691 | return dispatcher.useMemo(create, deps);
|
1692 | }
|
1693 | function useImperativeHandle(ref, create, deps) {
|
1694 | var dispatcher = resolveDispatcher();
|
1695 | return dispatcher.useImperativeHandle(ref, create, deps);
|
1696 | }
|
1697 | function useDebugValue(value, formatterFn) {
|
1698 | {
|
1699 | var dispatcher = resolveDispatcher();
|
1700 | return dispatcher.useDebugValue(value, formatterFn);
|
1701 | }
|
1702 | }
|
1703 | function useTransition() {
|
1704 | var dispatcher = resolveDispatcher();
|
1705 | return dispatcher.useTransition();
|
1706 | }
|
1707 | function useDeferredValue(value) {
|
1708 | var dispatcher = resolveDispatcher();
|
1709 | return dispatcher.useDeferredValue(value);
|
1710 | }
|
1711 | function useId() {
|
1712 | var dispatcher = resolveDispatcher();
|
1713 | return dispatcher.useId();
|
1714 | }
|
1715 | function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
1716 | var dispatcher = resolveDispatcher();
|
1717 | return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
1718 | }
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 | var disabledDepth = 0;
|
1725 | var prevLog;
|
1726 | var prevInfo;
|
1727 | var prevWarn;
|
1728 | var prevError;
|
1729 | var prevGroup;
|
1730 | var prevGroupCollapsed;
|
1731 | var prevGroupEnd;
|
1732 |
|
1733 | function disabledLog() {}
|
1734 |
|
1735 | disabledLog.__reactDisabledLog = true;
|
1736 | function disableLogs() {
|
1737 | {
|
1738 | if (disabledDepth === 0) {
|
1739 |
|
1740 | prevLog = console.log;
|
1741 | prevInfo = console.info;
|
1742 | prevWarn = console.warn;
|
1743 | prevError = console.error;
|
1744 | prevGroup = console.group;
|
1745 | prevGroupCollapsed = console.groupCollapsed;
|
1746 | prevGroupEnd = console.groupEnd;
|
1747 |
|
1748 | var props = {
|
1749 | configurable: true,
|
1750 | enumerable: true,
|
1751 | value: disabledLog,
|
1752 | writable: true
|
1753 | };
|
1754 |
|
1755 | Object.defineProperties(console, {
|
1756 | info: props,
|
1757 | log: props,
|
1758 | warn: props,
|
1759 | error: props,
|
1760 | group: props,
|
1761 | groupCollapsed: props,
|
1762 | groupEnd: props
|
1763 | });
|
1764 |
|
1765 | }
|
1766 |
|
1767 | disabledDepth++;
|
1768 | }
|
1769 | }
|
1770 | function reenableLogs() {
|
1771 | {
|
1772 | disabledDepth--;
|
1773 |
|
1774 | if (disabledDepth === 0) {
|
1775 |
|
1776 | var props = {
|
1777 | configurable: true,
|
1778 | enumerable: true,
|
1779 | writable: true
|
1780 | };
|
1781 |
|
1782 | Object.defineProperties(console, {
|
1783 | log: assign({}, props, {
|
1784 | value: prevLog
|
1785 | }),
|
1786 | info: assign({}, props, {
|
1787 | value: prevInfo
|
1788 | }),
|
1789 | warn: assign({}, props, {
|
1790 | value: prevWarn
|
1791 | }),
|
1792 | error: assign({}, props, {
|
1793 | value: prevError
|
1794 | }),
|
1795 | group: assign({}, props, {
|
1796 | value: prevGroup
|
1797 | }),
|
1798 | groupCollapsed: assign({}, props, {
|
1799 | value: prevGroupCollapsed
|
1800 | }),
|
1801 | groupEnd: assign({}, props, {
|
1802 | value: prevGroupEnd
|
1803 | })
|
1804 | });
|
1805 |
|
1806 | }
|
1807 |
|
1808 | if (disabledDepth < 0) {
|
1809 | error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
1810 | }
|
1811 | }
|
1812 | }
|
1813 |
|
1814 | var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
1815 | var prefix;
|
1816 | function describeBuiltInComponentFrame(name, source, ownerFn) {
|
1817 | {
|
1818 | if (prefix === undefined) {
|
1819 |
|
1820 | try {
|
1821 | throw Error();
|
1822 | } catch (x) {
|
1823 | var match = x.stack.trim().match(/\n( *(at )?)/);
|
1824 | prefix = match && match[1] || '';
|
1825 | }
|
1826 | }
|
1827 |
|
1828 |
|
1829 | return '\n' + prefix + name;
|
1830 | }
|
1831 | }
|
1832 | var reentry = false;
|
1833 | var componentFrameCache;
|
1834 |
|
1835 | {
|
1836 | var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
1837 | componentFrameCache = new PossiblyWeakMap();
|
1838 | }
|
1839 |
|
1840 | function describeNativeComponentFrame(fn, construct) {
|
1841 |
|
1842 | if ( !fn || reentry) {
|
1843 | return '';
|
1844 | }
|
1845 |
|
1846 | {
|
1847 | var frame = componentFrameCache.get(fn);
|
1848 |
|
1849 | if (frame !== undefined) {
|
1850 | return frame;
|
1851 | }
|
1852 | }
|
1853 |
|
1854 | var control;
|
1855 | reentry = true;
|
1856 | var previousPrepareStackTrace = Error.prepareStackTrace;
|
1857 |
|
1858 | Error.prepareStackTrace = undefined;
|
1859 | var previousDispatcher;
|
1860 |
|
1861 | {
|
1862 | previousDispatcher = ReactCurrentDispatcher$1.current;
|
1863 |
|
1864 |
|
1865 | ReactCurrentDispatcher$1.current = null;
|
1866 | disableLogs();
|
1867 | }
|
1868 |
|
1869 | try {
|
1870 |
|
1871 | if (construct) {
|
1872 |
|
1873 | var Fake = function () {
|
1874 | throw Error();
|
1875 | };
|
1876 |
|
1877 |
|
1878 | Object.defineProperty(Fake.prototype, 'props', {
|
1879 | set: function () {
|
1880 |
|
1881 |
|
1882 | throw Error();
|
1883 | }
|
1884 | });
|
1885 |
|
1886 | if (typeof Reflect === 'object' && Reflect.construct) {
|
1887 |
|
1888 |
|
1889 | try {
|
1890 | Reflect.construct(Fake, []);
|
1891 | } catch (x) {
|
1892 | control = x;
|
1893 | }
|
1894 |
|
1895 | Reflect.construct(fn, [], Fake);
|
1896 | } else {
|
1897 | try {
|
1898 | Fake.call();
|
1899 | } catch (x) {
|
1900 | control = x;
|
1901 | }
|
1902 |
|
1903 | fn.call(Fake.prototype);
|
1904 | }
|
1905 | } else {
|
1906 | try {
|
1907 | throw Error();
|
1908 | } catch (x) {
|
1909 | control = x;
|
1910 | }
|
1911 |
|
1912 | fn();
|
1913 | }
|
1914 | } catch (sample) {
|
1915 |
|
1916 | if (sample && control && typeof sample.stack === 'string') {
|
1917 |
|
1918 |
|
1919 | var sampleLines = sample.stack.split('\n');
|
1920 | var controlLines = control.stack.split('\n');
|
1921 | var s = sampleLines.length - 1;
|
1922 | var c = controlLines.length - 1;
|
1923 |
|
1924 | while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 | c--;
|
1932 | }
|
1933 |
|
1934 | for (; s >= 1 && c >= 0; s--, c--) {
|
1935 |
|
1936 |
|
1937 | if (sampleLines[s] !== controlLines[c]) {
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 | if (s !== 1 || c !== 1) {
|
1944 | do {
|
1945 | s--;
|
1946 | c--;
|
1947 |
|
1948 |
|
1949 | if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
1950 |
|
1951 | var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 | if (fn.displayName && _frame.includes('<anonymous>')) {
|
1957 | _frame = _frame.replace('<anonymous>', fn.displayName);
|
1958 | }
|
1959 |
|
1960 | {
|
1961 | if (typeof fn === 'function') {
|
1962 | componentFrameCache.set(fn, _frame);
|
1963 | }
|
1964 | }
|
1965 |
|
1966 |
|
1967 | return _frame;
|
1968 | }
|
1969 | } while (s >= 1 && c >= 0);
|
1970 | }
|
1971 |
|
1972 | break;
|
1973 | }
|
1974 | }
|
1975 | }
|
1976 | } finally {
|
1977 | reentry = false;
|
1978 |
|
1979 | {
|
1980 | ReactCurrentDispatcher$1.current = previousDispatcher;
|
1981 | reenableLogs();
|
1982 | }
|
1983 |
|
1984 | Error.prepareStackTrace = previousPrepareStackTrace;
|
1985 | }
|
1986 |
|
1987 |
|
1988 | var name = fn ? fn.displayName || fn.name : '';
|
1989 | var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
1990 |
|
1991 | {
|
1992 | if (typeof fn === 'function') {
|
1993 | componentFrameCache.set(fn, syntheticFrame);
|
1994 | }
|
1995 | }
|
1996 |
|
1997 | return syntheticFrame;
|
1998 | }
|
1999 | function describeFunctionComponentFrame(fn, source, ownerFn) {
|
2000 | {
|
2001 | return describeNativeComponentFrame(fn, false);
|
2002 | }
|
2003 | }
|
2004 |
|
2005 | function shouldConstruct(Component) {
|
2006 | var prototype = Component.prototype;
|
2007 | return !!(prototype && prototype.isReactComponent);
|
2008 | }
|
2009 |
|
2010 | function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
2011 |
|
2012 | if (type == null) {
|
2013 | return '';
|
2014 | }
|
2015 |
|
2016 | if (typeof type === 'function') {
|
2017 | {
|
2018 | return describeNativeComponentFrame(type, shouldConstruct(type));
|
2019 | }
|
2020 | }
|
2021 |
|
2022 | if (typeof type === 'string') {
|
2023 | return describeBuiltInComponentFrame(type);
|
2024 | }
|
2025 |
|
2026 | switch (type) {
|
2027 | case exports.Suspense:
|
2028 | return describeBuiltInComponentFrame('Suspense');
|
2029 |
|
2030 | case REACT_SUSPENSE_LIST_TYPE:
|
2031 | return describeBuiltInComponentFrame('SuspenseList');
|
2032 | }
|
2033 |
|
2034 | if (typeof type === 'object') {
|
2035 | switch (type.$$typeof) {
|
2036 | case REACT_FORWARD_REF_TYPE:
|
2037 | return describeFunctionComponentFrame(type.render);
|
2038 |
|
2039 | case REACT_MEMO_TYPE:
|
2040 |
|
2041 | return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
2042 |
|
2043 | case REACT_LAZY_TYPE:
|
2044 | {
|
2045 | var lazyComponent = type;
|
2046 | var payload = lazyComponent._payload;
|
2047 | var init = lazyComponent._init;
|
2048 |
|
2049 | try {
|
2050 |
|
2051 | return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
2052 | } catch (x) {}
|
2053 | }
|
2054 | }
|
2055 | }
|
2056 |
|
2057 | return '';
|
2058 | }
|
2059 |
|
2060 | var loggedTypeFailures = {};
|
2061 | var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
2062 |
|
2063 | function setCurrentlyValidatingElement(element) {
|
2064 | {
|
2065 | if (element) {
|
2066 | var owner = element._owner;
|
2067 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2068 | ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
2069 | } else {
|
2070 | ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
2071 | }
|
2072 | }
|
2073 | }
|
2074 |
|
2075 | function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
2076 | {
|
2077 |
|
2078 | var has = Function.call.bind(hasOwnProperty$1);
|
2079 |
|
2080 | for (var typeSpecName in typeSpecs) {
|
2081 | if (has(typeSpecs, typeSpecName)) {
|
2082 | var error$1 = void 0;
|
2083 |
|
2084 |
|
2085 |
|
2086 | try {
|
2087 |
|
2088 |
|
2089 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
2090 |
|
2091 | 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`.');
|
2092 | err.name = 'Invariant Violation';
|
2093 | throw err;
|
2094 | }
|
2095 |
|
2096 | error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
2097 | } catch (ex) {
|
2098 | error$1 = ex;
|
2099 | }
|
2100 |
|
2101 | if (error$1 && !(error$1 instanceof Error)) {
|
2102 | setCurrentlyValidatingElement(element);
|
2103 |
|
2104 | 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);
|
2105 |
|
2106 | setCurrentlyValidatingElement(null);
|
2107 | }
|
2108 |
|
2109 | if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
2110 |
|
2111 |
|
2112 | loggedTypeFailures[error$1.message] = true;
|
2113 | setCurrentlyValidatingElement(element);
|
2114 |
|
2115 | error('Failed %s type: %s', location, error$1.message);
|
2116 |
|
2117 | setCurrentlyValidatingElement(null);
|
2118 | }
|
2119 | }
|
2120 | }
|
2121 | }
|
2122 | }
|
2123 |
|
2124 | function setCurrentlyValidatingElement$1(element) {
|
2125 | {
|
2126 | if (element) {
|
2127 | var owner = element._owner;
|
2128 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2129 | setExtraStackFrame(stack);
|
2130 | } else {
|
2131 | setExtraStackFrame(null);
|
2132 | }
|
2133 | }
|
2134 | }
|
2135 |
|
2136 | var propTypesMisspellWarningShown;
|
2137 |
|
2138 | {
|
2139 | propTypesMisspellWarningShown = false;
|
2140 | }
|
2141 |
|
2142 | function getDeclarationErrorAddendum() {
|
2143 | if (ReactCurrentOwner.current) {
|
2144 | var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
2145 |
|
2146 | if (name) {
|
2147 | return '\n\nCheck the render method of `' + name + '`.';
|
2148 | }
|
2149 | }
|
2150 |
|
2151 | return '';
|
2152 | }
|
2153 |
|
2154 | function getSourceInfoErrorAddendum(source) {
|
2155 | if (source !== undefined) {
|
2156 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
2157 | var lineNumber = source.lineNumber;
|
2158 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
2159 | }
|
2160 |
|
2161 | return '';
|
2162 | }
|
2163 |
|
2164 | function getSourceInfoErrorAddendumForProps(elementProps) {
|
2165 | if (elementProps !== null && elementProps !== undefined) {
|
2166 | return getSourceInfoErrorAddendum(elementProps.__source);
|
2167 | }
|
2168 |
|
2169 | return '';
|
2170 | }
|
2171 | |
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 | var ownerHasKeyUseWarning = {};
|
2179 |
|
2180 | function getCurrentComponentErrorInfo(parentType) {
|
2181 | var info = getDeclarationErrorAddendum();
|
2182 |
|
2183 | if (!info) {
|
2184 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
2185 |
|
2186 | if (parentName) {
|
2187 | info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
2188 | }
|
2189 | }
|
2190 |
|
2191 | return info;
|
2192 | }
|
2193 | |
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 | function validateExplicitKey(element, parentType) {
|
2207 | if (!element._store || element._store.validated || element.key != null) {
|
2208 | return;
|
2209 | }
|
2210 |
|
2211 | element._store.validated = true;
|
2212 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
2213 |
|
2214 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
2215 | return;
|
2216 | }
|
2217 |
|
2218 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
2219 |
|
2220 |
|
2221 |
|
2222 | var childOwner = '';
|
2223 |
|
2224 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
2225 |
|
2226 | childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
2227 | }
|
2228 |
|
2229 | {
|
2230 | setCurrentlyValidatingElement$1(element);
|
2231 |
|
2232 | error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
2233 |
|
2234 | setCurrentlyValidatingElement$1(null);
|
2235 | }
|
2236 | }
|
2237 | |
2238 |
|
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 | function validateChildKeys(node, parentType) {
|
2249 | if (typeof node !== 'object') {
|
2250 | return;
|
2251 | }
|
2252 |
|
2253 | if (isArray(node)) {
|
2254 | for (var i = 0; i < node.length; i++) {
|
2255 | var child = node[i];
|
2256 |
|
2257 | if (isValidElement(child)) {
|
2258 | validateExplicitKey(child, parentType);
|
2259 | }
|
2260 | }
|
2261 | } else if (isValidElement(node)) {
|
2262 |
|
2263 | if (node._store) {
|
2264 | node._store.validated = true;
|
2265 | }
|
2266 | } else if (node) {
|
2267 | var iteratorFn = getIteratorFn(node);
|
2268 |
|
2269 | if (typeof iteratorFn === 'function') {
|
2270 |
|
2271 |
|
2272 | if (iteratorFn !== node.entries) {
|
2273 | var iterator = iteratorFn.call(node);
|
2274 | var step;
|
2275 |
|
2276 | while (!(step = iterator.next()).done) {
|
2277 | if (isValidElement(step.value)) {
|
2278 | validateExplicitKey(step.value, parentType);
|
2279 | }
|
2280 | }
|
2281 | }
|
2282 | }
|
2283 | }
|
2284 | }
|
2285 | |
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 | function validatePropTypes(element) {
|
2294 | {
|
2295 | var type = element.type;
|
2296 |
|
2297 | if (type === null || type === undefined || typeof type === 'string') {
|
2298 | return;
|
2299 | }
|
2300 |
|
2301 | var propTypes;
|
2302 |
|
2303 | if (typeof type === 'function') {
|
2304 | propTypes = type.propTypes;
|
2305 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
2306 |
|
2307 | type.$$typeof === REACT_MEMO_TYPE)) {
|
2308 | propTypes = type.propTypes;
|
2309 | } else {
|
2310 | return;
|
2311 | }
|
2312 |
|
2313 | if (propTypes) {
|
2314 |
|
2315 | var name = getComponentNameFromType(type);
|
2316 | checkPropTypes(propTypes, element.props, 'prop', name, element);
|
2317 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
2318 | propTypesMisspellWarningShown = true;
|
2319 |
|
2320 | var _name = getComponentNameFromType(type);
|
2321 |
|
2322 | error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
2323 | }
|
2324 |
|
2325 | if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
2326 | error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
2327 | }
|
2328 | }
|
2329 | }
|
2330 | |
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 | function validateFragmentProps(fragment) {
|
2337 | {
|
2338 | var keys = Object.keys(fragment.props);
|
2339 |
|
2340 | for (var i = 0; i < keys.length; i++) {
|
2341 | var key = keys[i];
|
2342 |
|
2343 | if (key !== 'children' && key !== 'key') {
|
2344 | setCurrentlyValidatingElement$1(fragment);
|
2345 |
|
2346 | error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
2347 |
|
2348 | setCurrentlyValidatingElement$1(null);
|
2349 | break;
|
2350 | }
|
2351 | }
|
2352 |
|
2353 | if (fragment.ref !== null) {
|
2354 | setCurrentlyValidatingElement$1(fragment);
|
2355 |
|
2356 | error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
2357 |
|
2358 | setCurrentlyValidatingElement$1(null);
|
2359 | }
|
2360 | }
|
2361 | }
|
2362 | function createElementWithValidation(type, props, children) {
|
2363 | var validType = isValidElementType(type);
|
2364 |
|
2365 |
|
2366 | if (!validType) {
|
2367 | var info = '';
|
2368 |
|
2369 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
2370 | 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.";
|
2371 | }
|
2372 |
|
2373 | var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
2374 |
|
2375 | if (sourceInfo) {
|
2376 | info += sourceInfo;
|
2377 | } else {
|
2378 | info += getDeclarationErrorAddendum();
|
2379 | }
|
2380 |
|
2381 | var typeString;
|
2382 |
|
2383 | if (type === null) {
|
2384 | typeString = 'null';
|
2385 | } else if (isArray(type)) {
|
2386 | typeString = 'array';
|
2387 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
2388 | typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
2389 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
2390 | } else {
|
2391 | typeString = typeof type;
|
2392 | }
|
2393 |
|
2394 | {
|
2395 | error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
2396 | }
|
2397 | }
|
2398 |
|
2399 | var element = createElement.apply(this, arguments);
|
2400 |
|
2401 |
|
2402 | if (element == null) {
|
2403 | return element;
|
2404 | }
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 | if (validType) {
|
2412 | for (var i = 2; i < arguments.length; i++) {
|
2413 | validateChildKeys(arguments[i], type);
|
2414 | }
|
2415 | }
|
2416 |
|
2417 | if (type === exports.Fragment) {
|
2418 | validateFragmentProps(element);
|
2419 | } else {
|
2420 | validatePropTypes(element);
|
2421 | }
|
2422 |
|
2423 | return element;
|
2424 | }
|
2425 | var didWarnAboutDeprecatedCreateFactory = false;
|
2426 | function createFactoryWithValidation(type) {
|
2427 | var validatedFactory = createElementWithValidation.bind(null, type);
|
2428 | validatedFactory.type = type;
|
2429 |
|
2430 | {
|
2431 | if (!didWarnAboutDeprecatedCreateFactory) {
|
2432 | didWarnAboutDeprecatedCreateFactory = true;
|
2433 |
|
2434 | warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
2435 | }
|
2436 |
|
2437 |
|
2438 | Object.defineProperty(validatedFactory, 'type', {
|
2439 | enumerable: false,
|
2440 | get: function () {
|
2441 | warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
2442 |
|
2443 | Object.defineProperty(this, 'type', {
|
2444 | value: type
|
2445 | });
|
2446 | return type;
|
2447 | }
|
2448 | });
|
2449 | }
|
2450 |
|
2451 | return validatedFactory;
|
2452 | }
|
2453 | function cloneElementWithValidation(element, props, children) {
|
2454 | var newElement = cloneElement.apply(this, arguments);
|
2455 |
|
2456 | for (var i = 2; i < arguments.length; i++) {
|
2457 | validateChildKeys(arguments[i], newElement.type);
|
2458 | }
|
2459 |
|
2460 | validatePropTypes(newElement);
|
2461 | return newElement;
|
2462 | }
|
2463 |
|
2464 | function createMutableSource(source, getVersion) {
|
2465 | var mutableSource = {
|
2466 | _getVersion: getVersion,
|
2467 | _source: source,
|
2468 | _workInProgressVersionPrimary: null,
|
2469 | _workInProgressVersionSecondary: null
|
2470 | };
|
2471 |
|
2472 | {
|
2473 | mutableSource._currentPrimaryRenderer = null;
|
2474 | mutableSource._currentSecondaryRenderer = null;
|
2475 |
|
2476 |
|
2477 | mutableSource._currentlyRenderingFiber = null;
|
2478 | mutableSource._initialVersionAsOfFirstRender = null;
|
2479 | }
|
2480 |
|
2481 | return mutableSource;
|
2482 | }
|
2483 |
|
2484 | var enableSchedulerDebugging = false;
|
2485 | var enableProfiling = false;
|
2486 | var frameYieldMs = 5;
|
2487 |
|
2488 | function push(heap, node) {
|
2489 | var index = heap.length;
|
2490 | heap.push(node);
|
2491 | siftUp(heap, node, index);
|
2492 | }
|
2493 | function peek(heap) {
|
2494 | return heap.length === 0 ? null : heap[0];
|
2495 | }
|
2496 | function pop(heap) {
|
2497 | if (heap.length === 0) {
|
2498 | return null;
|
2499 | }
|
2500 |
|
2501 | var first = heap[0];
|
2502 | var last = heap.pop();
|
2503 |
|
2504 | if (last !== first) {
|
2505 | heap[0] = last;
|
2506 | siftDown(heap, last, 0);
|
2507 | }
|
2508 |
|
2509 | return first;
|
2510 | }
|
2511 |
|
2512 | function siftUp(heap, node, i) {
|
2513 | var index = i;
|
2514 |
|
2515 | while (index > 0) {
|
2516 | var parentIndex = index - 1 >>> 1;
|
2517 | var parent = heap[parentIndex];
|
2518 |
|
2519 | if (compare(parent, node) > 0) {
|
2520 |
|
2521 | heap[parentIndex] = node;
|
2522 | heap[index] = parent;
|
2523 | index = parentIndex;
|
2524 | } else {
|
2525 |
|
2526 | return;
|
2527 | }
|
2528 | }
|
2529 | }
|
2530 |
|
2531 | function siftDown(heap, node, i) {
|
2532 | var index = i;
|
2533 | var length = heap.length;
|
2534 | var halfLength = length >>> 1;
|
2535 |
|
2536 | while (index < halfLength) {
|
2537 | var leftIndex = (index + 1) * 2 - 1;
|
2538 | var left = heap[leftIndex];
|
2539 | var rightIndex = leftIndex + 1;
|
2540 | var right = heap[rightIndex];
|
2541 |
|
2542 | if (compare(left, node) < 0) {
|
2543 | if (rightIndex < length && compare(right, left) < 0) {
|
2544 | heap[index] = right;
|
2545 | heap[rightIndex] = node;
|
2546 | index = rightIndex;
|
2547 | } else {
|
2548 | heap[index] = left;
|
2549 | heap[leftIndex] = node;
|
2550 | index = leftIndex;
|
2551 | }
|
2552 | } else if (rightIndex < length && compare(right, node) < 0) {
|
2553 | heap[index] = right;
|
2554 | heap[rightIndex] = node;
|
2555 | index = rightIndex;
|
2556 | } else {
|
2557 |
|
2558 | return;
|
2559 | }
|
2560 | }
|
2561 | }
|
2562 |
|
2563 | function compare(a, b) {
|
2564 |
|
2565 | var diff = a.sortIndex - b.sortIndex;
|
2566 | return diff !== 0 ? diff : a.id - b.id;
|
2567 | }
|
2568 |
|
2569 |
|
2570 | var ImmediatePriority = 1;
|
2571 | var UserBlockingPriority = 2;
|
2572 | var NormalPriority = 3;
|
2573 | var LowPriority = 4;
|
2574 | var IdlePriority = 5;
|
2575 |
|
2576 | function markTaskErrored(task, ms) {
|
2577 | }
|
2578 |
|
2579 |
|
2580 | var getCurrentTime;
|
2581 | var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
|
2582 |
|
2583 | if (hasPerformanceNow) {
|
2584 | var localPerformance = performance;
|
2585 |
|
2586 | getCurrentTime = function () {
|
2587 | return localPerformance.now();
|
2588 | };
|
2589 | } else {
|
2590 | var localDate = Date;
|
2591 | var initialTime = localDate.now();
|
2592 |
|
2593 | getCurrentTime = function () {
|
2594 | return localDate.now() - initialTime;
|
2595 | };
|
2596 | }
|
2597 |
|
2598 |
|
2599 |
|
2600 |
|
2601 | var maxSigned31BitInt = 1073741823;
|
2602 |
|
2603 | var IMMEDIATE_PRIORITY_TIMEOUT = -1;
|
2604 |
|
2605 | var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
|
2606 | var NORMAL_PRIORITY_TIMEOUT = 5000;
|
2607 | var LOW_PRIORITY_TIMEOUT = 10000;
|
2608 |
|
2609 | var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt;
|
2610 |
|
2611 | var taskQueue = [];
|
2612 | var timerQueue = [];
|
2613 |
|
2614 | var taskIdCounter = 1;
|
2615 | var currentTask = null;
|
2616 | var currentPriorityLevel = NormalPriority;
|
2617 |
|
2618 | var isPerformingWork = false;
|
2619 | var isHostCallbackScheduled = false;
|
2620 | var isHostTimeoutScheduled = false;
|
2621 |
|
2622 | var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
|
2623 | var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
|
2624 | var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null;
|
2625 |
|
2626 | var isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
|
2627 |
|
2628 | function advanceTimers(currentTime) {
|
2629 |
|
2630 | var timer = peek(timerQueue);
|
2631 |
|
2632 | while (timer !== null) {
|
2633 | if (timer.callback === null) {
|
2634 |
|
2635 | pop(timerQueue);
|
2636 | } else if (timer.startTime <= currentTime) {
|
2637 |
|
2638 | pop(timerQueue);
|
2639 | timer.sortIndex = timer.expirationTime;
|
2640 | push(taskQueue, timer);
|
2641 | } else {
|
2642 |
|
2643 | return;
|
2644 | }
|
2645 |
|
2646 | timer = peek(timerQueue);
|
2647 | }
|
2648 | }
|
2649 |
|
2650 | function handleTimeout(currentTime) {
|
2651 | isHostTimeoutScheduled = false;
|
2652 | advanceTimers(currentTime);
|
2653 |
|
2654 | if (!isHostCallbackScheduled) {
|
2655 | if (peek(taskQueue) !== null) {
|
2656 | isHostCallbackScheduled = true;
|
2657 | requestHostCallback(flushWork);
|
2658 | } else {
|
2659 | var firstTimer = peek(timerQueue);
|
2660 |
|
2661 | if (firstTimer !== null) {
|
2662 | requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
2663 | }
|
2664 | }
|
2665 | }
|
2666 | }
|
2667 |
|
2668 | function flushWork(hasTimeRemaining, initialTime) {
|
2669 |
|
2670 |
|
2671 | isHostCallbackScheduled = false;
|
2672 |
|
2673 | if (isHostTimeoutScheduled) {
|
2674 |
|
2675 | isHostTimeoutScheduled = false;
|
2676 | cancelHostTimeout();
|
2677 | }
|
2678 |
|
2679 | isPerformingWork = true;
|
2680 | var previousPriorityLevel = currentPriorityLevel;
|
2681 |
|
2682 | try {
|
2683 | if (enableProfiling) {
|
2684 | try {
|
2685 | return workLoop(hasTimeRemaining, initialTime);
|
2686 | } catch (error) {
|
2687 | if (currentTask !== null) {
|
2688 | var currentTime = getCurrentTime();
|
2689 | markTaskErrored(currentTask, currentTime);
|
2690 | currentTask.isQueued = false;
|
2691 | }
|
2692 |
|
2693 | throw error;
|
2694 | }
|
2695 | } else {
|
2696 |
|
2697 | return workLoop(hasTimeRemaining, initialTime);
|
2698 | }
|
2699 | } finally {
|
2700 | currentTask = null;
|
2701 | currentPriorityLevel = previousPriorityLevel;
|
2702 | isPerformingWork = false;
|
2703 | }
|
2704 | }
|
2705 |
|
2706 | function workLoop(hasTimeRemaining, initialTime) {
|
2707 | var currentTime = initialTime;
|
2708 | advanceTimers(currentTime);
|
2709 | currentTask = peek(taskQueue);
|
2710 |
|
2711 | while (currentTask !== null && !(enableSchedulerDebugging )) {
|
2712 | if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
|
2713 |
|
2714 | break;
|
2715 | }
|
2716 |
|
2717 | var callback = currentTask.callback;
|
2718 |
|
2719 | if (typeof callback === 'function') {
|
2720 | currentTask.callback = null;
|
2721 | currentPriorityLevel = currentTask.priorityLevel;
|
2722 | var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
|
2723 |
|
2724 | var continuationCallback = callback(didUserCallbackTimeout);
|
2725 | currentTime = getCurrentTime();
|
2726 |
|
2727 | if (typeof continuationCallback === 'function') {
|
2728 | currentTask.callback = continuationCallback;
|
2729 | } else {
|
2730 |
|
2731 | if (currentTask === peek(taskQueue)) {
|
2732 | pop(taskQueue);
|
2733 | }
|
2734 | }
|
2735 |
|
2736 | advanceTimers(currentTime);
|
2737 | } else {
|
2738 | pop(taskQueue);
|
2739 | }
|
2740 |
|
2741 | currentTask = peek(taskQueue);
|
2742 | }
|
2743 |
|
2744 |
|
2745 | if (currentTask !== null) {
|
2746 | return true;
|
2747 | } else {
|
2748 | var firstTimer = peek(timerQueue);
|
2749 |
|
2750 | if (firstTimer !== null) {
|
2751 | requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
|
2752 | }
|
2753 |
|
2754 | return false;
|
2755 | }
|
2756 | }
|
2757 |
|
2758 | function unstable_runWithPriority(priorityLevel, eventHandler) {
|
2759 | switch (priorityLevel) {
|
2760 | case ImmediatePriority:
|
2761 | case UserBlockingPriority:
|
2762 | case NormalPriority:
|
2763 | case LowPriority:
|
2764 | case IdlePriority:
|
2765 | break;
|
2766 |
|
2767 | default:
|
2768 | priorityLevel = NormalPriority;
|
2769 | }
|
2770 |
|
2771 | var previousPriorityLevel = currentPriorityLevel;
|
2772 | currentPriorityLevel = priorityLevel;
|
2773 |
|
2774 | try {
|
2775 | return eventHandler();
|
2776 | } finally {
|
2777 | currentPriorityLevel = previousPriorityLevel;
|
2778 | }
|
2779 | }
|
2780 |
|
2781 | function unstable_next(eventHandler) {
|
2782 | var priorityLevel;
|
2783 |
|
2784 | switch (currentPriorityLevel) {
|
2785 | case ImmediatePriority:
|
2786 | case UserBlockingPriority:
|
2787 | case NormalPriority:
|
2788 |
|
2789 | priorityLevel = NormalPriority;
|
2790 | break;
|
2791 |
|
2792 | default:
|
2793 |
|
2794 | priorityLevel = currentPriorityLevel;
|
2795 | break;
|
2796 | }
|
2797 |
|
2798 | var previousPriorityLevel = currentPriorityLevel;
|
2799 | currentPriorityLevel = priorityLevel;
|
2800 |
|
2801 | try {
|
2802 | return eventHandler();
|
2803 | } finally {
|
2804 | currentPriorityLevel = previousPriorityLevel;
|
2805 | }
|
2806 | }
|
2807 |
|
2808 | function unstable_wrapCallback(callback) {
|
2809 | var parentPriorityLevel = currentPriorityLevel;
|
2810 | return function () {
|
2811 |
|
2812 | var previousPriorityLevel = currentPriorityLevel;
|
2813 | currentPriorityLevel = parentPriorityLevel;
|
2814 |
|
2815 | try {
|
2816 | return callback.apply(this, arguments);
|
2817 | } finally {
|
2818 | currentPriorityLevel = previousPriorityLevel;
|
2819 | }
|
2820 | };
|
2821 | }
|
2822 |
|
2823 | function unstable_scheduleCallback(priorityLevel, callback, options) {
|
2824 | var currentTime = getCurrentTime();
|
2825 | var startTime;
|
2826 |
|
2827 | if (typeof options === 'object' && options !== null) {
|
2828 | var delay = options.delay;
|
2829 |
|
2830 | if (typeof delay === 'number' && delay > 0) {
|
2831 | startTime = currentTime + delay;
|
2832 | } else {
|
2833 | startTime = currentTime;
|
2834 | }
|
2835 | } else {
|
2836 | startTime = currentTime;
|
2837 | }
|
2838 |
|
2839 | var timeout;
|
2840 |
|
2841 | switch (priorityLevel) {
|
2842 | case ImmediatePriority:
|
2843 | timeout = IMMEDIATE_PRIORITY_TIMEOUT;
|
2844 | break;
|
2845 |
|
2846 | case UserBlockingPriority:
|
2847 | timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
|
2848 | break;
|
2849 |
|
2850 | case IdlePriority:
|
2851 | timeout = IDLE_PRIORITY_TIMEOUT;
|
2852 | break;
|
2853 |
|
2854 | case LowPriority:
|
2855 | timeout = LOW_PRIORITY_TIMEOUT;
|
2856 | break;
|
2857 |
|
2858 | case NormalPriority:
|
2859 | default:
|
2860 | timeout = NORMAL_PRIORITY_TIMEOUT;
|
2861 | break;
|
2862 | }
|
2863 |
|
2864 | var expirationTime = startTime + timeout;
|
2865 | var newTask = {
|
2866 | id: taskIdCounter++,
|
2867 | callback: callback,
|
2868 | priorityLevel: priorityLevel,
|
2869 | startTime: startTime,
|
2870 | expirationTime: expirationTime,
|
2871 | sortIndex: -1
|
2872 | };
|
2873 |
|
2874 | if (startTime > currentTime) {
|
2875 |
|
2876 | newTask.sortIndex = startTime;
|
2877 | push(timerQueue, newTask);
|
2878 |
|
2879 | if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
|
2880 |
|
2881 | if (isHostTimeoutScheduled) {
|
2882 |
|
2883 | cancelHostTimeout();
|
2884 | } else {
|
2885 | isHostTimeoutScheduled = true;
|
2886 | }
|
2887 |
|
2888 |
|
2889 | requestHostTimeout(handleTimeout, startTime - currentTime);
|
2890 | }
|
2891 | } else {
|
2892 | newTask.sortIndex = expirationTime;
|
2893 | push(taskQueue, newTask);
|
2894 |
|
2895 |
|
2896 |
|
2897 | if (!isHostCallbackScheduled && !isPerformingWork) {
|
2898 | isHostCallbackScheduled = true;
|
2899 | requestHostCallback(flushWork);
|
2900 | }
|
2901 | }
|
2902 |
|
2903 | return newTask;
|
2904 | }
|
2905 |
|
2906 | function unstable_pauseExecution() {
|
2907 | }
|
2908 |
|
2909 | function unstable_continueExecution() {
|
2910 |
|
2911 | if (!isHostCallbackScheduled && !isPerformingWork) {
|
2912 | isHostCallbackScheduled = true;
|
2913 | requestHostCallback(flushWork);
|
2914 | }
|
2915 | }
|
2916 |
|
2917 | function unstable_getFirstCallbackNode() {
|
2918 | return peek(taskQueue);
|
2919 | }
|
2920 |
|
2921 | function unstable_cancelCallback(task) {
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 | task.callback = null;
|
2927 | }
|
2928 |
|
2929 | function unstable_getCurrentPriorityLevel() {
|
2930 | return currentPriorityLevel;
|
2931 | }
|
2932 |
|
2933 | var isMessageLoopRunning = false;
|
2934 | var scheduledHostCallback = null;
|
2935 | var taskTimeoutID = -1;
|
2936 |
|
2937 |
|
2938 |
|
2939 |
|
2940 | var frameInterval = frameYieldMs;
|
2941 | var startTime = -1;
|
2942 |
|
2943 | function shouldYieldToHost() {
|
2944 | var timeElapsed = getCurrentTime() - startTime;
|
2945 |
|
2946 | if (timeElapsed < frameInterval) {
|
2947 |
|
2948 |
|
2949 | return false;
|
2950 | }
|
2951 |
|
2952 |
|
2953 | return true;
|
2954 | }
|
2955 |
|
2956 | function requestPaint() {
|
2957 |
|
2958 | }
|
2959 |
|
2960 | function forceFrameRate(fps) {
|
2961 | if (fps < 0 || fps > 125) {
|
2962 |
|
2963 | console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
|
2964 | return;
|
2965 | }
|
2966 |
|
2967 | if (fps > 0) {
|
2968 | frameInterval = Math.floor(1000 / fps);
|
2969 | } else {
|
2970 |
|
2971 | frameInterval = frameYieldMs;
|
2972 | }
|
2973 | }
|
2974 |
|
2975 | var performWorkUntilDeadline = function () {
|
2976 | if (scheduledHostCallback !== null) {
|
2977 | var currentTime = getCurrentTime();
|
2978 |
|
2979 |
|
2980 | startTime = currentTime;
|
2981 | var hasTimeRemaining = true;
|
2982 |
|
2983 |
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 | var hasMoreWork = true;
|
2989 |
|
2990 | try {
|
2991 | hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
|
2992 | } finally {
|
2993 | if (hasMoreWork) {
|
2994 |
|
2995 |
|
2996 | schedulePerformWorkUntilDeadline();
|
2997 | } else {
|
2998 | isMessageLoopRunning = false;
|
2999 | scheduledHostCallback = null;
|
3000 | }
|
3001 | }
|
3002 | } else {
|
3003 | isMessageLoopRunning = false;
|
3004 | }
|
3005 | };
|
3006 |
|
3007 | var schedulePerformWorkUntilDeadline;
|
3008 |
|
3009 | if (typeof localSetImmediate === 'function') {
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 | schedulePerformWorkUntilDeadline = function () {
|
3022 | localSetImmediate(performWorkUntilDeadline);
|
3023 | };
|
3024 | } else if (typeof MessageChannel !== 'undefined') {
|
3025 |
|
3026 |
|
3027 | var channel = new MessageChannel();
|
3028 | var port = channel.port2;
|
3029 | channel.port1.onmessage = performWorkUntilDeadline;
|
3030 |
|
3031 | schedulePerformWorkUntilDeadline = function () {
|
3032 | port.postMessage(null);
|
3033 | };
|
3034 | } else {
|
3035 |
|
3036 | schedulePerformWorkUntilDeadline = function () {
|
3037 | localSetTimeout(performWorkUntilDeadline, 0);
|
3038 | };
|
3039 | }
|
3040 |
|
3041 | function requestHostCallback(callback) {
|
3042 | scheduledHostCallback = callback;
|
3043 |
|
3044 | if (!isMessageLoopRunning) {
|
3045 | isMessageLoopRunning = true;
|
3046 | schedulePerformWorkUntilDeadline();
|
3047 | }
|
3048 | }
|
3049 |
|
3050 | function requestHostTimeout(callback, ms) {
|
3051 | taskTimeoutID = localSetTimeout(function () {
|
3052 | callback(getCurrentTime());
|
3053 | }, ms);
|
3054 | }
|
3055 |
|
3056 | function cancelHostTimeout() {
|
3057 | localClearTimeout(taskTimeoutID);
|
3058 | taskTimeoutID = -1;
|
3059 | }
|
3060 |
|
3061 | var unstable_requestPaint = requestPaint;
|
3062 | var unstable_Profiling = null;
|
3063 |
|
3064 |
|
3065 |
|
3066 | var Scheduler = Object.freeze({
|
3067 | __proto__: null,
|
3068 | unstable_ImmediatePriority: ImmediatePriority,
|
3069 | unstable_UserBlockingPriority: UserBlockingPriority,
|
3070 | unstable_NormalPriority: NormalPriority,
|
3071 | unstable_IdlePriority: IdlePriority,
|
3072 | unstable_LowPriority: LowPriority,
|
3073 | unstable_runWithPriority: unstable_runWithPriority,
|
3074 | unstable_next: unstable_next,
|
3075 | unstable_scheduleCallback: unstable_scheduleCallback,
|
3076 | unstable_cancelCallback: unstable_cancelCallback,
|
3077 | unstable_wrapCallback: unstable_wrapCallback,
|
3078 | unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
|
3079 | unstable_shouldYield: shouldYieldToHost,
|
3080 | unstable_requestPaint: unstable_requestPaint,
|
3081 | unstable_continueExecution: unstable_continueExecution,
|
3082 | unstable_pauseExecution: unstable_pauseExecution,
|
3083 | unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
|
3084 | get unstable_now () { return getCurrentTime; },
|
3085 | unstable_forceFrameRate: forceFrameRate,
|
3086 | unstable_Profiling: unstable_Profiling
|
3087 | });
|
3088 |
|
3089 | var ReactSharedInternals$1 = {
|
3090 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
3091 | ReactCurrentOwner: ReactCurrentOwner,
|
3092 | ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
3093 |
|
3094 | assign: assign,
|
3095 |
|
3096 |
|
3097 |
|
3098 |
|
3099 |
|
3100 | Scheduler: Scheduler
|
3101 | };
|
3102 |
|
3103 | {
|
3104 | ReactSharedInternals$1.ReactCurrentActQueue = ReactCurrentActQueue;
|
3105 | ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
3106 | }
|
3107 |
|
3108 | function startTransition(scope) {
|
3109 | var prevTransition = ReactCurrentBatchConfig.transition;
|
3110 | ReactCurrentBatchConfig.transition = 1;
|
3111 |
|
3112 | try {
|
3113 | scope();
|
3114 | } finally {
|
3115 | ReactCurrentBatchConfig.transition = prevTransition;
|
3116 |
|
3117 | {
|
3118 | if (prevTransition !== 1 && warnOnSubscriptionInsideStartTransition && ReactCurrentBatchConfig._updatedFibers) {
|
3119 | var updatedFibersCount = ReactCurrentBatchConfig._updatedFibers.size;
|
3120 |
|
3121 | if (updatedFibersCount > 10) {
|
3122 | 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.');
|
3123 | }
|
3124 |
|
3125 | ReactCurrentBatchConfig._updatedFibers.clear();
|
3126 | }
|
3127 | }
|
3128 | }
|
3129 | }
|
3130 |
|
3131 | var didWarnAboutMessageChannel = false;
|
3132 | var enqueueTaskImpl = null;
|
3133 | function enqueueTask(task) {
|
3134 | if (enqueueTaskImpl === null) {
|
3135 | try {
|
3136 |
|
3137 |
|
3138 | var requireString = ('require' + Math.random()).slice(0, 7);
|
3139 | var nodeRequire = module && module[requireString];
|
3140 |
|
3141 |
|
3142 | enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
3143 | } catch (_err) {
|
3144 |
|
3145 |
|
3146 |
|
3147 | enqueueTaskImpl = function (callback) {
|
3148 | {
|
3149 | if (didWarnAboutMessageChannel === false) {
|
3150 | didWarnAboutMessageChannel = true;
|
3151 |
|
3152 | if (typeof MessageChannel === 'undefined') {
|
3153 | error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
|
3154 | }
|
3155 | }
|
3156 | }
|
3157 |
|
3158 | var channel = new MessageChannel();
|
3159 | channel.port1.onmessage = callback;
|
3160 | channel.port2.postMessage(undefined);
|
3161 | };
|
3162 | }
|
3163 | }
|
3164 |
|
3165 | return enqueueTaskImpl(task);
|
3166 | }
|
3167 |
|
3168 | var actScopeDepth = 0;
|
3169 | var didWarnNoAwaitAct = false;
|
3170 | function act(callback) {
|
3171 | {
|
3172 |
|
3173 |
|
3174 | var prevActScopeDepth = actScopeDepth;
|
3175 | actScopeDepth++;
|
3176 |
|
3177 | if (ReactCurrentActQueue.current === null) {
|
3178 |
|
3179 |
|
3180 | ReactCurrentActQueue.current = [];
|
3181 | }
|
3182 |
|
3183 | var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
3184 | var result;
|
3185 |
|
3186 | try {
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 | ReactCurrentActQueue.isBatchingLegacy = true;
|
3192 | result = callback();
|
3193 |
|
3194 |
|
3195 |
|
3196 | if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
3197 | var queue = ReactCurrentActQueue.current;
|
3198 |
|
3199 | if (queue !== null) {
|
3200 | ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
3201 | flushActQueue(queue);
|
3202 | }
|
3203 | }
|
3204 | } catch (error) {
|
3205 | popActScope(prevActScopeDepth);
|
3206 | throw error;
|
3207 | } finally {
|
3208 | ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
3209 | }
|
3210 |
|
3211 | if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
3212 | var thenableResult = result;
|
3213 |
|
3214 |
|
3215 | var wasAwaited = false;
|
3216 | var thenable = {
|
3217 | then: function (resolve, reject) {
|
3218 | wasAwaited = true;
|
3219 | thenableResult.then(function (returnValue) {
|
3220 | popActScope(prevActScopeDepth);
|
3221 |
|
3222 | if (actScopeDepth === 0) {
|
3223 |
|
3224 |
|
3225 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3226 | } else {
|
3227 | resolve(returnValue);
|
3228 | }
|
3229 | }, function (error) {
|
3230 |
|
3231 | popActScope(prevActScopeDepth);
|
3232 | reject(error);
|
3233 | });
|
3234 | }
|
3235 | };
|
3236 |
|
3237 | {
|
3238 | if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
3239 |
|
3240 | Promise.resolve().then(function () {}).then(function () {
|
3241 | if (!wasAwaited) {
|
3242 | didWarnNoAwaitAct = true;
|
3243 |
|
3244 | error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
|
3245 | }
|
3246 | });
|
3247 | }
|
3248 | }
|
3249 |
|
3250 | return thenable;
|
3251 | } else {
|
3252 | var returnValue = result;
|
3253 |
|
3254 |
|
3255 | popActScope(prevActScopeDepth);
|
3256 |
|
3257 | if (actScopeDepth === 0) {
|
3258 |
|
3259 | var _queue = ReactCurrentActQueue.current;
|
3260 |
|
3261 | if (_queue !== null) {
|
3262 | flushActQueue(_queue);
|
3263 | ReactCurrentActQueue.current = null;
|
3264 | }
|
3265 |
|
3266 |
|
3267 |
|
3268 | var _thenable = {
|
3269 | then: function (resolve, reject) {
|
3270 |
|
3271 |
|
3272 |
|
3273 | if (ReactCurrentActQueue.current === null) {
|
3274 |
|
3275 | ReactCurrentActQueue.current = [];
|
3276 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3277 | } else {
|
3278 | resolve(returnValue);
|
3279 | }
|
3280 | }
|
3281 | };
|
3282 | return _thenable;
|
3283 | } else {
|
3284 |
|
3285 |
|
3286 | var _thenable2 = {
|
3287 | then: function (resolve, reject) {
|
3288 | resolve(returnValue);
|
3289 | }
|
3290 | };
|
3291 | return _thenable2;
|
3292 | }
|
3293 | }
|
3294 | }
|
3295 | }
|
3296 |
|
3297 | function popActScope(prevActScopeDepth) {
|
3298 | {
|
3299 | if (prevActScopeDepth !== actScopeDepth - 1) {
|
3300 | error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
3301 | }
|
3302 |
|
3303 | actScopeDepth = prevActScopeDepth;
|
3304 | }
|
3305 | }
|
3306 |
|
3307 | function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
3308 | {
|
3309 | var queue = ReactCurrentActQueue.current;
|
3310 |
|
3311 | if (queue !== null) {
|
3312 | try {
|
3313 | flushActQueue(queue);
|
3314 | enqueueTask(function () {
|
3315 | if (queue.length === 0) {
|
3316 |
|
3317 | ReactCurrentActQueue.current = null;
|
3318 | resolve(returnValue);
|
3319 | } else {
|
3320 |
|
3321 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
3322 | }
|
3323 | });
|
3324 | } catch (error) {
|
3325 | reject(error);
|
3326 | }
|
3327 | } else {
|
3328 | resolve(returnValue);
|
3329 | }
|
3330 | }
|
3331 | }
|
3332 |
|
3333 | var isFlushing = false;
|
3334 |
|
3335 | function flushActQueue(queue) {
|
3336 | {
|
3337 | if (!isFlushing) {
|
3338 |
|
3339 | isFlushing = true;
|
3340 | var i = 0;
|
3341 |
|
3342 | try {
|
3343 | for (; i < queue.length; i++) {
|
3344 | var callback = queue[i];
|
3345 |
|
3346 | do {
|
3347 | callback = callback(true);
|
3348 | } while (callback !== null);
|
3349 | }
|
3350 |
|
3351 | queue.length = 0;
|
3352 | } catch (error) {
|
3353 |
|
3354 | queue = queue.slice(i + 1);
|
3355 | throw error;
|
3356 | } finally {
|
3357 | isFlushing = false;
|
3358 | }
|
3359 | }
|
3360 | }
|
3361 | }
|
3362 |
|
3363 | var createElement$1 = createElementWithValidation ;
|
3364 | var cloneElement$1 = cloneElementWithValidation ;
|
3365 | var createFactory = createFactoryWithValidation ;
|
3366 | var Children = {
|
3367 | map: mapChildren,
|
3368 | forEach: forEachChildren,
|
3369 | count: countChildren,
|
3370 | toArray: toArray,
|
3371 | only: onlyChild
|
3372 | };
|
3373 |
|
3374 | exports.Children = Children;
|
3375 | exports.Component = Component;
|
3376 | exports.PureComponent = PureComponent;
|
3377 | exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1;
|
3378 | exports.cloneElement = cloneElement$1;
|
3379 | exports.createContext = createContext;
|
3380 | exports.createElement = createElement$1;
|
3381 | exports.createFactory = createFactory;
|
3382 | exports.createRef = createRef;
|
3383 | exports.forwardRef = forwardRef;
|
3384 | exports.isValidElement = isValidElement;
|
3385 | exports.lazy = lazy;
|
3386 | exports.memo = memo;
|
3387 | exports.startTransition = startTransition;
|
3388 | exports.unstable_act = act;
|
3389 | exports.unstable_createMutableSource = createMutableSource;
|
3390 | exports.useCallback = useCallback;
|
3391 | exports.useContext = useContext;
|
3392 | exports.useDebugValue = useDebugValue;
|
3393 | exports.useDeferredValue = useDeferredValue;
|
3394 | exports.useEffect = useEffect;
|
3395 | exports.useId = useId;
|
3396 | exports.useImperativeHandle = useImperativeHandle;
|
3397 | exports.useInsertionEffect = useInsertionEffect;
|
3398 | exports.useLayoutEffect = useLayoutEffect;
|
3399 | exports.useMemo = useMemo;
|
3400 | exports.useReducer = useReducer;
|
3401 | exports.useRef = useRef;
|
3402 | exports.useState = useState;
|
3403 | exports.useSyncExternalStore = useSyncExternalStore;
|
3404 | exports.useTransition = useTransition;
|
3405 | exports.version = ReactVersion;
|
3406 |
|
3407 | })));
|