Projekt

Obecné

Profil

Stáhnout (126 KB) Statistiky
| Větev: | Revize:
1 3a515b92 cagy
/** @license React v16.13.1
2
 * react-dom-server.browser.development.js
3
 *
4
 * Copyright (c) Facebook, Inc. and its affiliates.
5
 *
6
 * This source code is licensed under the MIT license found in the
7
 * LICENSE file in the root directory of this source tree.
8
 */
9
10
'use strict';
11
12
13
14
if (process.env.NODE_ENV !== "production") {
15
  (function() {
16
'use strict';
17
18
var React = require('react');
19
var _assign = require('object-assign');
20
var checkPropTypes = require('prop-types/checkPropTypes');
21
22
// Do not require this module directly! Use normal `invariant` calls with
23
// template literal strings. The messages will be replaced with error codes
24
// during build.
25
function formatProdErrorMessage(code) {
26
  var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
27
28
  for (var i = 1; i < arguments.length; i++) {
29
    url += '&args[]=' + encodeURIComponent(arguments[i]);
30
  }
31
32
  return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';
33
}
34
35
var ReactVersion = '16.13.1';
36
37
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
38
// Current owner and dispatcher used to share the same ref,
39
// but PR #14548 split them out to better support the react-debug-tools package.
40
41
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
42
  ReactSharedInternals.ReactCurrentDispatcher = {
43
    current: null
44
  };
45
}
46
47
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
48
  ReactSharedInternals.ReactCurrentBatchConfig = {
49
    suspense: null
50
  };
51
}
52
53
// by calls to these methods by a Babel plugin.
54
//
55
// In PROD (or in packages without access to React internals),
56
// they are left as they are instead.
57
58
function warn(format) {
59
  {
60
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
61
      args[_key - 1] = arguments[_key];
62
    }
63
64
    printWarning('warn', format, args);
65
  }
66
}
67
function error(format) {
68
  {
69
    for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
70
      args[_key2 - 1] = arguments[_key2];
71
    }
72
73
    printWarning('error', format, args);
74
  }
75
}
76
77
function printWarning(level, format, args) {
78
  // When changing this logic, you might want to also
79
  // update consoleWithStackDev.www.js as well.
80
  {
81
    var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n    in') === 0;
82
83
    if (!hasExistingStack) {
84
      var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
85
      var stack = ReactDebugCurrentFrame.getStackAddendum();
86
87
      if (stack !== '') {
88
        format += '%s';
89
        args = args.concat([stack]);
90
      }
91
    }
92
93
    var argsWithFormat = args.map(function (item) {
94
      return '' + item;
95
    }); // Careful: RN currently depends on this prefix
96
97
    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
98
    // breaks IE9: https://github.com/facebook/react/issues/13610
99
    // eslint-disable-next-line react-internal/no-production-logging
100
101
    Function.prototype.apply.call(console[level], console, argsWithFormat);
102
103
    try {
104
      // --- Welcome to debugging React ---
105
      // This error was thrown as a convenience so that you can use this stack
106
      // to find the callsite that caused this warning to fire.
107
      var argIndex = 0;
108
      var message = 'Warning: ' + format.replace(/%s/g, function () {
109
        return args[argIndex++];
110
      });
111
      throw new Error(message);
112
    } catch (x) {}
113
  }
114
}
115
116
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
117
// nor polyfill, then a plain number is used for performance.
118
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
119
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
120
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
121
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
122
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
123
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
124
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
125
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
126
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
127
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
128
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
129
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
130
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
131
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
132
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
133
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
134
135
var Uninitialized = -1;
136
var Pending = 0;
137
var Resolved = 1;
138
var Rejected = 2;
139
function refineResolvedLazyComponent(lazyComponent) {
140
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
141
}
142
function initializeLazyComponentType(lazyComponent) {
143
  if (lazyComponent._status === Uninitialized) {
144
    lazyComponent._status = Pending;
145
    var ctor = lazyComponent._ctor;
146
    var thenable = ctor();
147
    lazyComponent._result = thenable;
148
    thenable.then(function (moduleObject) {
149
      if (lazyComponent._status === Pending) {
150
        var defaultExport = moduleObject.default;
151
152
        {
153
          if (defaultExport === undefined) {
154
            error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n  ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
155
          }
156
        }
157
158
        lazyComponent._status = Resolved;
159
        lazyComponent._result = defaultExport;
160
      }
161
    }, function (error) {
162
      if (lazyComponent._status === Pending) {
163
        lazyComponent._status = Rejected;
164
        lazyComponent._result = error;
165
      }
166
    });
167
  }
168
}
169
170
function getWrappedName(outerType, innerType, wrapperName) {
171
  var functionName = innerType.displayName || innerType.name || '';
172
  return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
173
}
174
175
function getComponentName(type) {
176
  if (type == null) {
177
    // Host root, text node or just invalid type.
178
    return null;
179
  }
180
181
  {
182
    if (typeof type.tag === 'number') {
183
      error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
184
    }
185
  }
186
187
  if (typeof type === 'function') {
188
    return type.displayName || type.name || null;
189
  }
190
191
  if (typeof type === 'string') {
192
    return type;
193
  }
194
195
  switch (type) {
196
    case REACT_FRAGMENT_TYPE:
197
      return 'Fragment';
198
199
    case REACT_PORTAL_TYPE:
200
      return 'Portal';
201
202
    case REACT_PROFILER_TYPE:
203
      return "Profiler";
204
205
    case REACT_STRICT_MODE_TYPE:
206
      return 'StrictMode';
207
208
    case REACT_SUSPENSE_TYPE:
209
      return 'Suspense';
210
211
    case REACT_SUSPENSE_LIST_TYPE:
212
      return 'SuspenseList';
213
  }
214
215
  if (typeof type === 'object') {
216
    switch (type.$$typeof) {
217
      case REACT_CONTEXT_TYPE:
218
        return 'Context.Consumer';
219
220
      case REACT_PROVIDER_TYPE:
221
        return 'Context.Provider';
222
223
      case REACT_FORWARD_REF_TYPE:
224
        return getWrappedName(type, type.render, 'ForwardRef');
225
226
      case REACT_MEMO_TYPE:
227
        return getComponentName(type.type);
228
229
      case REACT_BLOCK_TYPE:
230
        return getComponentName(type.render);
231
232
      case REACT_LAZY_TYPE:
233
        {
234
          var thenable = type;
235
          var resolvedThenable = refineResolvedLazyComponent(thenable);
236
237
          if (resolvedThenable) {
238
            return getComponentName(resolvedThenable);
239
          }
240
241
          break;
242
        }
243
    }
244
  }
245
246
  return null;
247
}
248
249
var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
250
function describeComponentFrame (name, source, ownerName) {
251
  var sourceInfo = '';
252
253
  if (source) {
254
    var path = source.fileName;
255
    var fileName = path.replace(BEFORE_SLASH_RE, '');
256
257
    {
258
      // In DEV, include code for a common special case:
259
      // prefer "folder/index.js" instead of just "index.js".
260
      if (/^index\./.test(fileName)) {
261
        var match = path.match(BEFORE_SLASH_RE);
262
263
        if (match) {
264
          var pathBeforeSlash = match[1];
265
266
          if (pathBeforeSlash) {
267
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
268
            fileName = folderName + '/' + fileName;
269
          }
270
        }
271
      }
272
    }
273
274
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
275
  } else if (ownerName) {
276
    sourceInfo = ' (created by ' + ownerName + ')';
277
  }
278
279
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
280
}
281
282
var enableSuspenseServerRenderer = false;
283
284
var enableDeprecatedFlareAPI = false; // Experimental Host Component support.
285
286
var ReactDebugCurrentFrame;
287
var didWarnAboutInvalidateContextType;
288
289
{
290
  ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
291
  didWarnAboutInvalidateContextType = new Set();
292
}
293
294
var emptyObject = {};
295
296
{
297
  Object.freeze(emptyObject);
298
}
299
300
function maskContext(type, context) {
301
  var contextTypes = type.contextTypes;
302
303
  if (!contextTypes) {
304
    return emptyObject;
305
  }
306
307
  var maskedContext = {};
308
309
  for (var contextName in contextTypes) {
310
    maskedContext[contextName] = context[contextName];
311
  }
312
313
  return maskedContext;
314
}
315
316
function checkContextTypes(typeSpecs, values, location) {
317
  {
318
    checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack);
319
  }
320
}
321
322
function validateContextBounds(context, threadID) {
323
  // If we don't have enough slots in this context to store this threadID,
324
  // fill it in without leaving any holes to ensure that the VM optimizes
325
  // this as non-holey index properties.
326
  // (Note: If `react` package is < 16.6, _threadCount is undefined.)
327
  for (var i = context._threadCount | 0; i <= threadID; i++) {
328
    // We assume that this is the same as the defaultValue which might not be
329
    // true if we're rendering inside a secondary renderer but they are
330
    // secondary because these use cases are very rare.
331
    context[i] = context._currentValue2;
332
    context._threadCount = i + 1;
333
  }
334
}
335
function processContext(type, context, threadID, isClass) {
336
  if (isClass) {
337
    var contextType = type.contextType;
338
339
    {
340
      if ('contextType' in type) {
341
        var isValid = // Allow null for conditional declaration
342
        contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
343
344
        if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {
345
          didWarnAboutInvalidateContextType.add(type);
346
          var addendum = '';
347
348
          if (contextType === undefined) {
349
            addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
350
          } else if (typeof contextType !== 'object') {
351
            addendum = ' However, it is set to a ' + typeof contextType + '.';
352
          } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
353
            addendum = ' Did you accidentally pass the Context.Provider instead?';
354
          } else if (contextType._context !== undefined) {
355
            // <Context.Consumer>
356
            addendum = ' Did you accidentally pass the Context.Consumer instead?';
357
          } else {
358
            addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
359
          }
360
361
          error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
362
        }
363
      }
364
    }
365
366
    if (typeof contextType === 'object' && contextType !== null) {
367
      validateContextBounds(contextType, threadID);
368
      return contextType[threadID];
369
    }
370
371
    {
372
      var maskedContext = maskContext(type, context);
373
374
      {
375
        if (type.contextTypes) {
376
          checkContextTypes(type.contextTypes, maskedContext, 'context');
377
        }
378
      }
379
380
      return maskedContext;
381
    }
382
  } else {
383
    {
384
      var _maskedContext = maskContext(type, context);
385
386
      {
387
        if (type.contextTypes) {
388
          checkContextTypes(type.contextTypes, _maskedContext, 'context');
389
        }
390
      }
391
392
      return _maskedContext;
393
    }
394
  }
395
}
396
397
var nextAvailableThreadIDs = new Uint16Array(16);
398
399
for (var i = 0; i < 15; i++) {
400
  nextAvailableThreadIDs[i] = i + 1;
401
}
402
403
nextAvailableThreadIDs[15] = 0;
404
405
function growThreadCountAndReturnNextAvailable() {
406
  var oldArray = nextAvailableThreadIDs;
407
  var oldSize = oldArray.length;
408
  var newSize = oldSize * 2;
409
410
  if (!(newSize <= 0x10000)) {
411
    {
412
      throw Error( "Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic." );
413
    }
414
  }
415
416
  var newArray = new Uint16Array(newSize);
417
  newArray.set(oldArray);
418
  nextAvailableThreadIDs = newArray;
419
  nextAvailableThreadIDs[0] = oldSize + 1;
420
421
  for (var _i = oldSize; _i < newSize - 1; _i++) {
422
    nextAvailableThreadIDs[_i] = _i + 1;
423
  }
424
425
  nextAvailableThreadIDs[newSize - 1] = 0;
426
  return oldSize;
427
}
428
429
function allocThreadID() {
430
  var nextID = nextAvailableThreadIDs[0];
431
432
  if (nextID === 0) {
433
    return growThreadCountAndReturnNextAvailable();
434
  }
435
436
  nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];
437
  return nextID;
438
}
439
function freeThreadID(id) {
440
  nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];
441
  nextAvailableThreadIDs[0] = id;
442
}
443
444
// A reserved attribute.
445
// It is handled by React separately and shouldn't be written to the DOM.
446
var RESERVED = 0; // A simple string attribute.
447
// Attributes that aren't in the whitelist are presumed to have this type.
448
449
var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
450
// "enumerated" attributes with "true" and "false" as possible values.
451
// When true, it should be set to a "true" string.
452
// When false, it should be set to a "false" string.
453
454
var BOOLEANISH_STRING = 2; // A real boolean attribute.
455
// When true, it should be present (set either to an empty string or its name).
456
// When false, it should be omitted.
457
458
var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
459
// When true, it should be present (set either to an empty string or its name).
460
// When false, it should be omitted.
461
// For any other value, should be present with that value.
462
463
var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
464
// When falsy, it should be removed.
465
466
var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
467
// When falsy, it should be removed.
468
469
var POSITIVE_NUMERIC = 6;
470
471
/* eslint-disable max-len */
472
var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
473
/* eslint-enable max-len */
474
475
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
476
var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
477
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
478
var hasOwnProperty = Object.prototype.hasOwnProperty;
479
var illegalAttributeNameCache = {};
480
var validatedAttributeNameCache = {};
481
function isAttributeNameSafe(attributeName) {
482
  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
483
    return true;
484
  }
485
486
  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
487
    return false;
488
  }
489
490
  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
491
    validatedAttributeNameCache[attributeName] = true;
492
    return true;
493
  }
494
495
  illegalAttributeNameCache[attributeName] = true;
496
497
  {
498
    error('Invalid attribute name: `%s`', attributeName);
499
  }
500
501
  return false;
502
}
503
function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
504
  if (propertyInfo !== null) {
505
    return propertyInfo.type === RESERVED;
506
  }
507
508
  if (isCustomComponentTag) {
509
    return false;
510
  }
511
512
  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
513
    return true;
514
  }
515
516
  return false;
517
}
518
function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
519
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
520
    return false;
521
  }
522
523
  switch (typeof value) {
524
    case 'function': // $FlowIssue symbol is perfectly valid here
525
526
    case 'symbol':
527
      // eslint-disable-line
528
      return true;
529
530
    case 'boolean':
531
      {
532
        if (isCustomComponentTag) {
533
          return false;
534
        }
535
536
        if (propertyInfo !== null) {
537
          return !propertyInfo.acceptsBooleans;
538
        } else {
539
          var prefix = name.toLowerCase().slice(0, 5);
540
          return prefix !== 'data-' && prefix !== 'aria-';
541
        }
542
      }
543
544
    default:
545
      return false;
546
  }
547
}
548
function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
549
  if (value === null || typeof value === 'undefined') {
550
    return true;
551
  }
552
553
  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
554
    return true;
555
  }
556
557
  if (isCustomComponentTag) {
558
    return false;
559
  }
560
561
  if (propertyInfo !== null) {
562
    switch (propertyInfo.type) {
563
      case BOOLEAN:
564
        return !value;
565
566
      case OVERLOADED_BOOLEAN:
567
        return value === false;
568
569
      case NUMERIC:
570
        return isNaN(value);
571
572
      case POSITIVE_NUMERIC:
573
        return isNaN(value) || value < 1;
574
    }
575
  }
576
577
  return false;
578
}
579
function getPropertyInfo(name) {
580
  return properties.hasOwnProperty(name) ? properties[name] : null;
581
}
582
583
function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
584
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
585
  this.attributeName = attributeName;
586
  this.attributeNamespace = attributeNamespace;
587
  this.mustUseProperty = mustUseProperty;
588
  this.propertyName = name;
589
  this.type = type;
590
  this.sanitizeURL = sanitizeURL;
591
} // When adding attributes to this list, be sure to also add them to
592
// the `possibleStandardNames` module to ensure casing and incorrect
593
// name warnings.
594
595
596
var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
597
598
var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
599
// elements (not just inputs). Now that ReactDOMInput assigns to the
600
// defaultValue property -- do we need this?
601
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
602
603
reservedProps.forEach(function (name) {
604
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
605
  name, // attributeName
606
  null, // attributeNamespace
607
  false);
608
}); // A few React string attributes have a different name.
609
// This is a mapping from React prop names to the attribute names.
610
611
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
612
  var name = _ref[0],
613
      attributeName = _ref[1];
614
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
615
  attributeName, // attributeName
616
  null, // attributeNamespace
617
  false);
618
}); // These are "enumerated" HTML attributes that accept "true" and "false".
619
// In React, we let users pass `true` and `false` even though technically
620
// these aren't boolean attributes (they are coerced to strings).
621
622
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
623
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
624
  name.toLowerCase(), // attributeName
625
  null, // attributeNamespace
626
  false);
627
}); // These are "enumerated" SVG attributes that accept "true" and "false".
628
// In React, we let users pass `true` and `false` even though technically
629
// these aren't boolean attributes (they are coerced to strings).
630
// Since these are SVG attributes, their attribute names are case-sensitive.
631
632
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
633
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
634
  name, // attributeName
635
  null, // attributeNamespace
636
  false);
637
}); // These are HTML boolean attributes.
638
639
['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
640
// on the client side because the browsers are inconsistent. Instead we call focus().
641
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
642
'itemScope'].forEach(function (name) {
643
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
644
  name.toLowerCase(), // attributeName
645
  null, // attributeNamespace
646
  false);
647
}); // These are the few React props that we set as DOM properties
648
// rather than attributes. These are all booleans.
649
650
['checked', // Note: `option.selected` is not updated if `select.multiple` is
651
// disabled with `removeAttribute`. We have special logic for handling this.
652
'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,
653
// you'll need to set attributeName to name.toLowerCase()
654
// instead in the assignment below.
655
].forEach(function (name) {
656
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
657
  name, // attributeName
658
  null, // attributeNamespace
659
  false);
660
}); // These are HTML attributes that are "overloaded booleans": they behave like
661
// booleans, but can also accept a string value.
662
663
['capture', 'download' // NOTE: if you add a camelCased prop to this list,
664
// you'll need to set attributeName to name.toLowerCase()
665
// instead in the assignment below.
666
].forEach(function (name) {
667
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
668
  name, // attributeName
669
  null, // attributeNamespace
670
  false);
671
}); // These are HTML attributes that must be positive numbers.
672
673
['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,
674
// you'll need to set attributeName to name.toLowerCase()
675
// instead in the assignment below.
676
].forEach(function (name) {
677
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
678
  name, // attributeName
679
  null, // attributeNamespace
680
  false);
681
}); // These are HTML attributes that must be numbers.
682
683
['rowSpan', 'start'].forEach(function (name) {
684
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
685
  name.toLowerCase(), // attributeName
686
  null, // attributeNamespace
687
  false);
688
});
689
var CAMELIZE = /[\-\:]([a-z])/g;
690
691
var capitalize = function (token) {
692
  return token[1].toUpperCase();
693
}; // This is a list of all SVG attributes that need special casing, namespacing,
694
// or boolean value assignment. Regular attributes that just accept strings
695
// and have the same names are omitted, just like in the HTML whitelist.
696
// Some of these attributes can be hard to find. This list was created by
697
// scraping the MDN documentation.
698
699
700
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,
701
// you'll need to set attributeName to name.toLowerCase()
702
// instead in the assignment below.
703
].forEach(function (attributeName) {
704
  var name = attributeName.replace(CAMELIZE, capitalize);
705
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
706
  attributeName, null, // attributeNamespace
707
  false);
708
}); // String SVG attributes with the xlink namespace.
709
710
['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,
711
// you'll need to set attributeName to name.toLowerCase()
712
// instead in the assignment below.
713
].forEach(function (attributeName) {
714
  var name = attributeName.replace(CAMELIZE, capitalize);
715
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
716
  attributeName, 'http://www.w3.org/1999/xlink', false);
717
}); // String SVG attributes with the xml namespace.
718
719
['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,
720
// you'll need to set attributeName to name.toLowerCase()
721
// instead in the assignment below.
722
].forEach(function (attributeName) {
723
  var name = attributeName.replace(CAMELIZE, capitalize);
724
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
725
  attributeName, 'http://www.w3.org/XML/1998/namespace', false);
726
}); // These attribute exists both in HTML and SVG.
727
// The attribute name is case-sensitive in SVG so we can't just use
728
// the React name like we do for attributes that exist only in HTML.
729
730
['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
731
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
732
  attributeName.toLowerCase(), // attributeName
733
  null, // attributeNamespace
734
  false);
735
}); // These attributes accept URLs. These must not allow javascript: URLS.
736
// These will also need to accept Trusted Types object in the future.
737
738
var xlinkHref = 'xlinkHref';
739
properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
740
'xlink:href', 'http://www.w3.org/1999/xlink', true);
741
['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
742
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
743
  attributeName.toLowerCase(), // attributeName
744
  null, // attributeNamespace
745
  true);
746
});
747
748
var ReactDebugCurrentFrame$1 = null;
749
750
{
751
  ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
752
} // A javascript: URL can contain leading C0 control or \u0020 SPACE,
753
// and any newline or tab are filtered out as if they're not part of the URL.
754
// https://url.spec.whatwg.org/#url-parsing
755
// Tab or newline are defined as \r\n\t:
756
// https://infra.spec.whatwg.org/#ascii-tab-or-newline
757
// A C0 control is a code point in the range \u0000 NULL to \u001F
758
// INFORMATION SEPARATOR ONE, inclusive:
759
// https://infra.spec.whatwg.org/#c0-control-or-space
760
761
/* eslint-disable max-len */
762
763
764
var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
765
var didWarn = false;
766
767
function sanitizeURL(url) {
768
  {
769
    if (!didWarn && isJavaScriptProtocol.test(url)) {
770
      didWarn = true;
771
772
      error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
773
    }
774
  }
775
}
776
777
// code copied and modified from escape-html
778
779
/**
780
 * Module variables.
781
 * @private
782
 */
783
var matchHtmlRegExp = /["'&<>]/;
784
/**
785
 * Escapes special characters and HTML entities in a given html string.
786
 *
787
 * @param  {string} string HTML string to escape for later insertion
788
 * @return {string}
789
 * @public
790
 */
791
792
function escapeHtml(string) {
793
  var str = '' + string;
794
  var match = matchHtmlRegExp.exec(str);
795
796
  if (!match) {
797
    return str;
798
  }
799
800
  var escape;
801
  var html = '';
802
  var index;
803
  var lastIndex = 0;
804
805
  for (index = match.index; index < str.length; index++) {
806
    switch (str.charCodeAt(index)) {
807
      case 34:
808
        // "
809
        escape = '&quot;';
810
        break;
811
812
      case 38:
813
        // &
814
        escape = '&amp;';
815
        break;
816
817
      case 39:
818
        // '
819
        escape = '&#x27;'; // modified from escape-html; used to be '&#39'
820
821
        break;
822
823
      case 60:
824
        // <
825
        escape = '&lt;';
826
        break;
827
828
      case 62:
829
        // >
830
        escape = '&gt;';
831
        break;
832
833
      default:
834
        continue;
835
    }
836
837
    if (lastIndex !== index) {
838
      html += str.substring(lastIndex, index);
839
    }
840
841
    lastIndex = index + 1;
842
    html += escape;
843
  }
844
845
  return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
846
} // end code copied and modified from escape-html
847
848
/**
849
 * Escapes text to prevent scripting attacks.
850
 *
851
 * @param {*} text Text value to escape.
852
 * @return {string} An escaped string.
853
 */
854
855
856
function escapeTextForBrowser(text) {
857
  if (typeof text === 'boolean' || typeof text === 'number') {
858
    // this shortcircuit helps perf for types that we know will never have
859
    // special characters, especially given that this function is used often
860
    // for numeric dom ids.
861
    return '' + text;
862
  }
863
864
  return escapeHtml(text);
865
}
866
867
/**
868
 * Escapes attribute value to prevent scripting attacks.
869
 *
870
 * @param {*} value Value to escape.
871
 * @return {string} An escaped string.
872
 */
873
874
function quoteAttributeValueForBrowser(value) {
875
  return '"' + escapeTextForBrowser(value) + '"';
876
}
877
878
function createMarkupForRoot() {
879
  return ROOT_ATTRIBUTE_NAME + '=""';
880
}
881
/**
882
 * Creates markup for a property.
883
 *
884
 * @param {string} name
885
 * @param {*} value
886
 * @return {?string} Markup string, or null if the property was invalid.
887
 */
888
889
function createMarkupForProperty(name, value) {
890
  var propertyInfo = getPropertyInfo(name);
891
892
  if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
893
    return '';
894
  }
895
896
  if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
897
    return '';
898
  }
899
900
  if (propertyInfo !== null) {
901
    var attributeName = propertyInfo.attributeName;
902
    var type = propertyInfo.type;
903
904
    if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
905
      return attributeName + '=""';
906
    } else {
907
      if (propertyInfo.sanitizeURL) {
908
        value = '' + value;
909
        sanitizeURL(value);
910
      }
911
912
      return attributeName + '=' + quoteAttributeValueForBrowser(value);
913
    }
914
  } else if (isAttributeNameSafe(name)) {
915
    return name + '=' + quoteAttributeValueForBrowser(value);
916
  }
917
918
  return '';
919
}
920
/**
921
 * Creates markup for a custom property.
922
 *
923
 * @param {string} name
924
 * @param {*} value
925
 * @return {string} Markup string, or empty string if the property was invalid.
926
 */
927
928
function createMarkupForCustomAttribute(name, value) {
929
  if (!isAttributeNameSafe(name) || value == null) {
930
    return '';
931
  }
932
933
  return name + '=' + quoteAttributeValueForBrowser(value);
934
}
935
936
/**
937
 * inlined Object.is polyfill to avoid requiring consumers ship their own
938
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
939
 */
940
function is(x, y) {
941
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
942
  ;
943
}
944
945
var objectIs = typeof Object.is === 'function' ? Object.is : is;
946
947
var currentlyRenderingComponent = null;
948
var firstWorkInProgressHook = null;
949
var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook
950
951
var isReRender = false; // Whether an update was scheduled during the currently executing render pass.
952
953
var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates
954
955
var renderPhaseUpdates = null; // Counter to prevent infinite loops.
956
957
var numberOfReRenders = 0;
958
var RE_RENDER_LIMIT = 25;
959
var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook
960
961
var currentHookNameInDev;
962
963
function resolveCurrentlyRenderingComponent() {
964
  if (!(currentlyRenderingComponent !== null)) {
965
    {
966
      throw 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." );
967
    }
968
  }
969
970
  {
971
    if (isInHookUserCodeInDev) {
972
      error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
973
    }
974
  }
975
976
  return currentlyRenderingComponent;
977
}
978
979
function areHookInputsEqual(nextDeps, prevDeps) {
980
  if (prevDeps === null) {
981
    {
982
      error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
983
    }
984
985
    return false;
986
  }
987
988
  {
989
    // Don't bother comparing lengths in prod because these arrays should be
990
    // passed inline.
991
    if (nextDeps.length !== prevDeps.length) {
992
      error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + nextDeps.join(', ') + "]", "[" + prevDeps.join(', ') + "]");
993
    }
994
  }
995
996
  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
997
    if (objectIs(nextDeps[i], prevDeps[i])) {
998
      continue;
999
    }
1000
1001
    return false;
1002
  }
1003
1004
  return true;
1005
}
1006
1007
function createHook() {
1008
  if (numberOfReRenders > 0) {
1009
    {
1010
      {
1011
        throw Error( "Rendered more hooks than during the previous render" );
1012
      }
1013
    }
1014
  }
1015
1016
  return {
1017
    memoizedState: null,
1018
    queue: null,
1019
    next: null
1020
  };
1021
}
1022
1023
function createWorkInProgressHook() {
1024
  if (workInProgressHook === null) {
1025
    // This is the first hook in the list
1026
    if (firstWorkInProgressHook === null) {
1027
      isReRender = false;
1028
      firstWorkInProgressHook = workInProgressHook = createHook();
1029
    } else {
1030
      // There's already a work-in-progress. Reuse it.
1031
      isReRender = true;
1032
      workInProgressHook = firstWorkInProgressHook;
1033
    }
1034
  } else {
1035
    if (workInProgressHook.next === null) {
1036
      isReRender = false; // Append to the end of the list
1037
1038
      workInProgressHook = workInProgressHook.next = createHook();
1039
    } else {
1040
      // There's already a work-in-progress. Reuse it.
1041
      isReRender = true;
1042
      workInProgressHook = workInProgressHook.next;
1043
    }
1044
  }
1045
1046
  return workInProgressHook;
1047
}
1048
1049
function prepareToUseHooks(componentIdentity) {
1050
  currentlyRenderingComponent = componentIdentity;
1051
1052
  {
1053
    isInHookUserCodeInDev = false;
1054
  } // The following should have already been reset
1055
  // didScheduleRenderPhaseUpdate = false;
1056
  // firstWorkInProgressHook = null;
1057
  // numberOfReRenders = 0;
1058
  // renderPhaseUpdates = null;
1059
  // workInProgressHook = null;
1060
1061
}
1062
function finishHooks(Component, props, children, refOrContext) {
1063
  // This must be called after every function component to prevent hooks from
1064
  // being used in classes.
1065
  while (didScheduleRenderPhaseUpdate) {
1066
    // Updates were scheduled during the render phase. They are stored in
1067
    // the `renderPhaseUpdates` map. Call the component again, reusing the
1068
    // work-in-progress hooks and applying the additional updates on top. Keep
1069
    // restarting until no more updates are scheduled.
1070
    didScheduleRenderPhaseUpdate = false;
1071
    numberOfReRenders += 1; // Start over from the beginning of the list
1072
1073
    workInProgressHook = null;
1074
    children = Component(props, refOrContext);
1075
  }
1076
1077
  currentlyRenderingComponent = null;
1078
  firstWorkInProgressHook = null;
1079
  numberOfReRenders = 0;
1080
  renderPhaseUpdates = null;
1081
  workInProgressHook = null;
1082
1083
  {
1084
    isInHookUserCodeInDev = false;
1085
  } // These were reset above
1086
  // currentlyRenderingComponent = null;
1087
  // didScheduleRenderPhaseUpdate = false;
1088
  // firstWorkInProgressHook = null;
1089
  // numberOfReRenders = 0;
1090
  // renderPhaseUpdates = null;
1091
  // workInProgressHook = null;
1092
1093
1094
  return children;
1095
}
1096
1097
function readContext(context, observedBits) {
1098
  var threadID = currentThreadID;
1099
  validateContextBounds(context, threadID);
1100
1101
  {
1102
    if (isInHookUserCodeInDev) {
1103
      error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
1104
    }
1105
  }
1106
1107
  return context[threadID];
1108
}
1109
1110
function useContext(context, observedBits) {
1111
  {
1112
    currentHookNameInDev = 'useContext';
1113
  }
1114
1115
  resolveCurrentlyRenderingComponent();
1116
  var threadID = currentThreadID;
1117
  validateContextBounds(context, threadID);
1118
  return context[threadID];
1119
}
1120
1121
function basicStateReducer(state, action) {
1122
  // $FlowFixMe: Flow doesn't like mixed types
1123
  return typeof action === 'function' ? action(state) : action;
1124
}
1125
1126
function useState(initialState) {
1127
  {
1128
    currentHookNameInDev = 'useState';
1129
  }
1130
1131
  return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers
1132
  initialState);
1133
}
1134
function useReducer(reducer, initialArg, init) {
1135
  {
1136
    if (reducer !== basicStateReducer) {
1137
      currentHookNameInDev = 'useReducer';
1138
    }
1139
  }
1140
1141
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
1142
  workInProgressHook = createWorkInProgressHook();
1143
1144
  if (isReRender) {
1145
    // This is a re-render. Apply the new render phase updates to the previous
1146
    // current hook.
1147
    var queue = workInProgressHook.queue;
1148
    var dispatch = queue.dispatch;
1149
1150
    if (renderPhaseUpdates !== null) {
1151
      // Render phase updates are stored in a map of queue -> linked list
1152
      var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
1153
1154
      if (firstRenderPhaseUpdate !== undefined) {
1155
        renderPhaseUpdates.delete(queue);
1156
        var newState = workInProgressHook.memoizedState;
1157
        var update = firstRenderPhaseUpdate;
1158
1159
        do {
1160
          // Process this render phase update. We don't have to check the
1161
          // priority because it will always be the same as the current
1162
          // render's.
1163
          var action = update.action;
1164
1165
          {
1166
            isInHookUserCodeInDev = true;
1167
          }
1168
1169
          newState = reducer(newState, action);
1170
1171
          {
1172
            isInHookUserCodeInDev = false;
1173
          }
1174
1175
          update = update.next;
1176
        } while (update !== null);
1177
1178
        workInProgressHook.memoizedState = newState;
1179
        return [newState, dispatch];
1180
      }
1181
    }
1182
1183
    return [workInProgressHook.memoizedState, dispatch];
1184
  } else {
1185
    {
1186
      isInHookUserCodeInDev = true;
1187
    }
1188
1189
    var initialState;
1190
1191
    if (reducer === basicStateReducer) {
1192
      // Special case for `useState`.
1193
      initialState = typeof initialArg === 'function' ? initialArg() : initialArg;
1194
    } else {
1195
      initialState = init !== undefined ? init(initialArg) : initialArg;
1196
    }
1197
1198
    {
1199
      isInHookUserCodeInDev = false;
1200
    }
1201
1202
    workInProgressHook.memoizedState = initialState;
1203
1204
    var _queue = workInProgressHook.queue = {
1205
      last: null,
1206
      dispatch: null
1207
    };
1208
1209
    var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue);
1210
1211
    return [workInProgressHook.memoizedState, _dispatch];
1212
  }
1213
}
1214
1215
function useMemo(nextCreate, deps) {
1216
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
1217
  workInProgressHook = createWorkInProgressHook();
1218
  var nextDeps = deps === undefined ? null : deps;
1219
1220
  if (workInProgressHook !== null) {
1221
    var prevState = workInProgressHook.memoizedState;
1222
1223
    if (prevState !== null) {
1224
      if (nextDeps !== null) {
1225
        var prevDeps = prevState[1];
1226
1227
        if (areHookInputsEqual(nextDeps, prevDeps)) {
1228
          return prevState[0];
1229
        }
1230
      }
1231
    }
1232
  }
1233
1234
  {
1235
    isInHookUserCodeInDev = true;
1236
  }
1237
1238
  var nextValue = nextCreate();
1239
1240
  {
1241
    isInHookUserCodeInDev = false;
1242
  }
1243
1244
  workInProgressHook.memoizedState = [nextValue, nextDeps];
1245
  return nextValue;
1246
}
1247
1248
function useRef(initialValue) {
1249
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
1250
  workInProgressHook = createWorkInProgressHook();
1251
  var previousRef = workInProgressHook.memoizedState;
1252
1253
  if (previousRef === null) {
1254
    var ref = {
1255
      current: initialValue
1256
    };
1257
1258
    {
1259
      Object.seal(ref);
1260
    }
1261
1262
    workInProgressHook.memoizedState = ref;
1263
    return ref;
1264
  } else {
1265
    return previousRef;
1266
  }
1267
}
1268
1269
function useLayoutEffect(create, inputs) {
1270
  {
1271
    currentHookNameInDev = 'useLayoutEffect';
1272
1273
    error('useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.');
1274
  }
1275
}
1276
1277
function dispatchAction(componentIdentity, queue, action) {
1278
  if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
1279
    {
1280
      throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
1281
    }
1282
  }
1283
1284
  if (componentIdentity === currentlyRenderingComponent) {
1285
    // This is a render phase update. Stash it in a lazily-created map of
1286
    // queue -> linked list of updates. After this render pass, we'll restart
1287
    // and apply the stashed updates on top of the work-in-progress hook.
1288
    didScheduleRenderPhaseUpdate = true;
1289
    var update = {
1290
      action: action,
1291
      next: null
1292
    };
1293
1294
    if (renderPhaseUpdates === null) {
1295
      renderPhaseUpdates = new Map();
1296
    }
1297
1298
    var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
1299
1300
    if (firstRenderPhaseUpdate === undefined) {
1301
      renderPhaseUpdates.set(queue, update);
1302
    } else {
1303
      // Append the update to the end of the list.
1304
      var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
1305
1306
      while (lastRenderPhaseUpdate.next !== null) {
1307
        lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
1308
      }
1309
1310
      lastRenderPhaseUpdate.next = update;
1311
    }
1312
  }
1313
}
1314
1315
function useCallback(callback, deps) {
1316
  // Callbacks are passed as they are in the server environment.
1317
  return callback;
1318
}
1319
1320
function useResponder(responder, props) {
1321
  return {
1322
    props: props,
1323
    responder: responder
1324
  };
1325
}
1326
1327
function useDeferredValue(value, config) {
1328
  resolveCurrentlyRenderingComponent();
1329
  return value;
1330
}
1331
1332
function useTransition(config) {
1333
  resolveCurrentlyRenderingComponent();
1334
1335
  var startTransition = function (callback) {
1336
    callback();
1337
  };
1338
1339
  return [startTransition, false];
1340
}
1341
1342
function noop() {}
1343
1344
var currentThreadID = 0;
1345
function setCurrentThreadID(threadID) {
1346
  currentThreadID = threadID;
1347
}
1348
var Dispatcher = {
1349
  readContext: readContext,
1350
  useContext: useContext,
1351
  useMemo: useMemo,
1352
  useReducer: useReducer,
1353
  useRef: useRef,
1354
  useState: useState,
1355
  useLayoutEffect: useLayoutEffect,
1356
  useCallback: useCallback,
1357
  // useImperativeHandle is not run in the server environment
1358
  useImperativeHandle: noop,
1359
  // Effects are not run in the server environment.
1360
  useEffect: noop,
1361
  // Debugging effect
1362
  useDebugValue: noop,
1363
  useResponder: useResponder,
1364
  useDeferredValue: useDeferredValue,
1365
  useTransition: useTransition
1366
};
1367
1368
var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
1369
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
1370
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
1371
var Namespaces = {
1372
  html: HTML_NAMESPACE,
1373
  mathml: MATH_NAMESPACE,
1374
  svg: SVG_NAMESPACE
1375
}; // Assumes there is no parent namespace.
1376
1377
function getIntrinsicNamespace(type) {
1378
  switch (type) {
1379
    case 'svg':
1380
      return SVG_NAMESPACE;
1381
1382
    case 'math':
1383
      return MATH_NAMESPACE;
1384
1385
    default:
1386
      return HTML_NAMESPACE;
1387
  }
1388
}
1389
function getChildNamespace(parentNamespace, type) {
1390
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
1391
    // No (or default) parent namespace: potential entry point.
1392
    return getIntrinsicNamespace(type);
1393
  }
1394
1395
  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
1396
    // We're leaving SVG.
1397
    return HTML_NAMESPACE;
1398
  } // By default, pass namespace below.
1399
1400
1401
  return parentNamespace;
1402
}
1403
1404
var ReactDebugCurrentFrame$2 = null;
1405
var ReactControlledValuePropTypes = {
1406
  checkPropTypes: null
1407
};
1408
1409
{
1410
  ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
1411
  var hasReadOnlyValue = {
1412
    button: true,
1413
    checkbox: true,
1414
    image: true,
1415
    hidden: true,
1416
    radio: true,
1417
    reset: true,
1418
    submit: true
1419
  };
1420
  var propTypes = {
1421
    value: function (props, propName, componentName) {
1422
      if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
1423
        return null;
1424
      }
1425
1426
      return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
1427
    },
1428
    checked: function (props, propName, componentName) {
1429
      if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
1430
        return null;
1431
      }
1432
1433
      return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
1434
    }
1435
  };
1436
  /**
1437
   * Provide a linked `value` attribute for controlled forms. You should not use
1438
   * this outside of the ReactDOM controlled form components.
1439
   */
1440
1441
  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
1442
    checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
1443
  };
1444
}
1445
1446
// For HTML, certain tags should omit their close tag. We keep a whitelist for
1447
// those special-case tags.
1448
var omittedCloseTags = {
1449
  area: true,
1450
  base: true,
1451
  br: true,
1452
  col: true,
1453
  embed: true,
1454
  hr: true,
1455
  img: true,
1456
  input: true,
1457
  keygen: true,
1458
  link: true,
1459
  meta: true,
1460
  param: true,
1461
  source: true,
1462
  track: true,
1463
  wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
1464
1465
};
1466
1467
// `omittedCloseTags` except that `menuitem` should still have its closing tag.
1468
1469
var voidElementTags = _assign({
1470
  menuitem: true
1471
}, omittedCloseTags);
1472
1473
var HTML = '__html';
1474
var ReactDebugCurrentFrame$3 = null;
1475
1476
{
1477
  ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
1478
}
1479
1480
function assertValidProps(tag, props) {
1481
  if (!props) {
1482
    return;
1483
  } // Note the use of `==` which checks for null or undefined.
1484
1485
1486
  if (voidElementTags[tag]) {
1487
    if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
1488
      {
1489
        throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
1490
      }
1491
    }
1492
  }
1493
1494
  if (props.dangerouslySetInnerHTML != null) {
1495
    if (!(props.children == null)) {
1496
      {
1497
        throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
1498
      }
1499
    }
1500
1501
    if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
1502
      {
1503
        throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." );
1504
      }
1505
    }
1506
  }
1507
1508
  {
1509
    if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
1510
      error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
1511
    }
1512
  }
1513
1514
  if (!(props.style == null || typeof props.style === 'object')) {
1515
    {
1516
      throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
1517
    }
1518
  }
1519
}
1520
1521
/**
1522
 * CSS properties which accept numbers but are not in units of "px".
1523
 */
1524
var isUnitlessNumber = {
1525
  animationIterationCount: true,
1526
  borderImageOutset: true,
1527
  borderImageSlice: true,
1528
  borderImageWidth: true,
1529
  boxFlex: true,
1530
  boxFlexGroup: true,
1531
  boxOrdinalGroup: true,
1532
  columnCount: true,
1533
  columns: true,
1534
  flex: true,
1535
  flexGrow: true,
1536
  flexPositive: true,
1537
  flexShrink: true,
1538
  flexNegative: true,
1539
  flexOrder: true,
1540
  gridArea: true,
1541
  gridRow: true,
1542
  gridRowEnd: true,
1543
  gridRowSpan: true,
1544
  gridRowStart: true,
1545
  gridColumn: true,
1546
  gridColumnEnd: true,
1547
  gridColumnSpan: true,
1548
  gridColumnStart: true,
1549
  fontWeight: true,
1550
  lineClamp: true,
1551
  lineHeight: true,
1552
  opacity: true,
1553
  order: true,
1554
  orphans: true,
1555
  tabSize: true,
1556
  widows: true,
1557
  zIndex: true,
1558
  zoom: true,
1559
  // SVG-related properties
1560
  fillOpacity: true,
1561
  floodOpacity: true,
1562
  stopOpacity: true,
1563
  strokeDasharray: true,
1564
  strokeDashoffset: true,
1565
  strokeMiterlimit: true,
1566
  strokeOpacity: true,
1567
  strokeWidth: true
1568
};
1569
/**
1570
 * @param {string} prefix vendor-specific prefix, eg: Webkit
1571
 * @param {string} key style name, eg: transitionDuration
1572
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
1573
 * WebkitTransitionDuration
1574
 */
1575
1576
function prefixKey(prefix, key) {
1577
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
1578
}
1579
/**
1580
 * Support style names that may come passed in prefixed by adding permutations
1581
 * of vendor prefixes.
1582
 */
1583
1584
1585
var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
1586
// infinite loop, because it iterates over the newly added props too.
1587
1588
Object.keys(isUnitlessNumber).forEach(function (prop) {
1589
  prefixes.forEach(function (prefix) {
1590
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
1591
  });
1592
});
1593
1594
/**
1595
 * Convert a value into the proper css writable value. The style name `name`
1596
 * should be logical (no hyphens), as specified
1597
 * in `CSSProperty.isUnitlessNumber`.
1598
 *
1599
 * @param {string} name CSS property name such as `topMargin`.
1600
 * @param {*} value CSS property value such as `10px`.
1601
 * @return {string} Normalized style value with dimensions applied.
1602
 */
1603
1604
function dangerousStyleValue(name, value, isCustomProperty) {
1605
  // Note that we've removed escapeTextForBrowser() calls here since the
1606
  // whole string will be escaped when the attribute is injected into
1607
  // the markup. If you provide unsafe user data here they can inject
1608
  // arbitrary CSS which may be problematic (I couldn't repro this):
1609
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
1610
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
1611
  // This is not an XSS hole but instead a potential CSS injection issue
1612
  // which has lead to a greater discussion about how we're going to
1613
  // trust URLs moving forward. See #2115901
1614
  var isEmpty = value == null || typeof value === 'boolean' || value === '';
1615
1616
  if (isEmpty) {
1617
    return '';
1618
  }
1619
1620
  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
1621
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
1622
  }
1623
1624
  return ('' + value).trim();
1625
}
1626
1627
var uppercasePattern = /([A-Z])/g;
1628
var msPattern = /^ms-/;
1629
/**
1630
 * Hyphenates a camelcased CSS property name, for example:
1631
 *
1632
 *   > hyphenateStyleName('backgroundColor')
1633
 *   < "background-color"
1634
 *   > hyphenateStyleName('MozTransition')
1635
 *   < "-moz-transition"
1636
 *   > hyphenateStyleName('msTransition')
1637
 *   < "-ms-transition"
1638
 *
1639
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
1640
 * is converted to `-ms-`.
1641
 */
1642
1643
function hyphenateStyleName(name) {
1644
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
1645
}
1646
1647
function isCustomComponent(tagName, props) {
1648
  if (tagName.indexOf('-') === -1) {
1649
    return typeof props.is === 'string';
1650
  }
1651
1652
  switch (tagName) {
1653
    // These are reserved SVG and MathML elements.
1654
    // We don't mind this whitelist too much because we expect it to never grow.
1655
    // The alternative is to track the namespace in a few places which is convoluted.
1656
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
1657
    case 'annotation-xml':
1658
    case 'color-profile':
1659
    case 'font-face':
1660
    case 'font-face-src':
1661
    case 'font-face-uri':
1662
    case 'font-face-format':
1663
    case 'font-face-name':
1664
    case 'missing-glyph':
1665
      return false;
1666
1667
    default:
1668
      return true;
1669
  }
1670
}
1671
1672
var warnValidStyle = function () {};
1673
1674
{
1675
  // 'msTransform' is correct, but the other prefixes should be capitalized
1676
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
1677
  var msPattern$1 = /^-ms-/;
1678
  var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
1679
1680
  var badStyleValueWithSemicolonPattern = /;\s*$/;
1681
  var warnedStyleNames = {};
1682
  var warnedStyleValues = {};
1683
  var warnedForNaNValue = false;
1684
  var warnedForInfinityValue = false;
1685
1686
  var camelize = function (string) {
1687
    return string.replace(hyphenPattern, function (_, character) {
1688
      return character.toUpperCase();
1689
    });
1690
  };
1691
1692
  var warnHyphenatedStyleName = function (name) {
1693
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
1694
      return;
1695
    }
1696
1697
    warnedStyleNames[name] = true;
1698
1699
    error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
1700
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
1701
    // is converted to lowercase `ms`.
1702
    camelize(name.replace(msPattern$1, 'ms-')));
1703
  };
1704
1705
  var warnBadVendoredStyleName = function (name) {
1706
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
1707
      return;
1708
    }
1709
1710
    warnedStyleNames[name] = true;
1711
1712
    error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
1713
  };
1714
1715
  var warnStyleValueWithSemicolon = function (name, value) {
1716
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
1717
      return;
1718
    }
1719
1720
    warnedStyleValues[value] = true;
1721
1722
    error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
1723
  };
1724
1725
  var warnStyleValueIsNaN = function (name, value) {
1726
    if (warnedForNaNValue) {
1727
      return;
1728
    }
1729
1730
    warnedForNaNValue = true;
1731
1732
    error('`NaN` is an invalid value for the `%s` css style property.', name);
1733
  };
1734
1735
  var warnStyleValueIsInfinity = function (name, value) {
1736
    if (warnedForInfinityValue) {
1737
      return;
1738
    }
1739
1740
    warnedForInfinityValue = true;
1741
1742
    error('`Infinity` is an invalid value for the `%s` css style property.', name);
1743
  };
1744
1745
  warnValidStyle = function (name, value) {
1746
    if (name.indexOf('-') > -1) {
1747
      warnHyphenatedStyleName(name);
1748
    } else if (badVendoredStyleNamePattern.test(name)) {
1749
      warnBadVendoredStyleName(name);
1750
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
1751
      warnStyleValueWithSemicolon(name, value);
1752
    }
1753
1754
    if (typeof value === 'number') {
1755
      if (isNaN(value)) {
1756
        warnStyleValueIsNaN(name, value);
1757
      } else if (!isFinite(value)) {
1758
        warnStyleValueIsInfinity(name, value);
1759
      }
1760
    }
1761
  };
1762
}
1763
1764
var warnValidStyle$1 = warnValidStyle;
1765
1766
var ariaProperties = {
1767
  'aria-current': 0,
1768
  // state
1769
  'aria-details': 0,
1770
  'aria-disabled': 0,
1771
  // state
1772
  'aria-hidden': 0,
1773
  // state
1774
  'aria-invalid': 0,
1775
  // state
1776
  'aria-keyshortcuts': 0,
1777
  'aria-label': 0,
1778
  'aria-roledescription': 0,
1779
  // Widget Attributes
1780
  'aria-autocomplete': 0,
1781
  'aria-checked': 0,
1782
  'aria-expanded': 0,
1783
  'aria-haspopup': 0,
1784
  'aria-level': 0,
1785
  'aria-modal': 0,
1786
  'aria-multiline': 0,
1787
  'aria-multiselectable': 0,
1788
  'aria-orientation': 0,
1789
  'aria-placeholder': 0,
1790
  'aria-pressed': 0,
1791
  'aria-readonly': 0,
1792
  'aria-required': 0,
1793
  'aria-selected': 0,
1794
  'aria-sort': 0,
1795
  'aria-valuemax': 0,
1796
  'aria-valuemin': 0,
1797
  'aria-valuenow': 0,
1798
  'aria-valuetext': 0,
1799
  // Live Region Attributes
1800
  'aria-atomic': 0,
1801
  'aria-busy': 0,
1802
  'aria-live': 0,
1803
  'aria-relevant': 0,
1804
  // Drag-and-Drop Attributes
1805
  'aria-dropeffect': 0,
1806
  'aria-grabbed': 0,
1807
  // Relationship Attributes
1808
  'aria-activedescendant': 0,
1809
  'aria-colcount': 0,
1810
  'aria-colindex': 0,
1811
  'aria-colspan': 0,
1812
  'aria-controls': 0,
1813
  'aria-describedby': 0,
1814
  'aria-errormessage': 0,
1815
  'aria-flowto': 0,
1816
  'aria-labelledby': 0,
1817
  'aria-owns': 0,
1818
  'aria-posinset': 0,
1819
  'aria-rowcount': 0,
1820
  'aria-rowindex': 0,
1821
  'aria-rowspan': 0,
1822
  'aria-setsize': 0
1823
};
1824
1825
var warnedProperties = {};
1826
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
1827
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
1828
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
1829
1830
function validateProperty(tagName, name) {
1831
  {
1832
    if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
1833
      return true;
1834
    }
1835
1836
    if (rARIACamel.test(name)) {
1837
      var ariaName = 'aria-' + name.slice(4).toLowerCase();
1838
      var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
1839
      // DOM properties, then it is an invalid aria-* attribute.
1840
1841
      if (correctName == null) {
1842
        error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
1843
1844
        warnedProperties[name] = true;
1845
        return true;
1846
      } // aria-* attributes should be lowercase; suggest the lowercase version.
1847
1848
1849
      if (name !== correctName) {
1850
        error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
1851
1852
        warnedProperties[name] = true;
1853
        return true;
1854
      }
1855
    }
1856
1857
    if (rARIA.test(name)) {
1858
      var lowerCasedName = name.toLowerCase();
1859
      var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
1860
      // DOM properties, then it is an invalid aria-* attribute.
1861
1862
      if (standardName == null) {
1863
        warnedProperties[name] = true;
1864
        return false;
1865
      } // aria-* attributes should be lowercase; suggest the lowercase version.
1866
1867
1868
      if (name !== standardName) {
1869
        error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
1870
1871
        warnedProperties[name] = true;
1872
        return true;
1873
      }
1874
    }
1875
  }
1876
1877
  return true;
1878
}
1879
1880
function warnInvalidARIAProps(type, props) {
1881
  {
1882
    var invalidProps = [];
1883
1884
    for (var key in props) {
1885
      var isValid = validateProperty(type, key);
1886
1887
      if (!isValid) {
1888
        invalidProps.push(key);
1889
      }
1890
    }
1891
1892
    var unknownPropString = invalidProps.map(function (prop) {
1893
      return '`' + prop + '`';
1894
    }).join(', ');
1895
1896
    if (invalidProps.length === 1) {
1897
      error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
1898
    } else if (invalidProps.length > 1) {
1899
      error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
1900
    }
1901
  }
1902
}
1903
1904
function validateProperties(type, props) {
1905
  if (isCustomComponent(type, props)) {
1906
    return;
1907
  }
1908
1909
  warnInvalidARIAProps(type, props);
1910
}
1911
1912
var didWarnValueNull = false;
1913
function validateProperties$1(type, props) {
1914
  {
1915
    if (type !== 'input' && type !== 'textarea' && type !== 'select') {
1916
      return;
1917
    }
1918
1919
    if (props != null && props.value === null && !didWarnValueNull) {
1920
      didWarnValueNull = true;
1921
1922
      if (type === 'select' && props.multiple) {
1923
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
1924
      } else {
1925
        error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
1926
      }
1927
    }
1928
  }
1929
}
1930
1931
/**
1932
 * Mapping from registration name to plugin module
1933
 */
1934
1935
var registrationNameModules = {};
1936
/**
1937
 * Mapping from lowercase registration names to the properly cased version,
1938
 * used to warn in the case of missing event handlers. Available
1939
 * only in true.
1940
 * @type {Object}
1941
 */
1942
1943
var possibleRegistrationNames =  {} ; // Trust the developer to only use possibleRegistrationNames in true
1944
1945
// When adding attributes to the HTML or SVG whitelist, be sure to
1946
// also add them to this module to ensure casing and incorrect name
1947
// warnings.
1948
var possibleStandardNames = {
1949
  // HTML
1950
  accept: 'accept',
1951
  acceptcharset: 'acceptCharset',
1952
  'accept-charset': 'acceptCharset',
1953
  accesskey: 'accessKey',
1954
  action: 'action',
1955
  allowfullscreen: 'allowFullScreen',
1956
  alt: 'alt',
1957
  as: 'as',
1958
  async: 'async',
1959
  autocapitalize: 'autoCapitalize',
1960
  autocomplete: 'autoComplete',
1961
  autocorrect: 'autoCorrect',
1962
  autofocus: 'autoFocus',
1963
  autoplay: 'autoPlay',
1964
  autosave: 'autoSave',
1965
  capture: 'capture',
1966
  cellpadding: 'cellPadding',
1967
  cellspacing: 'cellSpacing',
1968
  challenge: 'challenge',
1969
  charset: 'charSet',
1970
  checked: 'checked',
1971
  children: 'children',
1972
  cite: 'cite',
1973
  class: 'className',
1974
  classid: 'classID',
1975
  classname: 'className',
1976
  cols: 'cols',
1977
  colspan: 'colSpan',
1978
  content: 'content',
1979
  contenteditable: 'contentEditable',
1980
  contextmenu: 'contextMenu',
1981
  controls: 'controls',
1982
  controlslist: 'controlsList',
1983
  coords: 'coords',
1984
  crossorigin: 'crossOrigin',
1985
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
1986
  data: 'data',
1987
  datetime: 'dateTime',
1988
  default: 'default',
1989
  defaultchecked: 'defaultChecked',
1990
  defaultvalue: 'defaultValue',
1991
  defer: 'defer',
1992
  dir: 'dir',
1993
  disabled: 'disabled',
1994
  disablepictureinpicture: 'disablePictureInPicture',
1995
  download: 'download',
1996
  draggable: 'draggable',
1997
  enctype: 'encType',
1998
  for: 'htmlFor',
1999
  form: 'form',
2000
  formmethod: 'formMethod',
2001
  formaction: 'formAction',
2002
  formenctype: 'formEncType',
2003
  formnovalidate: 'formNoValidate',
2004
  formtarget: 'formTarget',
2005
  frameborder: 'frameBorder',
2006
  headers: 'headers',
2007
  height: 'height',
2008
  hidden: 'hidden',
2009
  high: 'high',
2010
  href: 'href',
2011
  hreflang: 'hrefLang',
2012
  htmlfor: 'htmlFor',
2013
  httpequiv: 'httpEquiv',
2014
  'http-equiv': 'httpEquiv',
2015
  icon: 'icon',
2016
  id: 'id',
2017
  innerhtml: 'innerHTML',
2018
  inputmode: 'inputMode',
2019
  integrity: 'integrity',
2020
  is: 'is',
2021
  itemid: 'itemID',
2022
  itemprop: 'itemProp',
2023
  itemref: 'itemRef',
2024
  itemscope: 'itemScope',
2025
  itemtype: 'itemType',
2026
  keyparams: 'keyParams',
2027
  keytype: 'keyType',
2028
  kind: 'kind',
2029
  label: 'label',
2030
  lang: 'lang',
2031
  list: 'list',
2032
  loop: 'loop',
2033
  low: 'low',
2034
  manifest: 'manifest',
2035
  marginwidth: 'marginWidth',
2036
  marginheight: 'marginHeight',
2037
  max: 'max',
2038
  maxlength: 'maxLength',
2039
  media: 'media',
2040
  mediagroup: 'mediaGroup',
2041
  method: 'method',
2042
  min: 'min',
2043
  minlength: 'minLength',
2044
  multiple: 'multiple',
2045
  muted: 'muted',
2046
  name: 'name',
2047
  nomodule: 'noModule',
2048
  nonce: 'nonce',
2049
  novalidate: 'noValidate',
2050
  open: 'open',
2051
  optimum: 'optimum',
2052
  pattern: 'pattern',
2053
  placeholder: 'placeholder',
2054
  playsinline: 'playsInline',
2055
  poster: 'poster',
2056
  preload: 'preload',
2057
  profile: 'profile',
2058
  radiogroup: 'radioGroup',
2059
  readonly: 'readOnly',
2060
  referrerpolicy: 'referrerPolicy',
2061
  rel: 'rel',
2062
  required: 'required',
2063
  reversed: 'reversed',
2064
  role: 'role',
2065
  rows: 'rows',
2066
  rowspan: 'rowSpan',
2067
  sandbox: 'sandbox',
2068
  scope: 'scope',
2069
  scoped: 'scoped',
2070
  scrolling: 'scrolling',
2071
  seamless: 'seamless',
2072
  selected: 'selected',
2073
  shape: 'shape',
2074
  size: 'size',
2075
  sizes: 'sizes',
2076
  span: 'span',
2077
  spellcheck: 'spellCheck',
2078
  src: 'src',
2079
  srcdoc: 'srcDoc',
2080
  srclang: 'srcLang',
2081
  srcset: 'srcSet',
2082
  start: 'start',
2083
  step: 'step',
2084
  style: 'style',
2085
  summary: 'summary',
2086
  tabindex: 'tabIndex',
2087
  target: 'target',
2088
  title: 'title',
2089
  type: 'type',
2090
  usemap: 'useMap',
2091
  value: 'value',
2092
  width: 'width',
2093
  wmode: 'wmode',
2094
  wrap: 'wrap',
2095
  // SVG
2096
  about: 'about',
2097
  accentheight: 'accentHeight',
2098
  'accent-height': 'accentHeight',
2099
  accumulate: 'accumulate',
2100
  additive: 'additive',
2101
  alignmentbaseline: 'alignmentBaseline',
2102
  'alignment-baseline': 'alignmentBaseline',
2103
  allowreorder: 'allowReorder',
2104
  alphabetic: 'alphabetic',
2105
  amplitude: 'amplitude',
2106
  arabicform: 'arabicForm',
2107
  'arabic-form': 'arabicForm',
2108
  ascent: 'ascent',
2109
  attributename: 'attributeName',
2110
  attributetype: 'attributeType',
2111
  autoreverse: 'autoReverse',
2112
  azimuth: 'azimuth',
2113
  basefrequency: 'baseFrequency',
2114
  baselineshift: 'baselineShift',
2115
  'baseline-shift': 'baselineShift',
2116
  baseprofile: 'baseProfile',
2117
  bbox: 'bbox',
2118
  begin: 'begin',
2119
  bias: 'bias',
2120
  by: 'by',
2121
  calcmode: 'calcMode',
2122
  capheight: 'capHeight',
2123
  'cap-height': 'capHeight',
2124
  clip: 'clip',
2125
  clippath: 'clipPath',
2126
  'clip-path': 'clipPath',
2127
  clippathunits: 'clipPathUnits',
2128
  cliprule: 'clipRule',
2129
  'clip-rule': 'clipRule',
2130
  color: 'color',
2131
  colorinterpolation: 'colorInterpolation',
2132
  'color-interpolation': 'colorInterpolation',
2133
  colorinterpolationfilters: 'colorInterpolationFilters',
2134
  'color-interpolation-filters': 'colorInterpolationFilters',
2135
  colorprofile: 'colorProfile',
2136
  'color-profile': 'colorProfile',
2137
  colorrendering: 'colorRendering',
2138
  'color-rendering': 'colorRendering',
2139
  contentscripttype: 'contentScriptType',
2140
  contentstyletype: 'contentStyleType',
2141
  cursor: 'cursor',
2142
  cx: 'cx',
2143
  cy: 'cy',
2144
  d: 'd',
2145
  datatype: 'datatype',
2146
  decelerate: 'decelerate',
2147
  descent: 'descent',
2148
  diffuseconstant: 'diffuseConstant',
2149
  direction: 'direction',
2150
  display: 'display',
2151
  divisor: 'divisor',
2152
  dominantbaseline: 'dominantBaseline',
2153
  'dominant-baseline': 'dominantBaseline',
2154
  dur: 'dur',
2155
  dx: 'dx',
2156
  dy: 'dy',
2157
  edgemode: 'edgeMode',
2158
  elevation: 'elevation',
2159
  enablebackground: 'enableBackground',
2160
  'enable-background': 'enableBackground',
2161
  end: 'end',
2162
  exponent: 'exponent',
2163
  externalresourcesrequired: 'externalResourcesRequired',
2164
  fill: 'fill',
2165
  fillopacity: 'fillOpacity',
2166
  'fill-opacity': 'fillOpacity',
2167
  fillrule: 'fillRule',
2168
  'fill-rule': 'fillRule',
2169
  filter: 'filter',
2170
  filterres: 'filterRes',
2171
  filterunits: 'filterUnits',
2172
  floodopacity: 'floodOpacity',
2173
  'flood-opacity': 'floodOpacity',
2174
  floodcolor: 'floodColor',
2175
  'flood-color': 'floodColor',
2176
  focusable: 'focusable',
2177
  fontfamily: 'fontFamily',
2178
  'font-family': 'fontFamily',
2179
  fontsize: 'fontSize',
2180
  'font-size': 'fontSize',
2181
  fontsizeadjust: 'fontSizeAdjust',
2182
  'font-size-adjust': 'fontSizeAdjust',
2183
  fontstretch: 'fontStretch',
2184
  'font-stretch': 'fontStretch',
2185
  fontstyle: 'fontStyle',
2186
  'font-style': 'fontStyle',
2187
  fontvariant: 'fontVariant',
2188
  'font-variant': 'fontVariant',
2189
  fontweight: 'fontWeight',
2190
  'font-weight': 'fontWeight',
2191
  format: 'format',
2192
  from: 'from',
2193
  fx: 'fx',
2194
  fy: 'fy',
2195
  g1: 'g1',
2196
  g2: 'g2',
2197
  glyphname: 'glyphName',
2198
  'glyph-name': 'glyphName',
2199
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
2200
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
2201
  glyphorientationvertical: 'glyphOrientationVertical',
2202
  'glyph-orientation-vertical': 'glyphOrientationVertical',
2203
  glyphref: 'glyphRef',
2204
  gradienttransform: 'gradientTransform',
2205
  gradientunits: 'gradientUnits',
2206
  hanging: 'hanging',
2207
  horizadvx: 'horizAdvX',
2208
  'horiz-adv-x': 'horizAdvX',
2209
  horizoriginx: 'horizOriginX',
2210
  'horiz-origin-x': 'horizOriginX',
2211
  ideographic: 'ideographic',
2212
  imagerendering: 'imageRendering',
2213
  'image-rendering': 'imageRendering',
2214
  in2: 'in2',
2215
  in: 'in',
2216
  inlist: 'inlist',
2217
  intercept: 'intercept',
2218
  k1: 'k1',
2219
  k2: 'k2',
2220
  k3: 'k3',
2221
  k4: 'k4',
2222
  k: 'k',
2223
  kernelmatrix: 'kernelMatrix',
2224
  kernelunitlength: 'kernelUnitLength',
2225
  kerning: 'kerning',
2226
  keypoints: 'keyPoints',
2227
  keysplines: 'keySplines',
2228
  keytimes: 'keyTimes',
2229
  lengthadjust: 'lengthAdjust',
2230
  letterspacing: 'letterSpacing',
2231
  'letter-spacing': 'letterSpacing',
2232
  lightingcolor: 'lightingColor',
2233
  'lighting-color': 'lightingColor',
2234
  limitingconeangle: 'limitingConeAngle',
2235
  local: 'local',
2236
  markerend: 'markerEnd',
2237
  'marker-end': 'markerEnd',
2238
  markerheight: 'markerHeight',
2239
  markermid: 'markerMid',
2240
  'marker-mid': 'markerMid',
2241
  markerstart: 'markerStart',
2242
  'marker-start': 'markerStart',
2243
  markerunits: 'markerUnits',
2244
  markerwidth: 'markerWidth',
2245
  mask: 'mask',
2246
  maskcontentunits: 'maskContentUnits',
2247
  maskunits: 'maskUnits',
2248
  mathematical: 'mathematical',
2249
  mode: 'mode',
2250
  numoctaves: 'numOctaves',
2251
  offset: 'offset',
2252
  opacity: 'opacity',
2253
  operator: 'operator',
2254
  order: 'order',
2255
  orient: 'orient',
2256
  orientation: 'orientation',
2257
  origin: 'origin',
2258
  overflow: 'overflow',
2259
  overlineposition: 'overlinePosition',
2260
  'overline-position': 'overlinePosition',
2261
  overlinethickness: 'overlineThickness',
2262
  'overline-thickness': 'overlineThickness',
2263
  paintorder: 'paintOrder',
2264
  'paint-order': 'paintOrder',
2265
  panose1: 'panose1',
2266
  'panose-1': 'panose1',
2267
  pathlength: 'pathLength',
2268
  patterncontentunits: 'patternContentUnits',
2269
  patterntransform: 'patternTransform',
2270
  patternunits: 'patternUnits',
2271
  pointerevents: 'pointerEvents',
2272
  'pointer-events': 'pointerEvents',
2273
  points: 'points',
2274
  pointsatx: 'pointsAtX',
2275
  pointsaty: 'pointsAtY',
2276
  pointsatz: 'pointsAtZ',
2277
  prefix: 'prefix',
2278
  preservealpha: 'preserveAlpha',
2279
  preserveaspectratio: 'preserveAspectRatio',
2280
  primitiveunits: 'primitiveUnits',
2281
  property: 'property',
2282
  r: 'r',
2283
  radius: 'radius',
2284
  refx: 'refX',
2285
  refy: 'refY',
2286
  renderingintent: 'renderingIntent',
2287
  'rendering-intent': 'renderingIntent',
2288
  repeatcount: 'repeatCount',
2289
  repeatdur: 'repeatDur',
2290
  requiredextensions: 'requiredExtensions',
2291
  requiredfeatures: 'requiredFeatures',
2292
  resource: 'resource',
2293
  restart: 'restart',
2294
  result: 'result',
2295
  results: 'results',
2296
  rotate: 'rotate',
2297
  rx: 'rx',
2298
  ry: 'ry',
2299
  scale: 'scale',
2300
  security: 'security',
2301
  seed: 'seed',
2302
  shaperendering: 'shapeRendering',
2303
  'shape-rendering': 'shapeRendering',
2304
  slope: 'slope',
2305
  spacing: 'spacing',
2306
  specularconstant: 'specularConstant',
2307
  specularexponent: 'specularExponent',
2308
  speed: 'speed',
2309
  spreadmethod: 'spreadMethod',
2310
  startoffset: 'startOffset',
2311
  stddeviation: 'stdDeviation',
2312
  stemh: 'stemh',
2313
  stemv: 'stemv',
2314
  stitchtiles: 'stitchTiles',
2315
  stopcolor: 'stopColor',
2316
  'stop-color': 'stopColor',
2317
  stopopacity: 'stopOpacity',
2318
  'stop-opacity': 'stopOpacity',
2319
  strikethroughposition: 'strikethroughPosition',
2320
  'strikethrough-position': 'strikethroughPosition',
2321
  strikethroughthickness: 'strikethroughThickness',
2322
  'strikethrough-thickness': 'strikethroughThickness',
2323
  string: 'string',
2324
  stroke: 'stroke',
2325
  strokedasharray: 'strokeDasharray',
2326
  'stroke-dasharray': 'strokeDasharray',
2327
  strokedashoffset: 'strokeDashoffset',
2328
  'stroke-dashoffset': 'strokeDashoffset',
2329
  strokelinecap: 'strokeLinecap',
2330
  'stroke-linecap': 'strokeLinecap',
2331
  strokelinejoin: 'strokeLinejoin',
2332
  'stroke-linejoin': 'strokeLinejoin',
2333
  strokemiterlimit: 'strokeMiterlimit',
2334
  'stroke-miterlimit': 'strokeMiterlimit',
2335
  strokewidth: 'strokeWidth',
2336
  'stroke-width': 'strokeWidth',
2337
  strokeopacity: 'strokeOpacity',
2338
  'stroke-opacity': 'strokeOpacity',
2339
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
2340
  suppresshydrationwarning: 'suppressHydrationWarning',
2341
  surfacescale: 'surfaceScale',
2342
  systemlanguage: 'systemLanguage',
2343
  tablevalues: 'tableValues',
2344
  targetx: 'targetX',
2345
  targety: 'targetY',
2346
  textanchor: 'textAnchor',
2347
  'text-anchor': 'textAnchor',
2348
  textdecoration: 'textDecoration',
2349
  'text-decoration': 'textDecoration',
2350
  textlength: 'textLength',
2351
  textrendering: 'textRendering',
2352
  'text-rendering': 'textRendering',
2353
  to: 'to',
2354
  transform: 'transform',
2355
  typeof: 'typeof',
2356
  u1: 'u1',
2357
  u2: 'u2',
2358
  underlineposition: 'underlinePosition',
2359
  'underline-position': 'underlinePosition',
2360
  underlinethickness: 'underlineThickness',
2361
  'underline-thickness': 'underlineThickness',
2362
  unicode: 'unicode',
2363
  unicodebidi: 'unicodeBidi',
2364
  'unicode-bidi': 'unicodeBidi',
2365
  unicoderange: 'unicodeRange',
2366
  'unicode-range': 'unicodeRange',
2367
  unitsperem: 'unitsPerEm',
2368
  'units-per-em': 'unitsPerEm',
2369
  unselectable: 'unselectable',
2370
  valphabetic: 'vAlphabetic',
2371
  'v-alphabetic': 'vAlphabetic',
2372
  values: 'values',
2373
  vectoreffect: 'vectorEffect',
2374
  'vector-effect': 'vectorEffect',
2375
  version: 'version',
2376
  vertadvy: 'vertAdvY',
2377
  'vert-adv-y': 'vertAdvY',
2378
  vertoriginx: 'vertOriginX',
2379
  'vert-origin-x': 'vertOriginX',
2380
  vertoriginy: 'vertOriginY',
2381
  'vert-origin-y': 'vertOriginY',
2382
  vhanging: 'vHanging',
2383
  'v-hanging': 'vHanging',
2384
  videographic: 'vIdeographic',
2385
  'v-ideographic': 'vIdeographic',
2386
  viewbox: 'viewBox',
2387
  viewtarget: 'viewTarget',
2388
  visibility: 'visibility',
2389
  vmathematical: 'vMathematical',
2390
  'v-mathematical': 'vMathematical',
2391
  vocab: 'vocab',
2392
  widths: 'widths',
2393
  wordspacing: 'wordSpacing',
2394
  'word-spacing': 'wordSpacing',
2395
  writingmode: 'writingMode',
2396
  'writing-mode': 'writingMode',
2397
  x1: 'x1',
2398
  x2: 'x2',
2399
  x: 'x',
2400
  xchannelselector: 'xChannelSelector',
2401
  xheight: 'xHeight',
2402
  'x-height': 'xHeight',
2403
  xlinkactuate: 'xlinkActuate',
2404
  'xlink:actuate': 'xlinkActuate',
2405
  xlinkarcrole: 'xlinkArcrole',
2406
  'xlink:arcrole': 'xlinkArcrole',
2407
  xlinkhref: 'xlinkHref',
2408
  'xlink:href': 'xlinkHref',
2409
  xlinkrole: 'xlinkRole',
2410
  'xlink:role': 'xlinkRole',
2411
  xlinkshow: 'xlinkShow',
2412
  'xlink:show': 'xlinkShow',
2413
  xlinktitle: 'xlinkTitle',
2414
  'xlink:title': 'xlinkTitle',
2415
  xlinktype: 'xlinkType',
2416
  'xlink:type': 'xlinkType',
2417
  xmlbase: 'xmlBase',
2418
  'xml:base': 'xmlBase',
2419
  xmllang: 'xmlLang',
2420
  'xml:lang': 'xmlLang',
2421
  xmlns: 'xmlns',
2422
  'xml:space': 'xmlSpace',
2423
  xmlnsxlink: 'xmlnsXlink',
2424
  'xmlns:xlink': 'xmlnsXlink',
2425
  xmlspace: 'xmlSpace',
2426
  y1: 'y1',
2427
  y2: 'y2',
2428
  y: 'y',
2429
  ychannelselector: 'yChannelSelector',
2430
  z: 'z',
2431
  zoomandpan: 'zoomAndPan'
2432
};
2433
2434
var validateProperty$1 = function () {};
2435
2436
{
2437
  var warnedProperties$1 = {};
2438
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
2439
  var EVENT_NAME_REGEX = /^on./;
2440
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
2441
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
2442
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
2443
2444
  validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
2445
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
2446
      return true;
2447
    }
2448
2449
    var lowerCasedName = name.toLowerCase();
2450
2451
    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
2452
      error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
2453
2454
      warnedProperties$1[name] = true;
2455
      return true;
2456
    } // We can't rely on the event system being injected on the server.
2457
2458
2459
    if (canUseEventSystem) {
2460
      if (registrationNameModules.hasOwnProperty(name)) {
2461
        return true;
2462
      }
2463
2464
      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
2465
2466
      if (registrationName != null) {
2467
        error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
2468
2469
        warnedProperties$1[name] = true;
2470
        return true;
2471
      }
2472
2473
      if (EVENT_NAME_REGEX.test(name)) {
2474
        error('Unknown event handler property `%s`. It will be ignored.', name);
2475
2476
        warnedProperties$1[name] = true;
2477
        return true;
2478
      }
2479
    } else if (EVENT_NAME_REGEX.test(name)) {
2480
      // If no event plugins have been injected, we are in a server environment.
2481
      // So we can't tell if the event name is correct for sure, but we can filter
2482
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
2483
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
2484
        error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
2485
      }
2486
2487
      warnedProperties$1[name] = true;
2488
      return true;
2489
    } // Let the ARIA attribute hook validate ARIA attributes
2490
2491
2492
    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
2493
      return true;
2494
    }
2495
2496
    if (lowerCasedName === 'innerhtml') {
2497
      error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
2498
2499
      warnedProperties$1[name] = true;
2500
      return true;
2501
    }
2502
2503
    if (lowerCasedName === 'aria') {
2504
      error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
2505
2506
      warnedProperties$1[name] = true;
2507
      return true;
2508
    }
2509
2510
    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
2511
      error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
2512
2513
      warnedProperties$1[name] = true;
2514
      return true;
2515
    }
2516
2517
    if (typeof value === 'number' && isNaN(value)) {
2518
      error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
2519
2520
      warnedProperties$1[name] = true;
2521
      return true;
2522
    }
2523
2524
    var propertyInfo = getPropertyInfo(name);
2525
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
2526
2527
    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
2528
      var standardName = possibleStandardNames[lowerCasedName];
2529
2530
      if (standardName !== name) {
2531
        error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
2532
2533
        warnedProperties$1[name] = true;
2534
        return true;
2535
      }
2536
    } else if (!isReserved && name !== lowerCasedName) {
2537
      // Unknown attributes should have lowercase casing since that's how they
2538
      // will be cased anyway with server rendering.
2539
      error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
2540
2541
      warnedProperties$1[name] = true;
2542
      return true;
2543
    }
2544
2545
    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
2546
      if (value) {
2547
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
2548
      } else {
2549
        error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
2550
      }
2551
2552
      warnedProperties$1[name] = true;
2553
      return true;
2554
    } // Now that we've validated casing, do not validate
2555
    // data types for reserved props
2556
2557
2558
    if (isReserved) {
2559
      return true;
2560
    } // Warn when a known attribute is a bad type
2561
2562
2563
    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
2564
      warnedProperties$1[name] = true;
2565
      return false;
2566
    } // Warn when passing the strings 'false' or 'true' into a boolean prop
2567
2568
2569
    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
2570
      error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
2571
2572
      warnedProperties$1[name] = true;
2573
      return true;
2574
    }
2575
2576
    return true;
2577
  };
2578
}
2579
2580
var warnUnknownProperties = function (type, props, canUseEventSystem) {
2581
  {
2582
    var unknownProps = [];
2583
2584
    for (var key in props) {
2585
      var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
2586
2587
      if (!isValid) {
2588
        unknownProps.push(key);
2589
      }
2590
    }
2591
2592
    var unknownPropString = unknownProps.map(function (prop) {
2593
      return '`' + prop + '`';
2594
    }).join(', ');
2595
2596
    if (unknownProps.length === 1) {
2597
      error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
2598
    } else if (unknownProps.length > 1) {
2599
      error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
2600
    }
2601
  }
2602
};
2603
2604
function validateProperties$2(type, props, canUseEventSystem) {
2605
  if (isCustomComponent(type, props)) {
2606
    return;
2607
  }
2608
2609
  warnUnknownProperties(type, props, canUseEventSystem);
2610
}
2611
2612
var toArray = React.Children.toArray; // This is only used in DEV.
2613
// Each entry is `this.stack` from a currently executing renderer instance.
2614
// (There may be more than one because ReactDOMServer is reentrant).
2615
// Each stack is an array of frames which may contain nested stacks of elements.
2616
2617
var currentDebugStacks = [];
2618
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
2619
var ReactDebugCurrentFrame$4;
2620
var prevGetCurrentStackImpl = null;
2621
2622
var getCurrentServerStackImpl = function () {
2623
  return '';
2624
};
2625
2626
var describeStackFrame = function (element) {
2627
  return '';
2628
};
2629
2630
var validatePropertiesInDevelopment = function (type, props) {};
2631
2632
var pushCurrentDebugStack = function (stack) {};
2633
2634
var pushElementToDebugStack = function (element) {};
2635
2636
var popCurrentDebugStack = function () {};
2637
2638
var hasWarnedAboutUsingContextAsConsumer = false;
2639
2640
{
2641
  ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
2642
2643
  validatePropertiesInDevelopment = function (type, props) {
2644
    validateProperties(type, props);
2645
    validateProperties$1(type, props);
2646
    validateProperties$2(type, props,
2647
    /* canUseEventSystem */
2648
    false);
2649
  };
2650
2651
  describeStackFrame = function (element) {
2652
    var source = element._source;
2653
    var type = element.type;
2654
    var name = getComponentName(type);
2655
    var ownerName = null;
2656
    return describeComponentFrame(name, source, ownerName);
2657
  };
2658
2659
  pushCurrentDebugStack = function (stack) {
2660
    currentDebugStacks.push(stack);
2661
2662
    if (currentDebugStacks.length === 1) {
2663
      // We are entering a server renderer.
2664
      // Remember the previous (e.g. client) global stack implementation.
2665
      prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack;
2666
      ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl;
2667
    }
2668
  };
2669
2670
  pushElementToDebugStack = function (element) {
2671
    // For the innermost executing ReactDOMServer call,
2672
    var stack = currentDebugStacks[currentDebugStacks.length - 1]; // Take the innermost executing frame (e.g. <Foo>),
2673
2674
    var frame = stack[stack.length - 1]; // and record that it has one more element associated with it.
2675
2676
    frame.debugElementStack.push(element); // We only need this because we tail-optimize single-element
2677
    // children and directly handle them in an inner loop instead of
2678
    // creating separate frames for them.
2679
  };
2680
2681
  popCurrentDebugStack = function () {
2682
    currentDebugStacks.pop();
2683
2684
    if (currentDebugStacks.length === 0) {
2685
      // We are exiting the server renderer.
2686
      // Restore the previous (e.g. client) global stack implementation.
2687
      ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl;
2688
      prevGetCurrentStackImpl = null;
2689
    }
2690
  };
2691
2692
  getCurrentServerStackImpl = function () {
2693
    if (currentDebugStacks.length === 0) {
2694
      // Nothing is currently rendering.
2695
      return '';
2696
    } // ReactDOMServer is reentrant so there may be multiple calls at the same time.
2697
    // Take the frames from the innermost call which is the last in the array.
2698
2699
2700
    var frames = currentDebugStacks[currentDebugStacks.length - 1];
2701
    var stack = ''; // Go through every frame in the stack from the innermost one.
2702
2703
    for (var i = frames.length - 1; i >= 0; i--) {
2704
      var frame = frames[i]; // Every frame might have more than one debug element stack entry associated with it.
2705
      // This is because single-child nesting doesn't create materialized frames.
2706
      // Instead it would push them through `pushElementToDebugStack()`.
2707
2708
      var debugElementStack = frame.debugElementStack;
2709
2710
      for (var ii = debugElementStack.length - 1; ii >= 0; ii--) {
2711
        stack += describeStackFrame(debugElementStack[ii]);
2712
      }
2713
    }
2714
2715
    return stack;
2716
  };
2717
}
2718
2719
var didWarnDefaultInputValue = false;
2720
var didWarnDefaultChecked = false;
2721
var didWarnDefaultSelectValue = false;
2722
var didWarnDefaultTextareaValue = false;
2723
var didWarnInvalidOptionChildren = false;
2724
var didWarnAboutNoopUpdateForComponent = {};
2725
var didWarnAboutBadClass = {};
2726
var didWarnAboutModulePatternComponent = {};
2727
var didWarnAboutDeprecatedWillMount = {};
2728
var didWarnAboutUndefinedDerivedState = {};
2729
var didWarnAboutUninitializedState = {};
2730
var valuePropNames = ['value', 'defaultValue'];
2731
var newlineEatingTags = {
2732
  listing: true,
2733
  pre: true,
2734
  textarea: true
2735
}; // We accept any tag to be rendered but since this gets injected into arbitrary
2736
// HTML, we want to make sure that it's a safe tag.
2737
// http://www.w3.org/TR/REC-xml/#NT-Name
2738
2739
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
2740
2741
var validatedTagCache = {};
2742
2743
function validateDangerousTag(tag) {
2744
  if (!validatedTagCache.hasOwnProperty(tag)) {
2745
    if (!VALID_TAG_REGEX.test(tag)) {
2746
      {
2747
        throw Error( "Invalid tag: " + tag );
2748
      }
2749
    }
2750
2751
    validatedTagCache[tag] = true;
2752
  }
2753
}
2754
2755
var styleNameCache = {};
2756
2757
var processStyleName = function (styleName) {
2758
  if (styleNameCache.hasOwnProperty(styleName)) {
2759
    return styleNameCache[styleName];
2760
  }
2761
2762
  var result = hyphenateStyleName(styleName);
2763
  styleNameCache[styleName] = result;
2764
  return result;
2765
};
2766
2767
function createMarkupForStyles(styles) {
2768
  var serialized = '';
2769
  var delimiter = '';
2770
2771
  for (var styleName in styles) {
2772
    if (!styles.hasOwnProperty(styleName)) {
2773
      continue;
2774
    }
2775
2776
    var isCustomProperty = styleName.indexOf('--') === 0;
2777
    var styleValue = styles[styleName];
2778
2779
    {
2780
      if (!isCustomProperty) {
2781
        warnValidStyle$1(styleName, styleValue);
2782
      }
2783
    }
2784
2785
    if (styleValue != null) {
2786
      serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';
2787
      serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
2788
      delimiter = ';';
2789
    }
2790
  }
2791
2792
  return serialized || null;
2793
}
2794
2795
function warnNoop(publicInstance, callerName) {
2796
  {
2797
    var _constructor = publicInstance.constructor;
2798
    var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
2799
    var warningKey = componentName + '.' + callerName;
2800
2801
    if (didWarnAboutNoopUpdateForComponent[warningKey]) {
2802
      return;
2803
    }
2804
2805
    error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
2806
2807
    didWarnAboutNoopUpdateForComponent[warningKey] = true;
2808
  }
2809
}
2810
2811
function shouldConstruct(Component) {
2812
  return Component.prototype && Component.prototype.isReactComponent;
2813
}
2814
2815
function getNonChildrenInnerMarkup(props) {
2816
  var innerHTML = props.dangerouslySetInnerHTML;
2817
2818
  if (innerHTML != null) {
2819
    if (innerHTML.__html != null) {
2820
      return innerHTML.__html;
2821
    }
2822
  } else {
2823
    var content = props.children;
2824
2825
    if (typeof content === 'string' || typeof content === 'number') {
2826
      return escapeTextForBrowser(content);
2827
    }
2828
  }
2829
2830
  return null;
2831
}
2832
2833
function flattenTopLevelChildren(children) {
2834
  if (!React.isValidElement(children)) {
2835
    return toArray(children);
2836
  }
2837
2838
  var element = children;
2839
2840
  if (element.type !== REACT_FRAGMENT_TYPE) {
2841
    return [element];
2842
  }
2843
2844
  var fragmentChildren = element.props.children;
2845
2846
  if (!React.isValidElement(fragmentChildren)) {
2847
    return toArray(fragmentChildren);
2848
  }
2849
2850
  var fragmentChildElement = fragmentChildren;
2851
  return [fragmentChildElement];
2852
}
2853
2854
function flattenOptionChildren(children) {
2855
  if (children === undefined || children === null) {
2856
    return children;
2857
  }
2858
2859
  var content = ''; // Flatten children and warn if they aren't strings or numbers;
2860
  // invalid types are ignored.
2861
2862
  React.Children.forEach(children, function (child) {
2863
    if (child == null) {
2864
      return;
2865
    }
2866
2867
    content += child;
2868
2869
    {
2870
      if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
2871
        didWarnInvalidOptionChildren = true;
2872
2873
        error('Only strings and numbers are supported as <option> children.');
2874
      }
2875
    }
2876
  });
2877
  return content;
2878
}
2879
2880
var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
2881
var STYLE = 'style';
2882
var RESERVED_PROPS = {
2883
  children: null,
2884
  dangerouslySetInnerHTML: null,
2885
  suppressContentEditableWarning: null,
2886
  suppressHydrationWarning: null
2887
};
2888
2889
function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeStaticMarkup, isRootElement) {
2890
  var ret = '<' + tagVerbatim;
2891
2892
  for (var propKey in props) {
2893
    if (!hasOwnProperty$2.call(props, propKey)) {
2894
      continue;
2895
    }
2896
2897
    var propValue = props[propKey];
2898
2899
    if (propValue == null) {
2900
      continue;
2901
    }
2902
2903
    if (propKey === STYLE) {
2904
      propValue = createMarkupForStyles(propValue);
2905
    }
2906
2907
    var markup = null;
2908
2909
    if (isCustomComponent(tagLowercase, props)) {
2910
      if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
2911
        markup = createMarkupForCustomAttribute(propKey, propValue);
2912
      }
2913
    } else {
2914
      markup = createMarkupForProperty(propKey, propValue);
2915
    }
2916
2917
    if (markup) {
2918
      ret += ' ' + markup;
2919
    }
2920
  } // For static pages, no need to put React ID and checksum. Saves lots of
2921
  // bytes.
2922
2923
2924
  if (makeStaticMarkup) {
2925
    return ret;
2926
  }
2927
2928
  if (isRootElement) {
2929
    ret += ' ' + createMarkupForRoot();
2930
  }
2931
2932
  return ret;
2933
}
2934
2935
function validateRenderResult(child, type) {
2936
  if (child === undefined) {
2937
    {
2938
      {
2939
        throw Error( (getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
2940
      }
2941
    }
2942
  }
2943
}
2944
2945
function resolve(child, context, threadID) {
2946
  while (React.isValidElement(child)) {
2947
    // Safe because we just checked it's an element.
2948
    var element = child;
2949
    var Component = element.type;
2950
2951
    {
2952
      pushElementToDebugStack(element);
2953
    }
2954
2955
    if (typeof Component !== 'function') {
2956
      break;
2957
    }
2958
2959
    processChild(element, Component);
2960
  } // Extra closure so queue and replace can be captured properly
2961
2962
2963
  function processChild(element, Component) {
2964
    var isClass = shouldConstruct(Component);
2965
    var publicContext = processContext(Component, context, threadID, isClass);
2966
    var queue = [];
2967
    var replace = false;
2968
    var updater = {
2969
      isMounted: function (publicInstance) {
2970
        return false;
2971
      },
2972
      enqueueForceUpdate: function (publicInstance) {
2973
        if (queue === null) {
2974
          warnNoop(publicInstance, 'forceUpdate');
2975
          return null;
2976
        }
2977
      },
2978
      enqueueReplaceState: function (publicInstance, completeState) {
2979
        replace = true;
2980
        queue = [completeState];
2981
      },
2982
      enqueueSetState: function (publicInstance, currentPartialState) {
2983
        if (queue === null) {
2984
          warnNoop(publicInstance, 'setState');
2985
          return null;
2986
        }
2987
2988
        queue.push(currentPartialState);
2989
      }
2990
    };
2991
    var inst;
2992
2993
    if (isClass) {
2994
      inst = new Component(element.props, publicContext, updater);
2995
2996
      if (typeof Component.getDerivedStateFromProps === 'function') {
2997
        {
2998
          if (inst.state === null || inst.state === undefined) {
2999
            var componentName = getComponentName(Component) || 'Unknown';
3000
3001
            if (!didWarnAboutUninitializedState[componentName]) {
3002
              error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
3003
3004
              didWarnAboutUninitializedState[componentName] = true;
3005
            }
3006
          }
3007
        }
3008
3009
        var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
3010
3011
        {
3012
          if (partialState === undefined) {
3013
            var _componentName = getComponentName(Component) || 'Unknown';
3014
3015
            if (!didWarnAboutUndefinedDerivedState[_componentName]) {
3016
              error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
3017
3018
              didWarnAboutUndefinedDerivedState[_componentName] = true;
3019
            }
3020
          }
3021
        }
3022
3023
        if (partialState != null) {
3024
          inst.state = _assign({}, inst.state, partialState);
3025
        }
3026
      }
3027
    } else {
3028
      {
3029
        if (Component.prototype && typeof Component.prototype.render === 'function') {
3030
          var _componentName2 = getComponentName(Component) || 'Unknown';
3031
3032
          if (!didWarnAboutBadClass[_componentName2]) {
3033
            error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
3034
3035
            didWarnAboutBadClass[_componentName2] = true;
3036
          }
3037
        }
3038
      }
3039
3040
      var componentIdentity = {};
3041
      prepareToUseHooks(componentIdentity);
3042
      inst = Component(element.props, publicContext, updater);
3043
      inst = finishHooks(Component, element.props, inst, publicContext);
3044
3045
      if (inst == null || inst.render == null) {
3046
        child = inst;
3047
        validateRenderResult(child, Component);
3048
        return;
3049
      }
3050
3051
      {
3052
        var _componentName3 = getComponentName(Component) || 'Unknown';
3053
3054
        if (!didWarnAboutModulePatternComponent[_componentName3]) {
3055
          error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName3, _componentName3, _componentName3);
3056
3057
          didWarnAboutModulePatternComponent[_componentName3] = true;
3058
        }
3059
      }
3060
    }
3061
3062
    inst.props = element.props;
3063
    inst.context = publicContext;
3064
    inst.updater = updater;
3065
    var initialState = inst.state;
3066
3067
    if (initialState === undefined) {
3068
      inst.state = initialState = null;
3069
    }
3070
3071
    if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
3072
      if (typeof inst.componentWillMount === 'function') {
3073
        {
3074
          if ( inst.componentWillMount.__suppressDeprecationWarning !== true) {
3075
            var _componentName4 = getComponentName(Component) || 'Unknown';
3076
3077
            if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
3078
              warn( // keep this warning in sync with ReactStrictModeWarning.js
3079
              'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\n' + '\nPlease update the following components: %s', _componentName4);
3080
3081
              didWarnAboutDeprecatedWillMount[_componentName4] = true;
3082
            }
3083
          }
3084
        } // In order to support react-lifecycles-compat polyfilled components,
3085
        // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
3086
3087
3088
        if (typeof Component.getDerivedStateFromProps !== 'function') {
3089
          inst.componentWillMount();
3090
        }
3091
      }
3092
3093
      if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
3094
        // In order to support react-lifecycles-compat polyfilled components,
3095
        // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
3096
        inst.UNSAFE_componentWillMount();
3097
      }
3098
3099
      if (queue.length) {
3100
        var oldQueue = queue;
3101
        var oldReplace = replace;
3102
        queue = null;
3103
        replace = false;
3104
3105
        if (oldReplace && oldQueue.length === 1) {
3106
          inst.state = oldQueue[0];
3107
        } else {
3108
          var nextState = oldReplace ? oldQueue[0] : inst.state;
3109
          var dontMutate = true;
3110
3111
          for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
3112
            var partial = oldQueue[i];
3113
3114
            var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
3115
3116
            if (_partialState != null) {
3117
              if (dontMutate) {
3118
                dontMutate = false;
3119
                nextState = _assign({}, nextState, _partialState);
3120
              } else {
3121
                _assign(nextState, _partialState);
3122
              }
3123
            }
3124
          }
3125
3126
          inst.state = nextState;
3127
        }
3128
      } else {
3129
        queue = null;
3130
      }
3131
    }
3132
3133
    child = inst.render();
3134
3135
    {
3136
      if (child === undefined && inst.render._isMockFunction) {
3137
        // This is probably bad practice. Consider warning here and
3138
        // deprecating this convenience.
3139
        child = null;
3140
      }
3141
    }
3142
3143
    validateRenderResult(child, Component);
3144
    var childContext;
3145
3146
    {
3147
      if (typeof inst.getChildContext === 'function') {
3148
        var _childContextTypes = Component.childContextTypes;
3149
3150
        if (typeof _childContextTypes === 'object') {
3151
          childContext = inst.getChildContext();
3152
3153
          for (var contextKey in childContext) {
3154
            if (!(contextKey in _childContextTypes)) {
3155
              {
3156
                throw Error( (getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
3157
              }
3158
            }
3159
          }
3160
        } else {
3161
          {
3162
            error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
3163
          }
3164
        }
3165
      }
3166
3167
      if (childContext) {
3168
        context = _assign({}, context, childContext);
3169
      }
3170
    }
3171
  }
3172
3173
  return {
3174
    child: child,
3175
    context: context
3176
  };
3177
}
3178
3179
var ReactDOMServerRenderer =
3180
/*#__PURE__*/
3181
function () {
3182
  // TODO: type this more strictly:
3183
  // DEV-only
3184
  function ReactDOMServerRenderer(children, makeStaticMarkup) {
3185
    var flatChildren = flattenTopLevelChildren(children);
3186
    var topFrame = {
3187
      type: null,
3188
      // Assume all trees start in the HTML namespace (not totally true, but
3189
      // this is what we did historically)
3190
      domNamespace: Namespaces.html,
3191
      children: flatChildren,
3192
      childIndex: 0,
3193
      context: emptyObject,
3194
      footer: ''
3195
    };
3196
3197
    {
3198
      topFrame.debugElementStack = [];
3199
    }
3200
3201
    this.threadID = allocThreadID();
3202
    this.stack = [topFrame];
3203
    this.exhausted = false;
3204
    this.currentSelectValue = null;
3205
    this.previousWasTextNode = false;
3206
    this.makeStaticMarkup = makeStaticMarkup;
3207
    this.suspenseDepth = 0; // Context (new API)
3208
3209
    this.contextIndex = -1;
3210
    this.contextStack = [];
3211
    this.contextValueStack = [];
3212
3213
    {
3214
      this.contextProviderStack = [];
3215
    }
3216
  }
3217
3218
  var _proto = ReactDOMServerRenderer.prototype;
3219
3220
  _proto.destroy = function destroy() {
3221
    if (!this.exhausted) {
3222
      this.exhausted = true;
3223
      this.clearProviders();
3224
      freeThreadID(this.threadID);
3225
    }
3226
  }
3227
  /**
3228
   * Note: We use just two stacks regardless of how many context providers you have.
3229
   * Providers are always popped in the reverse order to how they were pushed
3230
   * so we always know on the way down which provider you'll encounter next on the way up.
3231
   * On the way down, we push the current provider, and its context value *before*
3232
   * we mutated it, onto the stacks. Therefore, on the way up, we always know which
3233
   * provider needs to be "restored" to which value.
3234
   * https://github.com/facebook/react/pull/12985#issuecomment-396301248
3235
   */
3236
  ;
3237
3238
  _proto.pushProvider = function pushProvider(provider) {
3239
    var index = ++this.contextIndex;
3240
    var context = provider.type._context;
3241
    var threadID = this.threadID;
3242
    validateContextBounds(context, threadID);
3243
    var previousValue = context[threadID]; // Remember which value to restore this context to on our way up.
3244
3245
    this.contextStack[index] = context;
3246
    this.contextValueStack[index] = previousValue;
3247
3248
    {
3249
      // Only used for push/pop mismatch warnings.
3250
      this.contextProviderStack[index] = provider;
3251
    } // Mutate the current value.
3252
3253
3254
    context[threadID] = provider.props.value;
3255
  };
3256
3257
  _proto.popProvider = function popProvider(provider) {
3258
    var index = this.contextIndex;
3259
3260
    {
3261
      if (index < 0 || provider !== this.contextProviderStack[index]) {
3262
        error('Unexpected pop.');
3263
      }
3264
    }
3265
3266
    var context = this.contextStack[index];
3267
    var previousValue = this.contextValueStack[index]; // "Hide" these null assignments from Flow by using `any`
3268
    // because conceptually they are deletions--as long as we
3269
    // promise to never access values beyond `this.contextIndex`.
3270
3271
    this.contextStack[index] = null;
3272
    this.contextValueStack[index] = null;
3273
3274
    {
3275
      this.contextProviderStack[index] = null;
3276
    }
3277
3278
    this.contextIndex--; // Restore to the previous value we stored as we were walking down.
3279
    // We've already verified that this context has been expanded to accommodate
3280
    // this thread id, so we don't need to do it again.
3281
3282
    context[this.threadID] = previousValue;
3283
  };
3284
3285
  _proto.clearProviders = function clearProviders() {
3286
    // Restore any remaining providers on the stack to previous values
3287
    for (var index = this.contextIndex; index >= 0; index--) {
3288
      var context = this.contextStack[index];
3289
      var previousValue = this.contextValueStack[index];
3290
      context[this.threadID] = previousValue;
3291
    }
3292
  };
3293
3294
  _proto.read = function read(bytes) {
3295
    if (this.exhausted) {
3296
      return null;
3297
    }
3298
3299
    var prevThreadID = currentThreadID;
3300
    setCurrentThreadID(this.threadID);
3301
    var prevDispatcher = ReactCurrentDispatcher.current;
3302
    ReactCurrentDispatcher.current = Dispatcher;
3303
3304
    try {
3305
      // Markup generated within <Suspense> ends up buffered until we know
3306
      // nothing in that boundary suspended
3307
      var out = [''];
3308
      var suspended = false;
3309
3310
      while (out[0].length < bytes) {
3311
        if (this.stack.length === 0) {
3312
          this.exhausted = true;
3313
          freeThreadID(this.threadID);
3314
          break;
3315
        }
3316
3317
        var frame = this.stack[this.stack.length - 1];
3318
3319
        if (suspended || frame.childIndex >= frame.children.length) {
3320
          var footer = frame.footer;
3321
3322
          if (footer !== '') {
3323
            this.previousWasTextNode = false;
3324
          }
3325
3326
          this.stack.pop();
3327
3328
          if (frame.type === 'select') {
3329
            this.currentSelectValue = null;
3330
          } else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
3331
            var provider = frame.type;
3332
            this.popProvider(provider);
3333
          } else if (frame.type === REACT_SUSPENSE_TYPE) {
3334
            this.suspenseDepth--;
3335
            var buffered = out.pop();
3336
3337
            if (suspended) {
3338
              suspended = false; // If rendering was suspended at this boundary, render the fallbackFrame
3339
3340
              var fallbackFrame = frame.fallbackFrame;
3341
3342
              if (!fallbackFrame) {
3343
                {
3344
                  throw Error(true ? "ReactDOMServer did not find an internal fallback frame for Suspense. This is a bug in React. Please file an issue." : formatProdErrorMessage(303));
3345
                }
3346
              }
3347
3348
              this.stack.push(fallbackFrame);
3349
              out[this.suspenseDepth] += '<!--$!-->'; // Skip flushing output since we're switching to the fallback
3350
3351
              continue;
3352
            } else {
3353
              out[this.suspenseDepth] += buffered;
3354
            }
3355
          } // Flush output
3356
3357
3358
          out[this.suspenseDepth] += footer;
3359
          continue;
3360
        }
3361
3362
        var child = frame.children[frame.childIndex++];
3363
        var outBuffer = '';
3364
3365
        if (true) {
3366
          pushCurrentDebugStack(this.stack); // We're starting work on this frame, so reset its inner stack.
3367
3368
          frame.debugElementStack.length = 0;
3369
        }
3370
3371
        try {
3372
          outBuffer += this.render(child, frame.context, frame.domNamespace);
3373
        } catch (err) {
3374
          if (err != null && typeof err.then === 'function') {
3375
            if (enableSuspenseServerRenderer) {
3376
              if (!(this.suspenseDepth > 0)) {
3377
                {
3378
                  throw Error(true ? "A React component suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." : formatProdErrorMessage(342));
3379
                }
3380
              }
3381
3382
              suspended = true;
3383
            } else {
3384
              if (!false) {
3385
                {
3386
                  throw Error(true ? "ReactDOMServer does not yet support Suspense." : formatProdErrorMessage(294));
3387
                }
3388
              }
3389
            }
3390
          } else {
3391
            throw err;
3392
          }
3393
        } finally {
3394
          if (true) {
3395
            popCurrentDebugStack();
3396
          }
3397
        }
3398
3399
        if (out.length <= this.suspenseDepth) {
3400
          out.push('');
3401
        }
3402
3403
        out[this.suspenseDepth] += outBuffer;
3404
      }
3405
3406
      return out[0];
3407
    } finally {
3408
      ReactCurrentDispatcher.current = prevDispatcher;
3409
      setCurrentThreadID(prevThreadID);
3410
    }
3411
  };
3412
3413
  _proto.render = function render(child, context, parentNamespace) {
3414
    if (typeof child === 'string' || typeof child === 'number') {
3415
      var text = '' + child;
3416
3417
      if (text === '') {
3418
        return '';
3419
      }
3420
3421
      if (this.makeStaticMarkup) {
3422
        return escapeTextForBrowser(text);
3423
      }
3424
3425
      if (this.previousWasTextNode) {
3426
        return '<!-- -->' + escapeTextForBrowser(text);
3427
      }
3428
3429
      this.previousWasTextNode = true;
3430
      return escapeTextForBrowser(text);
3431
    } else {
3432
      var nextChild;
3433
3434
      var _resolve = resolve(child, context, this.threadID);
3435
3436
      nextChild = _resolve.child;
3437
      context = _resolve.context;
3438
3439
      if (nextChild === null || nextChild === false) {
3440
        return '';
3441
      } else if (!React.isValidElement(nextChild)) {
3442
        if (nextChild != null && nextChild.$$typeof != null) {
3443
          // Catch unexpected special types early.
3444
          var $$typeof = nextChild.$$typeof;
3445
3446
          if (!($$typeof !== REACT_PORTAL_TYPE)) {
3447
            {
3448
              throw Error( "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render." );
3449
            }
3450
          } // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
3451
3452
3453
          {
3454
            {
3455
              throw Error( "Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue." );
3456
            }
3457
          }
3458
        }
3459
3460
        var nextChildren = toArray(nextChild);
3461
        var frame = {
3462
          type: null,
3463
          domNamespace: parentNamespace,
3464
          children: nextChildren,
3465
          childIndex: 0,
3466
          context: context,
3467
          footer: ''
3468
        };
3469
3470
        {
3471
          frame.debugElementStack = [];
3472
        }
3473
3474
        this.stack.push(frame);
3475
        return '';
3476
      } // Safe because we just checked it's an element.
3477
3478
3479
      var nextElement = nextChild;
3480
      var elementType = nextElement.type;
3481
3482
      if (typeof elementType === 'string') {
3483
        return this.renderDOM(nextElement, context, parentNamespace);
3484
      }
3485
3486
      switch (elementType) {
3487
        case REACT_STRICT_MODE_TYPE:
3488
        case REACT_CONCURRENT_MODE_TYPE:
3489
        case REACT_PROFILER_TYPE:
3490
        case REACT_SUSPENSE_LIST_TYPE:
3491
        case REACT_FRAGMENT_TYPE:
3492
          {
3493
            var _nextChildren = toArray(nextChild.props.children);
3494
3495
            var _frame = {
3496
              type: null,
3497
              domNamespace: parentNamespace,
3498
              children: _nextChildren,
3499
              childIndex: 0,
3500
              context: context,
3501
              footer: ''
3502
            };
3503
3504
            {
3505
              _frame.debugElementStack = [];
3506
            }
3507
3508
            this.stack.push(_frame);
3509
            return '';
3510
          }
3511
3512
        case REACT_SUSPENSE_TYPE:
3513
          {
3514
            {
3515
              {
3516
                {
3517
                  throw Error( "ReactDOMServer does not yet support Suspense." );
3518
                }
3519
              }
3520
            }
3521
          }
3522
      }
3523
3524
      if (typeof elementType === 'object' && elementType !== null) {
3525
        switch (elementType.$$typeof) {
3526
          case REACT_FORWARD_REF_TYPE:
3527
            {
3528
              var element = nextChild;
3529
3530
              var _nextChildren4;
3531
3532
              var componentIdentity = {};
3533
              prepareToUseHooks(componentIdentity);
3534
              _nextChildren4 = elementType.render(element.props, element.ref);
3535
              _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref);
3536
              _nextChildren4 = toArray(_nextChildren4);
3537
              var _frame4 = {
3538
                type: null,
3539
                domNamespace: parentNamespace,
3540
                children: _nextChildren4,
3541
                childIndex: 0,
3542
                context: context,
3543
                footer: ''
3544
              };
3545
3546
              {
3547
                _frame4.debugElementStack = [];
3548
              }
3549
3550
              this.stack.push(_frame4);
3551
              return '';
3552
            }
3553
3554
          case REACT_MEMO_TYPE:
3555
            {
3556
              var _element = nextChild;
3557
              var _nextChildren5 = [React.createElement(elementType.type, _assign({
3558
                ref: _element.ref
3559
              }, _element.props))];
3560
              var _frame5 = {
3561
                type: null,
3562
                domNamespace: parentNamespace,
3563
                children: _nextChildren5,
3564
                childIndex: 0,
3565
                context: context,
3566
                footer: ''
3567
              };
3568
3569
              {
3570
                _frame5.debugElementStack = [];
3571
              }
3572
3573
              this.stack.push(_frame5);
3574
              return '';
3575
            }
3576
3577
          case REACT_PROVIDER_TYPE:
3578
            {
3579
              var provider = nextChild;
3580
              var nextProps = provider.props;
3581
3582
              var _nextChildren6 = toArray(nextProps.children);
3583
3584
              var _frame6 = {
3585
                type: provider,
3586
                domNamespace: parentNamespace,
3587
                children: _nextChildren6,
3588
                childIndex: 0,
3589
                context: context,
3590
                footer: ''
3591
              };
3592
3593
              {
3594
                _frame6.debugElementStack = [];
3595
              }
3596
3597
              this.pushProvider(provider);
3598
              this.stack.push(_frame6);
3599
              return '';
3600
            }
3601
3602
          case REACT_CONTEXT_TYPE:
3603
            {
3604
              var reactContext = nextChild.type; // The logic below for Context differs depending on PROD or DEV mode. In
3605
              // DEV mode, we create a separate object for Context.Consumer that acts
3606
              // like a proxy to Context. This proxy object adds unnecessary code in PROD
3607
              // so we use the old behaviour (Context.Consumer references Context) to
3608
              // reduce size and overhead. The separate object references context via
3609
              // a property called "_context", which also gives us the ability to check
3610
              // in DEV mode if this property exists or not and warn if it does not.
3611
3612
              {
3613
                if (reactContext._context === undefined) {
3614
                  // This may be because it's a Context (rather than a Consumer).
3615
                  // Or it may be because it's older React where they're the same thing.
3616
                  // We only want to warn if we're sure it's a new React.
3617
                  if (reactContext !== reactContext.Consumer) {
3618
                    if (!hasWarnedAboutUsingContextAsConsumer) {
3619
                      hasWarnedAboutUsingContextAsConsumer = true;
3620
3621
                      error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
3622
                    }
3623
                  }
3624
                } else {
3625
                  reactContext = reactContext._context;
3626
                }
3627
              }
3628
3629
              var _nextProps = nextChild.props;
3630
              var threadID = this.threadID;
3631
              validateContextBounds(reactContext, threadID);
3632
              var nextValue = reactContext[threadID];
3633
3634
              var _nextChildren7 = toArray(_nextProps.children(nextValue));
3635
3636
              var _frame7 = {
3637
                type: nextChild,
3638
                domNamespace: parentNamespace,
3639
                children: _nextChildren7,
3640
                childIndex: 0,
3641
                context: context,
3642
                footer: ''
3643
              };
3644
3645
              {
3646
                _frame7.debugElementStack = [];
3647
              }
3648
3649
              this.stack.push(_frame7);
3650
              return '';
3651
            }
3652
          // eslint-disable-next-line-no-fallthrough
3653
3654
          case REACT_FUNDAMENTAL_TYPE:
3655
            {
3656
3657
              {
3658
                {
3659
                  throw Error( "ReactDOMServer does not yet support the fundamental API." );
3660
                }
3661
              }
3662
            }
3663
          // eslint-disable-next-line-no-fallthrough
3664
3665
          case REACT_LAZY_TYPE:
3666
            {
3667
              var _element2 = nextChild;
3668
              var lazyComponent = nextChild.type; // Attempt to initialize lazy component regardless of whether the
3669
              // suspense server-side renderer is enabled so synchronously
3670
              // resolved constructors are supported.
3671
3672
              initializeLazyComponentType(lazyComponent);
3673
3674
              switch (lazyComponent._status) {
3675
                case Resolved:
3676
                  {
3677
                    var _nextChildren9 = [React.createElement(lazyComponent._result, _assign({
3678
                      ref: _element2.ref
3679
                    }, _element2.props))];
3680
                    var _frame9 = {
3681
                      type: null,
3682
                      domNamespace: parentNamespace,
3683
                      children: _nextChildren9,
3684
                      childIndex: 0,
3685
                      context: context,
3686
                      footer: ''
3687
                    };
3688
3689
                    {
3690
                      _frame9.debugElementStack = [];
3691
                    }
3692
3693
                    this.stack.push(_frame9);
3694
                    return '';
3695
                  }
3696
3697
                case Rejected:
3698
                  throw lazyComponent._result;
3699
3700
                case Pending:
3701
                default:
3702
                  {
3703
                    {
3704
                      throw Error( "ReactDOMServer does not yet support lazy-loaded components." );
3705
                    }
3706
                  }
3707
3708
              }
3709
            }
3710
          // eslint-disable-next-line-no-fallthrough
3711
3712
          case REACT_SCOPE_TYPE:
3713
            {
3714
3715
              {
3716
                {
3717
                  throw Error( "ReactDOMServer does not yet support scope components." );
3718
                }
3719
              }
3720
            }
3721
        }
3722
      }
3723
3724
      var info = '';
3725
3726
      {
3727
        var owner = nextElement._owner;
3728
3729
        if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
3730
          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.';
3731
        }
3732
3733
        var ownerName = owner ? getComponentName(owner) : null;
3734
3735
        if (ownerName) {
3736
          info += '\n\nCheck the render method of `' + ownerName + '`.';
3737
        }
3738
      }
3739
3740
      {
3741
        {
3742
          throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (elementType == null ? elementType : typeof elementType) + "." + info );
3743
        }
3744
      }
3745
    }
3746
  };
3747
3748
  _proto.renderDOM = function renderDOM(element, context, parentNamespace) {
3749
    var tag = element.type.toLowerCase();
3750
    var namespace = parentNamespace;
3751
3752
    if (parentNamespace === Namespaces.html) {
3753
      namespace = getIntrinsicNamespace(tag);
3754
    }
3755
3756
    {
3757
      if (namespace === Namespaces.html) {
3758
        // Should this check be gated by parent namespace? Not sure we want to
3759
        // allow <SVG> or <mATH>.
3760
        if (tag !== element.type) {
3761
          error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type);
3762
        }
3763
      }
3764
    }
3765
3766
    validateDangerousTag(tag);
3767
    var props = element.props;
3768
3769
    if (tag === 'input') {
3770
      {
3771
        ReactControlledValuePropTypes.checkPropTypes('input', props);
3772
3773
        if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
3774
          error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
3775
3776
          didWarnDefaultChecked = true;
3777
        }
3778
3779
        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
3780
          error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
3781
3782
          didWarnDefaultInputValue = true;
3783
        }
3784
      }
3785
3786
      props = _assign({
3787
        type: undefined
3788
      }, props, {
3789
        defaultChecked: undefined,
3790
        defaultValue: undefined,
3791
        value: props.value != null ? props.value : props.defaultValue,
3792
        checked: props.checked != null ? props.checked : props.defaultChecked
3793
      });
3794
    } else if (tag === 'textarea') {
3795
      {
3796
        ReactControlledValuePropTypes.checkPropTypes('textarea', props);
3797
3798
        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
3799
          error('Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
3800
3801
          didWarnDefaultTextareaValue = true;
3802
        }
3803
      }
3804
3805
      var initialValue = props.value;
3806
3807
      if (initialValue == null) {
3808
        var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>.
3809
3810
        var textareaChildren = props.children;
3811
3812
        if (textareaChildren != null) {
3813
          {
3814
            error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
3815
          }
3816
3817
          if (!(defaultValue == null)) {
3818
            {
3819
              throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
3820
            }
3821
          }
3822
3823
          if (Array.isArray(textareaChildren)) {
3824
            if (!(textareaChildren.length <= 1)) {
3825
              {
3826
                throw Error( "<textarea> can only have at most one child." );
3827
              }
3828
            }
3829
3830
            textareaChildren = textareaChildren[0];
3831
          }
3832
3833
          defaultValue = '' + textareaChildren;
3834
        }
3835
3836
        if (defaultValue == null) {
3837
          defaultValue = '';
3838
        }
3839
3840
        initialValue = defaultValue;
3841
      }
3842
3843
      props = _assign({}, props, {
3844
        value: undefined,
3845
        children: '' + initialValue
3846
      });
3847
    } else if (tag === 'select') {
3848
      {
3849
        ReactControlledValuePropTypes.checkPropTypes('select', props);
3850
3851
        for (var i = 0; i < valuePropNames.length; i++) {
3852
          var propName = valuePropNames[i];
3853
3854
          if (props[propName] == null) {
3855
            continue;
3856
          }
3857
3858
          var isArray = Array.isArray(props[propName]);
3859
3860
          if (props.multiple && !isArray) {
3861
            error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
3862
          } else if (!props.multiple && isArray) {
3863
            error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
3864
          }
3865
        }
3866
3867
        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
3868
          error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
3869
3870
          didWarnDefaultSelectValue = true;
3871
        }
3872
      }
3873
3874
      this.currentSelectValue = props.value != null ? props.value : props.defaultValue;
3875
      props = _assign({}, props, {
3876
        value: undefined
3877
      });
3878
    } else if (tag === 'option') {
3879
      var selected = null;
3880
      var selectValue = this.currentSelectValue;
3881
      var optionChildren = flattenOptionChildren(props.children);
3882
3883
      if (selectValue != null) {
3884
        var value;
3885
3886
        if (props.value != null) {
3887
          value = props.value + '';
3888
        } else {
3889
          value = optionChildren;
3890
        }
3891
3892
        selected = false;
3893
3894
        if (Array.isArray(selectValue)) {
3895
          // multiple
3896
          for (var j = 0; j < selectValue.length; j++) {
3897
            if ('' + selectValue[j] === value) {
3898
              selected = true;
3899
              break;
3900
            }
3901
          }
3902
        } else {
3903
          selected = '' + selectValue === value;
3904
        }
3905
3906
        props = _assign({
3907
          selected: undefined,
3908
          children: undefined
3909
        }, props, {
3910
          selected: selected,
3911
          children: optionChildren
3912
        });
3913
      }
3914
    }
3915
3916
    {
3917
      validatePropertiesInDevelopment(tag, props);
3918
    }
3919
3920
    assertValidProps(tag, props);
3921
    var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
3922
    var footer = '';
3923
3924
    if (omittedCloseTags.hasOwnProperty(tag)) {
3925
      out += '/>';
3926
    } else {
3927
      out += '>';
3928
      footer = '</' + element.type + '>';
3929
    }
3930
3931
    var children;
3932
    var innerMarkup = getNonChildrenInnerMarkup(props);
3933
3934
    if (innerMarkup != null) {
3935
      children = [];
3936
3937
      if (newlineEatingTags.hasOwnProperty(tag) && innerMarkup.charAt(0) === '\n') {
3938
        // text/html ignores the first character in these tags if it's a newline
3939
        // Prefer to break application/xml over text/html (for now) by adding
3940
        // a newline specifically to get eaten by the parser. (Alternately for
3941
        // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
3942
        // \r is normalized out by HTMLTextAreaElement#value.)
3943
        // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
3944
        // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
3945
        // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
3946
        // See: Parsing of "textarea" "listing" and "pre" elements
3947
        //  from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
3948
        out += '\n';
3949
      }
3950
3951
      out += innerMarkup;
3952
    } else {
3953
      children = toArray(props.children);
3954
    }
3955
3956
    var frame = {
3957
      domNamespace: getChildNamespace(parentNamespace, element.type),
3958
      type: tag,
3959
      children: children,
3960
      childIndex: 0,
3961
      context: context,
3962
      footer: footer
3963
    };
3964
3965
    {
3966
      frame.debugElementStack = [];
3967
    }
3968
3969
    this.stack.push(frame);
3970
    this.previousWasTextNode = false;
3971
    return out;
3972
  };
3973
3974
  return ReactDOMServerRenderer;
3975
}();
3976
3977
/**
3978
 * Render a ReactElement to its initial HTML. This should only be used on the
3979
 * server.
3980
 * See https://reactjs.org/docs/react-dom-server.html#rendertostring
3981
 */
3982
3983
function renderToString(element) {
3984
  var renderer = new ReactDOMServerRenderer(element, false);
3985
3986
  try {
3987
    var markup = renderer.read(Infinity);
3988
    return markup;
3989
  } finally {
3990
    renderer.destroy();
3991
  }
3992
}
3993
/**
3994
 * Similar to renderToString, except this doesn't create extra DOM attributes
3995
 * such as data-react-id that React uses internally.
3996
 * See https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup
3997
 */
3998
3999
function renderToStaticMarkup(element) {
4000
  var renderer = new ReactDOMServerRenderer(element, true);
4001
4002
  try {
4003
    var markup = renderer.read(Infinity);
4004
    return markup;
4005
  } finally {
4006
    renderer.destroy();
4007
  }
4008
}
4009
4010
function renderToNodeStream() {
4011
  {
4012
    {
4013
      throw Error( "ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead." );
4014
    }
4015
  }
4016
}
4017
4018
function renderToStaticNodeStream() {
4019
  {
4020
    {
4021
      throw Error( "ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead." );
4022
    }
4023
  }
4024
} // Note: when changing this, also consider https://github.com/facebook/react/issues/11526
4025
4026
4027
var ReactDOMServer = {
4028
  renderToString: renderToString,
4029
  renderToStaticMarkup: renderToStaticMarkup,
4030
  renderToNodeStream: renderToNodeStream,
4031
  renderToStaticNodeStream: renderToStaticNodeStream,
4032
  version: ReactVersion
4033
};
4034
4035
// TODO: decide on the top-level export form.
4036
// This is hacky but makes it work with both Rollup and Jest
4037
4038
4039
var server_browser = ReactDOMServer.default || ReactDOMServer;
4040
4041
module.exports = server_browser;
4042
  })();
4043
}