1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 | if (process.env.NODE_ENV !== "production") {
|
15 | (function() {
|
16 | 'use strict';
|
17 |
|
18 | var _assign = require('object-assign');
|
19 | var checkPropTypes = require('prop-types/checkPropTypes');
|
20 |
|
21 |
|
22 |
|
23 | var ReactVersion = '16.8.3';
|
24 |
|
25 |
|
26 |
|
27 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
28 |
|
29 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
30 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
31 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
32 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
33 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
34 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
35 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
36 |
|
37 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
38 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
39 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
40 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
41 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
42 |
|
43 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
44 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
45 |
|
46 | function getIteratorFn(maybeIterable) {
|
47 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
48 | return null;
|
49 | }
|
50 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
51 | if (typeof maybeIterator === 'function') {
|
52 | return maybeIterator;
|
53 | }
|
54 | return null;
|
55 | }
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | var validateFormat = function () {};
|
69 |
|
70 | {
|
71 | validateFormat = function (format) {
|
72 | if (format === undefined) {
|
73 | throw new Error('invariant requires an error message argument');
|
74 | }
|
75 | };
|
76 | }
|
77 |
|
78 | function invariant(condition, format, a, b, c, d, e, f) {
|
79 | validateFormat(format);
|
80 |
|
81 | if (!condition) {
|
82 | var error = void 0;
|
83 | if (format === undefined) {
|
84 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
85 | } else {
|
86 | var args = [a, b, c, d, e, f];
|
87 | var argIndex = 0;
|
88 | error = new Error(format.replace(/%s/g, function () {
|
89 | return args[argIndex++];
|
90 | }));
|
91 | error.name = 'Invariant Violation';
|
92 | }
|
93 |
|
94 | error.framesToPop = 1;
|
95 | throw error;
|
96 | }
|
97 | }
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | var lowPriorityWarning = function () {};
|
117 |
|
118 | {
|
119 | var printWarning = function (format) {
|
120 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
121 | args[_key - 1] = arguments[_key];
|
122 | }
|
123 |
|
124 | var argIndex = 0;
|
125 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
126 | return args[argIndex++];
|
127 | });
|
128 | if (typeof console !== 'undefined') {
|
129 | console.warn(message);
|
130 | }
|
131 | try {
|
132 |
|
133 |
|
134 |
|
135 | throw new Error(message);
|
136 | } catch (x) {}
|
137 | };
|
138 |
|
139 | lowPriorityWarning = function (condition, format) {
|
140 | if (format === undefined) {
|
141 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
142 | }
|
143 | if (!condition) {
|
144 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
145 | args[_key2 - 2] = arguments[_key2];
|
146 | }
|
147 |
|
148 | printWarning.apply(undefined, [format].concat(args));
|
149 | }
|
150 | };
|
151 | }
|
152 |
|
153 | var lowPriorityWarning$1 = lowPriorityWarning;
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | var warningWithoutStack = function () {};
|
163 |
|
164 | {
|
165 | warningWithoutStack = function (condition, format) {
|
166 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
167 | args[_key - 2] = arguments[_key];
|
168 | }
|
169 |
|
170 | if (format === undefined) {
|
171 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
172 | }
|
173 | if (args.length > 8) {
|
174 |
|
175 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
176 | }
|
177 | if (condition) {
|
178 | return;
|
179 | }
|
180 | if (typeof console !== 'undefined') {
|
181 | var argsWithFormat = args.map(function (item) {
|
182 | return '' + item;
|
183 | });
|
184 | argsWithFormat.unshift('Warning: ' + format);
|
185 |
|
186 |
|
187 |
|
188 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
189 | }
|
190 | try {
|
191 |
|
192 |
|
193 |
|
194 | var argIndex = 0;
|
195 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
196 | return args[argIndex++];
|
197 | });
|
198 | throw new Error(message);
|
199 | } catch (x) {}
|
200 | };
|
201 | }
|
202 |
|
203 | var warningWithoutStack$1 = warningWithoutStack;
|
204 |
|
205 | var didWarnStateUpdateForUnmountedComponent = {};
|
206 |
|
207 | function warnNoop(publicInstance, callerName) {
|
208 | {
|
209 | var _constructor = publicInstance.constructor;
|
210 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
211 | var warningKey = componentName + '.' + callerName;
|
212 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
213 | return;
|
214 | }
|
215 | warningWithoutStack$1(false, "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);
|
216 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
217 | }
|
218 | }
|
219 |
|
220 |
|
221 |
|
222 |
|
223 | var ReactNoopUpdateQueue = {
|
224 | |
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 | isMounted: function (publicInstance) {
|
232 | return false;
|
233 | },
|
234 |
|
235 | |
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
251 | warnNoop(publicInstance, 'forceUpdate');
|
252 | },
|
253 |
|
254 | |
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
268 | warnNoop(publicInstance, 'replaceState');
|
269 | },
|
270 |
|
271 | |
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
284 | warnNoop(publicInstance, 'setState');
|
285 | }
|
286 | };
|
287 |
|
288 | var emptyObject = {};
|
289 | {
|
290 | Object.freeze(emptyObject);
|
291 | }
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | function Component(props, context, updater) {
|
297 | this.props = props;
|
298 | this.context = context;
|
299 |
|
300 | this.refs = emptyObject;
|
301 |
|
302 |
|
303 | this.updater = updater || ReactNoopUpdateQueue;
|
304 | }
|
305 |
|
306 | Component.prototype.isReactComponent = {};
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 | Component.prototype.setState = function (partialState, callback) {
|
334 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
335 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
336 | };
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 | Component.prototype.forceUpdate = function (callback) {
|
353 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
354 | };
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 | {
|
362 | var deprecatedAPIs = {
|
363 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
364 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
365 | };
|
366 | var defineDeprecationWarning = function (methodName, info) {
|
367 | Object.defineProperty(Component.prototype, methodName, {
|
368 | get: function () {
|
369 | lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
370 | return undefined;
|
371 | }
|
372 | });
|
373 | };
|
374 | for (var fnName in deprecatedAPIs) {
|
375 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
376 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
377 | }
|
378 | }
|
379 | }
|
380 |
|
381 | function ComponentDummy() {}
|
382 | ComponentDummy.prototype = Component.prototype;
|
383 |
|
384 |
|
385 |
|
386 |
|
387 | function PureComponent(props, context, updater) {
|
388 | this.props = props;
|
389 | this.context = context;
|
390 |
|
391 | this.refs = emptyObject;
|
392 | this.updater = updater || ReactNoopUpdateQueue;
|
393 | }
|
394 |
|
395 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
396 | pureComponentPrototype.constructor = PureComponent;
|
397 |
|
398 | _assign(pureComponentPrototype, Component.prototype);
|
399 | pureComponentPrototype.isPureReactComponent = true;
|
400 |
|
401 |
|
402 | function createRef() {
|
403 | var refObject = {
|
404 | current: null
|
405 | };
|
406 | {
|
407 | Object.seal(refObject);
|
408 | }
|
409 | return refObject;
|
410 | }
|
411 |
|
412 |
|
413 |
|
414 |
|
415 | var ReactCurrentDispatcher = {
|
416 | |
417 |
|
418 |
|
419 |
|
420 | current: null
|
421 | };
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 | var ReactCurrentOwner = {
|
430 | |
431 |
|
432 |
|
433 |
|
434 | current: null
|
435 | };
|
436 |
|
437 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
438 |
|
439 | var describeComponentFrame = function (name, source, ownerName) {
|
440 | var sourceInfo = '';
|
441 | if (source) {
|
442 | var path = source.fileName;
|
443 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
444 | {
|
445 |
|
446 |
|
447 | if (/^index\./.test(fileName)) {
|
448 | var match = path.match(BEFORE_SLASH_RE);
|
449 | if (match) {
|
450 | var pathBeforeSlash = match[1];
|
451 | if (pathBeforeSlash) {
|
452 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
453 | fileName = folderName + '/' + fileName;
|
454 | }
|
455 | }
|
456 | }
|
457 | }
|
458 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
459 | } else if (ownerName) {
|
460 | sourceInfo = ' (created by ' + ownerName + ')';
|
461 | }
|
462 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
463 | };
|
464 |
|
465 | var Resolved = 1;
|
466 |
|
467 |
|
468 | function refineResolvedLazyComponent(lazyComponent) {
|
469 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
470 | }
|
471 |
|
472 | function getWrappedName(outerType, innerType, wrapperName) {
|
473 | var functionName = innerType.displayName || innerType.name || '';
|
474 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
475 | }
|
476 |
|
477 | function getComponentName(type) {
|
478 | if (type == null) {
|
479 |
|
480 | return null;
|
481 | }
|
482 | {
|
483 | if (typeof type.tag === 'number') {
|
484 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
485 | }
|
486 | }
|
487 | if (typeof type === 'function') {
|
488 | return type.displayName || type.name || null;
|
489 | }
|
490 | if (typeof type === 'string') {
|
491 | return type;
|
492 | }
|
493 | switch (type) {
|
494 | case REACT_CONCURRENT_MODE_TYPE:
|
495 | return 'ConcurrentMode';
|
496 | case REACT_FRAGMENT_TYPE:
|
497 | return 'Fragment';
|
498 | case REACT_PORTAL_TYPE:
|
499 | return 'Portal';
|
500 | case REACT_PROFILER_TYPE:
|
501 | return 'Profiler';
|
502 | case REACT_STRICT_MODE_TYPE:
|
503 | return 'StrictMode';
|
504 | case REACT_SUSPENSE_TYPE:
|
505 | return 'Suspense';
|
506 | }
|
507 | if (typeof type === 'object') {
|
508 | switch (type.$$typeof) {
|
509 | case REACT_CONTEXT_TYPE:
|
510 | return 'Context.Consumer';
|
511 | case REACT_PROVIDER_TYPE:
|
512 | return 'Context.Provider';
|
513 | case REACT_FORWARD_REF_TYPE:
|
514 | return getWrappedName(type, type.render, 'ForwardRef');
|
515 | case REACT_MEMO_TYPE:
|
516 | return getComponentName(type.type);
|
517 | case REACT_LAZY_TYPE:
|
518 | {
|
519 | var thenable = type;
|
520 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
521 | if (resolvedThenable) {
|
522 | return getComponentName(resolvedThenable);
|
523 | }
|
524 | }
|
525 | }
|
526 | }
|
527 | return null;
|
528 | }
|
529 |
|
530 | var ReactDebugCurrentFrame = {};
|
531 |
|
532 | var currentlyValidatingElement = null;
|
533 |
|
534 | function setCurrentlyValidatingElement(element) {
|
535 | {
|
536 | currentlyValidatingElement = element;
|
537 | }
|
538 | }
|
539 |
|
540 | {
|
541 |
|
542 | ReactDebugCurrentFrame.getCurrentStack = null;
|
543 |
|
544 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
545 | var stack = '';
|
546 |
|
547 |
|
548 | if (currentlyValidatingElement) {
|
549 | var name = getComponentName(currentlyValidatingElement.type);
|
550 | var owner = currentlyValidatingElement._owner;
|
551 | stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
552 | }
|
553 |
|
554 |
|
555 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
556 | if (impl) {
|
557 | stack += impl() || '';
|
558 | }
|
559 |
|
560 | return stack;
|
561 | };
|
562 | }
|
563 |
|
564 | var ReactSharedInternals = {
|
565 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
566 | ReactCurrentOwner: ReactCurrentOwner,
|
567 |
|
568 | assign: _assign
|
569 | };
|
570 |
|
571 | {
|
572 | _assign(ReactSharedInternals, {
|
573 |
|
574 | ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
575 |
|
576 |
|
577 | ReactComponentTreeHook: {}
|
578 | });
|
579 | }
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 | var warning = warningWithoutStack$1;
|
589 |
|
590 | {
|
591 | warning = function (condition, format) {
|
592 | if (condition) {
|
593 | return;
|
594 | }
|
595 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
596 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
597 |
|
598 |
|
599 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
600 | args[_key - 2] = arguments[_key];
|
601 | }
|
602 |
|
603 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
604 | };
|
605 | }
|
606 |
|
607 | var warning$1 = warning;
|
608 |
|
609 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
610 |
|
611 | var RESERVED_PROPS = {
|
612 | key: true,
|
613 | ref: true,
|
614 | __self: true,
|
615 | __source: true
|
616 | };
|
617 |
|
618 | var specialPropKeyWarningShown = void 0;
|
619 | var specialPropRefWarningShown = void 0;
|
620 |
|
621 | function hasValidRef(config) {
|
622 | {
|
623 | if (hasOwnProperty.call(config, 'ref')) {
|
624 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
625 | if (getter && getter.isReactWarning) {
|
626 | return false;
|
627 | }
|
628 | }
|
629 | }
|
630 | return config.ref !== undefined;
|
631 | }
|
632 |
|
633 | function hasValidKey(config) {
|
634 | {
|
635 | if (hasOwnProperty.call(config, 'key')) {
|
636 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
637 | if (getter && getter.isReactWarning) {
|
638 | return false;
|
639 | }
|
640 | }
|
641 | }
|
642 | return config.key !== undefined;
|
643 | }
|
644 |
|
645 | function defineKeyPropWarningGetter(props, displayName) {
|
646 | var warnAboutAccessingKey = function () {
|
647 | if (!specialPropKeyWarningShown) {
|
648 | specialPropKeyWarningShown = true;
|
649 | warningWithoutStack$1(false, '%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://fb.me/react-special-props)', displayName);
|
650 | }
|
651 | };
|
652 | warnAboutAccessingKey.isReactWarning = true;
|
653 | Object.defineProperty(props, 'key', {
|
654 | get: warnAboutAccessingKey,
|
655 | configurable: true
|
656 | });
|
657 | }
|
658 |
|
659 | function defineRefPropWarningGetter(props, displayName) {
|
660 | var warnAboutAccessingRef = function () {
|
661 | if (!specialPropRefWarningShown) {
|
662 | specialPropRefWarningShown = true;
|
663 | warningWithoutStack$1(false, '%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://fb.me/react-special-props)', displayName);
|
664 | }
|
665 | };
|
666 | warnAboutAccessingRef.isReactWarning = true;
|
667 | Object.defineProperty(props, 'ref', {
|
668 | get: warnAboutAccessingRef,
|
669 | configurable: true
|
670 | });
|
671 | }
|
672 |
|
673 | /**
|
674 | * Factory method to create a new React element. This no longer adheres to
|
675 | * the class pattern, so do not use new to call it. Also, no instanceof check
|
676 | * will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
677 | * if something is a React Element.
|
678 | *
|
679 | * @param {*} type
|
680 | * @param {*} key
|
681 | * @param {string|object} ref
|
682 | * @param {*} self A *temporary* helper to detect places where `this` is
|
683 | * different from the `owner` when React.createElement is called, so that we
|
684 | * can warn. We want to get rid of owner and replace string `ref`s with arrow
|
685 | * functions, and as long as `this` and owner are the same, there will be no
|
686 | * change in behavior.
|
687 | * @param {*} source An annotation object (added by a transpiler or otherwise)
|
688 | * indicating filename, line number, and/or other information.
|
689 | * @param {*} owner
|
690 | * @param {*} props
|
691 | * @internal
|
692 | */
|
693 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
694 | var element = {
|
695 |
|
696 | $$typeof: REACT_ELEMENT_TYPE,
|
697 |
|
698 |
|
699 | type: type,
|
700 | key: key,
|
701 | ref: ref,
|
702 | props: props,
|
703 |
|
704 |
|
705 | _owner: owner
|
706 | };
|
707 |
|
708 | {
|
709 |
|
710 |
|
711 |
|
712 |
|
713 | element._store = {};
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 | Object.defineProperty(element._store, 'validated', {
|
720 | configurable: false,
|
721 | enumerable: false,
|
722 | writable: true,
|
723 | value: false
|
724 | });
|
725 |
|
726 | Object.defineProperty(element, '_self', {
|
727 | configurable: false,
|
728 | enumerable: false,
|
729 | writable: false,
|
730 | value: self
|
731 | });
|
732 |
|
733 |
|
734 | Object.defineProperty(element, '_source', {
|
735 | configurable: false,
|
736 | enumerable: false,
|
737 | writable: false,
|
738 | value: source
|
739 | });
|
740 | if (Object.freeze) {
|
741 | Object.freeze(element.props);
|
742 | Object.freeze(element);
|
743 | }
|
744 | }
|
745 |
|
746 | return element;
|
747 | };
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 | function createElement(type, config, children) {
|
754 | var propName = void 0;
|
755 |
|
756 |
|
757 | var props = {};
|
758 |
|
759 | var key = null;
|
760 | var ref = null;
|
761 | var self = null;
|
762 | var source = null;
|
763 |
|
764 | if (config != null) {
|
765 | if (hasValidRef(config)) {
|
766 | ref = config.ref;
|
767 | }
|
768 | if (hasValidKey(config)) {
|
769 | key = '' + config.key;
|
770 | }
|
771 |
|
772 | self = config.__self === undefined ? null : config.__self;
|
773 | source = config.__source === undefined ? null : config.__source;
|
774 |
|
775 | for (propName in config) {
|
776 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
777 | props[propName] = config[propName];
|
778 | }
|
779 | }
|
780 | }
|
781 |
|
782 |
|
783 |
|
784 | var childrenLength = arguments.length - 2;
|
785 | if (childrenLength === 1) {
|
786 | props.children = children;
|
787 | } else if (childrenLength > 1) {
|
788 | var childArray = Array(childrenLength);
|
789 | for (var i = 0; i < childrenLength; i++) {
|
790 | childArray[i] = arguments[i + 2];
|
791 | }
|
792 | {
|
793 | if (Object.freeze) {
|
794 | Object.freeze(childArray);
|
795 | }
|
796 | }
|
797 | props.children = childArray;
|
798 | }
|
799 |
|
800 |
|
801 | if (type && type.defaultProps) {
|
802 | var defaultProps = type.defaultProps;
|
803 | for (propName in defaultProps) {
|
804 | if (props[propName] === undefined) {
|
805 | props[propName] = defaultProps[propName];
|
806 | }
|
807 | }
|
808 | }
|
809 | {
|
810 | if (key || ref) {
|
811 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
812 | if (key) {
|
813 | defineKeyPropWarningGetter(props, displayName);
|
814 | }
|
815 | if (ref) {
|
816 | defineRefPropWarningGetter(props, displayName);
|
817 | }
|
818 | }
|
819 | }
|
820 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
821 | }
|
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 | function cloneAndReplaceKey(oldElement, newKey) {
|
830 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
831 |
|
832 | return newElement;
|
833 | }
|
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 | function cloneElement(element, config, children) {
|
840 | !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
|
841 |
|
842 | var propName = void 0;
|
843 |
|
844 |
|
845 | var props = _assign({}, element.props);
|
846 |
|
847 |
|
848 | var key = element.key;
|
849 | var ref = element.ref;
|
850 |
|
851 | var self = element._self;
|
852 |
|
853 |
|
854 |
|
855 | var source = element._source;
|
856 |
|
857 |
|
858 | var owner = element._owner;
|
859 |
|
860 | if (config != null) {
|
861 | if (hasValidRef(config)) {
|
862 |
|
863 | ref = config.ref;
|
864 | owner = ReactCurrentOwner.current;
|
865 | }
|
866 | if (hasValidKey(config)) {
|
867 | key = '' + config.key;
|
868 | }
|
869 |
|
870 |
|
871 | var defaultProps = void 0;
|
872 | if (element.type && element.type.defaultProps) {
|
873 | defaultProps = element.type.defaultProps;
|
874 | }
|
875 | for (propName in config) {
|
876 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
877 | if (config[propName] === undefined && defaultProps !== undefined) {
|
878 |
|
879 | props[propName] = defaultProps[propName];
|
880 | } else {
|
881 | props[propName] = config[propName];
|
882 | }
|
883 | }
|
884 | }
|
885 | }
|
886 |
|
887 |
|
888 |
|
889 | var childrenLength = arguments.length - 2;
|
890 | if (childrenLength === 1) {
|
891 | props.children = children;
|
892 | } else if (childrenLength > 1) {
|
893 | var childArray = Array(childrenLength);
|
894 | for (var i = 0; i < childrenLength; i++) {
|
895 | childArray[i] = arguments[i + 2];
|
896 | }
|
897 | props.children = childArray;
|
898 | }
|
899 |
|
900 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
901 | }
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 | function isValidElement(object) {
|
911 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
912 | }
|
913 |
|
914 | var SEPARATOR = '.';
|
915 | var SUBSEPARATOR = ':';
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 | function escape(key) {
|
924 | var escapeRegex = /[=:]/g;
|
925 | var escaperLookup = {
|
926 | '=': '=0',
|
927 | ':': '=2'
|
928 | };
|
929 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
930 | return escaperLookup[match];
|
931 | });
|
932 |
|
933 | return '$' + escapedString;
|
934 | }
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 | var didWarnAboutMaps = false;
|
942 |
|
943 | var userProvidedKeyEscapeRegex = /\/+/g;
|
944 | function escapeUserProvidedKey(text) {
|
945 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
946 | }
|
947 |
|
948 | var POOL_SIZE = 10;
|
949 | var traverseContextPool = [];
|
950 | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
951 | if (traverseContextPool.length) {
|
952 | var traverseContext = traverseContextPool.pop();
|
953 | traverseContext.result = mapResult;
|
954 | traverseContext.keyPrefix = keyPrefix;
|
955 | traverseContext.func = mapFunction;
|
956 | traverseContext.context = mapContext;
|
957 | traverseContext.count = 0;
|
958 | return traverseContext;
|
959 | } else {
|
960 | return {
|
961 | result: mapResult,
|
962 | keyPrefix: keyPrefix,
|
963 | func: mapFunction,
|
964 | context: mapContext,
|
965 | count: 0
|
966 | };
|
967 | }
|
968 | }
|
969 |
|
970 | function releaseTraverseContext(traverseContext) {
|
971 | traverseContext.result = null;
|
972 | traverseContext.keyPrefix = null;
|
973 | traverseContext.func = null;
|
974 | traverseContext.context = null;
|
975 | traverseContext.count = 0;
|
976 | if (traverseContextPool.length < POOL_SIZE) {
|
977 | traverseContextPool.push(traverseContext);
|
978 | }
|
979 | }
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
990 | var type = typeof children;
|
991 |
|
992 | if (type === 'undefined' || type === 'boolean') {
|
993 |
|
994 | children = null;
|
995 | }
|
996 |
|
997 | var invokeCallback = false;
|
998 |
|
999 | if (children === null) {
|
1000 | invokeCallback = true;
|
1001 | } else {
|
1002 | switch (type) {
|
1003 | case 'string':
|
1004 | case 'number':
|
1005 | invokeCallback = true;
|
1006 | break;
|
1007 | case 'object':
|
1008 | switch (children.$$typeof) {
|
1009 | case REACT_ELEMENT_TYPE:
|
1010 | case REACT_PORTAL_TYPE:
|
1011 | invokeCallback = true;
|
1012 | }
|
1013 | }
|
1014 | }
|
1015 |
|
1016 | if (invokeCallback) {
|
1017 | callback(traverseContext, children,
|
1018 |
|
1019 |
|
1020 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
1021 | return 1;
|
1022 | }
|
1023 |
|
1024 | var child = void 0;
|
1025 | var nextName = void 0;
|
1026 | var subtreeCount = 0;
|
1027 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1028 |
|
1029 | if (Array.isArray(children)) {
|
1030 | for (var i = 0; i < children.length; i++) {
|
1031 | child = children[i];
|
1032 | nextName = nextNamePrefix + getComponentKey(child, i);
|
1033 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
1034 | }
|
1035 | } else {
|
1036 | var iteratorFn = getIteratorFn(children);
|
1037 | if (typeof iteratorFn === 'function') {
|
1038 | {
|
1039 |
|
1040 | if (iteratorFn === children.entries) {
|
1041 | !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
1042 | didWarnAboutMaps = true;
|
1043 | }
|
1044 | }
|
1045 |
|
1046 | var iterator = iteratorFn.call(children);
|
1047 | var step = void 0;
|
1048 | var ii = 0;
|
1049 | while (!(step = iterator.next()).done) {
|
1050 | child = step.value;
|
1051 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
1052 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
1053 | }
|
1054 | } else if (type === 'object') {
|
1055 | var addendum = '';
|
1056 | {
|
1057 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
1058 | }
|
1059 | var childrenString = '' + children;
|
1060 | invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
1061 | }
|
1062 | }
|
1063 |
|
1064 | return subtreeCount;
|
1065 | }
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 | function traverseAllChildren(children, callback, traverseContext) {
|
1084 | if (children == null) {
|
1085 | return 0;
|
1086 | }
|
1087 |
|
1088 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
1089 | }
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 | function getComponentKey(component, index) {
|
1099 |
|
1100 |
|
1101 | if (typeof component === 'object' && component !== null && component.key != null) {
|
1102 |
|
1103 | return escape(component.key);
|
1104 | }
|
1105 |
|
1106 | return index.toString(36);
|
1107 | }
|
1108 |
|
1109 | function forEachSingleChild(bookKeeping, child, name) {
|
1110 | var func = bookKeeping.func,
|
1111 | context = bookKeeping.context;
|
1112 |
|
1113 | func.call(context, child, bookKeeping.count++);
|
1114 | }
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 | function forEachChildren(children, forEachFunc, forEachContext) {
|
1129 | if (children == null) {
|
1130 | return children;
|
1131 | }
|
1132 | var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
1133 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
1134 | releaseTraverseContext(traverseContext);
|
1135 | }
|
1136 |
|
1137 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
1138 | var result = bookKeeping.result,
|
1139 | keyPrefix = bookKeeping.keyPrefix,
|
1140 | func = bookKeeping.func,
|
1141 | context = bookKeeping.context;
|
1142 |
|
1143 |
|
1144 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
1145 | if (Array.isArray(mappedChild)) {
|
1146 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
1147 | return c;
|
1148 | });
|
1149 | } else if (mappedChild != null) {
|
1150 | if (isValidElement(mappedChild)) {
|
1151 | mappedChild = cloneAndReplaceKey(mappedChild,
|
1152 |
|
1153 |
|
1154 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
1155 | }
|
1156 | result.push(mappedChild);
|
1157 | }
|
1158 | }
|
1159 |
|
1160 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
1161 | var escapedPrefix = '';
|
1162 | if (prefix != null) {
|
1163 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
1164 | }
|
1165 | var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
1166 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
1167 | releaseTraverseContext(traverseContext);
|
1168 | }
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 | function mapChildren(children, func, context) {
|
1184 | if (children == null) {
|
1185 | return children;
|
1186 | }
|
1187 | var result = [];
|
1188 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
1189 | return result;
|
1190 | }
|
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 | function countChildren(children) {
|
1202 | return traverseAllChildren(children, function () {
|
1203 | return null;
|
1204 | }, null);
|
1205 | }
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 | function toArray(children) {
|
1214 | var result = [];
|
1215 | mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
1216 | return child;
|
1217 | });
|
1218 | return result;
|
1219 | }
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 | function onlyChild(children) {
|
1236 | !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
|
1237 | return children;
|
1238 | }
|
1239 |
|
1240 | function createContext(defaultValue, calculateChangedBits) {
|
1241 | if (calculateChangedBits === undefined) {
|
1242 | calculateChangedBits = null;
|
1243 | } else {
|
1244 | {
|
1245 | !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
1246 | }
|
1247 | }
|
1248 |
|
1249 | var context = {
|
1250 | $$typeof: REACT_CONTEXT_TYPE,
|
1251 | _calculateChangedBits: calculateChangedBits,
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 | _currentValue: defaultValue,
|
1258 | _currentValue2: defaultValue,
|
1259 |
|
1260 |
|
1261 | _threadCount: 0,
|
1262 |
|
1263 | Provider: null,
|
1264 | Consumer: null
|
1265 | };
|
1266 |
|
1267 | context.Provider = {
|
1268 | $$typeof: REACT_PROVIDER_TYPE,
|
1269 | _context: context
|
1270 | };
|
1271 |
|
1272 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
1273 | var hasWarnedAboutUsingConsumerProvider = false;
|
1274 |
|
1275 | {
|
1276 |
|
1277 |
|
1278 |
|
1279 | var Consumer = {
|
1280 | $$typeof: REACT_CONTEXT_TYPE,
|
1281 | _context: context,
|
1282 | _calculateChangedBits: context._calculateChangedBits
|
1283 | };
|
1284 |
|
1285 | Object.defineProperties(Consumer, {
|
1286 | Provider: {
|
1287 | get: function () {
|
1288 | if (!hasWarnedAboutUsingConsumerProvider) {
|
1289 | hasWarnedAboutUsingConsumerProvider = true;
|
1290 | warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
1291 | }
|
1292 | return context.Provider;
|
1293 | },
|
1294 | set: function (_Provider) {
|
1295 | context.Provider = _Provider;
|
1296 | }
|
1297 | },
|
1298 | _currentValue: {
|
1299 | get: function () {
|
1300 | return context._currentValue;
|
1301 | },
|
1302 | set: function (_currentValue) {
|
1303 | context._currentValue = _currentValue;
|
1304 | }
|
1305 | },
|
1306 | _currentValue2: {
|
1307 | get: function () {
|
1308 | return context._currentValue2;
|
1309 | },
|
1310 | set: function (_currentValue2) {
|
1311 | context._currentValue2 = _currentValue2;
|
1312 | }
|
1313 | },
|
1314 | _threadCount: {
|
1315 | get: function () {
|
1316 | return context._threadCount;
|
1317 | },
|
1318 | set: function (_threadCount) {
|
1319 | context._threadCount = _threadCount;
|
1320 | }
|
1321 | },
|
1322 | Consumer: {
|
1323 | get: function () {
|
1324 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
1325 | hasWarnedAboutUsingNestedContextConsumers = true;
|
1326 | warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
1327 | }
|
1328 | return context.Consumer;
|
1329 | }
|
1330 | }
|
1331 | });
|
1332 |
|
1333 | context.Consumer = Consumer;
|
1334 | }
|
1335 |
|
1336 | {
|
1337 | context._currentRenderer = null;
|
1338 | context._currentRenderer2 = null;
|
1339 | }
|
1340 |
|
1341 | return context;
|
1342 | }
|
1343 |
|
1344 | function lazy(ctor) {
|
1345 | var lazyType = {
|
1346 | $$typeof: REACT_LAZY_TYPE,
|
1347 | _ctor: ctor,
|
1348 |
|
1349 | _status: -1,
|
1350 | _result: null
|
1351 | };
|
1352 |
|
1353 | {
|
1354 |
|
1355 | var defaultProps = void 0;
|
1356 | var propTypes = void 0;
|
1357 | Object.defineProperties(lazyType, {
|
1358 | defaultProps: {
|
1359 | configurable: true,
|
1360 | get: function () {
|
1361 | return defaultProps;
|
1362 | },
|
1363 | set: function (newDefaultProps) {
|
1364 | warning$1(false, '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.');
|
1365 | defaultProps = newDefaultProps;
|
1366 |
|
1367 | Object.defineProperty(lazyType, 'defaultProps', {
|
1368 | enumerable: true
|
1369 | });
|
1370 | }
|
1371 | },
|
1372 | propTypes: {
|
1373 | configurable: true,
|
1374 | get: function () {
|
1375 | return propTypes;
|
1376 | },
|
1377 | set: function (newPropTypes) {
|
1378 | warning$1(false, '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.');
|
1379 | propTypes = newPropTypes;
|
1380 |
|
1381 | Object.defineProperty(lazyType, 'propTypes', {
|
1382 | enumerable: true
|
1383 | });
|
1384 | }
|
1385 | }
|
1386 | });
|
1387 | }
|
1388 |
|
1389 | return lazyType;
|
1390 | }
|
1391 |
|
1392 | function forwardRef(render) {
|
1393 | {
|
1394 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1395 | warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1396 | } else if (typeof render !== 'function') {
|
1397 | warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1398 | } else {
|
1399 | !(
|
1400 |
|
1401 | render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, '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.') : void 0;
|
1402 | }
|
1403 |
|
1404 | if (render != null) {
|
1405 | !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
|
1406 | }
|
1407 | }
|
1408 |
|
1409 | return {
|
1410 | $$typeof: REACT_FORWARD_REF_TYPE,
|
1411 | render: render
|
1412 | };
|
1413 | }
|
1414 |
|
1415 | function isValidElementType(type) {
|
1416 | return typeof type === 'string' || typeof type === 'function' ||
|
1417 |
|
1418 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_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);
|
1419 | }
|
1420 |
|
1421 | function memo(type, compare) {
|
1422 | {
|
1423 | if (!isValidElementType(type)) {
|
1424 | warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
1425 | }
|
1426 | }
|
1427 | return {
|
1428 | $$typeof: REACT_MEMO_TYPE,
|
1429 | type: type,
|
1430 | compare: compare === undefined ? null : compare
|
1431 | };
|
1432 | }
|
1433 |
|
1434 | function resolveDispatcher() {
|
1435 | var dispatcher = ReactCurrentDispatcher.current;
|
1436 | !(dispatcher !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)') : void 0;
|
1437 | return dispatcher;
|
1438 | }
|
1439 |
|
1440 | function useContext(Context, unstable_observedBits) {
|
1441 | var dispatcher = resolveDispatcher();
|
1442 | {
|
1443 | !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;
|
1444 |
|
1445 |
|
1446 | if (Context._context !== undefined) {
|
1447 | var realContext = Context._context;
|
1448 |
|
1449 |
|
1450 | if (realContext.Consumer === Context) {
|
1451 | warning$1(false, '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?');
|
1452 | } else if (realContext.Provider === Context) {
|
1453 | warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
1454 | }
|
1455 | }
|
1456 | }
|
1457 | return dispatcher.useContext(Context, unstable_observedBits);
|
1458 | }
|
1459 |
|
1460 | function useState(initialState) {
|
1461 | var dispatcher = resolveDispatcher();
|
1462 | return dispatcher.useState(initialState);
|
1463 | }
|
1464 |
|
1465 | function useReducer(reducer, initialArg, init) {
|
1466 | var dispatcher = resolveDispatcher();
|
1467 | return dispatcher.useReducer(reducer, initialArg, init);
|
1468 | }
|
1469 |
|
1470 | function useRef(initialValue) {
|
1471 | var dispatcher = resolveDispatcher();
|
1472 | return dispatcher.useRef(initialValue);
|
1473 | }
|
1474 |
|
1475 | function useEffect(create, inputs) {
|
1476 | var dispatcher = resolveDispatcher();
|
1477 | return dispatcher.useEffect(create, inputs);
|
1478 | }
|
1479 |
|
1480 | function useLayoutEffect(create, inputs) {
|
1481 | var dispatcher = resolveDispatcher();
|
1482 | return dispatcher.useLayoutEffect(create, inputs);
|
1483 | }
|
1484 |
|
1485 | function useCallback(callback, inputs) {
|
1486 | var dispatcher = resolveDispatcher();
|
1487 | return dispatcher.useCallback(callback, inputs);
|
1488 | }
|
1489 |
|
1490 | function useMemo(create, inputs) {
|
1491 | var dispatcher = resolveDispatcher();
|
1492 | return dispatcher.useMemo(create, inputs);
|
1493 | }
|
1494 |
|
1495 | function useImperativeHandle(ref, create, inputs) {
|
1496 | var dispatcher = resolveDispatcher();
|
1497 | return dispatcher.useImperativeHandle(ref, create, inputs);
|
1498 | }
|
1499 |
|
1500 | function useDebugValue(value, formatterFn) {
|
1501 | {
|
1502 | var dispatcher = resolveDispatcher();
|
1503 | return dispatcher.useDebugValue(value, formatterFn);
|
1504 | }
|
1505 | }
|
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 | var propTypesMisspellWarningShown = void 0;
|
1515 |
|
1516 | {
|
1517 | propTypesMisspellWarningShown = false;
|
1518 | }
|
1519 |
|
1520 | function getDeclarationErrorAddendum() {
|
1521 | if (ReactCurrentOwner.current) {
|
1522 | var name = getComponentName(ReactCurrentOwner.current.type);
|
1523 | if (name) {
|
1524 | return '\n\nCheck the render method of `' + name + '`.';
|
1525 | }
|
1526 | }
|
1527 | return '';
|
1528 | }
|
1529 |
|
1530 | function getSourceInfoErrorAddendum(elementProps) {
|
1531 | if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
|
1532 | var source = elementProps.__source;
|
1533 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
1534 | var lineNumber = source.lineNumber;
|
1535 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
1536 | }
|
1537 | return '';
|
1538 | }
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 | var ownerHasKeyUseWarning = {};
|
1546 |
|
1547 | function getCurrentComponentErrorInfo(parentType) {
|
1548 | var info = getDeclarationErrorAddendum();
|
1549 |
|
1550 | if (!info) {
|
1551 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
1552 | if (parentName) {
|
1553 | info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
1554 | }
|
1555 | }
|
1556 | return info;
|
1557 | }
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 |
|
1569 |
|
1570 | function validateExplicitKey(element, parentType) {
|
1571 | if (!element._store || element._store.validated || element.key != null) {
|
1572 | return;
|
1573 | }
|
1574 | element._store.validated = true;
|
1575 |
|
1576 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
1577 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
1578 | return;
|
1579 | }
|
1580 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 | var childOwner = '';
|
1586 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
1587 |
|
1588 | childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
|
1589 | }
|
1590 |
|
1591 | setCurrentlyValidatingElement(element);
|
1592 | {
|
1593 | warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
1594 | }
|
1595 | setCurrentlyValidatingElement(null);
|
1596 | }
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 | function validateChildKeys(node, parentType) {
|
1608 | if (typeof node !== 'object') {
|
1609 | return;
|
1610 | }
|
1611 | if (Array.isArray(node)) {
|
1612 | for (var i = 0; i < node.length; i++) {
|
1613 | var child = node[i];
|
1614 | if (isValidElement(child)) {
|
1615 | validateExplicitKey(child, parentType);
|
1616 | }
|
1617 | }
|
1618 | } else if (isValidElement(node)) {
|
1619 |
|
1620 | if (node._store) {
|
1621 | node._store.validated = true;
|
1622 | }
|
1623 | } else if (node) {
|
1624 | var iteratorFn = getIteratorFn(node);
|
1625 | if (typeof iteratorFn === 'function') {
|
1626 |
|
1627 |
|
1628 | if (iteratorFn !== node.entries) {
|
1629 | var iterator = iteratorFn.call(node);
|
1630 | var step = void 0;
|
1631 | while (!(step = iterator.next()).done) {
|
1632 | if (isValidElement(step.value)) {
|
1633 | validateExplicitKey(step.value, parentType);
|
1634 | }
|
1635 | }
|
1636 | }
|
1637 | }
|
1638 | }
|
1639 | }
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 | function validatePropTypes(element) {
|
1648 | var type = element.type;
|
1649 | if (type === null || type === undefined || typeof type === 'string') {
|
1650 | return;
|
1651 | }
|
1652 | var name = getComponentName(type);
|
1653 | var propTypes = void 0;
|
1654 | if (typeof type === 'function') {
|
1655 | propTypes = type.propTypes;
|
1656 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
1657 |
|
1658 |
|
1659 | type.$$typeof === REACT_MEMO_TYPE)) {
|
1660 | propTypes = type.propTypes;
|
1661 | } else {
|
1662 | return;
|
1663 | }
|
1664 | if (propTypes) {
|
1665 | setCurrentlyValidatingElement(element);
|
1666 | checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
1667 | setCurrentlyValidatingElement(null);
|
1668 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
1669 | propTypesMisspellWarningShown = true;
|
1670 | warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
1671 | }
|
1672 | if (typeof type.getDefaultProps === 'function') {
|
1673 | !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
1674 | }
|
1675 | }
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 | function validateFragmentProps(fragment) {
|
1682 | setCurrentlyValidatingElement(fragment);
|
1683 |
|
1684 | var keys = Object.keys(fragment.props);
|
1685 | for (var i = 0; i < keys.length; i++) {
|
1686 | var key = keys[i];
|
1687 | if (key !== 'children' && key !== 'key') {
|
1688 | warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
1689 | break;
|
1690 | }
|
1691 | }
|
1692 |
|
1693 | if (fragment.ref !== null) {
|
1694 | warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
1695 | }
|
1696 |
|
1697 | setCurrentlyValidatingElement(null);
|
1698 | }
|
1699 |
|
1700 | function createElementWithValidation(type, props, children) {
|
1701 | var validType = isValidElementType(type);
|
1702 |
|
1703 |
|
1704 |
|
1705 | if (!validType) {
|
1706 | var info = '';
|
1707 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1708 | 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.";
|
1709 | }
|
1710 |
|
1711 | var sourceInfo = getSourceInfoErrorAddendum(props);
|
1712 | if (sourceInfo) {
|
1713 | info += sourceInfo;
|
1714 | } else {
|
1715 | info += getDeclarationErrorAddendum();
|
1716 | }
|
1717 |
|
1718 | var typeString = void 0;
|
1719 | if (type === null) {
|
1720 | typeString = 'null';
|
1721 | } else if (Array.isArray(type)) {
|
1722 | typeString = 'array';
|
1723 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1724 | typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
|
1725 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
1726 | } else {
|
1727 | typeString = typeof type;
|
1728 | }
|
1729 |
|
1730 | warning$1(false, '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);
|
1731 | }
|
1732 |
|
1733 | var element = createElement.apply(this, arguments);
|
1734 |
|
1735 |
|
1736 |
|
1737 | if (element == null) {
|
1738 | return element;
|
1739 | }
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 | if (validType) {
|
1747 | for (var i = 2; i < arguments.length; i++) {
|
1748 | validateChildKeys(arguments[i], type);
|
1749 | }
|
1750 | }
|
1751 |
|
1752 | if (type === REACT_FRAGMENT_TYPE) {
|
1753 | validateFragmentProps(element);
|
1754 | } else {
|
1755 | validatePropTypes(element);
|
1756 | }
|
1757 |
|
1758 | return element;
|
1759 | }
|
1760 |
|
1761 | function createFactoryWithValidation(type) {
|
1762 | var validatedFactory = createElementWithValidation.bind(null, type);
|
1763 | validatedFactory.type = type;
|
1764 |
|
1765 | {
|
1766 | Object.defineProperty(validatedFactory, 'type', {
|
1767 | enumerable: false,
|
1768 | get: function () {
|
1769 | lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
1770 | Object.defineProperty(this, 'type', {
|
1771 | value: type
|
1772 | });
|
1773 | return type;
|
1774 | }
|
1775 | });
|
1776 | }
|
1777 |
|
1778 | return validatedFactory;
|
1779 | }
|
1780 |
|
1781 | function cloneElementWithValidation(element, props, children) {
|
1782 | var newElement = cloneElement.apply(this, arguments);
|
1783 | for (var i = 2; i < arguments.length; i++) {
|
1784 | validateChildKeys(arguments[i], newElement.type);
|
1785 | }
|
1786 | validatePropTypes(newElement);
|
1787 | return newElement;
|
1788 | }
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 | var enableStableConcurrentModeAPIs = false;
|
1828 |
|
1829 | var React = {
|
1830 | Children: {
|
1831 | map: mapChildren,
|
1832 | forEach: forEachChildren,
|
1833 | count: countChildren,
|
1834 | toArray: toArray,
|
1835 | only: onlyChild
|
1836 | },
|
1837 |
|
1838 | createRef: createRef,
|
1839 | Component: Component,
|
1840 | PureComponent: PureComponent,
|
1841 |
|
1842 | createContext: createContext,
|
1843 | forwardRef: forwardRef,
|
1844 | lazy: lazy,
|
1845 | memo: memo,
|
1846 |
|
1847 | useCallback: useCallback,
|
1848 | useContext: useContext,
|
1849 | useEffect: useEffect,
|
1850 | useImperativeHandle: useImperativeHandle,
|
1851 | useDebugValue: useDebugValue,
|
1852 | useLayoutEffect: useLayoutEffect,
|
1853 | useMemo: useMemo,
|
1854 | useReducer: useReducer,
|
1855 | useRef: useRef,
|
1856 | useState: useState,
|
1857 |
|
1858 | Fragment: REACT_FRAGMENT_TYPE,
|
1859 | StrictMode: REACT_STRICT_MODE_TYPE,
|
1860 | Suspense: REACT_SUSPENSE_TYPE,
|
1861 |
|
1862 | createElement: createElementWithValidation,
|
1863 | cloneElement: cloneElementWithValidation,
|
1864 | createFactory: createFactoryWithValidation,
|
1865 | isValidElement: isValidElement,
|
1866 |
|
1867 | version: ReactVersion,
|
1868 |
|
1869 | unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
1870 | unstable_Profiler: REACT_PROFILER_TYPE,
|
1871 |
|
1872 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
1873 | };
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 | if (enableStableConcurrentModeAPIs) {
|
1881 | React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
1882 | React.Profiler = REACT_PROFILER_TYPE;
|
1883 | React.unstable_ConcurrentMode = undefined;
|
1884 | React.unstable_Profiler = undefined;
|
1885 | }
|
1886 |
|
1887 |
|
1888 |
|
1889 | var React$2 = Object.freeze({
|
1890 | default: React
|
1891 | });
|
1892 |
|
1893 | var React$3 = ( React$2 && React ) || React$2;
|
1894 |
|
1895 |
|
1896 |
|
1897 | var react = React$3.default || React$3;
|
1898 |
|
1899 | module.exports = react;
|
1900 | })();
|
1901 | }
|