react 16.8.6 → 16.10.0

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.
package/build-info.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "branch": "pull/15226",
3
- "buildNumber": "14079",
4
- "checksum": "4a4c239",
5
- "commit": "297165f1e",
2
+ "branch": "master",
3
+ "buildNumber": "48138",
4
+ "checksum": "d91410d",
5
+ "commit": "3694a3b5e",
6
6
  "environment": "ci",
7
- "reactVersion": "16.8.5-canary-297165f1e"
7
+ "reactVersion": "16.9.0-canary-3694a3b5e"
8
8
  }
@@ -1,4 +1,4 @@
1
- /** @license React v16.8.6
1
+ /** @license React v16.10.0
2
2
  * react.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -20,40 +20,58 @@ var checkPropTypes = require('prop-types/checkPropTypes');
20
20
 
21
21
  // TODO: this is special because it gets imported during build.
22
22
 
23
- var ReactVersion = '16.8.6';
23
+ var ReactVersion = '16.10.0';
24
24
 
25
25
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
26
26
  // nor polyfill, then a plain number is used for performance.
27
27
  var hasSymbol = typeof Symbol === 'function' && Symbol.for;
28
-
29
28
  var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
30
29
  var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
31
30
  var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
32
31
  var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
33
32
  var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
34
33
  var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
35
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
34
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
35
+ // (unstable) APIs that have been removed. Can we remove the symbols?
36
+
36
37
 
37
38
  var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
38
39
  var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
39
40
  var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
41
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
40
42
  var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
41
43
  var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
42
-
44
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
45
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
46
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
43
47
  var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
44
48
  var FAUX_ITERATOR_SYMBOL = '@@iterator';
45
-
46
49
  function getIteratorFn(maybeIterable) {
47
50
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
48
51
  return null;
49
52
  }
53
+
50
54
  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
55
+
51
56
  if (typeof maybeIterator === 'function') {
52
57
  return maybeIterator;
53
58
  }
59
+
54
60
  return null;
55
61
  }
56
62
 
63
+ // Do not require this module directly! Use normal `invariant` calls with
64
+ // template literal strings. The messages will be converted to ReactError during
65
+ // build, and in production they will be minified.
66
+
67
+ // Do not require this module directly! Use normal `invariant` calls with
68
+ // template literal strings. The messages will be converted to ReactError during
69
+ // build, and in production they will be minified.
70
+ function ReactError(error) {
71
+ error.name = 'Invariant Violation';
72
+ return error;
73
+ }
74
+
57
75
  /**
58
76
  * Use invariant() to assert state which your program assumes to be true.
59
77
  *
@@ -65,40 +83,6 @@ function getIteratorFn(maybeIterable) {
65
83
  * will remain to ensure logic does not differ in production.
66
84
  */
67
85
 
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; // we don't care about invariant's own frame
95
- throw error;
96
- }
97
- }
98
-
99
- // Relying on the `invariant()` implementation lets us
100
- // preserve the format and params in the www builds.
101
-
102
86
  /**
103
87
  * Forked from fbjs/warning:
104
88
  * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
@@ -112,12 +96,11 @@ function invariant(condition, format, a, b, c, d, e, f) {
112
96
  * paths. Removing the logging code for production environments will keep the
113
97
  * same logic and follow the same code paths.
114
98
  */
115
-
116
- var lowPriorityWarning = function () {};
99
+ var lowPriorityWarningWithoutStack = function () {};
117
100
 
118
101
  {
119
102
  var printWarning = function (format) {
120
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
103
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
121
104
  args[_key - 1] = arguments[_key];
122
105
  }
123
106
 
@@ -125,9 +108,11 @@ var lowPriorityWarning = function () {};
125
108
  var message = 'Warning: ' + format.replace(/%s/g, function () {
126
109
  return args[argIndex++];
127
110
  });
111
+
128
112
  if (typeof console !== 'undefined') {
129
113
  console.warn(message);
130
114
  }
115
+
131
116
  try {
132
117
  // --- Welcome to debugging React ---
133
118
  // This error was thrown as a convenience so that you can use this stack
@@ -136,21 +121,22 @@ var lowPriorityWarning = function () {};
136
121
  } catch (x) {}
137
122
  };
138
123
 
139
- lowPriorityWarning = function (condition, format) {
124
+ lowPriorityWarningWithoutStack = function (condition, format) {
140
125
  if (format === undefined) {
141
- throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
126
+ throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
142
127
  }
128
+
143
129
  if (!condition) {
144
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
130
+ for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
145
131
  args[_key2 - 2] = arguments[_key2];
146
132
  }
147
133
 
148
- printWarning.apply(undefined, [format].concat(args));
134
+ printWarning.apply(void 0, [format].concat(args));
149
135
  }
150
136
  };
151
137
  }
152
138
 
153
- var lowPriorityWarning$1 = lowPriorityWarning;
139
+ var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
154
140
 
155
141
  /**
156
142
  * Similar to invariant but only logs a warning if the condition is not met.
@@ -158,35 +144,37 @@ var lowPriorityWarning$1 = lowPriorityWarning;
158
144
  * paths. Removing the logging code for production environments will keep the
159
145
  * same logic and follow the same code paths.
160
146
  */
161
-
162
147
  var warningWithoutStack = function () {};
163
148
 
164
149
  {
165
150
  warningWithoutStack = function (condition, format) {
166
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
151
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
167
152
  args[_key - 2] = arguments[_key];
168
153
  }
169
154
 
170
155
  if (format === undefined) {
171
156
  throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
172
157
  }
158
+
173
159
  if (args.length > 8) {
174
160
  // Check before the condition to catch violations early.
175
161
  throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
176
162
  }
163
+
177
164
  if (condition) {
178
165
  return;
179
166
  }
167
+
180
168
  if (typeof console !== 'undefined') {
181
169
  var argsWithFormat = args.map(function (item) {
182
170
  return '' + item;
183
171
  });
184
- argsWithFormat.unshift('Warning: ' + format);
185
-
186
- // We intentionally don't use spread (or .apply) directly because it
172
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
187
173
  // breaks IE9: https://github.com/facebook/react/issues/13610
174
+
188
175
  Function.prototype.apply.call(console.error, console, argsWithFormat);
189
176
  }
177
+
190
178
  try {
191
179
  // --- Welcome to debugging React ---
192
180
  // This error was thrown as a convenience so that you can use this stack
@@ -208,18 +196,21 @@ function warnNoop(publicInstance, callerName) {
208
196
  {
209
197
  var _constructor = publicInstance.constructor;
210
198
  var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
211
- var warningKey = componentName + '.' + callerName;
199
+ var warningKey = componentName + "." + callerName;
200
+
212
201
  if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
213
202
  return;
214
203
  }
204
+
215
205
  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
206
  didWarnStateUpdateForUnmountedComponent[warningKey] = true;
217
207
  }
218
208
  }
219
-
220
209
  /**
221
210
  * This is the abstract API for an update queue.
222
211
  */
212
+
213
+
223
214
  var ReactNoopUpdateQueue = {
224
215
  /**
225
216
  * Checks whether or not this composite component is mounted.
@@ -286,25 +277,26 @@ var ReactNoopUpdateQueue = {
286
277
  };
287
278
 
288
279
  var emptyObject = {};
280
+
289
281
  {
290
282
  Object.freeze(emptyObject);
291
283
  }
292
-
293
284
  /**
294
285
  * Base class helpers for the updating state of a component.
295
286
  */
287
+
288
+
296
289
  function Component(props, context, updater) {
297
290
  this.props = props;
298
- this.context = context;
299
- // If a component has string refs, we will assign a different object later.
300
- this.refs = emptyObject;
301
- // We initialize the default updater but the real one gets injected by the
291
+ this.context = context; // If a component has string refs, we will assign a different object later.
292
+
293
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
302
294
  // renderer.
295
+
303
296
  this.updater = updater || ReactNoopUpdateQueue;
304
297
  }
305
298
 
306
299
  Component.prototype.isReactComponent = {};
307
-
308
300
  /**
309
301
  * Sets a subset of the state. Always use this to mutate
310
302
  * state. You should treat `this.state` as immutable.
@@ -330,11 +322,18 @@ Component.prototype.isReactComponent = {};
330
322
  * @final
331
323
  * @protected
332
324
  */
325
+
333
326
  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;
327
+ (function () {
328
+ if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
329
+ {
330
+ throw ReactError(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."));
331
+ }
332
+ }
333
+ })();
334
+
335
335
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
336
336
  };
337
-
338
337
  /**
339
338
  * Forces an update. This should only be invoked when it is known with
340
339
  * certainty that we are **not** in a DOM transaction.
@@ -349,28 +348,33 @@ Component.prototype.setState = function (partialState, callback) {
349
348
  * @final
350
349
  * @protected
351
350
  */
351
+
352
+
352
353
  Component.prototype.forceUpdate = function (callback) {
353
354
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
354
355
  };
355
-
356
356
  /**
357
357
  * Deprecated APIs. These APIs used to exist on classic React classes but since
358
358
  * we would like to deprecate them, we're not going to move them over to this
359
359
  * modern base class. Instead, we define a getter that warns if it's accessed.
360
360
  */
361
+
362
+
361
363
  {
362
364
  var deprecatedAPIs = {
363
365
  isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
364
366
  replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
365
367
  };
368
+
366
369
  var defineDeprecationWarning = function (methodName, info) {
367
370
  Object.defineProperty(Component.prototype, methodName, {
368
371
  get: function () {
369
- lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
372
+ lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
370
373
  return undefined;
371
374
  }
372
375
  });
373
376
  };
377
+
374
378
  for (var fnName in deprecatedAPIs) {
375
379
  if (deprecatedAPIs.hasOwnProperty(fnName)) {
376
380
  defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
@@ -379,23 +383,25 @@ Component.prototype.forceUpdate = function (callback) {
379
383
  }
380
384
 
381
385
  function ComponentDummy() {}
382
- ComponentDummy.prototype = Component.prototype;
383
386
 
387
+ ComponentDummy.prototype = Component.prototype;
384
388
  /**
385
389
  * Convenience component with default shallow equality check for sCU.
386
390
  */
391
+
387
392
  function PureComponent(props, context, updater) {
388
393
  this.props = props;
389
- this.context = context;
390
- // If a component has string refs, we will assign a different object later.
394
+ this.context = context; // If a component has string refs, we will assign a different object later.
395
+
391
396
  this.refs = emptyObject;
392
397
  this.updater = updater || ReactNoopUpdateQueue;
393
398
  }
394
399
 
395
400
  var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
396
- pureComponentPrototype.constructor = PureComponent;
397
- // Avoid an extra prototype jump for these methods.
401
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
402
+
398
403
  _assign(pureComponentPrototype, Component.prototype);
404
+
399
405
  pureComponentPrototype.isPureReactComponent = true;
400
406
 
401
407
  // an immutable object with a single mutable value
@@ -403,9 +409,11 @@ function createRef() {
403
409
  var refObject = {
404
410
  current: null
405
411
  };
412
+
406
413
  {
407
414
  Object.seal(refObject);
408
415
  }
416
+
409
417
  return refObject;
410
418
  }
411
419
 
@@ -420,6 +428,14 @@ var ReactCurrentDispatcher = {
420
428
  current: null
421
429
  };
422
430
 
431
+ /**
432
+ * Keeps track of the current batch's configuration such as how long an update
433
+ * should suspend for if it needs to.
434
+ */
435
+ var ReactCurrentBatchConfig = {
436
+ suspense: null
437
+ };
438
+
423
439
  /**
424
440
  * Keeps track of the current owner.
425
441
  *
@@ -435,19 +451,22 @@ var ReactCurrentOwner = {
435
451
  };
436
452
 
437
453
  var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
438
-
439
454
  var describeComponentFrame = function (name, source, ownerName) {
440
455
  var sourceInfo = '';
456
+
441
457
  if (source) {
442
458
  var path = source.fileName;
443
459
  var fileName = path.replace(BEFORE_SLASH_RE, '');
460
+
444
461
  {
445
462
  // In DEV, include code for a common special case:
446
463
  // prefer "folder/index.js" instead of just "index.js".
447
464
  if (/^index\./.test(fileName)) {
448
465
  var match = path.match(BEFORE_SLASH_RE);
466
+
449
467
  if (match) {
450
468
  var pathBeforeSlash = match[1];
469
+
451
470
  if (pathBeforeSlash) {
452
471
  var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
453
472
  fileName = folderName + '/' + fileName;
@@ -455,23 +474,24 @@ var describeComponentFrame = function (name, source, ownerName) {
455
474
  }
456
475
  }
457
476
  }
477
+
458
478
  sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
459
479
  } else if (ownerName) {
460
480
  sourceInfo = ' (created by ' + ownerName + ')';
461
481
  }
482
+
462
483
  return '\n in ' + (name || 'Unknown') + sourceInfo;
463
484
  };
464
485
 
465
486
  var Resolved = 1;
466
487
 
467
-
468
488
  function refineResolvedLazyComponent(lazyComponent) {
469
489
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
470
490
  }
471
491
 
472
492
  function getWrappedName(outerType, innerType, wrapperName) {
473
493
  var functionName = innerType.displayName || innerType.name || '';
474
- return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
494
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
475
495
  }
476
496
 
477
497
  function getComponentName(type) {
@@ -479,58 +499,74 @@ function getComponentName(type) {
479
499
  // Host root, text node or just invalid type.
480
500
  return null;
481
501
  }
502
+
482
503
  {
483
504
  if (typeof type.tag === 'number') {
484
505
  warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
485
506
  }
486
507
  }
508
+
487
509
  if (typeof type === 'function') {
488
510
  return type.displayName || type.name || null;
489
511
  }
512
+
490
513
  if (typeof type === 'string') {
491
514
  return type;
492
515
  }
516
+
493
517
  switch (type) {
494
- case REACT_CONCURRENT_MODE_TYPE:
495
- return 'ConcurrentMode';
496
518
  case REACT_FRAGMENT_TYPE:
497
519
  return 'Fragment';
520
+
498
521
  case REACT_PORTAL_TYPE:
499
522
  return 'Portal';
523
+
500
524
  case REACT_PROFILER_TYPE:
501
- return 'Profiler';
525
+ return "Profiler";
526
+
502
527
  case REACT_STRICT_MODE_TYPE:
503
528
  return 'StrictMode';
529
+
504
530
  case REACT_SUSPENSE_TYPE:
505
531
  return 'Suspense';
532
+
533
+ case REACT_SUSPENSE_LIST_TYPE:
534
+ return 'SuspenseList';
506
535
  }
536
+
507
537
  if (typeof type === 'object') {
508
538
  switch (type.$$typeof) {
509
539
  case REACT_CONTEXT_TYPE:
510
540
  return 'Context.Consumer';
541
+
511
542
  case REACT_PROVIDER_TYPE:
512
543
  return 'Context.Provider';
544
+
513
545
  case REACT_FORWARD_REF_TYPE:
514
546
  return getWrappedName(type, type.render, 'ForwardRef');
547
+
515
548
  case REACT_MEMO_TYPE:
516
549
  return getComponentName(type.type);
550
+
517
551
  case REACT_LAZY_TYPE:
518
552
  {
519
553
  var thenable = type;
520
554
  var resolvedThenable = refineResolvedLazyComponent(thenable);
555
+
521
556
  if (resolvedThenable) {
522
557
  return getComponentName(resolvedThenable);
523
558
  }
559
+
560
+ break;
524
561
  }
525
562
  }
526
563
  }
564
+
527
565
  return null;
528
566
  }
529
567
 
530
568
  var ReactDebugCurrentFrame = {};
531
-
532
569
  var currentlyValidatingElement = null;
533
-
534
570
  function setCurrentlyValidatingElement(element) {
535
571
  {
536
572
  currentlyValidatingElement = element;
@@ -542,17 +578,17 @@ function setCurrentlyValidatingElement(element) {
542
578
  ReactDebugCurrentFrame.getCurrentStack = null;
543
579
 
544
580
  ReactDebugCurrentFrame.getStackAddendum = function () {
545
- var stack = '';
581
+ var stack = ''; // Add an extra top frame while an element is being validated
546
582
 
547
- // Add an extra top frame while an element is being validated
548
583
  if (currentlyValidatingElement) {
549
584
  var name = getComponentName(currentlyValidatingElement.type);
550
585
  var owner = currentlyValidatingElement._owner;
551
586
  stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
552
- }
587
+ } // Delegate to the injected renderer-specific implementation
588
+
553
589
 
554
- // Delegate to the injected renderer-specific implementation
555
590
  var impl = ReactDebugCurrentFrame.getCurrentStack;
591
+
556
592
  if (impl) {
557
593
  stack += impl() || '';
558
594
  }
@@ -561,9 +597,18 @@ function setCurrentlyValidatingElement(element) {
561
597
  };
562
598
  }
563
599
 
600
+ /**
601
+ * Used by act() to track whether you're inside an act() scope.
602
+ */
603
+ var IsSomeRendererActing = {
604
+ current: false
605
+ };
606
+
564
607
  var ReactSharedInternals = {
565
608
  ReactCurrentDispatcher: ReactCurrentDispatcher,
609
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
566
610
  ReactCurrentOwner: ReactCurrentOwner,
611
+ IsSomeRendererActing: IsSomeRendererActing,
567
612
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
568
613
  assign: _assign
569
614
  };
@@ -592,41 +637,41 @@ var warning = warningWithoutStack$1;
592
637
  if (condition) {
593
638
  return;
594
639
  }
640
+
595
641
  var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
596
- var stack = ReactDebugCurrentFrame.getStackAddendum();
597
- // eslint-disable-next-line react-internal/warning-and-invariant-args
642
+ var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
598
643
 
599
- for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
644
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
600
645
  args[_key - 2] = arguments[_key];
601
646
  }
602
647
 
603
- warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
648
+ warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
604
649
  };
605
650
  }
606
651
 
607
652
  var warning$1 = warning;
608
653
 
609
654
  var hasOwnProperty = Object.prototype.hasOwnProperty;
610
-
611
655
  var RESERVED_PROPS = {
612
656
  key: true,
613
657
  ref: true,
614
658
  __self: true,
615
659
  __source: true
616
660
  };
617
-
618
- var specialPropKeyWarningShown = void 0;
619
- var specialPropRefWarningShown = void 0;
661
+ var specialPropKeyWarningShown;
662
+ var specialPropRefWarningShown;
620
663
 
621
664
  function hasValidRef(config) {
622
665
  {
623
666
  if (hasOwnProperty.call(config, 'ref')) {
624
667
  var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
668
+
625
669
  if (getter && getter.isReactWarning) {
626
670
  return false;
627
671
  }
628
672
  }
629
673
  }
674
+
630
675
  return config.ref !== undefined;
631
676
  }
632
677
 
@@ -634,11 +679,13 @@ function hasValidKey(config) {
634
679
  {
635
680
  if (hasOwnProperty.call(config, 'key')) {
636
681
  var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
682
+
637
683
  if (getter && getter.isReactWarning) {
638
684
  return false;
639
685
  }
640
686
  }
641
687
  }
688
+
642
689
  return config.key !== undefined;
643
690
  }
644
691
 
@@ -649,6 +696,7 @@ function defineKeyPropWarningGetter(props, displayName) {
649
696
  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
697
  }
651
698
  };
699
+
652
700
  warnAboutAccessingKey.isReactWarning = true;
653
701
  Object.defineProperty(props, 'key', {
654
702
  get: warnAboutAccessingKey,
@@ -663,13 +711,13 @@ function defineRefPropWarningGetter(props, displayName) {
663
711
  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
712
  }
665
713
  };
714
+
666
715
  warnAboutAccessingRef.isReactWarning = true;
667
716
  Object.defineProperty(props, 'ref', {
668
717
  get: warnAboutAccessingRef,
669
718
  configurable: true
670
719
  });
671
720
  }
672
-
673
721
  /**
674
722
  * Factory method to create a new React element. This no longer adheres to
675
723
  * the class pattern, so do not use new to call it. Also, no instanceof check
@@ -677,8 +725,10 @@ function defineRefPropWarningGetter(props, displayName) {
677
725
  * if something is a React Element.
678
726
  *
679
727
  * @param {*} type
728
+ * @param {*} props
680
729
  * @param {*} key
681
730
  * @param {string|object} ref
731
+ * @param {*} owner
682
732
  * @param {*} self A *temporary* helper to detect places where `this` is
683
733
  * different from the `owner` when React.createElement is called, so that we
684
734
  * can warn. We want to get rid of owner and replace string `ref`s with arrow
@@ -686,21 +736,19 @@ function defineRefPropWarningGetter(props, displayName) {
686
736
  * change in behavior.
687
737
  * @param {*} source An annotation object (added by a transpiler or otherwise)
688
738
  * indicating filename, line number, and/or other information.
689
- * @param {*} owner
690
- * @param {*} props
691
739
  * @internal
692
740
  */
741
+
742
+
693
743
  var ReactElement = function (type, key, ref, self, source, owner, props) {
694
744
  var element = {
695
745
  // This tag allows us to uniquely identify this as a React Element
696
746
  $$typeof: REACT_ELEMENT_TYPE,
697
-
698
747
  // Built-in properties that belong on the element
699
748
  type: type,
700
749
  key: key,
701
750
  ref: ref,
702
751
  props: props,
703
-
704
752
  // Record the component responsible for creating this element.
705
753
  _owner: owner
706
754
  };
@@ -710,33 +758,33 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
710
758
  // an external backing store so that we can freeze the whole object.
711
759
  // This can be replaced with a WeakMap once they are implemented in
712
760
  // commonly used development environments.
713
- element._store = {};
714
-
715
- // To make comparing ReactElements easier for testing purposes, we make
761
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
716
762
  // the validation flag non-enumerable (where possible, which should
717
763
  // include every environment we run tests in), so the test framework
718
764
  // ignores it.
765
+
719
766
  Object.defineProperty(element._store, 'validated', {
720
767
  configurable: false,
721
768
  enumerable: false,
722
769
  writable: true,
723
770
  value: false
724
- });
725
- // self and source are DEV only properties.
771
+ }); // self and source are DEV only properties.
772
+
726
773
  Object.defineProperty(element, '_self', {
727
774
  configurable: false,
728
775
  enumerable: false,
729
776
  writable: false,
730
777
  value: self
731
- });
732
- // Two elements created in two different places should be considered
778
+ }); // Two elements created in two different places should be considered
733
779
  // equal for testing purposes and therefore we hide it from enumeration.
780
+
734
781
  Object.defineProperty(element, '_source', {
735
782
  configurable: false,
736
783
  enumerable: false,
737
784
  writable: false,
738
785
  value: source
739
786
  });
787
+
740
788
  if (Object.freeze) {
741
789
  Object.freeze(element.props);
742
790
  Object.freeze(element);
@@ -745,17 +793,87 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
745
793
 
746
794
  return element;
747
795
  };
796
+ /**
797
+ * https://github.com/reactjs/rfcs/pull/107
798
+ * @param {*} type
799
+ * @param {object} props
800
+ * @param {string} key
801
+ */
802
+
803
+
804
+
805
+ /**
806
+ * https://github.com/reactjs/rfcs/pull/107
807
+ * @param {*} type
808
+ * @param {object} props
809
+ * @param {string} key
810
+ */
811
+
812
+ function jsxDEV(type, config, maybeKey, source, self) {
813
+ var propName; // Reserved names are extracted
814
+
815
+ var props = {};
816
+ var key = null;
817
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
818
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
819
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
820
+ // but as an intermediary step, we will use jsxDEV for everything except
821
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
822
+ // key is explicitly declared to be undefined or not.
823
+
824
+ if (maybeKey !== undefined) {
825
+ key = '' + maybeKey;
826
+ }
827
+
828
+ if (hasValidKey(config)) {
829
+ key = '' + config.key;
830
+ }
831
+
832
+ if (hasValidRef(config)) {
833
+ ref = config.ref;
834
+ } // Remaining properties are added to a new props object
748
835
 
836
+
837
+ for (propName in config) {
838
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
839
+ props[propName] = config[propName];
840
+ }
841
+ } // Resolve default props
842
+
843
+
844
+ if (type && type.defaultProps) {
845
+ var defaultProps = type.defaultProps;
846
+
847
+ for (propName in defaultProps) {
848
+ if (props[propName] === undefined) {
849
+ props[propName] = defaultProps[propName];
850
+ }
851
+ }
852
+ }
853
+
854
+ if (key || ref) {
855
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
856
+
857
+ if (key) {
858
+ defineKeyPropWarningGetter(props, displayName);
859
+ }
860
+
861
+ if (ref) {
862
+ defineRefPropWarningGetter(props, displayName);
863
+ }
864
+ }
865
+
866
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
867
+ }
749
868
  /**
750
869
  * Create and return a new ReactElement of the given type.
751
870
  * See https://reactjs.org/docs/react-api.html#createelement
752
871
  */
872
+
753
873
  function createElement(type, config, children) {
754
- var propName = void 0;
874
+ var propName; // Reserved names are extracted
755
875
 
756
- // Reserved names are extracted
757
876
  var props = {};
758
-
759
877
  var key = null;
760
878
  var ref = null;
761
879
  var self = null;
@@ -765,61 +883,70 @@ function createElement(type, config, children) {
765
883
  if (hasValidRef(config)) {
766
884
  ref = config.ref;
767
885
  }
886
+
768
887
  if (hasValidKey(config)) {
769
888
  key = '' + config.key;
770
889
  }
771
890
 
772
891
  self = config.__self === undefined ? null : config.__self;
773
- source = config.__source === undefined ? null : config.__source;
774
- // Remaining properties are added to a new props object
892
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
893
+
775
894
  for (propName in config) {
776
895
  if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
777
896
  props[propName] = config[propName];
778
897
  }
779
898
  }
780
- }
781
-
782
- // Children can be more than one argument, and those are transferred onto
899
+ } // Children can be more than one argument, and those are transferred onto
783
900
  // the newly allocated props object.
901
+
902
+
784
903
  var childrenLength = arguments.length - 2;
904
+
785
905
  if (childrenLength === 1) {
786
906
  props.children = children;
787
907
  } else if (childrenLength > 1) {
788
908
  var childArray = Array(childrenLength);
909
+
789
910
  for (var i = 0; i < childrenLength; i++) {
790
911
  childArray[i] = arguments[i + 2];
791
912
  }
913
+
792
914
  {
793
915
  if (Object.freeze) {
794
916
  Object.freeze(childArray);
795
917
  }
796
918
  }
919
+
797
920
  props.children = childArray;
798
- }
921
+ } // Resolve default props
922
+
799
923
 
800
- // Resolve default props
801
924
  if (type && type.defaultProps) {
802
925
  var defaultProps = type.defaultProps;
926
+
803
927
  for (propName in defaultProps) {
804
928
  if (props[propName] === undefined) {
805
929
  props[propName] = defaultProps[propName];
806
930
  }
807
931
  }
808
932
  }
933
+
809
934
  {
810
935
  if (key || ref) {
811
936
  var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
937
+
812
938
  if (key) {
813
939
  defineKeyPropWarningGetter(props, displayName);
814
940
  }
941
+
815
942
  if (ref) {
816
943
  defineRefPropWarningGetter(props, displayName);
817
944
  }
818
945
  }
819
946
  }
947
+
820
948
  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
821
949
  }
822
-
823
950
  /**
824
951
  * Return a function that produces ReactElements of a given type.
825
952
  * See https://reactjs.org/docs/react-api.html#createfactory
@@ -828,33 +955,36 @@ function createElement(type, config, children) {
828
955
 
829
956
  function cloneAndReplaceKey(oldElement, newKey) {
830
957
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
831
-
832
958
  return newElement;
833
959
  }
834
-
835
960
  /**
836
961
  * Clone and return a new ReactElement using element as the starting point.
837
962
  * See https://reactjs.org/docs/react-api.html#cloneelement
838
963
  */
964
+
839
965
  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;
966
+ (function () {
967
+ if (!!(element === null || element === undefined)) {
968
+ {
969
+ throw ReactError(Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."));
970
+ }
971
+ }
972
+ })();
841
973
 
842
- var propName = void 0;
974
+ var propName; // Original props are copied
975
+
976
+ var props = _assign({}, element.props); // Reserved names are extracted
843
977
 
844
- // Original props are copied
845
- var props = _assign({}, element.props);
846
978
 
847
- // Reserved names are extracted
848
979
  var key = element.key;
849
- var ref = element.ref;
850
- // Self is preserved since the owner is preserved.
851
- var self = element._self;
852
- // Source is preserved since cloneElement is unlikely to be targeted by a
980
+ var ref = element.ref; // Self is preserved since the owner is preserved.
981
+
982
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
853
983
  // transpiler, and the original source is probably a better indicator of the
854
984
  // true owner.
855
- var source = element._source;
856
985
 
857
- // Owner will be preserved, unless ref is overridden
986
+ var source = element._source; // Owner will be preserved, unless ref is overridden
987
+
858
988
  var owner = element._owner;
859
989
 
860
990
  if (config != null) {
@@ -863,15 +993,18 @@ function cloneElement(element, config, children) {
863
993
  ref = config.ref;
864
994
  owner = ReactCurrentOwner.current;
865
995
  }
996
+
866
997
  if (hasValidKey(config)) {
867
998
  key = '' + config.key;
868
- }
999
+ } // Remaining properties override existing props
1000
+
1001
+
1002
+ var defaultProps;
869
1003
 
870
- // Remaining properties override existing props
871
- var defaultProps = void 0;
872
1004
  if (element.type && element.type.defaultProps) {
873
1005
  defaultProps = element.type.defaultProps;
874
1006
  }
1007
+
875
1008
  for (propName in config) {
876
1009
  if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
877
1010
  if (config[propName] === undefined && defaultProps !== undefined) {
@@ -882,24 +1015,26 @@ function cloneElement(element, config, children) {
882
1015
  }
883
1016
  }
884
1017
  }
885
- }
886
-
887
- // Children can be more than one argument, and those are transferred onto
1018
+ } // Children can be more than one argument, and those are transferred onto
888
1019
  // the newly allocated props object.
1020
+
1021
+
889
1022
  var childrenLength = arguments.length - 2;
1023
+
890
1024
  if (childrenLength === 1) {
891
1025
  props.children = children;
892
1026
  } else if (childrenLength > 1) {
893
1027
  var childArray = Array(childrenLength);
1028
+
894
1029
  for (var i = 0; i < childrenLength; i++) {
895
1030
  childArray[i] = arguments[i + 2];
896
1031
  }
1032
+
897
1033
  props.children = childArray;
898
1034
  }
899
1035
 
900
1036
  return ReactElement(element.type, key, ref, self, source, owner, props);
901
1037
  }
902
-
903
1038
  /**
904
1039
  * Verifies the object is a ReactElement.
905
1040
  * See https://reactjs.org/docs/react-api.html#isvalidelement
@@ -907,19 +1042,20 @@ function cloneElement(element, config, children) {
907
1042
  * @return {boolean} True if `object` is a ReactElement.
908
1043
  * @final
909
1044
  */
1045
+
910
1046
  function isValidElement(object) {
911
1047
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
912
1048
  }
913
1049
 
914
1050
  var SEPARATOR = '.';
915
1051
  var SUBSEPARATOR = ':';
916
-
917
1052
  /**
918
1053
  * Escape and wrap key so it is safe to use as a reactid
919
1054
  *
920
1055
  * @param {string} key to be escaped.
921
1056
  * @return {string} the escaped key.
922
1057
  */
1058
+
923
1059
  function escape(key) {
924
1060
  var escapeRegex = /[=:]/g;
925
1061
  var escaperLookup = {
@@ -929,24 +1065,24 @@ function escape(key) {
929
1065
  var escapedString = ('' + key).replace(escapeRegex, function (match) {
930
1066
  return escaperLookup[match];
931
1067
  });
932
-
933
1068
  return '$' + escapedString;
934
1069
  }
935
-
936
1070
  /**
937
1071
  * TODO: Test that a single child and an array with one item have the same key
938
1072
  * pattern.
939
1073
  */
940
1074
 
941
- var didWarnAboutMaps = false;
942
1075
 
1076
+ var didWarnAboutMaps = false;
943
1077
  var userProvidedKeyEscapeRegex = /\/+/g;
1078
+
944
1079
  function escapeUserProvidedKey(text) {
945
1080
  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
946
1081
  }
947
1082
 
948
1083
  var POOL_SIZE = 10;
949
1084
  var traverseContextPool = [];
1085
+
950
1086
  function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
951
1087
  if (traverseContextPool.length) {
952
1088
  var traverseContext = traverseContextPool.pop();
@@ -973,11 +1109,11 @@ function releaseTraverseContext(traverseContext) {
973
1109
  traverseContext.func = null;
974
1110
  traverseContext.context = null;
975
1111
  traverseContext.count = 0;
1112
+
976
1113
  if (traverseContextPool.length < POOL_SIZE) {
977
1114
  traverseContextPool.push(traverseContext);
978
1115
  }
979
1116
  }
980
-
981
1117
  /**
982
1118
  * @param {?*} children Children tree container.
983
1119
  * @param {!string} nameSoFar Name of the key path so far.
@@ -986,6 +1122,8 @@ function releaseTraverseContext(traverseContext) {
986
1122
  * process.
987
1123
  * @return {!number} The number of children in this subtree.
988
1124
  */
1125
+
1126
+
989
1127
  function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
990
1128
  var type = typeof children;
991
1129
 
@@ -1004,26 +1142,28 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1004
1142
  case 'number':
1005
1143
  invokeCallback = true;
1006
1144
  break;
1145
+
1007
1146
  case 'object':
1008
1147
  switch (children.$$typeof) {
1009
1148
  case REACT_ELEMENT_TYPE:
1010
1149
  case REACT_PORTAL_TYPE:
1011
1150
  invokeCallback = true;
1012
1151
  }
1152
+
1013
1153
  }
1014
1154
  }
1015
1155
 
1016
1156
  if (invokeCallback) {
1017
- callback(traverseContext, children,
1018
- // If it's the only child, treat the name as if it was wrapped in an array
1157
+ callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
1019
1158
  // so that it's consistent if the number of children grows.
1020
1159
  nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1021
1160
  return 1;
1022
1161
  }
1023
1162
 
1024
- var child = void 0;
1025
- var nextName = void 0;
1163
+ var child;
1164
+ var nextName;
1026
1165
  var subtreeCount = 0; // Count of children found in the current subtree.
1166
+
1027
1167
  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1028
1168
 
1029
1169
  if (Array.isArray(children)) {
@@ -1034,6 +1174,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1034
1174
  }
1035
1175
  } else {
1036
1176
  var iteratorFn = getIteratorFn(children);
1177
+
1037
1178
  if (typeof iteratorFn === 'function') {
1038
1179
  {
1039
1180
  // Warn about using Maps as children
@@ -1044,8 +1185,9 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1044
1185
  }
1045
1186
 
1046
1187
  var iterator = iteratorFn.call(children);
1047
- var step = void 0;
1188
+ var step;
1048
1189
  var ii = 0;
1190
+
1049
1191
  while (!(step = iterator.next()).done) {
1050
1192
  child = step.value;
1051
1193
  nextName = nextNamePrefix + getComponentKey(child, ii++);
@@ -1053,17 +1195,25 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1053
1195
  }
1054
1196
  } else if (type === 'object') {
1055
1197
  var addendum = '';
1198
+
1056
1199
  {
1057
1200
  addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
1058
1201
  }
1202
+
1059
1203
  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);
1204
+
1205
+ (function () {
1206
+ {
1207
+ {
1208
+ throw ReactError(Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum));
1209
+ }
1210
+ }
1211
+ })();
1061
1212
  }
1062
1213
  }
1063
1214
 
1064
1215
  return subtreeCount;
1065
1216
  }
1066
-
1067
1217
  /**
1068
1218
  * Traverses children that are typically specified as `props.children`, but
1069
1219
  * might also be specified through attributes:
@@ -1080,6 +1230,8 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1080
1230
  * @param {?*} traverseContext Context for traversal.
1081
1231
  * @return {!number} The number of children in this subtree.
1082
1232
  */
1233
+
1234
+
1083
1235
  function traverseAllChildren(children, callback, traverseContext) {
1084
1236
  if (children == null) {
1085
1237
  return 0;
@@ -1087,7 +1239,6 @@ function traverseAllChildren(children, callback, traverseContext) {
1087
1239
 
1088
1240
  return traverseAllChildrenImpl(children, '', callback, traverseContext);
1089
1241
  }
1090
-
1091
1242
  /**
1092
1243
  * Generate a key string that identifies a component within a set.
1093
1244
  *
@@ -1095,24 +1246,25 @@ function traverseAllChildren(children, callback, traverseContext) {
1095
1246
  * @param {number} index Index that is used if a manual key is not provided.
1096
1247
  * @return {string}
1097
1248
  */
1249
+
1250
+
1098
1251
  function getComponentKey(component, index) {
1099
1252
  // Do some typechecking here since we call this blindly. We want to ensure
1100
1253
  // that we don't block potential future ES APIs.
1101
1254
  if (typeof component === 'object' && component !== null && component.key != null) {
1102
1255
  // Explicit key
1103
1256
  return escape(component.key);
1104
- }
1105
- // Implicit key determined by the index in the set
1257
+ } // Implicit key determined by the index in the set
1258
+
1259
+
1106
1260
  return index.toString(36);
1107
1261
  }
1108
1262
 
1109
1263
  function forEachSingleChild(bookKeeping, child, name) {
1110
1264
  var func = bookKeeping.func,
1111
1265
  context = bookKeeping.context;
1112
-
1113
1266
  func.call(context, child, bookKeeping.count++);
1114
1267
  }
1115
-
1116
1268
  /**
1117
1269
  * Iterates through children that are typically specified as `props.children`.
1118
1270
  *
@@ -1125,10 +1277,13 @@ function forEachSingleChild(bookKeeping, child, name) {
1125
1277
  * @param {function(*, int)} forEachFunc
1126
1278
  * @param {*} forEachContext Context for forEachContext.
1127
1279
  */
1280
+
1281
+
1128
1282
  function forEachChildren(children, forEachFunc, forEachContext) {
1129
1283
  if (children == null) {
1130
1284
  return children;
1131
1285
  }
1286
+
1132
1287
  var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
1133
1288
  traverseAllChildren(children, forEachSingleChild, traverseContext);
1134
1289
  releaseTraverseContext(traverseContext);
@@ -1139,34 +1294,34 @@ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1139
1294
  keyPrefix = bookKeeping.keyPrefix,
1140
1295
  func = bookKeeping.func,
1141
1296
  context = bookKeeping.context;
1142
-
1143
-
1144
1297
  var mappedChild = func.call(context, child, bookKeeping.count++);
1298
+
1145
1299
  if (Array.isArray(mappedChild)) {
1146
1300
  mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
1147
1301
  return c;
1148
1302
  });
1149
1303
  } else if (mappedChild != null) {
1150
1304
  if (isValidElement(mappedChild)) {
1151
- mappedChild = cloneAndReplaceKey(mappedChild,
1152
- // Keep both the (mapped) and old keys if they differ, just as
1305
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1153
1306
  // traverseAllChildren used to do for objects as children
1154
1307
  keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1155
1308
  }
1309
+
1156
1310
  result.push(mappedChild);
1157
1311
  }
1158
1312
  }
1159
1313
 
1160
1314
  function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1161
1315
  var escapedPrefix = '';
1316
+
1162
1317
  if (prefix != null) {
1163
1318
  escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1164
1319
  }
1320
+
1165
1321
  var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
1166
1322
  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
1167
1323
  releaseTraverseContext(traverseContext);
1168
1324
  }
1169
-
1170
1325
  /**
1171
1326
  * Maps children that are typically specified as `props.children`.
1172
1327
  *
@@ -1180,15 +1335,17 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1180
1335
  * @param {*} context Context for mapFunction.
1181
1336
  * @return {object} Object containing the ordered map of results.
1182
1337
  */
1338
+
1339
+
1183
1340
  function mapChildren(children, func, context) {
1184
1341
  if (children == null) {
1185
1342
  return children;
1186
1343
  }
1344
+
1187
1345
  var result = [];
1188
1346
  mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1189
1347
  return result;
1190
1348
  }
1191
-
1192
1349
  /**
1193
1350
  * Count the number of children that are typically specified as
1194
1351
  * `props.children`.
@@ -1198,18 +1355,21 @@ function mapChildren(children, func, context) {
1198
1355
  * @param {?*} children Children tree container.
1199
1356
  * @return {number} The number of children.
1200
1357
  */
1358
+
1359
+
1201
1360
  function countChildren(children) {
1202
1361
  return traverseAllChildren(children, function () {
1203
1362
  return null;
1204
1363
  }, null);
1205
1364
  }
1206
-
1207
1365
  /**
1208
1366
  * Flatten a children object (typically specified as `props.children`) and
1209
1367
  * return an array with appropriately re-keyed children.
1210
1368
  *
1211
1369
  * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1212
1370
  */
1371
+
1372
+
1213
1373
  function toArray(children) {
1214
1374
  var result = [];
1215
1375
  mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
@@ -1217,7 +1377,6 @@ function toArray(children) {
1217
1377
  });
1218
1378
  return result;
1219
1379
  }
1220
-
1221
1380
  /**
1222
1381
  * Returns the first child in a collection of children and verifies that there
1223
1382
  * is only one child in the collection.
@@ -1232,8 +1391,17 @@ function toArray(children) {
1232
1391
  * @return {ReactElement} The first and only `ReactElement` contained in the
1233
1392
  * structure.
1234
1393
  */
1394
+
1395
+
1235
1396
  function onlyChild(children) {
1236
- !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
1397
+ (function () {
1398
+ if (!isValidElement(children)) {
1399
+ {
1400
+ throw ReactError(Error("React.Children.only expected to receive a single React element child."));
1401
+ }
1402
+ }
1403
+ })();
1404
+
1237
1405
  return children;
1238
1406
  }
1239
1407
 
@@ -1263,12 +1431,10 @@ function createContext(defaultValue, calculateChangedBits) {
1263
1431
  Provider: null,
1264
1432
  Consumer: null
1265
1433
  };
1266
-
1267
1434
  context.Provider = {
1268
1435
  $$typeof: REACT_PROVIDER_TYPE,
1269
1436
  _context: context
1270
1437
  };
1271
-
1272
1438
  var hasWarnedAboutUsingNestedContextConsumers = false;
1273
1439
  var hasWarnedAboutUsingConsumerProvider = false;
1274
1440
 
@@ -1280,8 +1446,8 @@ function createContext(defaultValue, calculateChangedBits) {
1280
1446
  $$typeof: REACT_CONTEXT_TYPE,
1281
1447
  _context: context,
1282
1448
  _calculateChangedBits: context._calculateChangedBits
1283
- };
1284
- // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1449
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1450
+
1285
1451
  Object.defineProperties(Consumer, {
1286
1452
  Provider: {
1287
1453
  get: function () {
@@ -1289,6 +1455,7 @@ function createContext(defaultValue, calculateChangedBits) {
1289
1455
  hasWarnedAboutUsingConsumerProvider = true;
1290
1456
  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
1457
  }
1458
+
1292
1459
  return context.Provider;
1293
1460
  },
1294
1461
  set: function (_Provider) {
@@ -1325,11 +1492,12 @@ function createContext(defaultValue, calculateChangedBits) {
1325
1492
  hasWarnedAboutUsingNestedContextConsumers = true;
1326
1493
  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
1494
  }
1495
+
1328
1496
  return context.Consumer;
1329
1497
  }
1330
1498
  }
1331
- });
1332
- // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1499
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1500
+
1333
1501
  context.Consumer = Consumer;
1334
1502
  }
1335
1503
 
@@ -1352,8 +1520,8 @@ function lazy(ctor) {
1352
1520
 
1353
1521
  {
1354
1522
  // In production, this would just set it on the object.
1355
- var defaultProps = void 0;
1356
- var propTypes = void 0;
1523
+ var defaultProps;
1524
+ var propTypes;
1357
1525
  Object.defineProperties(lazyType, {
1358
1526
  defaultProps: {
1359
1527
  configurable: true,
@@ -1362,8 +1530,8 @@ function lazy(ctor) {
1362
1530
  },
1363
1531
  set: function (newDefaultProps) {
1364
1532
  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
- // Match production behavior more closely:
1533
+ defaultProps = newDefaultProps; // Match production behavior more closely:
1534
+
1367
1535
  Object.defineProperty(lazyType, 'defaultProps', {
1368
1536
  enumerable: true
1369
1537
  });
@@ -1376,8 +1544,8 @@ function lazy(ctor) {
1376
1544
  },
1377
1545
  set: function (newPropTypes) {
1378
1546
  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
- // Match production behavior more closely:
1547
+ propTypes = newPropTypes; // Match production behavior more closely:
1548
+
1381
1549
  Object.defineProperty(lazyType, 'propTypes', {
1382
1550
  enumerable: true
1383
1551
  });
@@ -1396,8 +1564,7 @@ function forwardRef(render) {
1396
1564
  } else if (typeof render !== 'function') {
1397
1565
  warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1398
1566
  } else {
1399
- !(
1400
- // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
1567
+ !( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
1401
1568
  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
1569
  }
1403
1570
 
@@ -1413,9 +1580,8 @@ function forwardRef(render) {
1413
1580
  }
1414
1581
 
1415
1582
  function isValidElementType(type) {
1416
- return typeof type === 'string' || typeof type === 'function' ||
1417
- // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
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);
1583
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1584
+ 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);
1419
1585
  }
1420
1586
 
1421
1587
  function memo(type, compare) {
@@ -1424,6 +1590,7 @@ function memo(type, compare) {
1424
1590
  warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1425
1591
  }
1426
1592
  }
1593
+
1427
1594
  return {
1428
1595
  $$typeof: REACT_MEMO_TYPE,
1429
1596
  type: type,
@@ -1433,20 +1600,28 @@ function memo(type, compare) {
1433
1600
 
1434
1601
  function resolveDispatcher() {
1435
1602
  var dispatcher = ReactCurrentDispatcher.current;
1436
- !(dispatcher !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0;
1603
+
1604
+ (function () {
1605
+ if (!(dispatcher !== null)) {
1606
+ {
1607
+ throw ReactError(Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."));
1608
+ }
1609
+ }
1610
+ })();
1611
+
1437
1612
  return dispatcher;
1438
1613
  }
1439
1614
 
1440
1615
  function useContext(Context, unstable_observedBits) {
1441
1616
  var dispatcher = resolveDispatcher();
1617
+
1442
1618
  {
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;
1619
+ !(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; // TODO: add a more generic warning for invalid values.
1444
1620
 
1445
- // TODO: add a more generic warning for invalid values.
1446
1621
  if (Context._context !== undefined) {
1447
- var realContext = Context._context;
1448
- // Don't deduplicate because this legitimately causes bugs
1622
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1449
1623
  // and nobody should be using this in existing code.
1624
+
1450
1625
  if (realContext.Consumer === Context) {
1451
1626
  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
1627
  } else if (realContext.Provider === Context) {
@@ -1454,55 +1629,71 @@ function useContext(Context, unstable_observedBits) {
1454
1629
  }
1455
1630
  }
1456
1631
  }
1632
+
1457
1633
  return dispatcher.useContext(Context, unstable_observedBits);
1458
1634
  }
1459
-
1460
1635
  function useState(initialState) {
1461
1636
  var dispatcher = resolveDispatcher();
1462
1637
  return dispatcher.useState(initialState);
1463
1638
  }
1464
-
1465
1639
  function useReducer(reducer, initialArg, init) {
1466
1640
  var dispatcher = resolveDispatcher();
1467
1641
  return dispatcher.useReducer(reducer, initialArg, init);
1468
1642
  }
1469
-
1470
1643
  function useRef(initialValue) {
1471
1644
  var dispatcher = resolveDispatcher();
1472
1645
  return dispatcher.useRef(initialValue);
1473
1646
  }
1474
-
1475
1647
  function useEffect(create, inputs) {
1476
1648
  var dispatcher = resolveDispatcher();
1477
1649
  return dispatcher.useEffect(create, inputs);
1478
1650
  }
1479
-
1480
1651
  function useLayoutEffect(create, inputs) {
1481
1652
  var dispatcher = resolveDispatcher();
1482
1653
  return dispatcher.useLayoutEffect(create, inputs);
1483
1654
  }
1484
-
1485
1655
  function useCallback(callback, inputs) {
1486
1656
  var dispatcher = resolveDispatcher();
1487
1657
  return dispatcher.useCallback(callback, inputs);
1488
1658
  }
1489
-
1490
1659
  function useMemo(create, inputs) {
1491
1660
  var dispatcher = resolveDispatcher();
1492
1661
  return dispatcher.useMemo(create, inputs);
1493
1662
  }
1494
-
1495
1663
  function useImperativeHandle(ref, create, inputs) {
1496
1664
  var dispatcher = resolveDispatcher();
1497
1665
  return dispatcher.useImperativeHandle(ref, create, inputs);
1498
1666
  }
1499
-
1500
1667
  function useDebugValue(value, formatterFn) {
1501
1668
  {
1502
1669
  var dispatcher = resolveDispatcher();
1503
1670
  return dispatcher.useDebugValue(value, formatterFn);
1504
1671
  }
1505
1672
  }
1673
+ var emptyObject$1 = {};
1674
+ function useResponder(responder, listenerProps) {
1675
+ var dispatcher = resolveDispatcher();
1676
+
1677
+ {
1678
+ if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
1679
+ warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
1680
+ return;
1681
+ }
1682
+ }
1683
+
1684
+ return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
1685
+ }
1686
+
1687
+ function withSuspenseConfig(scope, config) {
1688
+ var previousConfig = ReactCurrentBatchConfig.suspense;
1689
+ ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
1690
+
1691
+ try {
1692
+ scope();
1693
+ } finally {
1694
+ ReactCurrentBatchConfig.suspense = previousConfig;
1695
+ }
1696
+ }
1506
1697
 
1507
1698
  /**
1508
1699
  * ReactElementValidator provides a wrapper around a element factory
@@ -1510,38 +1701,50 @@ function useDebugValue(value, formatterFn) {
1510
1701
  * used only in DEV and could be replaced by a static type checker for languages
1511
1702
  * that support it.
1512
1703
  */
1513
-
1514
- var propTypesMisspellWarningShown = void 0;
1704
+ var propTypesMisspellWarningShown;
1515
1705
 
1516
1706
  {
1517
1707
  propTypesMisspellWarningShown = false;
1518
1708
  }
1519
1709
 
1710
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
1711
+
1520
1712
  function getDeclarationErrorAddendum() {
1521
1713
  if (ReactCurrentOwner.current) {
1522
1714
  var name = getComponentName(ReactCurrentOwner.current.type);
1715
+
1523
1716
  if (name) {
1524
1717
  return '\n\nCheck the render method of `' + name + '`.';
1525
1718
  }
1526
1719
  }
1720
+
1527
1721
  return '';
1528
1722
  }
1529
1723
 
1530
- function getSourceInfoErrorAddendum(elementProps) {
1531
- if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
1532
- var source = elementProps.__source;
1724
+ function getSourceInfoErrorAddendum(source) {
1725
+ if (source !== undefined) {
1533
1726
  var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1534
1727
  var lineNumber = source.lineNumber;
1535
1728
  return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1536
1729
  }
1730
+
1537
1731
  return '';
1538
1732
  }
1539
1733
 
1734
+ function getSourceInfoErrorAddendumForProps(elementProps) {
1735
+ if (elementProps !== null && elementProps !== undefined) {
1736
+ return getSourceInfoErrorAddendum(elementProps.__source);
1737
+ }
1738
+
1739
+ return '';
1740
+ }
1540
1741
  /**
1541
1742
  * Warn if there's no key explicitly set on dynamic arrays of children or
1542
1743
  * object keys are not valid. This allows us to keep track of children between
1543
1744
  * updates.
1544
1745
  */
1746
+
1747
+
1545
1748
  var ownerHasKeyUseWarning = {};
1546
1749
 
1547
1750
  function getCurrentComponentErrorInfo(parentType) {
@@ -1549,13 +1752,14 @@ function getCurrentComponentErrorInfo(parentType) {
1549
1752
 
1550
1753
  if (!info) {
1551
1754
  var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1755
+
1552
1756
  if (parentName) {
1553
- info = '\n\nCheck the top-level render call using <' + parentName + '>.';
1757
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1554
1758
  }
1555
1759
  }
1760
+
1556
1761
  return info;
1557
1762
  }
1558
-
1559
1763
  /**
1560
1764
  * Warn if the element doesn't have an explicit key assigned to it.
1561
1765
  * This element is in an array. The array could grow and shrink or be
@@ -1567,34 +1771,39 @@ function getCurrentComponentErrorInfo(parentType) {
1567
1771
  * @param {ReactElement} element Element that requires a key.
1568
1772
  * @param {*} parentType element's parent's type.
1569
1773
  */
1774
+
1775
+
1570
1776
  function validateExplicitKey(element, parentType) {
1571
1777
  if (!element._store || element._store.validated || element.key != null) {
1572
1778
  return;
1573
1779
  }
1574
- element._store.validated = true;
1575
1780
 
1781
+ element._store.validated = true;
1576
1782
  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1783
+
1577
1784
  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1578
1785
  return;
1579
1786
  }
1580
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
1581
1787
 
1582
- // Usually the current owner is the offender, but if it accepts children as a
1788
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1583
1789
  // property, it may be the creator of the child that's responsible for
1584
1790
  // assigning it a key.
1791
+
1585
1792
  var childOwner = '';
1793
+
1586
1794
  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
1587
1795
  // Give the component that originally created this child.
1588
- childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
1796
+ childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
1589
1797
  }
1590
1798
 
1591
1799
  setCurrentlyValidatingElement(element);
1800
+
1592
1801
  {
1593
1802
  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
1803
  }
1804
+
1595
1805
  setCurrentlyValidatingElement(null);
1596
1806
  }
1597
-
1598
1807
  /**
1599
1808
  * Ensure that every element either is passed in a static location, in an
1600
1809
  * array with an explicit keys property defined, or in an object literal
@@ -1604,13 +1813,17 @@ function validateExplicitKey(element, parentType) {
1604
1813
  * @param {ReactNode} node Statically passed child of any type.
1605
1814
  * @param {*} parentType node's parent's type.
1606
1815
  */
1816
+
1817
+
1607
1818
  function validateChildKeys(node, parentType) {
1608
1819
  if (typeof node !== 'object') {
1609
1820
  return;
1610
1821
  }
1822
+
1611
1823
  if (Array.isArray(node)) {
1612
1824
  for (var i = 0; i < node.length; i++) {
1613
1825
  var child = node[i];
1826
+
1614
1827
  if (isValidElement(child)) {
1615
1828
  validateExplicitKey(child, parentType);
1616
1829
  }
@@ -1622,12 +1835,14 @@ function validateChildKeys(node, parentType) {
1622
1835
  }
1623
1836
  } else if (node) {
1624
1837
  var iteratorFn = getIteratorFn(node);
1838
+
1625
1839
  if (typeof iteratorFn === 'function') {
1626
1840
  // Entry iterators used to provide implicit keys,
1627
1841
  // but now we print a separate warning for them later.
1628
1842
  if (iteratorFn !== node.entries) {
1629
1843
  var iterator = iteratorFn.call(node);
1630
- var step = void 0;
1844
+ var step;
1845
+
1631
1846
  while (!(step = iterator.next()).done) {
1632
1847
  if (isValidElement(step.value)) {
1633
1848
  validateExplicitKey(step.value, parentType);
@@ -1637,30 +1852,34 @@ function validateChildKeys(node, parentType) {
1637
1852
  }
1638
1853
  }
1639
1854
  }
1640
-
1641
1855
  /**
1642
1856
  * Given an element, validate that its props follow the propTypes definition,
1643
1857
  * provided by the type.
1644
1858
  *
1645
1859
  * @param {ReactElement} element
1646
1860
  */
1861
+
1862
+
1647
1863
  function validatePropTypes(element) {
1648
1864
  var type = element.type;
1865
+
1649
1866
  if (type === null || type === undefined || typeof type === 'string') {
1650
1867
  return;
1651
1868
  }
1869
+
1652
1870
  var name = getComponentName(type);
1653
- var propTypes = void 0;
1871
+ var propTypes;
1872
+
1654
1873
  if (typeof type === 'function') {
1655
1874
  propTypes = type.propTypes;
1656
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
1657
- // Note: Memo only checks outer props here.
1875
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1658
1876
  // Inner props are checked in the reconciler.
1659
1877
  type.$$typeof === REACT_MEMO_TYPE)) {
1660
1878
  propTypes = type.propTypes;
1661
1879
  } else {
1662
1880
  return;
1663
1881
  }
1882
+
1664
1883
  if (propTypes) {
1665
1884
  setCurrentlyValidatingElement(element);
1666
1885
  checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
@@ -1669,21 +1888,24 @@ function validatePropTypes(element) {
1669
1888
  propTypesMisspellWarningShown = true;
1670
1889
  warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
1671
1890
  }
1891
+
1672
1892
  if (typeof type.getDefaultProps === 'function') {
1673
1893
  !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
1894
  }
1675
1895
  }
1676
-
1677
1896
  /**
1678
1897
  * Given a fragment, validate that it can only be provided with fragment props
1679
1898
  * @param {ReactElement} fragment
1680
1899
  */
1900
+
1901
+
1681
1902
  function validateFragmentProps(fragment) {
1682
1903
  setCurrentlyValidatingElement(fragment);
1683
-
1684
1904
  var keys = Object.keys(fragment.props);
1905
+
1685
1906
  for (var i = 0; i < keys.length; i++) {
1686
1907
  var key = keys[i];
1908
+
1687
1909
  if (key !== 'children' && key !== 'key') {
1688
1910
  warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1689
1911
  break;
@@ -1697,52 +1919,144 @@ function validateFragmentProps(fragment) {
1697
1919
  setCurrentlyValidatingElement(null);
1698
1920
  }
1699
1921
 
1700
- function createElementWithValidation(type, props, children) {
1701
- var validType = isValidElementType(type);
1702
-
1703
- // We warn in this case but don't throw. We expect the element creation to
1922
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1923
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1704
1924
  // succeed and there will likely be errors in render.
1925
+
1705
1926
  if (!validType) {
1706
1927
  var info = '';
1928
+
1707
1929
  if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1708
1930
  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
1931
  }
1710
1932
 
1711
- var sourceInfo = getSourceInfoErrorAddendum(props);
1933
+ var sourceInfo = getSourceInfoErrorAddendum(source);
1934
+
1712
1935
  if (sourceInfo) {
1713
1936
  info += sourceInfo;
1714
1937
  } else {
1715
1938
  info += getDeclarationErrorAddendum();
1716
1939
  }
1717
1940
 
1718
- var typeString = void 0;
1941
+ var typeString;
1942
+
1719
1943
  if (type === null) {
1720
1944
  typeString = 'null';
1721
1945
  } else if (Array.isArray(type)) {
1722
1946
  typeString = 'array';
1723
1947
  } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1724
- typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
1948
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
1725
1949
  info = ' Did you accidentally export a JSX literal instead of a component?';
1726
1950
  } else {
1727
1951
  typeString = typeof type;
1728
1952
  }
1729
1953
 
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);
1954
+ warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1731
1955
  }
1732
1956
 
1733
- var element = createElement.apply(this, arguments);
1734
-
1735
- // The result can be nullish if a mock or a custom function is used.
1957
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1736
1958
  // TODO: Drop this when these are no longer allowed as the type argument.
1959
+
1737
1960
  if (element == null) {
1738
1961
  return element;
1962
+ } // Skip key warning if the type isn't valid since our key validation logic
1963
+ // doesn't expect a non-string/function type and can throw confusing errors.
1964
+ // We don't want exception behavior to differ between dev and prod.
1965
+ // (Rendering will throw with a helpful message and as soon as the type is
1966
+ // fixed, the key warnings will appear.)
1967
+
1968
+
1969
+ if (validType) {
1970
+ var children = props.children;
1971
+
1972
+ if (children !== undefined) {
1973
+ if (isStaticChildren) {
1974
+ if (Array.isArray(children)) {
1975
+ for (var i = 0; i < children.length; i++) {
1976
+ validateChildKeys(children[i], type);
1977
+ }
1978
+
1979
+ if (Object.freeze) {
1980
+ Object.freeze(children);
1981
+ }
1982
+ } else {
1983
+ warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1984
+ }
1985
+ } else {
1986
+ validateChildKeys(children, type);
1987
+ }
1988
+ }
1989
+ }
1990
+
1991
+ if (hasOwnProperty$1.call(props, 'key')) {
1992
+ warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
1993
+ }
1994
+
1995
+ if (type === REACT_FRAGMENT_TYPE) {
1996
+ validateFragmentProps(element);
1997
+ } else {
1998
+ validatePropTypes(element);
1999
+ }
2000
+
2001
+ return element;
2002
+ } // These two functions exist to still get child warnings in dev
2003
+ // even with the prod transform. This means that jsxDEV is purely
2004
+ // opt-in behavior for better messages but that we won't stop
2005
+ // giving you warnings if you use production apis.
2006
+
2007
+ function jsxWithValidationStatic(type, props, key) {
2008
+ return jsxWithValidation(type, props, key, true);
2009
+ }
2010
+ function jsxWithValidationDynamic(type, props, key) {
2011
+ return jsxWithValidation(type, props, key, false);
2012
+ }
2013
+ function createElementWithValidation(type, props, children) {
2014
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2015
+ // succeed and there will likely be errors in render.
2016
+
2017
+ if (!validType) {
2018
+ var info = '';
2019
+
2020
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2021
+ 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.";
2022
+ }
2023
+
2024
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2025
+
2026
+ if (sourceInfo) {
2027
+ info += sourceInfo;
2028
+ } else {
2029
+ info += getDeclarationErrorAddendum();
2030
+ }
2031
+
2032
+ var typeString;
2033
+
2034
+ if (type === null) {
2035
+ typeString = 'null';
2036
+ } else if (Array.isArray(type)) {
2037
+ typeString = 'array';
2038
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2039
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2040
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2041
+ } else {
2042
+ typeString = typeof type;
2043
+ }
2044
+
2045
+ 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);
1739
2046
  }
1740
2047
 
1741
- // Skip key warning if the type isn't valid since our key validation logic
2048
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2049
+ // TODO: Drop this when these are no longer allowed as the type argument.
2050
+
2051
+ if (element == null) {
2052
+ return element;
2053
+ } // Skip key warning if the type isn't valid since our key validation logic
1742
2054
  // doesn't expect a non-string/function type and can throw confusing errors.
1743
2055
  // We don't want exception behavior to differ between dev and prod.
1744
2056
  // (Rendering will throw with a helpful message and as soon as the type is
1745
2057
  // fixed, the key warnings will appear.)
2058
+
2059
+
1746
2060
  if (validType) {
1747
2061
  for (var i = 2; i < arguments.length; i++) {
1748
2062
  validateChildKeys(arguments[i], type);
@@ -1757,16 +2071,15 @@ function createElementWithValidation(type, props, children) {
1757
2071
 
1758
2072
  return element;
1759
2073
  }
1760
-
1761
2074
  function createFactoryWithValidation(type) {
1762
2075
  var validatedFactory = createElementWithValidation.bind(null, type);
1763
- validatedFactory.type = type;
1764
- // Legacy hook: remove it
2076
+ validatedFactory.type = type; // Legacy hook: remove it
2077
+
1765
2078
  {
1766
2079
  Object.defineProperty(validatedFactory, 'type', {
1767
2080
  enumerable: false,
1768
2081
  get: function () {
1769
- lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2082
+ lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1770
2083
  Object.defineProperty(this, 'type', {
1771
2084
  value: type
1772
2085
  });
@@ -1777,54 +2090,164 @@ function createFactoryWithValidation(type) {
1777
2090
 
1778
2091
  return validatedFactory;
1779
2092
  }
1780
-
1781
2093
  function cloneElementWithValidation(element, props, children) {
1782
2094
  var newElement = cloneElement.apply(this, arguments);
2095
+
1783
2096
  for (var i = 2; i < arguments.length; i++) {
1784
2097
  validateChildKeys(arguments[i], newElement.type);
1785
2098
  }
2099
+
1786
2100
  validatePropTypes(newElement);
1787
2101
  return newElement;
1788
2102
  }
1789
2103
 
1790
- // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
2104
+ var hasBadMapPolyfill;
1791
2105
 
2106
+ {
2107
+ hasBadMapPolyfill = false;
2108
+
2109
+ try {
2110
+ var frozenObject = Object.freeze({});
2111
+ var testMap = new Map([[frozenObject, null]]);
2112
+ var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
2113
+ // https://github.com/rollup/rollup/issues/1771
2114
+ // TODO: we can remove these if Rollup fixes the bug.
2115
+
2116
+ testMap.set(0, 0);
2117
+ testSet.add(0);
2118
+ } catch (e) {
2119
+ // TODO: Consider warning about bad polyfills
2120
+ hasBadMapPolyfill = true;
2121
+ }
2122
+ }
2123
+
2124
+ function createFundamentalComponent(impl) {
2125
+ // We use responder as a Map key later on. When we have a bad
2126
+ // polyfill, then we can't use it as a key as the polyfill tries
2127
+ // to add a property to the object.
2128
+ if (true && !hasBadMapPolyfill) {
2129
+ Object.freeze(impl);
2130
+ }
2131
+
2132
+ var fundamantalComponent = {
2133
+ $$typeof: REACT_FUNDAMENTAL_TYPE,
2134
+ impl: impl
2135
+ };
2136
+
2137
+ {
2138
+ Object.freeze(fundamantalComponent);
2139
+ }
2140
+
2141
+ return fundamantalComponent;
2142
+ }
2143
+
2144
+ function createEventResponder(displayName, responderConfig) {
2145
+ var getInitialState = responderConfig.getInitialState,
2146
+ onEvent = responderConfig.onEvent,
2147
+ onMount = responderConfig.onMount,
2148
+ onUnmount = responderConfig.onUnmount,
2149
+ onRootEvent = responderConfig.onRootEvent,
2150
+ rootEventTypes = responderConfig.rootEventTypes,
2151
+ targetEventTypes = responderConfig.targetEventTypes,
2152
+ targetPortalPropagation = responderConfig.targetPortalPropagation;
2153
+ var eventResponder = {
2154
+ $$typeof: REACT_RESPONDER_TYPE,
2155
+ displayName: displayName,
2156
+ getInitialState: getInitialState || null,
2157
+ onEvent: onEvent || null,
2158
+ onMount: onMount || null,
2159
+ onRootEvent: onRootEvent || null,
2160
+ onUnmount: onUnmount || null,
2161
+ rootEventTypes: rootEventTypes || null,
2162
+ targetEventTypes: targetEventTypes || null,
2163
+ targetPortalPropagation: targetPortalPropagation || false
2164
+ }; // We use responder as a Map key later on. When we have a bad
2165
+ // polyfill, then we can't use it as a key as the polyfill tries
2166
+ // to add a property to the object.
2167
+
2168
+ if (true && !hasBadMapPolyfill) {
2169
+ Object.freeze(eventResponder);
2170
+ }
2171
+
2172
+ return eventResponder;
2173
+ }
2174
+
2175
+ function createScope(fn) {
2176
+ var scopeComponent = {
2177
+ $$typeof: REACT_SCOPE_TYPE,
2178
+ fn: fn
2179
+ };
2180
+
2181
+ {
2182
+ Object.freeze(scopeComponent);
2183
+ }
2184
+
2185
+ return scopeComponent;
2186
+ }
2187
+
2188
+ // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
1792
2189
 
1793
- // In some cases, StrictMode should also double-render lifecycles.
2190
+ // In some cases, StrictMode should also double-render lifecycles.
1794
2191
  // This can be confusing for tests though,
1795
2192
  // And it can be bad for performance in production.
1796
2193
  // This feature flag can be used to control the behavior:
1797
2194
 
1798
-
1799
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
2195
+ // To preserve the "Pause on caught exceptions" behavior of the debugger, we
1800
2196
  // replay the begin phase of a failed component inside invokeGuardedCallback.
1801
2197
 
2198
+ // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
2199
+
2200
+ // Gather advanced timing metrics for Profiler subtrees.
1802
2201
 
1803
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
2202
+ // Trace which interactions trigger each commit.
1804
2203
 
2204
+ // Only used in www builds.
1805
2205
 
1806
- // Gather advanced timing metrics for Profiler subtrees.
2206
+ // TODO: true? Here it might just be false.
1807
2207
 
2208
+ // Only used in www builds.
1808
2209
 
1809
- // Trace which interactions trigger each commit.
2210
+ // Only used in www builds.
1810
2211
 
2212
+ // Disable javascript: URL strings in href for XSS protection.
1811
2213
 
1812
- // Only used in www builds.
1813
- // TODO: true? Here it might just be false.
2214
+ // React Fire: prevent the value and checked attributes from syncing
2215
+ // with their related DOM properties
1814
2216
 
1815
- // Only used in www builds.
2217
+ // These APIs will no longer be "unstable" in the upcoming 16.7 release,
2218
+ // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
1816
2219
 
1817
2220
 
1818
- // Only used in www builds.
2221
+ // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information
2222
+ // This is a flag so we can fix warnings in RN core before turning it on
1819
2223
 
2224
+ // Experimental React Flare event system and event components support.
1820
2225
 
1821
- // React Fire: prevent the value and checked attributes from syncing
1822
- // with their related DOM properties
2226
+ var enableFlareAPI = false; // Experimental Host Component support.
1823
2227
 
2228
+ var enableFundamentalAPI = false; // Experimental Scope support.
1824
2229
 
1825
- // These APIs will no longer be "unstable" in the upcoming 16.7 release,
1826
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
1827
- var enableStableConcurrentModeAPIs = false;
2230
+ var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
2231
+
2232
+ var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
2233
+ // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version
2234
+
2235
+ // For tests, we flush suspense fallbacks in an act scope;
2236
+ // *except* in some of our own tests, where we test incremental loading states.
2237
+
2238
+ // Changes priority of some events like mousemove to user-blocking priority,
2239
+ // but without making them discrete. The flag exists in case it causes
2240
+ // starvation problems.
2241
+
2242
+ // Add a callback property to suspense to notify which promises are currently
2243
+ // in the update queue. This allows reporting and tracing of what is causing
2244
+ // the user to see a loading state.
2245
+ // Also allows hydration callbacks to fire when a dehydrated boundary gets
2246
+ // hydrated or deleted.
2247
+
2248
+ // Part of the simplification of React.createElement so we can eventually move
2249
+ // from React.createElement to React.jsx
2250
+ // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
1828
2251
 
1829
2252
  var React = {
1830
2253
  Children: {
@@ -1834,16 +2257,13 @@ var React = {
1834
2257
  toArray: toArray,
1835
2258
  only: onlyChild
1836
2259
  },
1837
-
1838
2260
  createRef: createRef,
1839
2261
  Component: Component,
1840
2262
  PureComponent: PureComponent,
1841
-
1842
2263
  createContext: createContext,
1843
2264
  forwardRef: forwardRef,
1844
2265
  lazy: lazy,
1845
2266
  memo: memo,
1846
-
1847
2267
  useCallback: useCallback,
1848
2268
  useContext: useContext,
1849
2269
  useEffect: useEffect,
@@ -1854,34 +2274,43 @@ var React = {
1854
2274
  useReducer: useReducer,
1855
2275
  useRef: useRef,
1856
2276
  useState: useState,
1857
-
1858
2277
  Fragment: REACT_FRAGMENT_TYPE,
2278
+ Profiler: REACT_PROFILER_TYPE,
1859
2279
  StrictMode: REACT_STRICT_MODE_TYPE,
1860
2280
  Suspense: REACT_SUSPENSE_TYPE,
1861
-
2281
+ unstable_SuspenseList: REACT_SUSPENSE_LIST_TYPE,
1862
2282
  createElement: createElementWithValidation,
1863
2283
  cloneElement: cloneElementWithValidation,
1864
2284
  createFactory: createFactoryWithValidation,
1865
2285
  isValidElement: isValidElement,
1866
-
1867
2286
  version: ReactVersion,
1868
-
1869
- unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
1870
- unstable_Profiler: REACT_PROFILER_TYPE,
1871
-
2287
+ unstable_withSuspenseConfig: withSuspenseConfig,
1872
2288
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
1873
2289
  };
1874
2290
 
1875
- // Note: some APIs are added with feature flags.
2291
+ if (enableFlareAPI) {
2292
+ React.unstable_useResponder = useResponder;
2293
+ React.unstable_createResponder = createEventResponder;
2294
+ }
2295
+
2296
+ if (enableFundamentalAPI) {
2297
+ React.unstable_createFundamental = createFundamentalComponent;
2298
+ }
2299
+
2300
+ if (enableScopeAPI) {
2301
+ React.unstable_createScope = createScope;
2302
+ } // Note: some APIs are added with feature flags.
1876
2303
  // Make sure that stable builds for open source
1877
2304
  // don't modify the React object to avoid deopts.
1878
2305
  // Also let's not expose their names in stable builds.
1879
2306
 
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;
2307
+
2308
+ if (enableJSXTransformAPI) {
2309
+ {
2310
+ React.jsxDEV = jsxWithValidation;
2311
+ React.jsx = jsxWithValidationDynamic;
2312
+ React.jsxs = jsxWithValidationStatic;
2313
+ }
1885
2314
  }
1886
2315
 
1887
2316
 
@@ -1894,6 +2323,8 @@ var React$3 = ( React$2 && React ) || React$2;
1894
2323
 
1895
2324
  // TODO: decide on the top-level export form.
1896
2325
  // This is hacky but makes it work with both Rollup and Jest.
2326
+
2327
+
1897
2328
  var react = React$3.default || React$3;
1898
2329
 
1899
2330
  module.exports = react;