@raspberrypifoundation/design-system-react 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3945 @@
1
+ 'use strict';
2
+
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
7
+ var classnames$1 = {exports: {}};
8
+
9
+ /*!
10
+ Copyright (c) 2018 Jed Watson.
11
+ Licensed under the MIT License (MIT), see
12
+ http://jedwatson.github.io/classnames
13
+ */
14
+
15
+ (function (module) {
16
+ /* global define */
17
+
18
+ (function () {
19
+
20
+ var hasOwn = {}.hasOwnProperty;
21
+
22
+ function classNames() {
23
+ var classes = [];
24
+
25
+ for (var i = 0; i < arguments.length; i++) {
26
+ var arg = arguments[i];
27
+ if (!arg) continue;
28
+
29
+ var argType = typeof arg;
30
+
31
+ if (argType === 'string' || argType === 'number') {
32
+ classes.push(arg);
33
+ } else if (Array.isArray(arg)) {
34
+ if (arg.length) {
35
+ var inner = classNames.apply(null, arg);
36
+ if (inner) {
37
+ classes.push(inner);
38
+ }
39
+ }
40
+ } else if (argType === 'object') {
41
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
42
+ classes.push(arg.toString());
43
+ continue;
44
+ }
45
+
46
+ for (var key in arg) {
47
+ if (hasOwn.call(arg, key) && arg[key]) {
48
+ classes.push(key);
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ return classes.join(' ');
55
+ }
56
+
57
+ if (module.exports) {
58
+ classNames.default = classNames;
59
+ module.exports = classNames;
60
+ } else {
61
+ window.classNames = classNames;
62
+ }
63
+ }());
64
+ } (classnames$1));
65
+
66
+ var classnamesExports = classnames$1.exports;
67
+ var classnames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
68
+
69
+ var propTypes = {exports: {}};
70
+
71
+ var reactIs = {exports: {}};
72
+
73
+ var reactIs_development = {};
74
+
75
+ /** @license React v16.13.1
76
+ * react-is.development.js
77
+ *
78
+ * Copyright (c) Facebook, Inc. and its affiliates.
79
+ *
80
+ * This source code is licensed under the MIT license found in the
81
+ * LICENSE file in the root directory of this source tree.
82
+ */
83
+
84
+
85
+
86
+ {
87
+ (function() {
88
+
89
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
90
+ // nor polyfill, then a plain number is used for performance.
91
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
92
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
93
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
94
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
95
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
96
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
97
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
98
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
99
+ // (unstable) APIs that have been removed. Can we remove the symbols?
100
+
101
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
102
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
103
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
104
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
105
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
106
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
107
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
108
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
109
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
110
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
111
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
112
+
113
+ function isValidElementType(type) {
114
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
115
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
116
+ }
117
+
118
+ function typeOf(object) {
119
+ if (typeof object === 'object' && object !== null) {
120
+ var $$typeof = object.$$typeof;
121
+
122
+ switch ($$typeof) {
123
+ case REACT_ELEMENT_TYPE:
124
+ var type = object.type;
125
+
126
+ switch (type) {
127
+ case REACT_ASYNC_MODE_TYPE:
128
+ case REACT_CONCURRENT_MODE_TYPE:
129
+ case REACT_FRAGMENT_TYPE:
130
+ case REACT_PROFILER_TYPE:
131
+ case REACT_STRICT_MODE_TYPE:
132
+ case REACT_SUSPENSE_TYPE:
133
+ return type;
134
+
135
+ default:
136
+ var $$typeofType = type && type.$$typeof;
137
+
138
+ switch ($$typeofType) {
139
+ case REACT_CONTEXT_TYPE:
140
+ case REACT_FORWARD_REF_TYPE:
141
+ case REACT_LAZY_TYPE:
142
+ case REACT_MEMO_TYPE:
143
+ case REACT_PROVIDER_TYPE:
144
+ return $$typeofType;
145
+
146
+ default:
147
+ return $$typeof;
148
+ }
149
+
150
+ }
151
+
152
+ case REACT_PORTAL_TYPE:
153
+ return $$typeof;
154
+ }
155
+ }
156
+
157
+ return undefined;
158
+ } // AsyncMode is deprecated along with isAsyncMode
159
+
160
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
161
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
162
+ var ContextConsumer = REACT_CONTEXT_TYPE;
163
+ var ContextProvider = REACT_PROVIDER_TYPE;
164
+ var Element = REACT_ELEMENT_TYPE;
165
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
166
+ var Fragment = REACT_FRAGMENT_TYPE;
167
+ var Lazy = REACT_LAZY_TYPE;
168
+ var Memo = REACT_MEMO_TYPE;
169
+ var Portal = REACT_PORTAL_TYPE;
170
+ var Profiler = REACT_PROFILER_TYPE;
171
+ var StrictMode = REACT_STRICT_MODE_TYPE;
172
+ var Suspense = REACT_SUSPENSE_TYPE;
173
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
174
+
175
+ function isAsyncMode(object) {
176
+ {
177
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
178
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
179
+
180
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
181
+ }
182
+ }
183
+
184
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
185
+ }
186
+ function isConcurrentMode(object) {
187
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
188
+ }
189
+ function isContextConsumer(object) {
190
+ return typeOf(object) === REACT_CONTEXT_TYPE;
191
+ }
192
+ function isContextProvider(object) {
193
+ return typeOf(object) === REACT_PROVIDER_TYPE;
194
+ }
195
+ function isElement(object) {
196
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
197
+ }
198
+ function isForwardRef(object) {
199
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
200
+ }
201
+ function isFragment(object) {
202
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
203
+ }
204
+ function isLazy(object) {
205
+ return typeOf(object) === REACT_LAZY_TYPE;
206
+ }
207
+ function isMemo(object) {
208
+ return typeOf(object) === REACT_MEMO_TYPE;
209
+ }
210
+ function isPortal(object) {
211
+ return typeOf(object) === REACT_PORTAL_TYPE;
212
+ }
213
+ function isProfiler(object) {
214
+ return typeOf(object) === REACT_PROFILER_TYPE;
215
+ }
216
+ function isStrictMode(object) {
217
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
218
+ }
219
+ function isSuspense(object) {
220
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
221
+ }
222
+
223
+ reactIs_development.AsyncMode = AsyncMode;
224
+ reactIs_development.ConcurrentMode = ConcurrentMode;
225
+ reactIs_development.ContextConsumer = ContextConsumer;
226
+ reactIs_development.ContextProvider = ContextProvider;
227
+ reactIs_development.Element = Element;
228
+ reactIs_development.ForwardRef = ForwardRef;
229
+ reactIs_development.Fragment = Fragment;
230
+ reactIs_development.Lazy = Lazy;
231
+ reactIs_development.Memo = Memo;
232
+ reactIs_development.Portal = Portal;
233
+ reactIs_development.Profiler = Profiler;
234
+ reactIs_development.StrictMode = StrictMode;
235
+ reactIs_development.Suspense = Suspense;
236
+ reactIs_development.isAsyncMode = isAsyncMode;
237
+ reactIs_development.isConcurrentMode = isConcurrentMode;
238
+ reactIs_development.isContextConsumer = isContextConsumer;
239
+ reactIs_development.isContextProvider = isContextProvider;
240
+ reactIs_development.isElement = isElement;
241
+ reactIs_development.isForwardRef = isForwardRef;
242
+ reactIs_development.isFragment = isFragment;
243
+ reactIs_development.isLazy = isLazy;
244
+ reactIs_development.isMemo = isMemo;
245
+ reactIs_development.isPortal = isPortal;
246
+ reactIs_development.isProfiler = isProfiler;
247
+ reactIs_development.isStrictMode = isStrictMode;
248
+ reactIs_development.isSuspense = isSuspense;
249
+ reactIs_development.isValidElementType = isValidElementType;
250
+ reactIs_development.typeOf = typeOf;
251
+ })();
252
+ }
253
+
254
+ {
255
+ reactIs.exports = reactIs_development;
256
+ }
257
+
258
+ var reactIsExports = reactIs.exports;
259
+
260
+ /*
261
+ object-assign
262
+ (c) Sindre Sorhus
263
+ @license MIT
264
+ */
265
+ /* eslint-disable no-unused-vars */
266
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
267
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
268
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
269
+
270
+ function toObject(val) {
271
+ if (val === null || val === undefined) {
272
+ throw new TypeError('Object.assign cannot be called with null or undefined');
273
+ }
274
+
275
+ return Object(val);
276
+ }
277
+
278
+ function shouldUseNative() {
279
+ try {
280
+ if (!Object.assign) {
281
+ return false;
282
+ }
283
+
284
+ // Detect buggy property enumeration order in older V8 versions.
285
+
286
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
287
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
288
+ test1[5] = 'de';
289
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
290
+ return false;
291
+ }
292
+
293
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
294
+ var test2 = {};
295
+ for (var i = 0; i < 10; i++) {
296
+ test2['_' + String.fromCharCode(i)] = i;
297
+ }
298
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
299
+ return test2[n];
300
+ });
301
+ if (order2.join('') !== '0123456789') {
302
+ return false;
303
+ }
304
+
305
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
306
+ var test3 = {};
307
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
308
+ test3[letter] = letter;
309
+ });
310
+ if (Object.keys(Object.assign({}, test3)).join('') !==
311
+ 'abcdefghijklmnopqrst') {
312
+ return false;
313
+ }
314
+
315
+ return true;
316
+ } catch (err) {
317
+ // We don't expect any of the above to throw, but better to be safe.
318
+ return false;
319
+ }
320
+ }
321
+
322
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
323
+ var from;
324
+ var to = toObject(target);
325
+ var symbols;
326
+
327
+ for (var s = 1; s < arguments.length; s++) {
328
+ from = Object(arguments[s]);
329
+
330
+ for (var key in from) {
331
+ if (hasOwnProperty.call(from, key)) {
332
+ to[key] = from[key];
333
+ }
334
+ }
335
+
336
+ if (getOwnPropertySymbols) {
337
+ symbols = getOwnPropertySymbols(from);
338
+ for (var i = 0; i < symbols.length; i++) {
339
+ if (propIsEnumerable.call(from, symbols[i])) {
340
+ to[symbols[i]] = from[symbols[i]];
341
+ }
342
+ }
343
+ }
344
+ }
345
+
346
+ return to;
347
+ };
348
+
349
+ /**
350
+ * Copyright (c) 2013-present, Facebook, Inc.
351
+ *
352
+ * This source code is licensed under the MIT license found in the
353
+ * LICENSE file in the root directory of this source tree.
354
+ */
355
+
356
+ var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
357
+
358
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
359
+
360
+ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
361
+
362
+ /**
363
+ * Copyright (c) 2013-present, Facebook, Inc.
364
+ *
365
+ * This source code is licensed under the MIT license found in the
366
+ * LICENSE file in the root directory of this source tree.
367
+ */
368
+
369
+ var printWarning$1 = function() {};
370
+
371
+ {
372
+ var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
373
+ var loggedTypeFailures = {};
374
+ var has$1 = has$2;
375
+
376
+ printWarning$1 = function(text) {
377
+ var message = 'Warning: ' + text;
378
+ if (typeof console !== 'undefined') {
379
+ console.error(message);
380
+ }
381
+ try {
382
+ // --- Welcome to debugging React ---
383
+ // This error was thrown as a convenience so that you can use this stack
384
+ // to find the callsite that caused this warning to fire.
385
+ throw new Error(message);
386
+ } catch (x) { /**/ }
387
+ };
388
+ }
389
+
390
+ /**
391
+ * Assert that the values match with the type specs.
392
+ * Error messages are memorized and will only be shown once.
393
+ *
394
+ * @param {object} typeSpecs Map of name to a ReactPropType
395
+ * @param {object} values Runtime values that need to be type-checked
396
+ * @param {string} location e.g. "prop", "context", "child context"
397
+ * @param {string} componentName Name of the component for error messages.
398
+ * @param {?Function} getStack Returns the component stack.
399
+ * @private
400
+ */
401
+ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
402
+ {
403
+ for (var typeSpecName in typeSpecs) {
404
+ if (has$1(typeSpecs, typeSpecName)) {
405
+ var error;
406
+ // Prop type validation may throw. In case they do, we don't want to
407
+ // fail the render phase where it didn't fail before. So we log it.
408
+ // After these have been cleaned up, we'll let them throw.
409
+ try {
410
+ // This is intentionally an invariant that gets caught. It's the same
411
+ // behavior as without this statement except with a better message.
412
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
413
+ var err = Error(
414
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
415
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
416
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
417
+ );
418
+ err.name = 'Invariant Violation';
419
+ throw err;
420
+ }
421
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
422
+ } catch (ex) {
423
+ error = ex;
424
+ }
425
+ if (error && !(error instanceof Error)) {
426
+ printWarning$1(
427
+ (componentName || 'React class') + ': type specification of ' +
428
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
429
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
430
+ 'You may have forgotten to pass an argument to the type checker ' +
431
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
432
+ 'shape all require an argument).'
433
+ );
434
+ }
435
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
436
+ // Only monitor this failure once because there tends to be a lot of the
437
+ // same error.
438
+ loggedTypeFailures[error.message] = true;
439
+
440
+ var stack = getStack ? getStack() : '';
441
+
442
+ printWarning$1(
443
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
444
+ );
445
+ }
446
+ }
447
+ }
448
+ }
449
+ }
450
+
451
+ /**
452
+ * Resets warning cache when testing.
453
+ *
454
+ * @private
455
+ */
456
+ checkPropTypes$1.resetWarningCache = function() {
457
+ {
458
+ loggedTypeFailures = {};
459
+ }
460
+ };
461
+
462
+ var checkPropTypes_1 = checkPropTypes$1;
463
+
464
+ /**
465
+ * Copyright (c) 2013-present, Facebook, Inc.
466
+ *
467
+ * This source code is licensed under the MIT license found in the
468
+ * LICENSE file in the root directory of this source tree.
469
+ */
470
+
471
+ var ReactIs$1 = reactIsExports;
472
+ var assign = objectAssign;
473
+
474
+ var ReactPropTypesSecret = ReactPropTypesSecret_1;
475
+ var has = has$2;
476
+ var checkPropTypes = checkPropTypes_1;
477
+
478
+ var printWarning = function() {};
479
+
480
+ {
481
+ printWarning = function(text) {
482
+ var message = 'Warning: ' + text;
483
+ if (typeof console !== 'undefined') {
484
+ console.error(message);
485
+ }
486
+ try {
487
+ // --- Welcome to debugging React ---
488
+ // This error was thrown as a convenience so that you can use this stack
489
+ // to find the callsite that caused this warning to fire.
490
+ throw new Error(message);
491
+ } catch (x) {}
492
+ };
493
+ }
494
+
495
+ function emptyFunctionThatReturnsNull() {
496
+ return null;
497
+ }
498
+
499
+ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
500
+ /* global Symbol */
501
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
502
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
503
+
504
+ /**
505
+ * Returns the iterator method function contained on the iterable object.
506
+ *
507
+ * Be sure to invoke the function with the iterable as context:
508
+ *
509
+ * var iteratorFn = getIteratorFn(myIterable);
510
+ * if (iteratorFn) {
511
+ * var iterator = iteratorFn.call(myIterable);
512
+ * ...
513
+ * }
514
+ *
515
+ * @param {?object} maybeIterable
516
+ * @return {?function}
517
+ */
518
+ function getIteratorFn(maybeIterable) {
519
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
520
+ if (typeof iteratorFn === 'function') {
521
+ return iteratorFn;
522
+ }
523
+ }
524
+
525
+ /**
526
+ * Collection of methods that allow declaration and validation of props that are
527
+ * supplied to React components. Example usage:
528
+ *
529
+ * var Props = require('ReactPropTypes');
530
+ * var MyArticle = React.createClass({
531
+ * propTypes: {
532
+ * // An optional string prop named "description".
533
+ * description: Props.string,
534
+ *
535
+ * // A required enum prop named "category".
536
+ * category: Props.oneOf(['News','Photos']).isRequired,
537
+ *
538
+ * // A prop named "dialog" that requires an instance of Dialog.
539
+ * dialog: Props.instanceOf(Dialog).isRequired
540
+ * },
541
+ * render: function() { ... }
542
+ * });
543
+ *
544
+ * A more formal specification of how these methods are used:
545
+ *
546
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
547
+ * decl := ReactPropTypes.{type}(.isRequired)?
548
+ *
549
+ * Each and every declaration produces a function with the same signature. This
550
+ * allows the creation of custom validation functions. For example:
551
+ *
552
+ * var MyLink = React.createClass({
553
+ * propTypes: {
554
+ * // An optional string or URI prop named "href".
555
+ * href: function(props, propName, componentName) {
556
+ * var propValue = props[propName];
557
+ * if (propValue != null && typeof propValue !== 'string' &&
558
+ * !(propValue instanceof URI)) {
559
+ * return new Error(
560
+ * 'Expected a string or an URI for ' + propName + ' in ' +
561
+ * componentName
562
+ * );
563
+ * }
564
+ * }
565
+ * },
566
+ * render: function() {...}
567
+ * });
568
+ *
569
+ * @internal
570
+ */
571
+
572
+ var ANONYMOUS = '<<anonymous>>';
573
+
574
+ // Important!
575
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
576
+ var ReactPropTypes = {
577
+ array: createPrimitiveTypeChecker('array'),
578
+ bigint: createPrimitiveTypeChecker('bigint'),
579
+ bool: createPrimitiveTypeChecker('boolean'),
580
+ func: createPrimitiveTypeChecker('function'),
581
+ number: createPrimitiveTypeChecker('number'),
582
+ object: createPrimitiveTypeChecker('object'),
583
+ string: createPrimitiveTypeChecker('string'),
584
+ symbol: createPrimitiveTypeChecker('symbol'),
585
+
586
+ any: createAnyTypeChecker(),
587
+ arrayOf: createArrayOfTypeChecker,
588
+ element: createElementTypeChecker(),
589
+ elementType: createElementTypeTypeChecker(),
590
+ instanceOf: createInstanceTypeChecker,
591
+ node: createNodeChecker(),
592
+ objectOf: createObjectOfTypeChecker,
593
+ oneOf: createEnumTypeChecker,
594
+ oneOfType: createUnionTypeChecker,
595
+ shape: createShapeTypeChecker,
596
+ exact: createStrictShapeTypeChecker,
597
+ };
598
+
599
+ /**
600
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
601
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
602
+ */
603
+ /*eslint-disable no-self-compare*/
604
+ function is(x, y) {
605
+ // SameValue algorithm
606
+ if (x === y) {
607
+ // Steps 1-5, 7-10
608
+ // Steps 6.b-6.e: +0 != -0
609
+ return x !== 0 || 1 / x === 1 / y;
610
+ } else {
611
+ // Step 6.a: NaN == NaN
612
+ return x !== x && y !== y;
613
+ }
614
+ }
615
+ /*eslint-enable no-self-compare*/
616
+
617
+ /**
618
+ * We use an Error-like object for backward compatibility as people may call
619
+ * PropTypes directly and inspect their output. However, we don't use real
620
+ * Errors anymore. We don't inspect their stack anyway, and creating them
621
+ * is prohibitively expensive if they are created too often, such as what
622
+ * happens in oneOfType() for any type before the one that matched.
623
+ */
624
+ function PropTypeError(message, data) {
625
+ this.message = message;
626
+ this.data = data && typeof data === 'object' ? data: {};
627
+ this.stack = '';
628
+ }
629
+ // Make `instanceof Error` still work for returned errors.
630
+ PropTypeError.prototype = Error.prototype;
631
+
632
+ function createChainableTypeChecker(validate) {
633
+ {
634
+ var manualPropTypeCallCache = {};
635
+ var manualPropTypeWarningCount = 0;
636
+ }
637
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
638
+ componentName = componentName || ANONYMOUS;
639
+ propFullName = propFullName || propName;
640
+
641
+ if (secret !== ReactPropTypesSecret) {
642
+ if (throwOnDirectAccess) {
643
+ // New behavior only for users of `prop-types` package
644
+ var err = new Error(
645
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
646
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
647
+ 'Read more at http://fb.me/use-check-prop-types'
648
+ );
649
+ err.name = 'Invariant Violation';
650
+ throw err;
651
+ } else if (typeof console !== 'undefined') {
652
+ // Old behavior for people using React.PropTypes
653
+ var cacheKey = componentName + ':' + propName;
654
+ if (
655
+ !manualPropTypeCallCache[cacheKey] &&
656
+ // Avoid spamming the console because they are often not actionable except for lib authors
657
+ manualPropTypeWarningCount < 3
658
+ ) {
659
+ printWarning(
660
+ 'You are manually calling a React.PropTypes validation ' +
661
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
662
+ 'and will throw in the standalone `prop-types` package. ' +
663
+ 'You may be seeing this warning due to a third-party PropTypes ' +
664
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
665
+ );
666
+ manualPropTypeCallCache[cacheKey] = true;
667
+ manualPropTypeWarningCount++;
668
+ }
669
+ }
670
+ }
671
+ if (props[propName] == null) {
672
+ if (isRequired) {
673
+ if (props[propName] === null) {
674
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
675
+ }
676
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
677
+ }
678
+ return null;
679
+ } else {
680
+ return validate(props, propName, componentName, location, propFullName);
681
+ }
682
+ }
683
+
684
+ var chainedCheckType = checkType.bind(null, false);
685
+ chainedCheckType.isRequired = checkType.bind(null, true);
686
+
687
+ return chainedCheckType;
688
+ }
689
+
690
+ function createPrimitiveTypeChecker(expectedType) {
691
+ function validate(props, propName, componentName, location, propFullName, secret) {
692
+ var propValue = props[propName];
693
+ var propType = getPropType(propValue);
694
+ if (propType !== expectedType) {
695
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
696
+ // check, but we can offer a more precise error message here rather than
697
+ // 'of type `object`'.
698
+ var preciseType = getPreciseType(propValue);
699
+
700
+ return new PropTypeError(
701
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
702
+ {expectedType: expectedType}
703
+ );
704
+ }
705
+ return null;
706
+ }
707
+ return createChainableTypeChecker(validate);
708
+ }
709
+
710
+ function createAnyTypeChecker() {
711
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
712
+ }
713
+
714
+ function createArrayOfTypeChecker(typeChecker) {
715
+ function validate(props, propName, componentName, location, propFullName) {
716
+ if (typeof typeChecker !== 'function') {
717
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
718
+ }
719
+ var propValue = props[propName];
720
+ if (!Array.isArray(propValue)) {
721
+ var propType = getPropType(propValue);
722
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
723
+ }
724
+ for (var i = 0; i < propValue.length; i++) {
725
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
726
+ if (error instanceof Error) {
727
+ return error;
728
+ }
729
+ }
730
+ return null;
731
+ }
732
+ return createChainableTypeChecker(validate);
733
+ }
734
+
735
+ function createElementTypeChecker() {
736
+ function validate(props, propName, componentName, location, propFullName) {
737
+ var propValue = props[propName];
738
+ if (!isValidElement(propValue)) {
739
+ var propType = getPropType(propValue);
740
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
741
+ }
742
+ return null;
743
+ }
744
+ return createChainableTypeChecker(validate);
745
+ }
746
+
747
+ function createElementTypeTypeChecker() {
748
+ function validate(props, propName, componentName, location, propFullName) {
749
+ var propValue = props[propName];
750
+ if (!ReactIs$1.isValidElementType(propValue)) {
751
+ var propType = getPropType(propValue);
752
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
753
+ }
754
+ return null;
755
+ }
756
+ return createChainableTypeChecker(validate);
757
+ }
758
+
759
+ function createInstanceTypeChecker(expectedClass) {
760
+ function validate(props, propName, componentName, location, propFullName) {
761
+ if (!(props[propName] instanceof expectedClass)) {
762
+ var expectedClassName = expectedClass.name || ANONYMOUS;
763
+ var actualClassName = getClassName(props[propName]);
764
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
765
+ }
766
+ return null;
767
+ }
768
+ return createChainableTypeChecker(validate);
769
+ }
770
+
771
+ function createEnumTypeChecker(expectedValues) {
772
+ if (!Array.isArray(expectedValues)) {
773
+ {
774
+ if (arguments.length > 1) {
775
+ printWarning(
776
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
777
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
778
+ );
779
+ } else {
780
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
781
+ }
782
+ }
783
+ return emptyFunctionThatReturnsNull;
784
+ }
785
+
786
+ function validate(props, propName, componentName, location, propFullName) {
787
+ var propValue = props[propName];
788
+ for (var i = 0; i < expectedValues.length; i++) {
789
+ if (is(propValue, expectedValues[i])) {
790
+ return null;
791
+ }
792
+ }
793
+
794
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
795
+ var type = getPreciseType(value);
796
+ if (type === 'symbol') {
797
+ return String(value);
798
+ }
799
+ return value;
800
+ });
801
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
802
+ }
803
+ return createChainableTypeChecker(validate);
804
+ }
805
+
806
+ function createObjectOfTypeChecker(typeChecker) {
807
+ function validate(props, propName, componentName, location, propFullName) {
808
+ if (typeof typeChecker !== 'function') {
809
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
810
+ }
811
+ var propValue = props[propName];
812
+ var propType = getPropType(propValue);
813
+ if (propType !== 'object') {
814
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
815
+ }
816
+ for (var key in propValue) {
817
+ if (has(propValue, key)) {
818
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
819
+ if (error instanceof Error) {
820
+ return error;
821
+ }
822
+ }
823
+ }
824
+ return null;
825
+ }
826
+ return createChainableTypeChecker(validate);
827
+ }
828
+
829
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
830
+ if (!Array.isArray(arrayOfTypeCheckers)) {
831
+ printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') ;
832
+ return emptyFunctionThatReturnsNull;
833
+ }
834
+
835
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
836
+ var checker = arrayOfTypeCheckers[i];
837
+ if (typeof checker !== 'function') {
838
+ printWarning(
839
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
840
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
841
+ );
842
+ return emptyFunctionThatReturnsNull;
843
+ }
844
+ }
845
+
846
+ function validate(props, propName, componentName, location, propFullName) {
847
+ var expectedTypes = [];
848
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
849
+ var checker = arrayOfTypeCheckers[i];
850
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
851
+ if (checkerResult == null) {
852
+ return null;
853
+ }
854
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
855
+ expectedTypes.push(checkerResult.data.expectedType);
856
+ }
857
+ }
858
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
859
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
860
+ }
861
+ return createChainableTypeChecker(validate);
862
+ }
863
+
864
+ function createNodeChecker() {
865
+ function validate(props, propName, componentName, location, propFullName) {
866
+ if (!isNode(props[propName])) {
867
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
868
+ }
869
+ return null;
870
+ }
871
+ return createChainableTypeChecker(validate);
872
+ }
873
+
874
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
875
+ return new PropTypeError(
876
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
877
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
878
+ );
879
+ }
880
+
881
+ function createShapeTypeChecker(shapeTypes) {
882
+ function validate(props, propName, componentName, location, propFullName) {
883
+ var propValue = props[propName];
884
+ var propType = getPropType(propValue);
885
+ if (propType !== 'object') {
886
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
887
+ }
888
+ for (var key in shapeTypes) {
889
+ var checker = shapeTypes[key];
890
+ if (typeof checker !== 'function') {
891
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
892
+ }
893
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
894
+ if (error) {
895
+ return error;
896
+ }
897
+ }
898
+ return null;
899
+ }
900
+ return createChainableTypeChecker(validate);
901
+ }
902
+
903
+ function createStrictShapeTypeChecker(shapeTypes) {
904
+ function validate(props, propName, componentName, location, propFullName) {
905
+ var propValue = props[propName];
906
+ var propType = getPropType(propValue);
907
+ if (propType !== 'object') {
908
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
909
+ }
910
+ // We need to check all keys in case some are required but missing from props.
911
+ var allKeys = assign({}, props[propName], shapeTypes);
912
+ for (var key in allKeys) {
913
+ var checker = shapeTypes[key];
914
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
915
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
916
+ }
917
+ if (!checker) {
918
+ return new PropTypeError(
919
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
920
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
921
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
922
+ );
923
+ }
924
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
925
+ if (error) {
926
+ return error;
927
+ }
928
+ }
929
+ return null;
930
+ }
931
+
932
+ return createChainableTypeChecker(validate);
933
+ }
934
+
935
+ function isNode(propValue) {
936
+ switch (typeof propValue) {
937
+ case 'number':
938
+ case 'string':
939
+ case 'undefined':
940
+ return true;
941
+ case 'boolean':
942
+ return !propValue;
943
+ case 'object':
944
+ if (Array.isArray(propValue)) {
945
+ return propValue.every(isNode);
946
+ }
947
+ if (propValue === null || isValidElement(propValue)) {
948
+ return true;
949
+ }
950
+
951
+ var iteratorFn = getIteratorFn(propValue);
952
+ if (iteratorFn) {
953
+ var iterator = iteratorFn.call(propValue);
954
+ var step;
955
+ if (iteratorFn !== propValue.entries) {
956
+ while (!(step = iterator.next()).done) {
957
+ if (!isNode(step.value)) {
958
+ return false;
959
+ }
960
+ }
961
+ } else {
962
+ // Iterator will provide entry [k,v] tuples rather than values.
963
+ while (!(step = iterator.next()).done) {
964
+ var entry = step.value;
965
+ if (entry) {
966
+ if (!isNode(entry[1])) {
967
+ return false;
968
+ }
969
+ }
970
+ }
971
+ }
972
+ } else {
973
+ return false;
974
+ }
975
+
976
+ return true;
977
+ default:
978
+ return false;
979
+ }
980
+ }
981
+
982
+ function isSymbol(propType, propValue) {
983
+ // Native Symbol.
984
+ if (propType === 'symbol') {
985
+ return true;
986
+ }
987
+
988
+ // falsy value can't be a Symbol
989
+ if (!propValue) {
990
+ return false;
991
+ }
992
+
993
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
994
+ if (propValue['@@toStringTag'] === 'Symbol') {
995
+ return true;
996
+ }
997
+
998
+ // Fallback for non-spec compliant Symbols which are polyfilled.
999
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1000
+ return true;
1001
+ }
1002
+
1003
+ return false;
1004
+ }
1005
+
1006
+ // Equivalent of `typeof` but with special handling for array and regexp.
1007
+ function getPropType(propValue) {
1008
+ var propType = typeof propValue;
1009
+ if (Array.isArray(propValue)) {
1010
+ return 'array';
1011
+ }
1012
+ if (propValue instanceof RegExp) {
1013
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1014
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1015
+ // passes PropTypes.object.
1016
+ return 'object';
1017
+ }
1018
+ if (isSymbol(propType, propValue)) {
1019
+ return 'symbol';
1020
+ }
1021
+ return propType;
1022
+ }
1023
+
1024
+ // This handles more types than `getPropType`. Only used for error messages.
1025
+ // See `createPrimitiveTypeChecker`.
1026
+ function getPreciseType(propValue) {
1027
+ if (typeof propValue === 'undefined' || propValue === null) {
1028
+ return '' + propValue;
1029
+ }
1030
+ var propType = getPropType(propValue);
1031
+ if (propType === 'object') {
1032
+ if (propValue instanceof Date) {
1033
+ return 'date';
1034
+ } else if (propValue instanceof RegExp) {
1035
+ return 'regexp';
1036
+ }
1037
+ }
1038
+ return propType;
1039
+ }
1040
+
1041
+ // Returns a string that is postfixed to a warning about an invalid type.
1042
+ // For example, "undefined" or "of type array"
1043
+ function getPostfixForTypeWarning(value) {
1044
+ var type = getPreciseType(value);
1045
+ switch (type) {
1046
+ case 'array':
1047
+ case 'object':
1048
+ return 'an ' + type;
1049
+ case 'boolean':
1050
+ case 'date':
1051
+ case 'regexp':
1052
+ return 'a ' + type;
1053
+ default:
1054
+ return type;
1055
+ }
1056
+ }
1057
+
1058
+ // Returns class name of the object, if any.
1059
+ function getClassName(propValue) {
1060
+ if (!propValue.constructor || !propValue.constructor.name) {
1061
+ return ANONYMOUS;
1062
+ }
1063
+ return propValue.constructor.name;
1064
+ }
1065
+
1066
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1067
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1068
+ ReactPropTypes.PropTypes = ReactPropTypes;
1069
+
1070
+ return ReactPropTypes;
1071
+ };
1072
+
1073
+ /**
1074
+ * Copyright (c) 2013-present, Facebook, Inc.
1075
+ *
1076
+ * This source code is licensed under the MIT license found in the
1077
+ * LICENSE file in the root directory of this source tree.
1078
+ */
1079
+
1080
+ {
1081
+ var ReactIs = reactIsExports;
1082
+
1083
+ // By explicitly using `prop-types` you are opting into new development behavior.
1084
+ // http://fb.me/prop-types-in-prod
1085
+ var throwOnDirectAccess = true;
1086
+ propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
1087
+ }
1088
+
1089
+ var propTypesExports = propTypes.exports;
1090
+ var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
1091
+
1092
+ var react = {exports: {}};
1093
+
1094
+ var react_development = {exports: {}};
1095
+
1096
+ /**
1097
+ * @license React
1098
+ * react.development.js
1099
+ *
1100
+ * Copyright (c) Facebook, Inc. and its affiliates.
1101
+ *
1102
+ * This source code is licensed under the MIT license found in the
1103
+ * LICENSE file in the root directory of this source tree.
1104
+ */
1105
+ react_development.exports;
1106
+
1107
+ (function (module, exports) {
1108
+
1109
+ {
1110
+ (function() {
1111
+
1112
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1113
+ if (
1114
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
1115
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
1116
+ 'function'
1117
+ ) {
1118
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
1119
+ }
1120
+ var ReactVersion = '18.2.0';
1121
+
1122
+ // ATTENTION
1123
+ // When adding new symbols to this file,
1124
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1125
+ // The Symbol used to tag the ReactElement-like types.
1126
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
1127
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
1128
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
1129
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
1130
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
1131
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
1132
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
1133
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
1134
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
1135
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
1136
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
1137
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
1138
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
1139
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
1140
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
1141
+ function getIteratorFn(maybeIterable) {
1142
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
1143
+ return null;
1144
+ }
1145
+
1146
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1147
+
1148
+ if (typeof maybeIterator === 'function') {
1149
+ return maybeIterator;
1150
+ }
1151
+
1152
+ return null;
1153
+ }
1154
+
1155
+ /**
1156
+ * Keeps track of the current dispatcher.
1157
+ */
1158
+ var ReactCurrentDispatcher = {
1159
+ /**
1160
+ * @internal
1161
+ * @type {ReactComponent}
1162
+ */
1163
+ current: null
1164
+ };
1165
+
1166
+ /**
1167
+ * Keeps track of the current batch's configuration such as how long an update
1168
+ * should suspend for if it needs to.
1169
+ */
1170
+ var ReactCurrentBatchConfig = {
1171
+ transition: null
1172
+ };
1173
+
1174
+ var ReactCurrentActQueue = {
1175
+ current: null,
1176
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode.
1177
+ isBatchingLegacy: false,
1178
+ didScheduleLegacyUpdate: false
1179
+ };
1180
+
1181
+ /**
1182
+ * Keeps track of the current owner.
1183
+ *
1184
+ * The current owner is the component who should own any components that are
1185
+ * currently being constructed.
1186
+ */
1187
+ var ReactCurrentOwner = {
1188
+ /**
1189
+ * @internal
1190
+ * @type {ReactComponent}
1191
+ */
1192
+ current: null
1193
+ };
1194
+
1195
+ var ReactDebugCurrentFrame = {};
1196
+ var currentExtraStackFrame = null;
1197
+ function setExtraStackFrame(stack) {
1198
+ {
1199
+ currentExtraStackFrame = stack;
1200
+ }
1201
+ }
1202
+
1203
+ {
1204
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
1205
+ {
1206
+ currentExtraStackFrame = stack;
1207
+ }
1208
+ }; // Stack implementation injected by the current renderer.
1209
+
1210
+
1211
+ ReactDebugCurrentFrame.getCurrentStack = null;
1212
+
1213
+ ReactDebugCurrentFrame.getStackAddendum = function () {
1214
+ var stack = ''; // Add an extra top frame while an element is being validated
1215
+
1216
+ if (currentExtraStackFrame) {
1217
+ stack += currentExtraStackFrame;
1218
+ } // Delegate to the injected renderer-specific implementation
1219
+
1220
+
1221
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
1222
+
1223
+ if (impl) {
1224
+ stack += impl() || '';
1225
+ }
1226
+
1227
+ return stack;
1228
+ };
1229
+ }
1230
+
1231
+ // -----------------------------------------------------------------------------
1232
+
1233
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
1234
+ var enableCacheElement = false;
1235
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
1236
+
1237
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
1238
+ // stuff. Intended to enable React core members to more easily debug scheduling
1239
+ // issues in DEV builds.
1240
+
1241
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
1242
+
1243
+ var ReactSharedInternals = {
1244
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
1245
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
1246
+ ReactCurrentOwner: ReactCurrentOwner
1247
+ };
1248
+
1249
+ {
1250
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
1251
+ ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
1252
+ }
1253
+
1254
+ // by calls to these methods by a Babel plugin.
1255
+ //
1256
+ // In PROD (or in packages without access to React internals),
1257
+ // they are left as they are instead.
1258
+
1259
+ function warn(format) {
1260
+ {
1261
+ {
1262
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1263
+ args[_key - 1] = arguments[_key];
1264
+ }
1265
+
1266
+ printWarning('warn', format, args);
1267
+ }
1268
+ }
1269
+ }
1270
+ function error(format) {
1271
+ {
1272
+ {
1273
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1274
+ args[_key2 - 1] = arguments[_key2];
1275
+ }
1276
+
1277
+ printWarning('error', format, args);
1278
+ }
1279
+ }
1280
+ }
1281
+
1282
+ function printWarning(level, format, args) {
1283
+ // When changing this logic, you might want to also
1284
+ // update consoleWithStackDev.www.js as well.
1285
+ {
1286
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1287
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
1288
+
1289
+ if (stack !== '') {
1290
+ format += '%s';
1291
+ args = args.concat([stack]);
1292
+ } // eslint-disable-next-line react-internal/safe-string-coercion
1293
+
1294
+
1295
+ var argsWithFormat = args.map(function (item) {
1296
+ return String(item);
1297
+ }); // Careful: RN currently depends on this prefix
1298
+
1299
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
1300
+ // breaks IE9: https://github.com/facebook/react/issues/13610
1301
+ // eslint-disable-next-line react-internal/no-production-logging
1302
+
1303
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
1304
+ }
1305
+ }
1306
+
1307
+ var didWarnStateUpdateForUnmountedComponent = {};
1308
+
1309
+ function warnNoop(publicInstance, callerName) {
1310
+ {
1311
+ var _constructor = publicInstance.constructor;
1312
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
1313
+ var warningKey = componentName + "." + callerName;
1314
+
1315
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
1316
+ return;
1317
+ }
1318
+
1319
+ 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);
1320
+
1321
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
1322
+ }
1323
+ }
1324
+ /**
1325
+ * This is the abstract API for an update queue.
1326
+ */
1327
+
1328
+
1329
+ var ReactNoopUpdateQueue = {
1330
+ /**
1331
+ * Checks whether or not this composite component is mounted.
1332
+ * @param {ReactClass} publicInstance The instance we want to test.
1333
+ * @return {boolean} True if mounted, false otherwise.
1334
+ * @protected
1335
+ * @final
1336
+ */
1337
+ isMounted: function (publicInstance) {
1338
+ return false;
1339
+ },
1340
+
1341
+ /**
1342
+ * Forces an update. This should only be invoked when it is known with
1343
+ * certainty that we are **not** in a DOM transaction.
1344
+ *
1345
+ * You may want to call this when you know that some deeper aspect of the
1346
+ * component's state has changed but `setState` was not called.
1347
+ *
1348
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
1349
+ * `componentWillUpdate` and `componentDidUpdate`.
1350
+ *
1351
+ * @param {ReactClass} publicInstance The instance that should rerender.
1352
+ * @param {?function} callback Called after component is updated.
1353
+ * @param {?string} callerName name of the calling function in the public API.
1354
+ * @internal
1355
+ */
1356
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
1357
+ warnNoop(publicInstance, 'forceUpdate');
1358
+ },
1359
+
1360
+ /**
1361
+ * Replaces all of the state. Always use this or `setState` to mutate state.
1362
+ * You should treat `this.state` as immutable.
1363
+ *
1364
+ * There is no guarantee that `this.state` will be immediately updated, so
1365
+ * accessing `this.state` after calling this method may return the old value.
1366
+ *
1367
+ * @param {ReactClass} publicInstance The instance that should rerender.
1368
+ * @param {object} completeState Next state.
1369
+ * @param {?function} callback Called after component is updated.
1370
+ * @param {?string} callerName name of the calling function in the public API.
1371
+ * @internal
1372
+ */
1373
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
1374
+ warnNoop(publicInstance, 'replaceState');
1375
+ },
1376
+
1377
+ /**
1378
+ * Sets a subset of the state. This only exists because _pendingState is
1379
+ * internal. This provides a merging strategy that is not available to deep
1380
+ * properties which is confusing. TODO: Expose pendingState or don't use it
1381
+ * during the merge.
1382
+ *
1383
+ * @param {ReactClass} publicInstance The instance that should rerender.
1384
+ * @param {object} partialState Next partial state to be merged with state.
1385
+ * @param {?function} callback Called after component is updated.
1386
+ * @param {?string} Name of the calling function in the public API.
1387
+ * @internal
1388
+ */
1389
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
1390
+ warnNoop(publicInstance, 'setState');
1391
+ }
1392
+ };
1393
+
1394
+ var assign = Object.assign;
1395
+
1396
+ var emptyObject = {};
1397
+
1398
+ {
1399
+ Object.freeze(emptyObject);
1400
+ }
1401
+ /**
1402
+ * Base class helpers for the updating state of a component.
1403
+ */
1404
+
1405
+
1406
+ function Component(props, context, updater) {
1407
+ this.props = props;
1408
+ this.context = context; // If a component has string refs, we will assign a different object later.
1409
+
1410
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
1411
+ // renderer.
1412
+
1413
+ this.updater = updater || ReactNoopUpdateQueue;
1414
+ }
1415
+
1416
+ Component.prototype.isReactComponent = {};
1417
+ /**
1418
+ * Sets a subset of the state. Always use this to mutate
1419
+ * state. You should treat `this.state` as immutable.
1420
+ *
1421
+ * There is no guarantee that `this.state` will be immediately updated, so
1422
+ * accessing `this.state` after calling this method may return the old value.
1423
+ *
1424
+ * There is no guarantee that calls to `setState` will run synchronously,
1425
+ * as they may eventually be batched together. You can provide an optional
1426
+ * callback that will be executed when the call to setState is actually
1427
+ * completed.
1428
+ *
1429
+ * When a function is provided to setState, it will be called at some point in
1430
+ * the future (not synchronously). It will be called with the up to date
1431
+ * component arguments (state, props, context). These values can be different
1432
+ * from this.* because your function may be called after receiveProps but before
1433
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
1434
+ * assigned to this.
1435
+ *
1436
+ * @param {object|function} partialState Next partial state or function to
1437
+ * produce next partial state to be merged with current state.
1438
+ * @param {?function} callback Called after state is updated.
1439
+ * @final
1440
+ * @protected
1441
+ */
1442
+
1443
+ Component.prototype.setState = function (partialState, callback) {
1444
+ if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
1445
+ throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
1446
+ }
1447
+
1448
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
1449
+ };
1450
+ /**
1451
+ * Forces an update. This should only be invoked when it is known with
1452
+ * certainty that we are **not** in a DOM transaction.
1453
+ *
1454
+ * You may want to call this when you know that some deeper aspect of the
1455
+ * component's state has changed but `setState` was not called.
1456
+ *
1457
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
1458
+ * `componentWillUpdate` and `componentDidUpdate`.
1459
+ *
1460
+ * @param {?function} callback Called after update is complete.
1461
+ * @final
1462
+ * @protected
1463
+ */
1464
+
1465
+
1466
+ Component.prototype.forceUpdate = function (callback) {
1467
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
1468
+ };
1469
+ /**
1470
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
1471
+ * we would like to deprecate them, we're not going to move them over to this
1472
+ * modern base class. Instead, we define a getter that warns if it's accessed.
1473
+ */
1474
+
1475
+
1476
+ {
1477
+ var deprecatedAPIs = {
1478
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
1479
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
1480
+ };
1481
+
1482
+ var defineDeprecationWarning = function (methodName, info) {
1483
+ Object.defineProperty(Component.prototype, methodName, {
1484
+ get: function () {
1485
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
1486
+
1487
+ return undefined;
1488
+ }
1489
+ });
1490
+ };
1491
+
1492
+ for (var fnName in deprecatedAPIs) {
1493
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
1494
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1495
+ }
1496
+ }
1497
+ }
1498
+
1499
+ function ComponentDummy() {}
1500
+
1501
+ ComponentDummy.prototype = Component.prototype;
1502
+ /**
1503
+ * Convenience component with default shallow equality check for sCU.
1504
+ */
1505
+
1506
+ function PureComponent(props, context, updater) {
1507
+ this.props = props;
1508
+ this.context = context; // If a component has string refs, we will assign a different object later.
1509
+
1510
+ this.refs = emptyObject;
1511
+ this.updater = updater || ReactNoopUpdateQueue;
1512
+ }
1513
+
1514
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
1515
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
1516
+
1517
+ assign(pureComponentPrototype, Component.prototype);
1518
+ pureComponentPrototype.isPureReactComponent = true;
1519
+
1520
+ // an immutable object with a single mutable value
1521
+ function createRef() {
1522
+ var refObject = {
1523
+ current: null
1524
+ };
1525
+
1526
+ {
1527
+ Object.seal(refObject);
1528
+ }
1529
+
1530
+ return refObject;
1531
+ }
1532
+
1533
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
1534
+
1535
+ function isArray(a) {
1536
+ return isArrayImpl(a);
1537
+ }
1538
+
1539
+ /*
1540
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
1541
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
1542
+ *
1543
+ * The functions in this module will throw an easier-to-understand,
1544
+ * easier-to-debug exception with a clear errors message message explaining the
1545
+ * problem. (Instead of a confusing exception thrown inside the implementation
1546
+ * of the `value` object).
1547
+ */
1548
+ // $FlowFixMe only called in DEV, so void return is not possible.
1549
+ function typeName(value) {
1550
+ {
1551
+ // toStringTag is needed for namespaced types like Temporal.Instant
1552
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
1553
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
1554
+ return type;
1555
+ }
1556
+ } // $FlowFixMe only called in DEV, so void return is not possible.
1557
+
1558
+
1559
+ function willCoercionThrow(value) {
1560
+ {
1561
+ try {
1562
+ testStringCoercion(value);
1563
+ return false;
1564
+ } catch (e) {
1565
+ return true;
1566
+ }
1567
+ }
1568
+ }
1569
+
1570
+ function testStringCoercion(value) {
1571
+ // If you ended up here by following an exception call stack, here's what's
1572
+ // happened: you supplied an object or symbol value to React (as a prop, key,
1573
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
1574
+ // coerce it to a string using `'' + value`, an exception was thrown.
1575
+ //
1576
+ // The most common types that will cause this exception are `Symbol` instances
1577
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
1578
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
1579
+ // exception. (Library authors do this to prevent users from using built-in
1580
+ // numeric operators like `+` or comparison operators like `>=` because custom
1581
+ // methods are needed to perform accurate arithmetic or comparison.)
1582
+ //
1583
+ // To fix the problem, coerce this object or symbol value to a string before
1584
+ // passing it to React. The most reliable way is usually `String(value)`.
1585
+ //
1586
+ // To find which value is throwing, check the browser or debugger console.
1587
+ // Before this exception was thrown, there should be `console.error` output
1588
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
1589
+ // problem and how that type was used: key, atrribute, input value prop, etc.
1590
+ // In most cases, this console output also shows the component and its
1591
+ // ancestor components where the exception happened.
1592
+ //
1593
+ // eslint-disable-next-line react-internal/safe-string-coercion
1594
+ return '' + value;
1595
+ }
1596
+ function checkKeyStringCoercion(value) {
1597
+ {
1598
+ if (willCoercionThrow(value)) {
1599
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
1600
+
1601
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
1602
+ }
1603
+ }
1604
+ }
1605
+
1606
+ function getWrappedName(outerType, innerType, wrapperName) {
1607
+ var displayName = outerType.displayName;
1608
+
1609
+ if (displayName) {
1610
+ return displayName;
1611
+ }
1612
+
1613
+ var functionName = innerType.displayName || innerType.name || '';
1614
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
1615
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
1616
+
1617
+
1618
+ function getContextName(type) {
1619
+ return type.displayName || 'Context';
1620
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
1621
+
1622
+
1623
+ function getComponentNameFromType(type) {
1624
+ if (type == null) {
1625
+ // Host root, text node or just invalid type.
1626
+ return null;
1627
+ }
1628
+
1629
+ {
1630
+ if (typeof type.tag === 'number') {
1631
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
1632
+ }
1633
+ }
1634
+
1635
+ if (typeof type === 'function') {
1636
+ return type.displayName || type.name || null;
1637
+ }
1638
+
1639
+ if (typeof type === 'string') {
1640
+ return type;
1641
+ }
1642
+
1643
+ switch (type) {
1644
+ case REACT_FRAGMENT_TYPE:
1645
+ return 'Fragment';
1646
+
1647
+ case REACT_PORTAL_TYPE:
1648
+ return 'Portal';
1649
+
1650
+ case REACT_PROFILER_TYPE:
1651
+ return 'Profiler';
1652
+
1653
+ case REACT_STRICT_MODE_TYPE:
1654
+ return 'StrictMode';
1655
+
1656
+ case REACT_SUSPENSE_TYPE:
1657
+ return 'Suspense';
1658
+
1659
+ case REACT_SUSPENSE_LIST_TYPE:
1660
+ return 'SuspenseList';
1661
+
1662
+ }
1663
+
1664
+ if (typeof type === 'object') {
1665
+ switch (type.$$typeof) {
1666
+ case REACT_CONTEXT_TYPE:
1667
+ var context = type;
1668
+ return getContextName(context) + '.Consumer';
1669
+
1670
+ case REACT_PROVIDER_TYPE:
1671
+ var provider = type;
1672
+ return getContextName(provider._context) + '.Provider';
1673
+
1674
+ case REACT_FORWARD_REF_TYPE:
1675
+ return getWrappedName(type, type.render, 'ForwardRef');
1676
+
1677
+ case REACT_MEMO_TYPE:
1678
+ var outerName = type.displayName || null;
1679
+
1680
+ if (outerName !== null) {
1681
+ return outerName;
1682
+ }
1683
+
1684
+ return getComponentNameFromType(type.type) || 'Memo';
1685
+
1686
+ case REACT_LAZY_TYPE:
1687
+ {
1688
+ var lazyComponent = type;
1689
+ var payload = lazyComponent._payload;
1690
+ var init = lazyComponent._init;
1691
+
1692
+ try {
1693
+ return getComponentNameFromType(init(payload));
1694
+ } catch (x) {
1695
+ return null;
1696
+ }
1697
+ }
1698
+
1699
+ // eslint-disable-next-line no-fallthrough
1700
+ }
1701
+ }
1702
+
1703
+ return null;
1704
+ }
1705
+
1706
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1707
+
1708
+ var RESERVED_PROPS = {
1709
+ key: true,
1710
+ ref: true,
1711
+ __self: true,
1712
+ __source: true
1713
+ };
1714
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
1715
+
1716
+ {
1717
+ didWarnAboutStringRefs = {};
1718
+ }
1719
+
1720
+ function hasValidRef(config) {
1721
+ {
1722
+ if (hasOwnProperty.call(config, 'ref')) {
1723
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1724
+
1725
+ if (getter && getter.isReactWarning) {
1726
+ return false;
1727
+ }
1728
+ }
1729
+ }
1730
+
1731
+ return config.ref !== undefined;
1732
+ }
1733
+
1734
+ function hasValidKey(config) {
1735
+ {
1736
+ if (hasOwnProperty.call(config, 'key')) {
1737
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1738
+
1739
+ if (getter && getter.isReactWarning) {
1740
+ return false;
1741
+ }
1742
+ }
1743
+ }
1744
+
1745
+ return config.key !== undefined;
1746
+ }
1747
+
1748
+ function defineKeyPropWarningGetter(props, displayName) {
1749
+ var warnAboutAccessingKey = function () {
1750
+ {
1751
+ if (!specialPropKeyWarningShown) {
1752
+ specialPropKeyWarningShown = true;
1753
+
1754
+ 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);
1755
+ }
1756
+ }
1757
+ };
1758
+
1759
+ warnAboutAccessingKey.isReactWarning = true;
1760
+ Object.defineProperty(props, 'key', {
1761
+ get: warnAboutAccessingKey,
1762
+ configurable: true
1763
+ });
1764
+ }
1765
+
1766
+ function defineRefPropWarningGetter(props, displayName) {
1767
+ var warnAboutAccessingRef = function () {
1768
+ {
1769
+ if (!specialPropRefWarningShown) {
1770
+ specialPropRefWarningShown = true;
1771
+
1772
+ 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);
1773
+ }
1774
+ }
1775
+ };
1776
+
1777
+ warnAboutAccessingRef.isReactWarning = true;
1778
+ Object.defineProperty(props, 'ref', {
1779
+ get: warnAboutAccessingRef,
1780
+ configurable: true
1781
+ });
1782
+ }
1783
+
1784
+ function warnIfStringRefCannotBeAutoConverted(config) {
1785
+ {
1786
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
1787
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
1788
+
1789
+ if (!didWarnAboutStringRefs[componentName]) {
1790
+ 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);
1791
+
1792
+ didWarnAboutStringRefs[componentName] = true;
1793
+ }
1794
+ }
1795
+ }
1796
+ }
1797
+ /**
1798
+ * Factory method to create a new React element. This no longer adheres to
1799
+ * the class pattern, so do not use new to call it. Also, instanceof check
1800
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1801
+ * if something is a React Element.
1802
+ *
1803
+ * @param {*} type
1804
+ * @param {*} props
1805
+ * @param {*} key
1806
+ * @param {string|object} ref
1807
+ * @param {*} owner
1808
+ * @param {*} self A *temporary* helper to detect places where `this` is
1809
+ * different from the `owner` when React.createElement is called, so that we
1810
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
1811
+ * functions, and as long as `this` and owner are the same, there will be no
1812
+ * change in behavior.
1813
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
1814
+ * indicating filename, line number, and/or other information.
1815
+ * @internal
1816
+ */
1817
+
1818
+
1819
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
1820
+ var element = {
1821
+ // This tag allows us to uniquely identify this as a React Element
1822
+ $$typeof: REACT_ELEMENT_TYPE,
1823
+ // Built-in properties that belong on the element
1824
+ type: type,
1825
+ key: key,
1826
+ ref: ref,
1827
+ props: props,
1828
+ // Record the component responsible for creating this element.
1829
+ _owner: owner
1830
+ };
1831
+
1832
+ {
1833
+ // The validation flag is currently mutative. We put it on
1834
+ // an external backing store so that we can freeze the whole object.
1835
+ // This can be replaced with a WeakMap once they are implemented in
1836
+ // commonly used development environments.
1837
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1838
+ // the validation flag non-enumerable (where possible, which should
1839
+ // include every environment we run tests in), so the test framework
1840
+ // ignores it.
1841
+
1842
+ Object.defineProperty(element._store, 'validated', {
1843
+ configurable: false,
1844
+ enumerable: false,
1845
+ writable: true,
1846
+ value: false
1847
+ }); // self and source are DEV only properties.
1848
+
1849
+ Object.defineProperty(element, '_self', {
1850
+ configurable: false,
1851
+ enumerable: false,
1852
+ writable: false,
1853
+ value: self
1854
+ }); // Two elements created in two different places should be considered
1855
+ // equal for testing purposes and therefore we hide it from enumeration.
1856
+
1857
+ Object.defineProperty(element, '_source', {
1858
+ configurable: false,
1859
+ enumerable: false,
1860
+ writable: false,
1861
+ value: source
1862
+ });
1863
+
1864
+ if (Object.freeze) {
1865
+ Object.freeze(element.props);
1866
+ Object.freeze(element);
1867
+ }
1868
+ }
1869
+
1870
+ return element;
1871
+ };
1872
+ /**
1873
+ * Create and return a new ReactElement of the given type.
1874
+ * See https://reactjs.org/docs/react-api.html#createelement
1875
+ */
1876
+
1877
+ function createElement(type, config, children) {
1878
+ var propName; // Reserved names are extracted
1879
+
1880
+ var props = {};
1881
+ var key = null;
1882
+ var ref = null;
1883
+ var self = null;
1884
+ var source = null;
1885
+
1886
+ if (config != null) {
1887
+ if (hasValidRef(config)) {
1888
+ ref = config.ref;
1889
+
1890
+ {
1891
+ warnIfStringRefCannotBeAutoConverted(config);
1892
+ }
1893
+ }
1894
+
1895
+ if (hasValidKey(config)) {
1896
+ {
1897
+ checkKeyStringCoercion(config.key);
1898
+ }
1899
+
1900
+ key = '' + config.key;
1901
+ }
1902
+
1903
+ self = config.__self === undefined ? null : config.__self;
1904
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
1905
+
1906
+ for (propName in config) {
1907
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1908
+ props[propName] = config[propName];
1909
+ }
1910
+ }
1911
+ } // Children can be more than one argument, and those are transferred onto
1912
+ // the newly allocated props object.
1913
+
1914
+
1915
+ var childrenLength = arguments.length - 2;
1916
+
1917
+ if (childrenLength === 1) {
1918
+ props.children = children;
1919
+ } else if (childrenLength > 1) {
1920
+ var childArray = Array(childrenLength);
1921
+
1922
+ for (var i = 0; i < childrenLength; i++) {
1923
+ childArray[i] = arguments[i + 2];
1924
+ }
1925
+
1926
+ {
1927
+ if (Object.freeze) {
1928
+ Object.freeze(childArray);
1929
+ }
1930
+ }
1931
+
1932
+ props.children = childArray;
1933
+ } // Resolve default props
1934
+
1935
+
1936
+ if (type && type.defaultProps) {
1937
+ var defaultProps = type.defaultProps;
1938
+
1939
+ for (propName in defaultProps) {
1940
+ if (props[propName] === undefined) {
1941
+ props[propName] = defaultProps[propName];
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ {
1947
+ if (key || ref) {
1948
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1949
+
1950
+ if (key) {
1951
+ defineKeyPropWarningGetter(props, displayName);
1952
+ }
1953
+
1954
+ if (ref) {
1955
+ defineRefPropWarningGetter(props, displayName);
1956
+ }
1957
+ }
1958
+ }
1959
+
1960
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1961
+ }
1962
+ function cloneAndReplaceKey(oldElement, newKey) {
1963
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
1964
+ return newElement;
1965
+ }
1966
+ /**
1967
+ * Clone and return a new ReactElement using element as the starting point.
1968
+ * See https://reactjs.org/docs/react-api.html#cloneelement
1969
+ */
1970
+
1971
+ function cloneElement(element, config, children) {
1972
+ if (element === null || element === undefined) {
1973
+ throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
1974
+ }
1975
+
1976
+ var propName; // Original props are copied
1977
+
1978
+ var props = assign({}, element.props); // Reserved names are extracted
1979
+
1980
+ var key = element.key;
1981
+ var ref = element.ref; // Self is preserved since the owner is preserved.
1982
+
1983
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
1984
+ // transpiler, and the original source is probably a better indicator of the
1985
+ // true owner.
1986
+
1987
+ var source = element._source; // Owner will be preserved, unless ref is overridden
1988
+
1989
+ var owner = element._owner;
1990
+
1991
+ if (config != null) {
1992
+ if (hasValidRef(config)) {
1993
+ // Silently steal the ref from the parent.
1994
+ ref = config.ref;
1995
+ owner = ReactCurrentOwner.current;
1996
+ }
1997
+
1998
+ if (hasValidKey(config)) {
1999
+ {
2000
+ checkKeyStringCoercion(config.key);
2001
+ }
2002
+
2003
+ key = '' + config.key;
2004
+ } // Remaining properties override existing props
2005
+
2006
+
2007
+ var defaultProps;
2008
+
2009
+ if (element.type && element.type.defaultProps) {
2010
+ defaultProps = element.type.defaultProps;
2011
+ }
2012
+
2013
+ for (propName in config) {
2014
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2015
+ if (config[propName] === undefined && defaultProps !== undefined) {
2016
+ // Resolve default props
2017
+ props[propName] = defaultProps[propName];
2018
+ } else {
2019
+ props[propName] = config[propName];
2020
+ }
2021
+ }
2022
+ }
2023
+ } // Children can be more than one argument, and those are transferred onto
2024
+ // the newly allocated props object.
2025
+
2026
+
2027
+ var childrenLength = arguments.length - 2;
2028
+
2029
+ if (childrenLength === 1) {
2030
+ props.children = children;
2031
+ } else if (childrenLength > 1) {
2032
+ var childArray = Array(childrenLength);
2033
+
2034
+ for (var i = 0; i < childrenLength; i++) {
2035
+ childArray[i] = arguments[i + 2];
2036
+ }
2037
+
2038
+ props.children = childArray;
2039
+ }
2040
+
2041
+ return ReactElement(element.type, key, ref, self, source, owner, props);
2042
+ }
2043
+ /**
2044
+ * Verifies the object is a ReactElement.
2045
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
2046
+ * @param {?object} object
2047
+ * @return {boolean} True if `object` is a ReactElement.
2048
+ * @final
2049
+ */
2050
+
2051
+ function isValidElement(object) {
2052
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2053
+ }
2054
+
2055
+ var SEPARATOR = '.';
2056
+ var SUBSEPARATOR = ':';
2057
+ /**
2058
+ * Escape and wrap key so it is safe to use as a reactid
2059
+ *
2060
+ * @param {string} key to be escaped.
2061
+ * @return {string} the escaped key.
2062
+ */
2063
+
2064
+ function escape(key) {
2065
+ var escapeRegex = /[=:]/g;
2066
+ var escaperLookup = {
2067
+ '=': '=0',
2068
+ ':': '=2'
2069
+ };
2070
+ var escapedString = key.replace(escapeRegex, function (match) {
2071
+ return escaperLookup[match];
2072
+ });
2073
+ return '$' + escapedString;
2074
+ }
2075
+ /**
2076
+ * TODO: Test that a single child and an array with one item have the same key
2077
+ * pattern.
2078
+ */
2079
+
2080
+
2081
+ var didWarnAboutMaps = false;
2082
+ var userProvidedKeyEscapeRegex = /\/+/g;
2083
+
2084
+ function escapeUserProvidedKey(text) {
2085
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
2086
+ }
2087
+ /**
2088
+ * Generate a key string that identifies a element within a set.
2089
+ *
2090
+ * @param {*} element A element that could contain a manual key.
2091
+ * @param {number} index Index that is used if a manual key is not provided.
2092
+ * @return {string}
2093
+ */
2094
+
2095
+
2096
+ function getElementKey(element, index) {
2097
+ // Do some typechecking here since we call this blindly. We want to ensure
2098
+ // that we don't block potential future ES APIs.
2099
+ if (typeof element === 'object' && element !== null && element.key != null) {
2100
+ // Explicit key
2101
+ {
2102
+ checkKeyStringCoercion(element.key);
2103
+ }
2104
+
2105
+ return escape('' + element.key);
2106
+ } // Implicit key determined by the index in the set
2107
+
2108
+
2109
+ return index.toString(36);
2110
+ }
2111
+
2112
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
2113
+ var type = typeof children;
2114
+
2115
+ if (type === 'undefined' || type === 'boolean') {
2116
+ // All of the above are perceived as null.
2117
+ children = null;
2118
+ }
2119
+
2120
+ var invokeCallback = false;
2121
+
2122
+ if (children === null) {
2123
+ invokeCallback = true;
2124
+ } else {
2125
+ switch (type) {
2126
+ case 'string':
2127
+ case 'number':
2128
+ invokeCallback = true;
2129
+ break;
2130
+
2131
+ case 'object':
2132
+ switch (children.$$typeof) {
2133
+ case REACT_ELEMENT_TYPE:
2134
+ case REACT_PORTAL_TYPE:
2135
+ invokeCallback = true;
2136
+ }
2137
+
2138
+ }
2139
+ }
2140
+
2141
+ if (invokeCallback) {
2142
+ var _child = children;
2143
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
2144
+ // so that it's consistent if the number of children grows:
2145
+
2146
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
2147
+
2148
+ if (isArray(mappedChild)) {
2149
+ var escapedChildKey = '';
2150
+
2151
+ if (childKey != null) {
2152
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
2153
+ }
2154
+
2155
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
2156
+ return c;
2157
+ });
2158
+ } else if (mappedChild != null) {
2159
+ if (isValidElement(mappedChild)) {
2160
+ {
2161
+ // The `if` statement here prevents auto-disabling of the safe
2162
+ // coercion ESLint rule, so we must manually disable it below.
2163
+ // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
2164
+ if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
2165
+ checkKeyStringCoercion(mappedChild.key);
2166
+ }
2167
+ }
2168
+
2169
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
2170
+ // traverseAllChildren used to do for objects as children
2171
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
2172
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
2173
+ // eslint-disable-next-line react-internal/safe-string-coercion
2174
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
2175
+ }
2176
+
2177
+ array.push(mappedChild);
2178
+ }
2179
+
2180
+ return 1;
2181
+ }
2182
+
2183
+ var child;
2184
+ var nextName;
2185
+ var subtreeCount = 0; // Count of children found in the current subtree.
2186
+
2187
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
2188
+
2189
+ if (isArray(children)) {
2190
+ for (var i = 0; i < children.length; i++) {
2191
+ child = children[i];
2192
+ nextName = nextNamePrefix + getElementKey(child, i);
2193
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
2194
+ }
2195
+ } else {
2196
+ var iteratorFn = getIteratorFn(children);
2197
+
2198
+ if (typeof iteratorFn === 'function') {
2199
+ var iterableChildren = children;
2200
+
2201
+ {
2202
+ // Warn about using Maps as children
2203
+ if (iteratorFn === iterableChildren.entries) {
2204
+ if (!didWarnAboutMaps) {
2205
+ warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
2206
+ }
2207
+
2208
+ didWarnAboutMaps = true;
2209
+ }
2210
+ }
2211
+
2212
+ var iterator = iteratorFn.call(iterableChildren);
2213
+ var step;
2214
+ var ii = 0;
2215
+
2216
+ while (!(step = iterator.next()).done) {
2217
+ child = step.value;
2218
+ nextName = nextNamePrefix + getElementKey(child, ii++);
2219
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
2220
+ }
2221
+ } else if (type === 'object') {
2222
+ // eslint-disable-next-line react-internal/safe-string-coercion
2223
+ var childrenString = String(children);
2224
+ 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.');
2225
+ }
2226
+ }
2227
+
2228
+ return subtreeCount;
2229
+ }
2230
+
2231
+ /**
2232
+ * Maps children that are typically specified as `props.children`.
2233
+ *
2234
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
2235
+ *
2236
+ * The provided mapFunction(child, index) will be called for each
2237
+ * leaf child.
2238
+ *
2239
+ * @param {?*} children Children tree container.
2240
+ * @param {function(*, int)} func The map function.
2241
+ * @param {*} context Context for mapFunction.
2242
+ * @return {object} Object containing the ordered map of results.
2243
+ */
2244
+ function mapChildren(children, func, context) {
2245
+ if (children == null) {
2246
+ return children;
2247
+ }
2248
+
2249
+ var result = [];
2250
+ var count = 0;
2251
+ mapIntoArray(children, result, '', '', function (child) {
2252
+ return func.call(context, child, count++);
2253
+ });
2254
+ return result;
2255
+ }
2256
+ /**
2257
+ * Count the number of children that are typically specified as
2258
+ * `props.children`.
2259
+ *
2260
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
2261
+ *
2262
+ * @param {?*} children Children tree container.
2263
+ * @return {number} The number of children.
2264
+ */
2265
+
2266
+
2267
+ function countChildren(children) {
2268
+ var n = 0;
2269
+ mapChildren(children, function () {
2270
+ n++; // Don't return anything
2271
+ });
2272
+ return n;
2273
+ }
2274
+
2275
+ /**
2276
+ * Iterates through children that are typically specified as `props.children`.
2277
+ *
2278
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
2279
+ *
2280
+ * The provided forEachFunc(child, index) will be called for each
2281
+ * leaf child.
2282
+ *
2283
+ * @param {?*} children Children tree container.
2284
+ * @param {function(*, int)} forEachFunc
2285
+ * @param {*} forEachContext Context for forEachContext.
2286
+ */
2287
+ function forEachChildren(children, forEachFunc, forEachContext) {
2288
+ mapChildren(children, function () {
2289
+ forEachFunc.apply(this, arguments); // Don't return anything.
2290
+ }, forEachContext);
2291
+ }
2292
+ /**
2293
+ * Flatten a children object (typically specified as `props.children`) and
2294
+ * return an array with appropriately re-keyed children.
2295
+ *
2296
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
2297
+ */
2298
+
2299
+
2300
+ function toArray(children) {
2301
+ return mapChildren(children, function (child) {
2302
+ return child;
2303
+ }) || [];
2304
+ }
2305
+ /**
2306
+ * Returns the first child in a collection of children and verifies that there
2307
+ * is only one child in the collection.
2308
+ *
2309
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
2310
+ *
2311
+ * The current implementation of this function assumes that a single child gets
2312
+ * passed without a wrapper, but the purpose of this helper function is to
2313
+ * abstract away the particular structure of children.
2314
+ *
2315
+ * @param {?object} children Child collection structure.
2316
+ * @return {ReactElement} The first and only `ReactElement` contained in the
2317
+ * structure.
2318
+ */
2319
+
2320
+
2321
+ function onlyChild(children) {
2322
+ if (!isValidElement(children)) {
2323
+ throw new Error('React.Children.only expected to receive a single React element child.');
2324
+ }
2325
+
2326
+ return children;
2327
+ }
2328
+
2329
+ function createContext(defaultValue) {
2330
+ // TODO: Second argument used to be an optional `calculateChangedBits`
2331
+ // function. Warn to reserve for future use?
2332
+ var context = {
2333
+ $$typeof: REACT_CONTEXT_TYPE,
2334
+ // As a workaround to support multiple concurrent renderers, we categorize
2335
+ // some renderers as primary and others as secondary. We only expect
2336
+ // there to be two concurrent renderers at most: React Native (primary) and
2337
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
2338
+ // Secondary renderers store their context values on separate fields.
2339
+ _currentValue: defaultValue,
2340
+ _currentValue2: defaultValue,
2341
+ // Used to track how many concurrent renderers this context currently
2342
+ // supports within in a single renderer. Such as parallel server rendering.
2343
+ _threadCount: 0,
2344
+ // These are circular
2345
+ Provider: null,
2346
+ Consumer: null,
2347
+ // Add these to use same hidden class in VM as ServerContext
2348
+ _defaultValue: null,
2349
+ _globalName: null
2350
+ };
2351
+ context.Provider = {
2352
+ $$typeof: REACT_PROVIDER_TYPE,
2353
+ _context: context
2354
+ };
2355
+ var hasWarnedAboutUsingNestedContextConsumers = false;
2356
+ var hasWarnedAboutUsingConsumerProvider = false;
2357
+ var hasWarnedAboutDisplayNameOnConsumer = false;
2358
+
2359
+ {
2360
+ // A separate object, but proxies back to the original context object for
2361
+ // backwards compatibility. It has a different $$typeof, so we can properly
2362
+ // warn for the incorrect usage of Context as a Consumer.
2363
+ var Consumer = {
2364
+ $$typeof: REACT_CONTEXT_TYPE,
2365
+ _context: context
2366
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
2367
+
2368
+ Object.defineProperties(Consumer, {
2369
+ Provider: {
2370
+ get: function () {
2371
+ if (!hasWarnedAboutUsingConsumerProvider) {
2372
+ hasWarnedAboutUsingConsumerProvider = true;
2373
+
2374
+ 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?');
2375
+ }
2376
+
2377
+ return context.Provider;
2378
+ },
2379
+ set: function (_Provider) {
2380
+ context.Provider = _Provider;
2381
+ }
2382
+ },
2383
+ _currentValue: {
2384
+ get: function () {
2385
+ return context._currentValue;
2386
+ },
2387
+ set: function (_currentValue) {
2388
+ context._currentValue = _currentValue;
2389
+ }
2390
+ },
2391
+ _currentValue2: {
2392
+ get: function () {
2393
+ return context._currentValue2;
2394
+ },
2395
+ set: function (_currentValue2) {
2396
+ context._currentValue2 = _currentValue2;
2397
+ }
2398
+ },
2399
+ _threadCount: {
2400
+ get: function () {
2401
+ return context._threadCount;
2402
+ },
2403
+ set: function (_threadCount) {
2404
+ context._threadCount = _threadCount;
2405
+ }
2406
+ },
2407
+ Consumer: {
2408
+ get: function () {
2409
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
2410
+ hasWarnedAboutUsingNestedContextConsumers = true;
2411
+
2412
+ 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?');
2413
+ }
2414
+
2415
+ return context.Consumer;
2416
+ }
2417
+ },
2418
+ displayName: {
2419
+ get: function () {
2420
+ return context.displayName;
2421
+ },
2422
+ set: function (displayName) {
2423
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
2424
+ warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
2425
+
2426
+ hasWarnedAboutDisplayNameOnConsumer = true;
2427
+ }
2428
+ }
2429
+ }
2430
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
2431
+
2432
+ context.Consumer = Consumer;
2433
+ }
2434
+
2435
+ {
2436
+ context._currentRenderer = null;
2437
+ context._currentRenderer2 = null;
2438
+ }
2439
+
2440
+ return context;
2441
+ }
2442
+
2443
+ var Uninitialized = -1;
2444
+ var Pending = 0;
2445
+ var Resolved = 1;
2446
+ var Rejected = 2;
2447
+
2448
+ function lazyInitializer(payload) {
2449
+ if (payload._status === Uninitialized) {
2450
+ var ctor = payload._result;
2451
+ var thenable = ctor(); // Transition to the next state.
2452
+ // This might throw either because it's missing or throws. If so, we treat it
2453
+ // as still uninitialized and try again next time. Which is the same as what
2454
+ // happens if the ctor or any wrappers processing the ctor throws. This might
2455
+ // end up fixing it if the resolution was a concurrency bug.
2456
+
2457
+ thenable.then(function (moduleObject) {
2458
+ if (payload._status === Pending || payload._status === Uninitialized) {
2459
+ // Transition to the next state.
2460
+ var resolved = payload;
2461
+ resolved._status = Resolved;
2462
+ resolved._result = moduleObject;
2463
+ }
2464
+ }, function (error) {
2465
+ if (payload._status === Pending || payload._status === Uninitialized) {
2466
+ // Transition to the next state.
2467
+ var rejected = payload;
2468
+ rejected._status = Rejected;
2469
+ rejected._result = error;
2470
+ }
2471
+ });
2472
+
2473
+ if (payload._status === Uninitialized) {
2474
+ // In case, we're still uninitialized, then we're waiting for the thenable
2475
+ // to resolve. Set it as pending in the meantime.
2476
+ var pending = payload;
2477
+ pending._status = Pending;
2478
+ pending._result = thenable;
2479
+ }
2480
+ }
2481
+
2482
+ if (payload._status === Resolved) {
2483
+ var moduleObject = payload._result;
2484
+
2485
+ {
2486
+ if (moduleObject === undefined) {
2487
+ error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2488
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
2489
+ }
2490
+ }
2491
+
2492
+ {
2493
+ if (!('default' in moduleObject)) {
2494
+ error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2495
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
2496
+ }
2497
+ }
2498
+
2499
+ return moduleObject.default;
2500
+ } else {
2501
+ throw payload._result;
2502
+ }
2503
+ }
2504
+
2505
+ function lazy(ctor) {
2506
+ var payload = {
2507
+ // We use these fields to store the result.
2508
+ _status: Uninitialized,
2509
+ _result: ctor
2510
+ };
2511
+ var lazyType = {
2512
+ $$typeof: REACT_LAZY_TYPE,
2513
+ _payload: payload,
2514
+ _init: lazyInitializer
2515
+ };
2516
+
2517
+ {
2518
+ // In production, this would just set it on the object.
2519
+ var defaultProps;
2520
+ var propTypes; // $FlowFixMe
2521
+
2522
+ Object.defineProperties(lazyType, {
2523
+ defaultProps: {
2524
+ configurable: true,
2525
+ get: function () {
2526
+ return defaultProps;
2527
+ },
2528
+ set: function (newDefaultProps) {
2529
+ 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.');
2530
+
2531
+ defaultProps = newDefaultProps; // Match production behavior more closely:
2532
+ // $FlowFixMe
2533
+
2534
+ Object.defineProperty(lazyType, 'defaultProps', {
2535
+ enumerable: true
2536
+ });
2537
+ }
2538
+ },
2539
+ propTypes: {
2540
+ configurable: true,
2541
+ get: function () {
2542
+ return propTypes;
2543
+ },
2544
+ set: function (newPropTypes) {
2545
+ 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.');
2546
+
2547
+ propTypes = newPropTypes; // Match production behavior more closely:
2548
+ // $FlowFixMe
2549
+
2550
+ Object.defineProperty(lazyType, 'propTypes', {
2551
+ enumerable: true
2552
+ });
2553
+ }
2554
+ }
2555
+ });
2556
+ }
2557
+
2558
+ return lazyType;
2559
+ }
2560
+
2561
+ function forwardRef(render) {
2562
+ {
2563
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
2564
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
2565
+ } else if (typeof render !== 'function') {
2566
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
2567
+ } else {
2568
+ if (render.length !== 0 && render.length !== 2) {
2569
+ 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.');
2570
+ }
2571
+ }
2572
+
2573
+ if (render != null) {
2574
+ if (render.defaultProps != null || render.propTypes != null) {
2575
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
2576
+ }
2577
+ }
2578
+ }
2579
+
2580
+ var elementType = {
2581
+ $$typeof: REACT_FORWARD_REF_TYPE,
2582
+ render: render
2583
+ };
2584
+
2585
+ {
2586
+ var ownName;
2587
+ Object.defineProperty(elementType, 'displayName', {
2588
+ enumerable: false,
2589
+ configurable: true,
2590
+ get: function () {
2591
+ return ownName;
2592
+ },
2593
+ set: function (name) {
2594
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
2595
+ // because the component may be used elsewhere.
2596
+ // But it's nice for anonymous functions to inherit the name,
2597
+ // so that our component-stack generation logic will display their frames.
2598
+ // An anonymous function generally suggests a pattern like:
2599
+ // React.forwardRef((props, ref) => {...});
2600
+ // This kind of inner function is not used elsewhere so the side effect is okay.
2601
+
2602
+ if (!render.name && !render.displayName) {
2603
+ render.displayName = name;
2604
+ }
2605
+ }
2606
+ });
2607
+ }
2608
+
2609
+ return elementType;
2610
+ }
2611
+
2612
+ var REACT_MODULE_REFERENCE;
2613
+
2614
+ {
2615
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
2616
+ }
2617
+
2618
+ function isValidElementType(type) {
2619
+ if (typeof type === 'string' || typeof type === 'function') {
2620
+ return true;
2621
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
2622
+
2623
+
2624
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
2625
+ return true;
2626
+ }
2627
+
2628
+ if (typeof type === 'object' && type !== null) {
2629
+ 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 || // This needs to include all possible module reference object
2630
+ // types supported by any Flight configuration anywhere since
2631
+ // we don't know which Flight build this will end up being used
2632
+ // with.
2633
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
2634
+ return true;
2635
+ }
2636
+ }
2637
+
2638
+ return false;
2639
+ }
2640
+
2641
+ function memo(type, compare) {
2642
+ {
2643
+ if (!isValidElementType(type)) {
2644
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
2645
+ }
2646
+ }
2647
+
2648
+ var elementType = {
2649
+ $$typeof: REACT_MEMO_TYPE,
2650
+ type: type,
2651
+ compare: compare === undefined ? null : compare
2652
+ };
2653
+
2654
+ {
2655
+ var ownName;
2656
+ Object.defineProperty(elementType, 'displayName', {
2657
+ enumerable: false,
2658
+ configurable: true,
2659
+ get: function () {
2660
+ return ownName;
2661
+ },
2662
+ set: function (name) {
2663
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
2664
+ // because the component may be used elsewhere.
2665
+ // But it's nice for anonymous functions to inherit the name,
2666
+ // so that our component-stack generation logic will display their frames.
2667
+ // An anonymous function generally suggests a pattern like:
2668
+ // React.memo((props) => {...});
2669
+ // This kind of inner function is not used elsewhere so the side effect is okay.
2670
+
2671
+ if (!type.name && !type.displayName) {
2672
+ type.displayName = name;
2673
+ }
2674
+ }
2675
+ });
2676
+ }
2677
+
2678
+ return elementType;
2679
+ }
2680
+
2681
+ function resolveDispatcher() {
2682
+ var dispatcher = ReactCurrentDispatcher.current;
2683
+
2684
+ {
2685
+ if (dispatcher === null) {
2686
+ 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.');
2687
+ }
2688
+ } // Will result in a null access error if accessed outside render phase. We
2689
+ // intentionally don't throw our own error because this is in a hot path.
2690
+ // Also helps ensure this is inlined.
2691
+
2692
+
2693
+ return dispatcher;
2694
+ }
2695
+ function useContext(Context) {
2696
+ var dispatcher = resolveDispatcher();
2697
+
2698
+ {
2699
+ // TODO: add a more generic warning for invalid values.
2700
+ if (Context._context !== undefined) {
2701
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
2702
+ // and nobody should be using this in existing code.
2703
+
2704
+ if (realContext.Consumer === Context) {
2705
+ 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?');
2706
+ } else if (realContext.Provider === Context) {
2707
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
2708
+ }
2709
+ }
2710
+ }
2711
+
2712
+ return dispatcher.useContext(Context);
2713
+ }
2714
+ function useState(initialState) {
2715
+ var dispatcher = resolveDispatcher();
2716
+ return dispatcher.useState(initialState);
2717
+ }
2718
+ function useReducer(reducer, initialArg, init) {
2719
+ var dispatcher = resolveDispatcher();
2720
+ return dispatcher.useReducer(reducer, initialArg, init);
2721
+ }
2722
+ function useRef(initialValue) {
2723
+ var dispatcher = resolveDispatcher();
2724
+ return dispatcher.useRef(initialValue);
2725
+ }
2726
+ function useEffect(create, deps) {
2727
+ var dispatcher = resolveDispatcher();
2728
+ return dispatcher.useEffect(create, deps);
2729
+ }
2730
+ function useInsertionEffect(create, deps) {
2731
+ var dispatcher = resolveDispatcher();
2732
+ return dispatcher.useInsertionEffect(create, deps);
2733
+ }
2734
+ function useLayoutEffect(create, deps) {
2735
+ var dispatcher = resolveDispatcher();
2736
+ return dispatcher.useLayoutEffect(create, deps);
2737
+ }
2738
+ function useCallback(callback, deps) {
2739
+ var dispatcher = resolveDispatcher();
2740
+ return dispatcher.useCallback(callback, deps);
2741
+ }
2742
+ function useMemo(create, deps) {
2743
+ var dispatcher = resolveDispatcher();
2744
+ return dispatcher.useMemo(create, deps);
2745
+ }
2746
+ function useImperativeHandle(ref, create, deps) {
2747
+ var dispatcher = resolveDispatcher();
2748
+ return dispatcher.useImperativeHandle(ref, create, deps);
2749
+ }
2750
+ function useDebugValue(value, formatterFn) {
2751
+ {
2752
+ var dispatcher = resolveDispatcher();
2753
+ return dispatcher.useDebugValue(value, formatterFn);
2754
+ }
2755
+ }
2756
+ function useTransition() {
2757
+ var dispatcher = resolveDispatcher();
2758
+ return dispatcher.useTransition();
2759
+ }
2760
+ function useDeferredValue(value) {
2761
+ var dispatcher = resolveDispatcher();
2762
+ return dispatcher.useDeferredValue(value);
2763
+ }
2764
+ function useId() {
2765
+ var dispatcher = resolveDispatcher();
2766
+ return dispatcher.useId();
2767
+ }
2768
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
2769
+ var dispatcher = resolveDispatcher();
2770
+ return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
2771
+ }
2772
+
2773
+ // Helpers to patch console.logs to avoid logging during side-effect free
2774
+ // replaying on render function. This currently only patches the object
2775
+ // lazily which won't cover if the log function was extracted eagerly.
2776
+ // We could also eagerly patch the method.
2777
+ var disabledDepth = 0;
2778
+ var prevLog;
2779
+ var prevInfo;
2780
+ var prevWarn;
2781
+ var prevError;
2782
+ var prevGroup;
2783
+ var prevGroupCollapsed;
2784
+ var prevGroupEnd;
2785
+
2786
+ function disabledLog() {}
2787
+
2788
+ disabledLog.__reactDisabledLog = true;
2789
+ function disableLogs() {
2790
+ {
2791
+ if (disabledDepth === 0) {
2792
+ /* eslint-disable react-internal/no-production-logging */
2793
+ prevLog = console.log;
2794
+ prevInfo = console.info;
2795
+ prevWarn = console.warn;
2796
+ prevError = console.error;
2797
+ prevGroup = console.group;
2798
+ prevGroupCollapsed = console.groupCollapsed;
2799
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
2800
+
2801
+ var props = {
2802
+ configurable: true,
2803
+ enumerable: true,
2804
+ value: disabledLog,
2805
+ writable: true
2806
+ }; // $FlowFixMe Flow thinks console is immutable.
2807
+
2808
+ Object.defineProperties(console, {
2809
+ info: props,
2810
+ log: props,
2811
+ warn: props,
2812
+ error: props,
2813
+ group: props,
2814
+ groupCollapsed: props,
2815
+ groupEnd: props
2816
+ });
2817
+ /* eslint-enable react-internal/no-production-logging */
2818
+ }
2819
+
2820
+ disabledDepth++;
2821
+ }
2822
+ }
2823
+ function reenableLogs() {
2824
+ {
2825
+ disabledDepth--;
2826
+
2827
+ if (disabledDepth === 0) {
2828
+ /* eslint-disable react-internal/no-production-logging */
2829
+ var props = {
2830
+ configurable: true,
2831
+ enumerable: true,
2832
+ writable: true
2833
+ }; // $FlowFixMe Flow thinks console is immutable.
2834
+
2835
+ Object.defineProperties(console, {
2836
+ log: assign({}, props, {
2837
+ value: prevLog
2838
+ }),
2839
+ info: assign({}, props, {
2840
+ value: prevInfo
2841
+ }),
2842
+ warn: assign({}, props, {
2843
+ value: prevWarn
2844
+ }),
2845
+ error: assign({}, props, {
2846
+ value: prevError
2847
+ }),
2848
+ group: assign({}, props, {
2849
+ value: prevGroup
2850
+ }),
2851
+ groupCollapsed: assign({}, props, {
2852
+ value: prevGroupCollapsed
2853
+ }),
2854
+ groupEnd: assign({}, props, {
2855
+ value: prevGroupEnd
2856
+ })
2857
+ });
2858
+ /* eslint-enable react-internal/no-production-logging */
2859
+ }
2860
+
2861
+ if (disabledDepth < 0) {
2862
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
2863
+ }
2864
+ }
2865
+ }
2866
+
2867
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
2868
+ var prefix;
2869
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
2870
+ {
2871
+ if (prefix === undefined) {
2872
+ // Extract the VM specific prefix used by each line.
2873
+ try {
2874
+ throw Error();
2875
+ } catch (x) {
2876
+ var match = x.stack.trim().match(/\n( *(at )?)/);
2877
+ prefix = match && match[1] || '';
2878
+ }
2879
+ } // We use the prefix to ensure our stacks line up with native stack frames.
2880
+
2881
+
2882
+ return '\n' + prefix + name;
2883
+ }
2884
+ }
2885
+ var reentry = false;
2886
+ var componentFrameCache;
2887
+
2888
+ {
2889
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
2890
+ componentFrameCache = new PossiblyWeakMap();
2891
+ }
2892
+
2893
+ function describeNativeComponentFrame(fn, construct) {
2894
+ // If something asked for a stack inside a fake render, it should get ignored.
2895
+ if ( !fn || reentry) {
2896
+ return '';
2897
+ }
2898
+
2899
+ {
2900
+ var frame = componentFrameCache.get(fn);
2901
+
2902
+ if (frame !== undefined) {
2903
+ return frame;
2904
+ }
2905
+ }
2906
+
2907
+ var control;
2908
+ reentry = true;
2909
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
2910
+
2911
+ Error.prepareStackTrace = undefined;
2912
+ var previousDispatcher;
2913
+
2914
+ {
2915
+ previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
2916
+ // for warnings.
2917
+
2918
+ ReactCurrentDispatcher$1.current = null;
2919
+ disableLogs();
2920
+ }
2921
+
2922
+ try {
2923
+ // This should throw.
2924
+ if (construct) {
2925
+ // Something should be setting the props in the constructor.
2926
+ var Fake = function () {
2927
+ throw Error();
2928
+ }; // $FlowFixMe
2929
+
2930
+
2931
+ Object.defineProperty(Fake.prototype, 'props', {
2932
+ set: function () {
2933
+ // We use a throwing setter instead of frozen or non-writable props
2934
+ // because that won't throw in a non-strict mode function.
2935
+ throw Error();
2936
+ }
2937
+ });
2938
+
2939
+ if (typeof Reflect === 'object' && Reflect.construct) {
2940
+ // We construct a different control for this case to include any extra
2941
+ // frames added by the construct call.
2942
+ try {
2943
+ Reflect.construct(Fake, []);
2944
+ } catch (x) {
2945
+ control = x;
2946
+ }
2947
+
2948
+ Reflect.construct(fn, [], Fake);
2949
+ } else {
2950
+ try {
2951
+ Fake.call();
2952
+ } catch (x) {
2953
+ control = x;
2954
+ }
2955
+
2956
+ fn.call(Fake.prototype);
2957
+ }
2958
+ } else {
2959
+ try {
2960
+ throw Error();
2961
+ } catch (x) {
2962
+ control = x;
2963
+ }
2964
+
2965
+ fn();
2966
+ }
2967
+ } catch (sample) {
2968
+ // This is inlined manually because closure doesn't do it for us.
2969
+ if (sample && control && typeof sample.stack === 'string') {
2970
+ // This extracts the first frame from the sample that isn't also in the control.
2971
+ // Skipping one frame that we assume is the frame that calls the two.
2972
+ var sampleLines = sample.stack.split('\n');
2973
+ var controlLines = control.stack.split('\n');
2974
+ var s = sampleLines.length - 1;
2975
+ var c = controlLines.length - 1;
2976
+
2977
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
2978
+ // We expect at least one stack frame to be shared.
2979
+ // Typically this will be the root most one. However, stack frames may be
2980
+ // cut off due to maximum stack limits. In this case, one maybe cut off
2981
+ // earlier than the other. We assume that the sample is longer or the same
2982
+ // and there for cut off earlier. So we should find the root most frame in
2983
+ // the sample somewhere in the control.
2984
+ c--;
2985
+ }
2986
+
2987
+ for (; s >= 1 && c >= 0; s--, c--) {
2988
+ // Next we find the first one that isn't the same which should be the
2989
+ // frame that called our sample function and the control.
2990
+ if (sampleLines[s] !== controlLines[c]) {
2991
+ // In V8, the first line is describing the message but other VMs don't.
2992
+ // If we're about to return the first line, and the control is also on the same
2993
+ // line, that's a pretty good indicator that our sample threw at same line as
2994
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
2995
+ // This can happen if you passed a class to function component, or non-function.
2996
+ if (s !== 1 || c !== 1) {
2997
+ do {
2998
+ s--;
2999
+ c--; // We may still have similar intermediate frames from the construct call.
3000
+ // The next one that isn't the same should be our match though.
3001
+
3002
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
3003
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
3004
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
3005
+ // but we have a user-provided "displayName"
3006
+ // splice it in to make the stack more readable.
3007
+
3008
+
3009
+ if (fn.displayName && _frame.includes('<anonymous>')) {
3010
+ _frame = _frame.replace('<anonymous>', fn.displayName);
3011
+ }
3012
+
3013
+ {
3014
+ if (typeof fn === 'function') {
3015
+ componentFrameCache.set(fn, _frame);
3016
+ }
3017
+ } // Return the line we found.
3018
+
3019
+
3020
+ return _frame;
3021
+ }
3022
+ } while (s >= 1 && c >= 0);
3023
+ }
3024
+
3025
+ break;
3026
+ }
3027
+ }
3028
+ }
3029
+ } finally {
3030
+ reentry = false;
3031
+
3032
+ {
3033
+ ReactCurrentDispatcher$1.current = previousDispatcher;
3034
+ reenableLogs();
3035
+ }
3036
+
3037
+ Error.prepareStackTrace = previousPrepareStackTrace;
3038
+ } // Fallback to just using the name if we couldn't make it throw.
3039
+
3040
+
3041
+ var name = fn ? fn.displayName || fn.name : '';
3042
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
3043
+
3044
+ {
3045
+ if (typeof fn === 'function') {
3046
+ componentFrameCache.set(fn, syntheticFrame);
3047
+ }
3048
+ }
3049
+
3050
+ return syntheticFrame;
3051
+ }
3052
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
3053
+ {
3054
+ return describeNativeComponentFrame(fn, false);
3055
+ }
3056
+ }
3057
+
3058
+ function shouldConstruct(Component) {
3059
+ var prototype = Component.prototype;
3060
+ return !!(prototype && prototype.isReactComponent);
3061
+ }
3062
+
3063
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
3064
+
3065
+ if (type == null) {
3066
+ return '';
3067
+ }
3068
+
3069
+ if (typeof type === 'function') {
3070
+ {
3071
+ return describeNativeComponentFrame(type, shouldConstruct(type));
3072
+ }
3073
+ }
3074
+
3075
+ if (typeof type === 'string') {
3076
+ return describeBuiltInComponentFrame(type);
3077
+ }
3078
+
3079
+ switch (type) {
3080
+ case REACT_SUSPENSE_TYPE:
3081
+ return describeBuiltInComponentFrame('Suspense');
3082
+
3083
+ case REACT_SUSPENSE_LIST_TYPE:
3084
+ return describeBuiltInComponentFrame('SuspenseList');
3085
+ }
3086
+
3087
+ if (typeof type === 'object') {
3088
+ switch (type.$$typeof) {
3089
+ case REACT_FORWARD_REF_TYPE:
3090
+ return describeFunctionComponentFrame(type.render);
3091
+
3092
+ case REACT_MEMO_TYPE:
3093
+ // Memo may contain any component type so we recursively resolve it.
3094
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
3095
+
3096
+ case REACT_LAZY_TYPE:
3097
+ {
3098
+ var lazyComponent = type;
3099
+ var payload = lazyComponent._payload;
3100
+ var init = lazyComponent._init;
3101
+
3102
+ try {
3103
+ // Lazy may contain any component type so we recursively resolve it.
3104
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
3105
+ } catch (x) {}
3106
+ }
3107
+ }
3108
+ }
3109
+
3110
+ return '';
3111
+ }
3112
+
3113
+ var loggedTypeFailures = {};
3114
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
3115
+
3116
+ function setCurrentlyValidatingElement(element) {
3117
+ {
3118
+ if (element) {
3119
+ var owner = element._owner;
3120
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
3121
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
3122
+ } else {
3123
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
3124
+ }
3125
+ }
3126
+ }
3127
+
3128
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
3129
+ {
3130
+ // $FlowFixMe This is okay but Flow doesn't know it.
3131
+ var has = Function.call.bind(hasOwnProperty);
3132
+
3133
+ for (var typeSpecName in typeSpecs) {
3134
+ if (has(typeSpecs, typeSpecName)) {
3135
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
3136
+ // fail the render phase where it didn't fail before. So we log it.
3137
+ // After these have been cleaned up, we'll let them throw.
3138
+
3139
+ try {
3140
+ // This is intentionally an invariant that gets caught. It's the same
3141
+ // behavior as without this statement except with a better message.
3142
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
3143
+ // eslint-disable-next-line react-internal/prod-error-codes
3144
+ 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`.');
3145
+ err.name = 'Invariant Violation';
3146
+ throw err;
3147
+ }
3148
+
3149
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
3150
+ } catch (ex) {
3151
+ error$1 = ex;
3152
+ }
3153
+
3154
+ if (error$1 && !(error$1 instanceof Error)) {
3155
+ setCurrentlyValidatingElement(element);
3156
+
3157
+ 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);
3158
+
3159
+ setCurrentlyValidatingElement(null);
3160
+ }
3161
+
3162
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
3163
+ // Only monitor this failure once because there tends to be a lot of the
3164
+ // same error.
3165
+ loggedTypeFailures[error$1.message] = true;
3166
+ setCurrentlyValidatingElement(element);
3167
+
3168
+ error('Failed %s type: %s', location, error$1.message);
3169
+
3170
+ setCurrentlyValidatingElement(null);
3171
+ }
3172
+ }
3173
+ }
3174
+ }
3175
+ }
3176
+
3177
+ function setCurrentlyValidatingElement$1(element) {
3178
+ {
3179
+ if (element) {
3180
+ var owner = element._owner;
3181
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
3182
+ setExtraStackFrame(stack);
3183
+ } else {
3184
+ setExtraStackFrame(null);
3185
+ }
3186
+ }
3187
+ }
3188
+
3189
+ var propTypesMisspellWarningShown;
3190
+
3191
+ {
3192
+ propTypesMisspellWarningShown = false;
3193
+ }
3194
+
3195
+ function getDeclarationErrorAddendum() {
3196
+ if (ReactCurrentOwner.current) {
3197
+ var name = getComponentNameFromType(ReactCurrentOwner.current.type);
3198
+
3199
+ if (name) {
3200
+ return '\n\nCheck the render method of `' + name + '`.';
3201
+ }
3202
+ }
3203
+
3204
+ return '';
3205
+ }
3206
+
3207
+ function getSourceInfoErrorAddendum(source) {
3208
+ if (source !== undefined) {
3209
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
3210
+ var lineNumber = source.lineNumber;
3211
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
3212
+ }
3213
+
3214
+ return '';
3215
+ }
3216
+
3217
+ function getSourceInfoErrorAddendumForProps(elementProps) {
3218
+ if (elementProps !== null && elementProps !== undefined) {
3219
+ return getSourceInfoErrorAddendum(elementProps.__source);
3220
+ }
3221
+
3222
+ return '';
3223
+ }
3224
+ /**
3225
+ * Warn if there's no key explicitly set on dynamic arrays of children or
3226
+ * object keys are not valid. This allows us to keep track of children between
3227
+ * updates.
3228
+ */
3229
+
3230
+
3231
+ var ownerHasKeyUseWarning = {};
3232
+
3233
+ function getCurrentComponentErrorInfo(parentType) {
3234
+ var info = getDeclarationErrorAddendum();
3235
+
3236
+ if (!info) {
3237
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
3238
+
3239
+ if (parentName) {
3240
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
3241
+ }
3242
+ }
3243
+
3244
+ return info;
3245
+ }
3246
+ /**
3247
+ * Warn if the element doesn't have an explicit key assigned to it.
3248
+ * This element is in an array. The array could grow and shrink or be
3249
+ * reordered. All children that haven't already been validated are required to
3250
+ * have a "key" property assigned to it. Error statuses are cached so a warning
3251
+ * will only be shown once.
3252
+ *
3253
+ * @internal
3254
+ * @param {ReactElement} element Element that requires a key.
3255
+ * @param {*} parentType element's parent's type.
3256
+ */
3257
+
3258
+
3259
+ function validateExplicitKey(element, parentType) {
3260
+ if (!element._store || element._store.validated || element.key != null) {
3261
+ return;
3262
+ }
3263
+
3264
+ element._store.validated = true;
3265
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
3266
+
3267
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
3268
+ return;
3269
+ }
3270
+
3271
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
3272
+ // property, it may be the creator of the child that's responsible for
3273
+ // assigning it a key.
3274
+
3275
+ var childOwner = '';
3276
+
3277
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
3278
+ // Give the component that originally created this child.
3279
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
3280
+ }
3281
+
3282
+ {
3283
+ setCurrentlyValidatingElement$1(element);
3284
+
3285
+ 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);
3286
+
3287
+ setCurrentlyValidatingElement$1(null);
3288
+ }
3289
+ }
3290
+ /**
3291
+ * Ensure that every element either is passed in a static location, in an
3292
+ * array with an explicit keys property defined, or in an object literal
3293
+ * with valid key property.
3294
+ *
3295
+ * @internal
3296
+ * @param {ReactNode} node Statically passed child of any type.
3297
+ * @param {*} parentType node's parent's type.
3298
+ */
3299
+
3300
+
3301
+ function validateChildKeys(node, parentType) {
3302
+ if (typeof node !== 'object') {
3303
+ return;
3304
+ }
3305
+
3306
+ if (isArray(node)) {
3307
+ for (var i = 0; i < node.length; i++) {
3308
+ var child = node[i];
3309
+
3310
+ if (isValidElement(child)) {
3311
+ validateExplicitKey(child, parentType);
3312
+ }
3313
+ }
3314
+ } else if (isValidElement(node)) {
3315
+ // This element was passed in a valid location.
3316
+ if (node._store) {
3317
+ node._store.validated = true;
3318
+ }
3319
+ } else if (node) {
3320
+ var iteratorFn = getIteratorFn(node);
3321
+
3322
+ if (typeof iteratorFn === 'function') {
3323
+ // Entry iterators used to provide implicit keys,
3324
+ // but now we print a separate warning for them later.
3325
+ if (iteratorFn !== node.entries) {
3326
+ var iterator = iteratorFn.call(node);
3327
+ var step;
3328
+
3329
+ while (!(step = iterator.next()).done) {
3330
+ if (isValidElement(step.value)) {
3331
+ validateExplicitKey(step.value, parentType);
3332
+ }
3333
+ }
3334
+ }
3335
+ }
3336
+ }
3337
+ }
3338
+ /**
3339
+ * Given an element, validate that its props follow the propTypes definition,
3340
+ * provided by the type.
3341
+ *
3342
+ * @param {ReactElement} element
3343
+ */
3344
+
3345
+
3346
+ function validatePropTypes(element) {
3347
+ {
3348
+ var type = element.type;
3349
+
3350
+ if (type === null || type === undefined || typeof type === 'string') {
3351
+ return;
3352
+ }
3353
+
3354
+ var propTypes;
3355
+
3356
+ if (typeof type === 'function') {
3357
+ propTypes = type.propTypes;
3358
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
3359
+ // Inner props are checked in the reconciler.
3360
+ type.$$typeof === REACT_MEMO_TYPE)) {
3361
+ propTypes = type.propTypes;
3362
+ } else {
3363
+ return;
3364
+ }
3365
+
3366
+ if (propTypes) {
3367
+ // Intentionally inside to avoid triggering lazy initializers:
3368
+ var name = getComponentNameFromType(type);
3369
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
3370
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
3371
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
3372
+
3373
+ var _name = getComponentNameFromType(type);
3374
+
3375
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
3376
+ }
3377
+
3378
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
3379
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
3380
+ }
3381
+ }
3382
+ }
3383
+ /**
3384
+ * Given a fragment, validate that it can only be provided with fragment props
3385
+ * @param {ReactElement} fragment
3386
+ */
3387
+
3388
+
3389
+ function validateFragmentProps(fragment) {
3390
+ {
3391
+ var keys = Object.keys(fragment.props);
3392
+
3393
+ for (var i = 0; i < keys.length; i++) {
3394
+ var key = keys[i];
3395
+
3396
+ if (key !== 'children' && key !== 'key') {
3397
+ setCurrentlyValidatingElement$1(fragment);
3398
+
3399
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
3400
+
3401
+ setCurrentlyValidatingElement$1(null);
3402
+ break;
3403
+ }
3404
+ }
3405
+
3406
+ if (fragment.ref !== null) {
3407
+ setCurrentlyValidatingElement$1(fragment);
3408
+
3409
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
3410
+
3411
+ setCurrentlyValidatingElement$1(null);
3412
+ }
3413
+ }
3414
+ }
3415
+ function createElementWithValidation(type, props, children) {
3416
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
3417
+ // succeed and there will likely be errors in render.
3418
+
3419
+ if (!validType) {
3420
+ var info = '';
3421
+
3422
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
3423
+ 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.";
3424
+ }
3425
+
3426
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
3427
+
3428
+ if (sourceInfo) {
3429
+ info += sourceInfo;
3430
+ } else {
3431
+ info += getDeclarationErrorAddendum();
3432
+ }
3433
+
3434
+ var typeString;
3435
+
3436
+ if (type === null) {
3437
+ typeString = 'null';
3438
+ } else if (isArray(type)) {
3439
+ typeString = 'array';
3440
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
3441
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
3442
+ info = ' Did you accidentally export a JSX literal instead of a component?';
3443
+ } else {
3444
+ typeString = typeof type;
3445
+ }
3446
+
3447
+ {
3448
+ 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);
3449
+ }
3450
+ }
3451
+
3452
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
3453
+ // TODO: Drop this when these are no longer allowed as the type argument.
3454
+
3455
+ if (element == null) {
3456
+ return element;
3457
+ } // Skip key warning if the type isn't valid since our key validation logic
3458
+ // doesn't expect a non-string/function type and can throw confusing errors.
3459
+ // We don't want exception behavior to differ between dev and prod.
3460
+ // (Rendering will throw with a helpful message and as soon as the type is
3461
+ // fixed, the key warnings will appear.)
3462
+
3463
+
3464
+ if (validType) {
3465
+ for (var i = 2; i < arguments.length; i++) {
3466
+ validateChildKeys(arguments[i], type);
3467
+ }
3468
+ }
3469
+
3470
+ if (type === REACT_FRAGMENT_TYPE) {
3471
+ validateFragmentProps(element);
3472
+ } else {
3473
+ validatePropTypes(element);
3474
+ }
3475
+
3476
+ return element;
3477
+ }
3478
+ var didWarnAboutDeprecatedCreateFactory = false;
3479
+ function createFactoryWithValidation(type) {
3480
+ var validatedFactory = createElementWithValidation.bind(null, type);
3481
+ validatedFactory.type = type;
3482
+
3483
+ {
3484
+ if (!didWarnAboutDeprecatedCreateFactory) {
3485
+ didWarnAboutDeprecatedCreateFactory = true;
3486
+
3487
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
3488
+ } // Legacy hook: remove it
3489
+
3490
+
3491
+ Object.defineProperty(validatedFactory, 'type', {
3492
+ enumerable: false,
3493
+ get: function () {
3494
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
3495
+
3496
+ Object.defineProperty(this, 'type', {
3497
+ value: type
3498
+ });
3499
+ return type;
3500
+ }
3501
+ });
3502
+ }
3503
+
3504
+ return validatedFactory;
3505
+ }
3506
+ function cloneElementWithValidation(element, props, children) {
3507
+ var newElement = cloneElement.apply(this, arguments);
3508
+
3509
+ for (var i = 2; i < arguments.length; i++) {
3510
+ validateChildKeys(arguments[i], newElement.type);
3511
+ }
3512
+
3513
+ validatePropTypes(newElement);
3514
+ return newElement;
3515
+ }
3516
+
3517
+ function startTransition(scope, options) {
3518
+ var prevTransition = ReactCurrentBatchConfig.transition;
3519
+ ReactCurrentBatchConfig.transition = {};
3520
+ var currentTransition = ReactCurrentBatchConfig.transition;
3521
+
3522
+ {
3523
+ ReactCurrentBatchConfig.transition._updatedFibers = new Set();
3524
+ }
3525
+
3526
+ try {
3527
+ scope();
3528
+ } finally {
3529
+ ReactCurrentBatchConfig.transition = prevTransition;
3530
+
3531
+ {
3532
+ if (prevTransition === null && currentTransition._updatedFibers) {
3533
+ var updatedFibersCount = currentTransition._updatedFibers.size;
3534
+
3535
+ if (updatedFibersCount > 10) {
3536
+ 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.');
3537
+ }
3538
+
3539
+ currentTransition._updatedFibers.clear();
3540
+ }
3541
+ }
3542
+ }
3543
+ }
3544
+
3545
+ var didWarnAboutMessageChannel = false;
3546
+ var enqueueTaskImpl = null;
3547
+ function enqueueTask(task) {
3548
+ if (enqueueTaskImpl === null) {
3549
+ try {
3550
+ // read require off the module object to get around the bundlers.
3551
+ // we don't want them to detect a require and bundle a Node polyfill.
3552
+ var requireString = ('require' + Math.random()).slice(0, 7);
3553
+ var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
3554
+ // version of setImmediate, bypassing fake timers if any.
3555
+
3556
+ enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
3557
+ } catch (_err) {
3558
+ // we're in a browser
3559
+ // we can't use regular timers because they may still be faked
3560
+ // so we try MessageChannel+postMessage instead
3561
+ enqueueTaskImpl = function (callback) {
3562
+ {
3563
+ if (didWarnAboutMessageChannel === false) {
3564
+ didWarnAboutMessageChannel = true;
3565
+
3566
+ if (typeof MessageChannel === 'undefined') {
3567
+ 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.');
3568
+ }
3569
+ }
3570
+ }
3571
+
3572
+ var channel = new MessageChannel();
3573
+ channel.port1.onmessage = callback;
3574
+ channel.port2.postMessage(undefined);
3575
+ };
3576
+ }
3577
+ }
3578
+
3579
+ return enqueueTaskImpl(task);
3580
+ }
3581
+
3582
+ var actScopeDepth = 0;
3583
+ var didWarnNoAwaitAct = false;
3584
+ function act(callback) {
3585
+ {
3586
+ // `act` calls can be nested, so we track the depth. This represents the
3587
+ // number of `act` scopes on the stack.
3588
+ var prevActScopeDepth = actScopeDepth;
3589
+ actScopeDepth++;
3590
+
3591
+ if (ReactCurrentActQueue.current === null) {
3592
+ // This is the outermost `act` scope. Initialize the queue. The reconciler
3593
+ // will detect the queue and use it instead of Scheduler.
3594
+ ReactCurrentActQueue.current = [];
3595
+ }
3596
+
3597
+ var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
3598
+ var result;
3599
+
3600
+ try {
3601
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
3602
+ // set to `true` while the given callback is executed, not for updates
3603
+ // triggered during an async event, because this is how the legacy
3604
+ // implementation of `act` behaved.
3605
+ ReactCurrentActQueue.isBatchingLegacy = true;
3606
+ result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
3607
+ // which flushed updates immediately after the scope function exits, even
3608
+ // if it's an async function.
3609
+
3610
+ if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
3611
+ var queue = ReactCurrentActQueue.current;
3612
+
3613
+ if (queue !== null) {
3614
+ ReactCurrentActQueue.didScheduleLegacyUpdate = false;
3615
+ flushActQueue(queue);
3616
+ }
3617
+ }
3618
+ } catch (error) {
3619
+ popActScope(prevActScopeDepth);
3620
+ throw error;
3621
+ } finally {
3622
+ ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
3623
+ }
3624
+
3625
+ if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
3626
+ var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
3627
+ // for it to resolve before exiting the current scope.
3628
+
3629
+ var wasAwaited = false;
3630
+ var thenable = {
3631
+ then: function (resolve, reject) {
3632
+ wasAwaited = true;
3633
+ thenableResult.then(function (returnValue) {
3634
+ popActScope(prevActScopeDepth);
3635
+
3636
+ if (actScopeDepth === 0) {
3637
+ // We've exited the outermost act scope. Recursively flush the
3638
+ // queue until there's no remaining work.
3639
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3640
+ } else {
3641
+ resolve(returnValue);
3642
+ }
3643
+ }, function (error) {
3644
+ // The callback threw an error.
3645
+ popActScope(prevActScopeDepth);
3646
+ reject(error);
3647
+ });
3648
+ }
3649
+ };
3650
+
3651
+ {
3652
+ if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
3653
+ // eslint-disable-next-line no-undef
3654
+ Promise.resolve().then(function () {}).then(function () {
3655
+ if (!wasAwaited) {
3656
+ didWarnNoAwaitAct = true;
3657
+
3658
+ 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 () => ...);');
3659
+ }
3660
+ });
3661
+ }
3662
+ }
3663
+
3664
+ return thenable;
3665
+ } else {
3666
+ var returnValue = result; // The callback is not an async function. Exit the current scope
3667
+ // immediately, without awaiting.
3668
+
3669
+ popActScope(prevActScopeDepth);
3670
+
3671
+ if (actScopeDepth === 0) {
3672
+ // Exiting the outermost act scope. Flush the queue.
3673
+ var _queue = ReactCurrentActQueue.current;
3674
+
3675
+ if (_queue !== null) {
3676
+ flushActQueue(_queue);
3677
+ ReactCurrentActQueue.current = null;
3678
+ } // Return a thenable. If the user awaits it, we'll flush again in
3679
+ // case additional work was scheduled by a microtask.
3680
+
3681
+
3682
+ var _thenable = {
3683
+ then: function (resolve, reject) {
3684
+ // Confirm we haven't re-entered another `act` scope, in case
3685
+ // the user does something weird like await the thenable
3686
+ // multiple times.
3687
+ if (ReactCurrentActQueue.current === null) {
3688
+ // Recursively flush the queue until there's no remaining work.
3689
+ ReactCurrentActQueue.current = [];
3690
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3691
+ } else {
3692
+ resolve(returnValue);
3693
+ }
3694
+ }
3695
+ };
3696
+ return _thenable;
3697
+ } else {
3698
+ // Since we're inside a nested `act` scope, the returned thenable
3699
+ // immediately resolves. The outer scope will flush the queue.
3700
+ var _thenable2 = {
3701
+ then: function (resolve, reject) {
3702
+ resolve(returnValue);
3703
+ }
3704
+ };
3705
+ return _thenable2;
3706
+ }
3707
+ }
3708
+ }
3709
+ }
3710
+
3711
+ function popActScope(prevActScopeDepth) {
3712
+ {
3713
+ if (prevActScopeDepth !== actScopeDepth - 1) {
3714
+ error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
3715
+ }
3716
+
3717
+ actScopeDepth = prevActScopeDepth;
3718
+ }
3719
+ }
3720
+
3721
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
3722
+ {
3723
+ var queue = ReactCurrentActQueue.current;
3724
+
3725
+ if (queue !== null) {
3726
+ try {
3727
+ flushActQueue(queue);
3728
+ enqueueTask(function () {
3729
+ if (queue.length === 0) {
3730
+ // No additional work was scheduled. Finish.
3731
+ ReactCurrentActQueue.current = null;
3732
+ resolve(returnValue);
3733
+ } else {
3734
+ // Keep flushing work until there's none left.
3735
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3736
+ }
3737
+ });
3738
+ } catch (error) {
3739
+ reject(error);
3740
+ }
3741
+ } else {
3742
+ resolve(returnValue);
3743
+ }
3744
+ }
3745
+ }
3746
+
3747
+ var isFlushing = false;
3748
+
3749
+ function flushActQueue(queue) {
3750
+ {
3751
+ if (!isFlushing) {
3752
+ // Prevent re-entrance.
3753
+ isFlushing = true;
3754
+ var i = 0;
3755
+
3756
+ try {
3757
+ for (; i < queue.length; i++) {
3758
+ var callback = queue[i];
3759
+
3760
+ do {
3761
+ callback = callback(true);
3762
+ } while (callback !== null);
3763
+ }
3764
+
3765
+ queue.length = 0;
3766
+ } catch (error) {
3767
+ // If something throws, leave the remaining callbacks on the queue.
3768
+ queue = queue.slice(i + 1);
3769
+ throw error;
3770
+ } finally {
3771
+ isFlushing = false;
3772
+ }
3773
+ }
3774
+ }
3775
+ }
3776
+
3777
+ var createElement$1 = createElementWithValidation ;
3778
+ var cloneElement$1 = cloneElementWithValidation ;
3779
+ var createFactory = createFactoryWithValidation ;
3780
+ var Children = {
3781
+ map: mapChildren,
3782
+ forEach: forEachChildren,
3783
+ count: countChildren,
3784
+ toArray: toArray,
3785
+ only: onlyChild
3786
+ };
3787
+
3788
+ exports.Children = Children;
3789
+ exports.Component = Component;
3790
+ exports.Fragment = REACT_FRAGMENT_TYPE;
3791
+ exports.Profiler = REACT_PROFILER_TYPE;
3792
+ exports.PureComponent = PureComponent;
3793
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
3794
+ exports.Suspense = REACT_SUSPENSE_TYPE;
3795
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
3796
+ exports.cloneElement = cloneElement$1;
3797
+ exports.createContext = createContext;
3798
+ exports.createElement = createElement$1;
3799
+ exports.createFactory = createFactory;
3800
+ exports.createRef = createRef;
3801
+ exports.forwardRef = forwardRef;
3802
+ exports.isValidElement = isValidElement;
3803
+ exports.lazy = lazy;
3804
+ exports.memo = memo;
3805
+ exports.startTransition = startTransition;
3806
+ exports.unstable_act = act;
3807
+ exports.useCallback = useCallback;
3808
+ exports.useContext = useContext;
3809
+ exports.useDebugValue = useDebugValue;
3810
+ exports.useDeferredValue = useDeferredValue;
3811
+ exports.useEffect = useEffect;
3812
+ exports.useId = useId;
3813
+ exports.useImperativeHandle = useImperativeHandle;
3814
+ exports.useInsertionEffect = useInsertionEffect;
3815
+ exports.useLayoutEffect = useLayoutEffect;
3816
+ exports.useMemo = useMemo;
3817
+ exports.useReducer = useReducer;
3818
+ exports.useRef = useRef;
3819
+ exports.useState = useState;
3820
+ exports.useSyncExternalStore = useSyncExternalStore;
3821
+ exports.useTransition = useTransition;
3822
+ exports.version = ReactVersion;
3823
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
3824
+ if (
3825
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
3826
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
3827
+ 'function'
3828
+ ) {
3829
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
3830
+ }
3831
+
3832
+ })();
3833
+ }
3834
+ } (react_development, react_development.exports));
3835
+
3836
+ var react_developmentExports = react_development.exports;
3837
+
3838
+ {
3839
+ react.exports = react_developmentExports;
3840
+ }
3841
+
3842
+ var reactExports = react.exports;
3843
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
3844
+
3845
+ function styleInject(css, ref) {
3846
+ if ( ref === void 0 ) ref = {};
3847
+ var insertAt = ref.insertAt;
3848
+
3849
+ if (!css || typeof document === 'undefined') { return; }
3850
+
3851
+ var head = document.head || document.getElementsByTagName('head')[0];
3852
+ var style = document.createElement('style');
3853
+ style.type = 'text/css';
3854
+
3855
+ if (insertAt === 'top') {
3856
+ if (head.firstChild) {
3857
+ head.insertBefore(style, head.firstChild);
3858
+ } else {
3859
+ head.appendChild(style);
3860
+ }
3861
+ } else {
3862
+ head.appendChild(style);
3863
+ }
3864
+
3865
+ if (style.styleSheet) {
3866
+ style.styleSheet.cssText = css;
3867
+ } else {
3868
+ style.appendChild(document.createTextNode(css));
3869
+ }
3870
+ }
3871
+
3872
+ var css_248z = ":root {\n --rpf-brand-black: hsla(60, 4%, 11%, 1);\n --rpf-brand-leaf: hsla(123, 43%, 48%, 1);\n --rpf-brand-raspberry: hsla(342, 71%, 47%, 1);\n}\n\n:root {\n --rpf-red-100: hsla(4, 89%, 96%, 1);\n --rpf-red-200: hsla(1, 87%, 91%, 1);\n --rpf-red-400: hsla(1, 87%, 82%, 1);\n --rpf-red-600: hsla(1, 87%, 72%, 1);\n --rpf-red-800: hsla(1, 87%, 63%, 1);\n --rpf-red-900: hsla(1, 52%, 50%, 1);\n --rpf-green-100: hsla(125, 41%, 95%, 1);\n --rpf-green-200: hsla(122, 39%, 87%, 1);\n --rpf-green-400: hsla(123, 40%, 74%, 1);\n --rpf-green-600: hsla(123, 40%, 61%, 1);\n --rpf-green-800: hsla(123, 43%, 48%, 1);\n --rpf-green-900: hsla(123, 43%, 36%, 1);\n --rpf-teal-100: hsla(176, 55%, 94%, 1);\n --rpf-teal-200: hsla(174, 55%, 85%, 1);\n --rpf-teal-400: hsla(174, 55%, 70%, 1);\n --rpf-teal-600: hsla(174, 56%, 56%, 1);\n --rpf-teal-800: hsla(174, 81%, 41%, 1);\n --rpf-teal-900: hsla(174, 81%, 29%, 1);\n --rpf-orange-100: hsla(31, 100%, 95%, 1);\n --rpf-orange-200: hsla(32, 100%, 88%, 1);\n --rpf-orange-400: hsla(31, 100%, 77%, 1);\n --rpf-orange-600: hsla(31, 99%, 65%, 1);\n --rpf-orange-800: hsla(31, 99%, 54%, 1);\n --rpf-orange-900: hsla(31, 85%, 37%, 1);\n --rpf-yellow-100: hsla(51, 100%, 95%, 1);\n --rpf-yellow-200: hsla(52, 100%, 87%, 1);\n --rpf-yellow-400: hsla(51, 100%, 75%, 1);\n --rpf-yellow-600: hsla(52, 100%, 63%, 1);\n --rpf-yellow-800: hsla(52, 100%, 50%, 1);\n --rpf-yellow-900: hsla(52, 100%, 26%, 1);\n --rpf-purple-100: hsla(282, 36%, 95%, 1);\n --rpf-purple-200: hsla(279, 38%, 87%, 1);\n --rpf-purple-400: hsla(279, 38%, 73%, 1);\n --rpf-purple-600: hsla(279, 37%, 60%, 1);\n --rpf-purple-800: hsla(279, 43%, 47%, 1);\n --rpf-purple-900: hsla(280, 43%, 37%, 1);\n --rpf-navy-100: hsla(235, 38%, 94%, 1);\n --rpf-navy-200: hsla(234, 38%, 84%, 1);\n --rpf-navy-400: hsla(235, 38%, 69%, 1);\n --rpf-navy-600: hsla(235, 38%, 53%, 1);\n --rpf-navy-800: hsla(235, 63%, 37%, 1);\n --rpf-navy-900: hsla(234, 63%, 30%, 1);\n --rpf-blue-100: hsla(203, 86%, 95%, 1);\n --rpf-blue-200: hsla(204, 88%, 87%, 1);\n --rpf-blue-400: hsla(204, 88%, 74%, 1);\n --rpf-blue-600: hsla(204, 89%, 60%, 1);\n --rpf-blue-800: hsla(204, 100%, 47%, 1);\n --rpf-blue-900: hsla(204, 100%, 38%, 1);\n}\n\n:root {\n --rpf-white: hsla(0, 0%, 100%, 1);\n --rpf-off-white: hsla(225, 25%, 97%, 1);\n --rpf-grey-50: hsla(210, 8%, 95%, 1);\n --rpf-grey-100: hsla(228, 10%, 90%, 1);\n --rpf-grey-150: hsla(223, 9%, 85%, 1);\n --rpf-grey-200: hsla(228, 10%, 80%, 1);\n --rpf-grey-300: hsla(229, 9%, 75%, 1);\n --rpf-grey-400: hsla(229, 8%, 61%, 1);\n --rpf-grey-500: hsla(229, 9%, 42%, 1);\n --rpf-grey-600: hsla(228, 9%, 32%, 1);\n --rpf-grey-700: hsla(228, 9%, 22%, 1);\n --rpf-grey-800: hsla(232, 9%, 18%, 1);\n --rpf-grey-850: hsla(228, 9%, 15%, 1);\n --rpf-grey-900: hsla(228, 9%, 10%, 1);\n --rpf-grey-950: hsla(228, 8%, 5%, 1);\n --rpf-black: hsla(0, 0%, 0%, 1);\n}\n\n:root {\n --font-size-0-5: 0.5rem;\n --font-size-0-75: 0.75rem;\n --font-size-1: 1rem;\n --font-size-1-5: 1.25rem;\n --font-size-2: 1.5rem;\n --font-size-3: 2rem;\n --font-size-4: 2.5rem;\n --font-size-5: 3rem;\n --font-size-6: 3.5rem;\n --font-size-7: 4rem;\n --font-size-8: 4.5rem;\n --font-size-9: 5rem;\n}\n\n:root {\n --font-weight-regular: 400;\n --font-weight-bold: 700;\n}\n\n:root {\n --border-radius: var(--space-1);\n --input-border-width: 2px;\n --alert-border-width: 2px;\n}\n\n:root {\n --space-0-125: 0.0625rem;\n --space-0-25: 0.125rem;\n --space-0-5: 0.25rem;\n --space-1: 0.5rem;\n --space-1-5: 0.75rem;\n --space-2: 1rem;\n --space-3: 1.5rem;\n --space-4: 2rem;\n --space-5: 2.5rem;\n --space-6: 3rem;\n --space-7: 3.5rem;\n --space-8: 4rem;\n --space-9: 4.5rem;\n --space-10: 5rem;\n}\n\n:root {\n --rpf-button-primary-background-color: var(--rpf-navy-800);\n --rpf-button-primary-background-color-hover: var(--rpf-navy-900);\n --rpf-button-primary-background-color-active: var(--rpf-navy-600);\n --rpf-button-primary-background-color-disabled: var(--rpf-grey-600);\n --rpf-button-primary-text-color: var(--rpf-white);\n --rpf-button-border-radius: var(--border-radius);\n --rpf-button-lg-height: 48px;\n --rpf-button-sm-height: 32px;\n /* 44px min-height to meet WCAG AAA target size requirements */\n --rpf-button-min-target-size: 44px;\n}\n\n.rpf-button {\n all: unset;\n align-items: center;\n color: var(--rpf-button-primary-text-color);\n /*\n * We've decided to follow the masses on this and have a pointer on buttons.\n * Google, Facebook, Twitter, Mozilla, and Microsoft amongst many others have a pointer on buttons.\n */\n cursor: pointer;\n display: flex;\n font-size: var(--font-size-1-5);\n font-weight: var(--font-weight-bold);\n gap: var(--space-1);\n min-height: calc(var(--rpf-button-lg-height) - var(--space-1) - var(--space-1));\n padding: var(--space-1) var(--space-2);\n position: relative;\n text-align: center;\n text-decoration: none;\n /* Fixes a rendering error that sometimes occurs due to negative z-index */\n transform: scale(1);\n width: fit-content;\n /* A bit of a hack to allow for separate visual and target heights */\n}\n.rpf-button::before {\n background-color: var(--rpf-button-primary-background-color);\n border-color: var(--rpf-button-primary-background-color);\n border-radius: var(--rpf-button-border-radius);\n border-style: solid;\n border-width: 2px;\n content: \"\";\n display: block;\n inset: 0;\n position: absolute;\n /* To ensure it renders under its siblings */\n z-index: -1;\n}\n.rpf-button:hover::before {\n background-color: var(--rpf-button-primary-background-color-hover);\n border-color: var(--rpf-button-primary-background-color-hover);\n}\n.rpf-button:active::before {\n background-color: var(--rpf-button-primary-background-color-active);\n border-color: var(--rpf-button-primary-background-color-active);\n}\n.rpf-button:focus-visible::before {\n outline: 3px solid var(--rpf-brand-raspberry);\n}\n.rpf-button:disabled, .rpf-button--disabled {\n cursor: default;\n}\n.rpf-button:disabled:hover::before, .rpf-button:disabled::before, .rpf-button--disabled:hover::before, .rpf-button--disabled::before {\n border-color: var(--rpf-button-primary-background-color-disabled);\n background-color: var(--rpf-button-primary-background-color-disabled);\n}\n.rpf-button--secondary {\n color: var(--rpf-button-primary-background-color);\n}\n.rpf-button--secondary::before {\n background-color: var(--rpf-button-primary-text-color);\n}\n.rpf-button--secondary:hover {\n color: var(--rpf-button-primary-background-color-hover);\n}\n.rpf-button--secondary:hover::before {\n background-color: var(--rpf-button-primary-text-color);\n border-color: var(--rpf-button-primary-background-color-hover);\n}\n.rpf-button--secondary:active {\n color: var(--rpf-button-primary-background-color-active);\n}\n.rpf-button--secondary:active::before {\n background-color: var(--rpf-button-primary-text-color);\n border-color: var(--rpf-button-primary-background-color-active);\n}\n.rpf-button--secondary:disabled, .rpf-button--secondary.rpf-button--disabled {\n color: var(--rpf-button-primary-background-color-disabled);\n}\n.rpf-button--secondary:disabled:hover::before, .rpf-button--secondary:disabled:before, .rpf-button--secondary.rpf-button--disabled:hover::before, .rpf-button--secondary.rpf-button--disabled:before {\n background-color: var(--rpf-button-primary-text-color);\n border-color: var(--rpf-button-primary-background-color-disabled);\n}\n.rpf-button--tertiary {\n color: var(--rpf-button-primary-background-color);\n}\n.rpf-button--tertiary::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:hover {\n color: var(--rpf-button-primary-background-color-hover);\n}\n.rpf-button--tertiary:hover::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--tertiary:active {\n color: var(--rpf-button-primary-background-color-active);\n}\n.rpf-button--tertiary:active::before {\n background-color: transparent;\n}\n.rpf-button--tertiary:disabled, .rpf-button--tertiary.rpf-button--disabled {\n color: var(--rpf-button-primary-background-color-disabled);\n}\n.rpf-button--tertiary:disabled:hover::before, .rpf-button--tertiary:disabled::before, .rpf-button--tertiary.rpf-button--disabled:hover::before, .rpf-button--tertiary.rpf-button--disabled::before {\n background-color: transparent;\n border-color: transparent;\n}\n.rpf-button--icon-only {\n height: var(--rpf-button-lg-height);\n line-height: var(--rpf-button-lg-height);\n padding: 0;\n text-align: center;\n width: var(--rpf-button-lg-height);\n}\n.rpf-button--icon-only .rpf-button__icon {\n margin: 0 auto;\n}\n.rpf-button--sm {\n font-size: var(--font-size-1);\n min-height: calc(var(--rpf-button-min-target-size) - var(--space-1) - var(--space-1));\n padding: var(--space-1) var(--space-1);\n /* To account for 32px visual height and 44px target height */\n}\n.rpf-button--sm::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2) 0;\n}\n.rpf-button--sm.rpf-button--icon-only {\n height: var(--rpf-button-min-target-size);\n line-height: var(--rpf-button-min-target-size);\n padding: 0;\n width: var(--rpf-button-min-target-size);\n}\n.rpf-button--sm.rpf-button--icon-only::before {\n inset: calc((var(--rpf-button-min-target-size) - var(--rpf-button-sm-height)) / 2);\n}\n.rpf-button--sm .material-symbols-sharp {\n font-size: 20px;\n font-variation-settings: \"OPSZ\" 20;\n}\n";
3873
+ styleInject(css_248z);
3874
+
3875
+ /* eslint-disable complexity */
3876
+ const Button = ({
3877
+ type = "primary",
3878
+ className,
3879
+ enabled = true,
3880
+ active,
3881
+ icon,
3882
+ small = false,
3883
+ onClick = () => {},
3884
+ href,
3885
+ text,
3886
+ title,
3887
+ "aria-label": ariaLabel = "",
3888
+ textOnHover = false,
3889
+ textAlways = false
3890
+ }) => {
3891
+ const iconOnly = icon && !textAlways;
3892
+ const classes = classnames("rpf-button", {
3893
+ active: active,
3894
+ disabled: !enabled,
3895
+ "rpf-button--sm": small,
3896
+ // eslint-disable-next-line no-undefined
3897
+ "rpf-button--icon-only": iconOnly,
3898
+ text_on_hover: textOnHover,
3899
+ [`rpf-button--${type}`]: type
3900
+ }, className);
3901
+ const iconClasses = classnames("icon", "rpf-button__icon", {
3902
+ icon_with_text: !textOnHover,
3903
+ icon_without_text: textOnHover,
3904
+ // eslint-disable-next-line no-undefined
3905
+ icon_only: !textOnHover && !text
3906
+ });
3907
+ const content = /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement("div", {
3908
+ className: iconClasses
3909
+ }, icon), text && !iconOnly && /*#__PURE__*/React.createElement("span", {
3910
+ className: "text"
3911
+ }, text));
3912
+ if (href) {
3913
+ return /*#__PURE__*/React.createElement("a", {
3914
+ className: classes,
3915
+ "aria-label": ariaLabel,
3916
+ href: href,
3917
+ onClick: onClick
3918
+ }, content);
3919
+ }
3920
+ return /*#__PURE__*/React.createElement("button", {
3921
+ className: classes,
3922
+ title: title,
3923
+ "aria-label": ariaLabel,
3924
+ onClick: onClick,
3925
+ disabled: !enabled
3926
+ }, content);
3927
+ };
3928
+ /* eslint-enable complexity */
3929
+
3930
+ Button.propTypes = {
3931
+ type: PropTypes.string,
3932
+ className: PropTypes.string,
3933
+ enabled: PropTypes.bool,
3934
+ active: PropTypes.bool,
3935
+ icon: PropTypes.element,
3936
+ href: PropTypes.string,
3937
+ onClick: PropTypes.func,
3938
+ text: PropTypes.string,
3939
+ title: PropTypes.string,
3940
+ textAlways: PropTypes.bool,
3941
+ "aria-label": PropTypes.string,
3942
+ textOnHover: PropTypes.bool
3943
+ };
3944
+
3945
+ exports.Button = Button;