prop-types.js 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PropTypes = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. /**
  3. * Copyright (c) 2013-present, Facebook, Inc.
  4. *
  5. * This source code is licensed under the MIT license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. 'use strict';
  9. var printWarning = function() {};
  10. if ("development" !== 'production') {
  11. var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
  12. var loggedTypeFailures = {};
  13. var has = require('./lib/has');
  14. printWarning = function(text) {
  15. var message = 'Warning: ' + text;
  16. if (typeof console !== 'undefined') {
  17. console.error(message);
  18. }
  19. try {
  20. // --- Welcome to debugging React ---
  21. // This error was thrown as a convenience so that you can use this stack
  22. // to find the callsite that caused this warning to fire.
  23. throw new Error(message);
  24. } catch (x) { /**/ }
  25. };
  26. }
  27. /**
  28. * Assert that the values match with the type specs.
  29. * Error messages are memorized and will only be shown once.
  30. *
  31. * @param {object} typeSpecs Map of name to a ReactPropType
  32. * @param {object} values Runtime values that need to be type-checked
  33. * @param {string} location e.g. "prop", "context", "child context"
  34. * @param {string} componentName Name of the component for error messages.
  35. * @param {?Function} getStack Returns the component stack.
  36. * @private
  37. */
  38. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  39. if ("development" !== 'production') {
  40. for (var typeSpecName in typeSpecs) {
  41. if (has(typeSpecs, typeSpecName)) {
  42. var error;
  43. // Prop type validation may throw. In case they do, we don't want to
  44. // fail the render phase where it didn't fail before. So we log it.
  45. // After these have been cleaned up, we'll let them throw.
  46. try {
  47. // This is intentionally an invariant that gets caught. It's the same
  48. // behavior as without this statement except with a better message.
  49. if (typeof typeSpecs[typeSpecName] !== 'function') {
  50. var err = Error(
  51. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  52. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
  53. 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
  54. );
  55. err.name = 'Invariant Violation';
  56. throw err;
  57. }
  58. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  59. } catch (ex) {
  60. error = ex;
  61. }
  62. if (error && !(error instanceof Error)) {
  63. printWarning(
  64. (componentName || 'React class') + ': type specification of ' +
  65. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  66. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  67. 'You may have forgotten to pass an argument to the type checker ' +
  68. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  69. 'shape all require an argument).'
  70. );
  71. }
  72. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  73. // Only monitor this failure once because there tends to be a lot of the
  74. // same error.
  75. loggedTypeFailures[error.message] = true;
  76. var stack = getStack ? getStack() : '';
  77. printWarning(
  78. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  79. );
  80. }
  81. }
  82. }
  83. }
  84. }
  85. /**
  86. * Resets warning cache when testing.
  87. *
  88. * @private
  89. */
  90. checkPropTypes.resetWarningCache = function() {
  91. if ("development" !== 'production') {
  92. loggedTypeFailures = {};
  93. }
  94. }
  95. module.exports = checkPropTypes;
  96. },{"./lib/ReactPropTypesSecret":5,"./lib/has":6}],2:[function(require,module,exports){
  97. /**
  98. * Copyright (c) 2013-present, Facebook, Inc.
  99. *
  100. * This source code is licensed under the MIT license found in the
  101. * LICENSE file in the root directory of this source tree.
  102. */
  103. 'use strict';
  104. var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
  105. function emptyFunction() {}
  106. function emptyFunctionWithReset() {}
  107. emptyFunctionWithReset.resetWarningCache = emptyFunction;
  108. module.exports = function() {
  109. function shim(props, propName, componentName, location, propFullName, secret) {
  110. if (secret === ReactPropTypesSecret) {
  111. // It is still safe when called from React.
  112. return;
  113. }
  114. var err = new Error(
  115. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  116. 'Use PropTypes.checkPropTypes() to call them. ' +
  117. 'Read more at http://fb.me/use-check-prop-types'
  118. );
  119. err.name = 'Invariant Violation';
  120. throw err;
  121. };
  122. shim.isRequired = shim;
  123. function getShim() {
  124. return shim;
  125. };
  126. // Important!
  127. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  128. var ReactPropTypes = {
  129. array: shim,
  130. bigint: shim,
  131. bool: shim,
  132. func: shim,
  133. number: shim,
  134. object: shim,
  135. string: shim,
  136. symbol: shim,
  137. any: shim,
  138. arrayOf: getShim,
  139. element: shim,
  140. elementType: shim,
  141. instanceOf: getShim,
  142. node: shim,
  143. objectOf: getShim,
  144. oneOf: getShim,
  145. oneOfType: getShim,
  146. shape: getShim,
  147. exact: getShim,
  148. checkPropTypes: emptyFunctionWithReset,
  149. resetWarningCache: emptyFunction
  150. };
  151. ReactPropTypes.PropTypes = ReactPropTypes;
  152. return ReactPropTypes;
  153. };
  154. },{"./lib/ReactPropTypesSecret":5}],3:[function(require,module,exports){
  155. /**
  156. * Copyright (c) 2013-present, Facebook, Inc.
  157. *
  158. * This source code is licensed under the MIT license found in the
  159. * LICENSE file in the root directory of this source tree.
  160. */
  161. 'use strict';
  162. var ReactIs = require('react-is');
  163. var assign = require('object-assign');
  164. var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
  165. var has = require('./lib/has');
  166. var checkPropTypes = require('./checkPropTypes');
  167. var printWarning = function() {};
  168. if ("development" !== 'production') {
  169. printWarning = function(text) {
  170. var message = 'Warning: ' + text;
  171. if (typeof console !== 'undefined') {
  172. console.error(message);
  173. }
  174. try {
  175. // --- Welcome to debugging React ---
  176. // This error was thrown as a convenience so that you can use this stack
  177. // to find the callsite that caused this warning to fire.
  178. throw new Error(message);
  179. } catch (x) {}
  180. };
  181. }
  182. function emptyFunctionThatReturnsNull() {
  183. return null;
  184. }
  185. module.exports = function(isValidElement, throwOnDirectAccess) {
  186. /* global Symbol */
  187. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  188. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  189. /**
  190. * Returns the iterator method function contained on the iterable object.
  191. *
  192. * Be sure to invoke the function with the iterable as context:
  193. *
  194. * var iteratorFn = getIteratorFn(myIterable);
  195. * if (iteratorFn) {
  196. * var iterator = iteratorFn.call(myIterable);
  197. * ...
  198. * }
  199. *
  200. * @param {?object} maybeIterable
  201. * @return {?function}
  202. */
  203. function getIteratorFn(maybeIterable) {
  204. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  205. if (typeof iteratorFn === 'function') {
  206. return iteratorFn;
  207. }
  208. }
  209. /**
  210. * Collection of methods that allow declaration and validation of props that are
  211. * supplied to React components. Example usage:
  212. *
  213. * var Props = require('ReactPropTypes');
  214. * var MyArticle = React.createClass({
  215. * propTypes: {
  216. * // An optional string prop named "description".
  217. * description: Props.string,
  218. *
  219. * // A required enum prop named "category".
  220. * category: Props.oneOf(['News','Photos']).isRequired,
  221. *
  222. * // A prop named "dialog" that requires an instance of Dialog.
  223. * dialog: Props.instanceOf(Dialog).isRequired
  224. * },
  225. * render: function() { ... }
  226. * });
  227. *
  228. * A more formal specification of how these methods are used:
  229. *
  230. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  231. * decl := ReactPropTypes.{type}(.isRequired)?
  232. *
  233. * Each and every declaration produces a function with the same signature. This
  234. * allows the creation of custom validation functions. For example:
  235. *
  236. * var MyLink = React.createClass({
  237. * propTypes: {
  238. * // An optional string or URI prop named "href".
  239. * href: function(props, propName, componentName) {
  240. * var propValue = props[propName];
  241. * if (propValue != null && typeof propValue !== 'string' &&
  242. * !(propValue instanceof URI)) {
  243. * return new Error(
  244. * 'Expected a string or an URI for ' + propName + ' in ' +
  245. * componentName
  246. * );
  247. * }
  248. * }
  249. * },
  250. * render: function() {...}
  251. * });
  252. *
  253. * @internal
  254. */
  255. var ANONYMOUS = '<<anonymous>>';
  256. // Important!
  257. // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  258. var ReactPropTypes = {
  259. array: createPrimitiveTypeChecker('array'),
  260. bigint: createPrimitiveTypeChecker('bigint'),
  261. bool: createPrimitiveTypeChecker('boolean'),
  262. func: createPrimitiveTypeChecker('function'),
  263. number: createPrimitiveTypeChecker('number'),
  264. object: createPrimitiveTypeChecker('object'),
  265. string: createPrimitiveTypeChecker('string'),
  266. symbol: createPrimitiveTypeChecker('symbol'),
  267. any: createAnyTypeChecker(),
  268. arrayOf: createArrayOfTypeChecker,
  269. element: createElementTypeChecker(),
  270. elementType: createElementTypeTypeChecker(),
  271. instanceOf: createInstanceTypeChecker,
  272. node: createNodeChecker(),
  273. objectOf: createObjectOfTypeChecker,
  274. oneOf: createEnumTypeChecker,
  275. oneOfType: createUnionTypeChecker,
  276. shape: createShapeTypeChecker,
  277. exact: createStrictShapeTypeChecker,
  278. };
  279. /**
  280. * inlined Object.is polyfill to avoid requiring consumers ship their own
  281. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  282. */
  283. /*eslint-disable no-self-compare*/
  284. function is(x, y) {
  285. // SameValue algorithm
  286. if (x === y) {
  287. // Steps 1-5, 7-10
  288. // Steps 6.b-6.e: +0 != -0
  289. return x !== 0 || 1 / x === 1 / y;
  290. } else {
  291. // Step 6.a: NaN == NaN
  292. return x !== x && y !== y;
  293. }
  294. }
  295. /*eslint-enable no-self-compare*/
  296. /**
  297. * We use an Error-like object for backward compatibility as people may call
  298. * PropTypes directly and inspect their output. However, we don't use real
  299. * Errors anymore. We don't inspect their stack anyway, and creating them
  300. * is prohibitively expensive if they are created too often, such as what
  301. * happens in oneOfType() for any type before the one that matched.
  302. */
  303. function PropTypeError(message, data) {
  304. this.message = message;
  305. this.data = data && typeof data === 'object' ? data: {};
  306. this.stack = '';
  307. }
  308. // Make `instanceof Error` still work for returned errors.
  309. PropTypeError.prototype = Error.prototype;
  310. function createChainableTypeChecker(validate) {
  311. if ("development" !== 'production') {
  312. var manualPropTypeCallCache = {};
  313. var manualPropTypeWarningCount = 0;
  314. }
  315. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  316. componentName = componentName || ANONYMOUS;
  317. propFullName = propFullName || propName;
  318. if (secret !== ReactPropTypesSecret) {
  319. if (throwOnDirectAccess) {
  320. // New behavior only for users of `prop-types` package
  321. var err = new Error(
  322. 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
  323. 'Use `PropTypes.checkPropTypes()` to call them. ' +
  324. 'Read more at http://fb.me/use-check-prop-types'
  325. );
  326. err.name = 'Invariant Violation';
  327. throw err;
  328. } else if ("development" !== 'production' && typeof console !== 'undefined') {
  329. // Old behavior for people using React.PropTypes
  330. var cacheKey = componentName + ':' + propName;
  331. if (
  332. !manualPropTypeCallCache[cacheKey] &&
  333. // Avoid spamming the console because they are often not actionable except for lib authors
  334. manualPropTypeWarningCount < 3
  335. ) {
  336. printWarning(
  337. 'You are manually calling a React.PropTypes validation ' +
  338. 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
  339. 'and will throw in the standalone `prop-types` package. ' +
  340. 'You may be seeing this warning due to a third-party PropTypes ' +
  341. 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
  342. );
  343. manualPropTypeCallCache[cacheKey] = true;
  344. manualPropTypeWarningCount++;
  345. }
  346. }
  347. }
  348. if (props[propName] == null) {
  349. if (isRequired) {
  350. if (props[propName] === null) {
  351. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
  352. }
  353. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
  354. }
  355. return null;
  356. } else {
  357. return validate(props, propName, componentName, location, propFullName);
  358. }
  359. }
  360. var chainedCheckType = checkType.bind(null, false);
  361. chainedCheckType.isRequired = checkType.bind(null, true);
  362. return chainedCheckType;
  363. }
  364. function createPrimitiveTypeChecker(expectedType) {
  365. function validate(props, propName, componentName, location, propFullName, secret) {
  366. var propValue = props[propName];
  367. var propType = getPropType(propValue);
  368. if (propType !== expectedType) {
  369. // `propValue` being instance of, say, date/regexp, pass the 'object'
  370. // check, but we can offer a more precise error message here rather than
  371. // 'of type `object`'.
  372. var preciseType = getPreciseType(propValue);
  373. return new PropTypeError(
  374. 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
  375. {expectedType: expectedType}
  376. );
  377. }
  378. return null;
  379. }
  380. return createChainableTypeChecker(validate);
  381. }
  382. function createAnyTypeChecker() {
  383. return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  384. }
  385. function createArrayOfTypeChecker(typeChecker) {
  386. function validate(props, propName, componentName, location, propFullName) {
  387. if (typeof typeChecker !== 'function') {
  388. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  389. }
  390. var propValue = props[propName];
  391. if (!Array.isArray(propValue)) {
  392. var propType = getPropType(propValue);
  393. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  394. }
  395. for (var i = 0; i < propValue.length; i++) {
  396. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
  397. if (error instanceof Error) {
  398. return error;
  399. }
  400. }
  401. return null;
  402. }
  403. return createChainableTypeChecker(validate);
  404. }
  405. function createElementTypeChecker() {
  406. function validate(props, propName, componentName, location, propFullName) {
  407. var propValue = props[propName];
  408. if (!isValidElement(propValue)) {
  409. var propType = getPropType(propValue);
  410. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  411. }
  412. return null;
  413. }
  414. return createChainableTypeChecker(validate);
  415. }
  416. function createElementTypeTypeChecker() {
  417. function validate(props, propName, componentName, location, propFullName) {
  418. var propValue = props[propName];
  419. if (!ReactIs.isValidElementType(propValue)) {
  420. var propType = getPropType(propValue);
  421. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
  422. }
  423. return null;
  424. }
  425. return createChainableTypeChecker(validate);
  426. }
  427. function createInstanceTypeChecker(expectedClass) {
  428. function validate(props, propName, componentName, location, propFullName) {
  429. if (!(props[propName] instanceof expectedClass)) {
  430. var expectedClassName = expectedClass.name || ANONYMOUS;
  431. var actualClassName = getClassName(props[propName]);
  432. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  433. }
  434. return null;
  435. }
  436. return createChainableTypeChecker(validate);
  437. }
  438. function createEnumTypeChecker(expectedValues) {
  439. if (!Array.isArray(expectedValues)) {
  440. if ("development" !== 'production') {
  441. if (arguments.length > 1) {
  442. printWarning(
  443. 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
  444. 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
  445. );
  446. } else {
  447. printWarning('Invalid argument supplied to oneOf, expected an array.');
  448. }
  449. }
  450. return emptyFunctionThatReturnsNull;
  451. }
  452. function validate(props, propName, componentName, location, propFullName) {
  453. var propValue = props[propName];
  454. for (var i = 0; i < expectedValues.length; i++) {
  455. if (is(propValue, expectedValues[i])) {
  456. return null;
  457. }
  458. }
  459. var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
  460. var type = getPreciseType(value);
  461. if (type === 'symbol') {
  462. return String(value);
  463. }
  464. return value;
  465. });
  466. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  467. }
  468. return createChainableTypeChecker(validate);
  469. }
  470. function createObjectOfTypeChecker(typeChecker) {
  471. function validate(props, propName, componentName, location, propFullName) {
  472. if (typeof typeChecker !== 'function') {
  473. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  474. }
  475. var propValue = props[propName];
  476. var propType = getPropType(propValue);
  477. if (propType !== 'object') {
  478. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  479. }
  480. for (var key in propValue) {
  481. if (has(propValue, key)) {
  482. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  483. if (error instanceof Error) {
  484. return error;
  485. }
  486. }
  487. }
  488. return null;
  489. }
  490. return createChainableTypeChecker(validate);
  491. }
  492. function createUnionTypeChecker(arrayOfTypeCheckers) {
  493. if (!Array.isArray(arrayOfTypeCheckers)) {
  494. "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
  495. return emptyFunctionThatReturnsNull;
  496. }
  497. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  498. var checker = arrayOfTypeCheckers[i];
  499. if (typeof checker !== 'function') {
  500. printWarning(
  501. 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
  502. 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
  503. );
  504. return emptyFunctionThatReturnsNull;
  505. }
  506. }
  507. function validate(props, propName, componentName, location, propFullName) {
  508. var expectedTypes = [];
  509. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  510. var checker = arrayOfTypeCheckers[i];
  511. var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
  512. if (checkerResult == null) {
  513. return null;
  514. }
  515. if (checkerResult.data.hasOwnProperty('expectedType')) {
  516. expectedTypes.push(checkerResult.data.expectedType);
  517. }
  518. }
  519. var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
  520. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
  521. }
  522. return createChainableTypeChecker(validate);
  523. }
  524. function createNodeChecker() {
  525. function validate(props, propName, componentName, location, propFullName) {
  526. if (!isNode(props[propName])) {
  527. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  528. }
  529. return null;
  530. }
  531. return createChainableTypeChecker(validate);
  532. }
  533. function invalidValidatorError(componentName, location, propFullName, key, type) {
  534. return new PropTypeError(
  535. (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
  536. 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
  537. );
  538. }
  539. function createShapeTypeChecker(shapeTypes) {
  540. function validate(props, propName, componentName, location, propFullName) {
  541. var propValue = props[propName];
  542. var propType = getPropType(propValue);
  543. if (propType !== 'object') {
  544. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  545. }
  546. for (var key in shapeTypes) {
  547. var checker = shapeTypes[key];
  548. if (typeof checker !== 'function') {
  549. return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
  550. }
  551. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  552. if (error) {
  553. return error;
  554. }
  555. }
  556. return null;
  557. }
  558. return createChainableTypeChecker(validate);
  559. }
  560. function createStrictShapeTypeChecker(shapeTypes) {
  561. function validate(props, propName, componentName, location, propFullName) {
  562. var propValue = props[propName];
  563. var propType = getPropType(propValue);
  564. if (propType !== 'object') {
  565. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  566. }
  567. // We need to check all keys in case some are required but missing from props.
  568. var allKeys = assign({}, props[propName], shapeTypes);
  569. for (var key in allKeys) {
  570. var checker = shapeTypes[key];
  571. if (has(shapeTypes, key) && typeof checker !== 'function') {
  572. return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
  573. }
  574. if (!checker) {
  575. return new PropTypeError(
  576. 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
  577. '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
  578. '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
  579. );
  580. }
  581. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  582. if (error) {
  583. return error;
  584. }
  585. }
  586. return null;
  587. }
  588. return createChainableTypeChecker(validate);
  589. }
  590. function isNode(propValue) {
  591. switch (typeof propValue) {
  592. case 'number':
  593. case 'string':
  594. case 'undefined':
  595. return true;
  596. case 'boolean':
  597. return !propValue;
  598. case 'object':
  599. if (Array.isArray(propValue)) {
  600. return propValue.every(isNode);
  601. }
  602. if (propValue === null || isValidElement(propValue)) {
  603. return true;
  604. }
  605. var iteratorFn = getIteratorFn(propValue);
  606. if (iteratorFn) {
  607. var iterator = iteratorFn.call(propValue);
  608. var step;
  609. if (iteratorFn !== propValue.entries) {
  610. while (!(step = iterator.next()).done) {
  611. if (!isNode(step.value)) {
  612. return false;
  613. }
  614. }
  615. } else {
  616. // Iterator will provide entry [k,v] tuples rather than values.
  617. while (!(step = iterator.next()).done) {
  618. var entry = step.value;
  619. if (entry) {
  620. if (!isNode(entry[1])) {
  621. return false;
  622. }
  623. }
  624. }
  625. }
  626. } else {
  627. return false;
  628. }
  629. return true;
  630. default:
  631. return false;
  632. }
  633. }
  634. function isSymbol(propType, propValue) {
  635. // Native Symbol.
  636. if (propType === 'symbol') {
  637. return true;
  638. }
  639. // falsy value can't be a Symbol
  640. if (!propValue) {
  641. return false;
  642. }
  643. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  644. if (propValue['@@toStringTag'] === 'Symbol') {
  645. return true;
  646. }
  647. // Fallback for non-spec compliant Symbols which are polyfilled.
  648. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  649. return true;
  650. }
  651. return false;
  652. }
  653. // Equivalent of `typeof` but with special handling for array and regexp.
  654. function getPropType(propValue) {
  655. var propType = typeof propValue;
  656. if (Array.isArray(propValue)) {
  657. return 'array';
  658. }
  659. if (propValue instanceof RegExp) {
  660. // Old webkits (at least until Android 4.0) return 'function' rather than
  661. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  662. // passes PropTypes.object.
  663. return 'object';
  664. }
  665. if (isSymbol(propType, propValue)) {
  666. return 'symbol';
  667. }
  668. return propType;
  669. }
  670. // This handles more types than `getPropType`. Only used for error messages.
  671. // See `createPrimitiveTypeChecker`.
  672. function getPreciseType(propValue) {
  673. if (typeof propValue === 'undefined' || propValue === null) {
  674. return '' + propValue;
  675. }
  676. var propType = getPropType(propValue);
  677. if (propType === 'object') {
  678. if (propValue instanceof Date) {
  679. return 'date';
  680. } else if (propValue instanceof RegExp) {
  681. return 'regexp';
  682. }
  683. }
  684. return propType;
  685. }
  686. // Returns a string that is postfixed to a warning about an invalid type.
  687. // For example, "undefined" or "of type array"
  688. function getPostfixForTypeWarning(value) {
  689. var type = getPreciseType(value);
  690. switch (type) {
  691. case 'array':
  692. case 'object':
  693. return 'an ' + type;
  694. case 'boolean':
  695. case 'date':
  696. case 'regexp':
  697. return 'a ' + type;
  698. default:
  699. return type;
  700. }
  701. }
  702. // Returns class name of the object, if any.
  703. function getClassName(propValue) {
  704. if (!propValue.constructor || !propValue.constructor.name) {
  705. return ANONYMOUS;
  706. }
  707. return propValue.constructor.name;
  708. }
  709. ReactPropTypes.checkPropTypes = checkPropTypes;
  710. ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  711. ReactPropTypes.PropTypes = ReactPropTypes;
  712. return ReactPropTypes;
  713. };
  714. },{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"./lib/has":6,"object-assign":7,"react-is":11}],4:[function(require,module,exports){
  715. /**
  716. * Copyright (c) 2013-present, Facebook, Inc.
  717. *
  718. * This source code is licensed under the MIT license found in the
  719. * LICENSE file in the root directory of this source tree.
  720. */
  721. if ("development" !== 'production') {
  722. var ReactIs = require('react-is');
  723. // By explicitly using `prop-types` you are opting into new development behavior.
  724. // http://fb.me/prop-types-in-prod
  725. var throwOnDirectAccess = true;
  726. module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);
  727. } else {
  728. // By explicitly using `prop-types` you are opting into new production behavior.
  729. // http://fb.me/prop-types-in-prod
  730. module.exports = require('./factoryWithThrowingShims')();
  731. }
  732. },{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3,"react-is":11}],5:[function(require,module,exports){
  733. /**
  734. * Copyright (c) 2013-present, Facebook, Inc.
  735. *
  736. * This source code is licensed under the MIT license found in the
  737. * LICENSE file in the root directory of this source tree.
  738. */
  739. 'use strict';
  740. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  741. module.exports = ReactPropTypesSecret;
  742. },{}],6:[function(require,module,exports){
  743. module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
  744. },{}],7:[function(require,module,exports){
  745. /*
  746. object-assign
  747. (c) Sindre Sorhus
  748. @license MIT
  749. */
  750. 'use strict';
  751. /* eslint-disable no-unused-vars */
  752. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  753. var hasOwnProperty = Object.prototype.hasOwnProperty;
  754. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  755. function toObject(val) {
  756. if (val === null || val === undefined) {
  757. throw new TypeError('Object.assign cannot be called with null or undefined');
  758. }
  759. return Object(val);
  760. }
  761. function shouldUseNative() {
  762. try {
  763. if (!Object.assign) {
  764. return false;
  765. }
  766. // Detect buggy property enumeration order in older V8 versions.
  767. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  768. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  769. test1[5] = 'de';
  770. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  771. return false;
  772. }
  773. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  774. var test2 = {};
  775. for (var i = 0; i < 10; i++) {
  776. test2['_' + String.fromCharCode(i)] = i;
  777. }
  778. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  779. return test2[n];
  780. });
  781. if (order2.join('') !== '0123456789') {
  782. return false;
  783. }
  784. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  785. var test3 = {};
  786. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  787. test3[letter] = letter;
  788. });
  789. if (Object.keys(Object.assign({}, test3)).join('') !==
  790. 'abcdefghijklmnopqrst') {
  791. return false;
  792. }
  793. return true;
  794. } catch (err) {
  795. // We don't expect any of the above to throw, but better to be safe.
  796. return false;
  797. }
  798. }
  799. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  800. var from;
  801. var to = toObject(target);
  802. var symbols;
  803. for (var s = 1; s < arguments.length; s++) {
  804. from = Object(arguments[s]);
  805. for (var key in from) {
  806. if (hasOwnProperty.call(from, key)) {
  807. to[key] = from[key];
  808. }
  809. }
  810. if (getOwnPropertySymbols) {
  811. symbols = getOwnPropertySymbols(from);
  812. for (var i = 0; i < symbols.length; i++) {
  813. if (propIsEnumerable.call(from, symbols[i])) {
  814. to[symbols[i]] = from[symbols[i]];
  815. }
  816. }
  817. }
  818. }
  819. return to;
  820. };
  821. },{}],8:[function(require,module,exports){
  822. // shim for using process in browser
  823. var process = module.exports = {};
  824. // cached from whatever global is present so that test runners that stub it
  825. // don't break things. But we need to wrap it in a try catch in case it is
  826. // wrapped in strict mode code which doesn't define any globals. It's inside a
  827. // function because try/catches deoptimize in certain engines.
  828. var cachedSetTimeout;
  829. var cachedClearTimeout;
  830. function defaultSetTimout() {
  831. throw new Error('setTimeout has not been defined');
  832. }
  833. function defaultClearTimeout () {
  834. throw new Error('clearTimeout has not been defined');
  835. }
  836. (function () {
  837. try {
  838. if (typeof setTimeout === 'function') {
  839. cachedSetTimeout = setTimeout;
  840. } else {
  841. cachedSetTimeout = defaultSetTimout;
  842. }
  843. } catch (e) {
  844. cachedSetTimeout = defaultSetTimout;
  845. }
  846. try {
  847. if (typeof clearTimeout === 'function') {
  848. cachedClearTimeout = clearTimeout;
  849. } else {
  850. cachedClearTimeout = defaultClearTimeout;
  851. }
  852. } catch (e) {
  853. cachedClearTimeout = defaultClearTimeout;
  854. }
  855. } ())
  856. function runTimeout(fun) {
  857. if (cachedSetTimeout === setTimeout) {
  858. //normal enviroments in sane situations
  859. return setTimeout(fun, 0);
  860. }
  861. // if setTimeout wasn't available but was latter defined
  862. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  863. cachedSetTimeout = setTimeout;
  864. return setTimeout(fun, 0);
  865. }
  866. try {
  867. // when when somebody has screwed with setTimeout but no I.E. maddness
  868. return cachedSetTimeout(fun, 0);
  869. } catch(e){
  870. try {
  871. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  872. return cachedSetTimeout.call(null, fun, 0);
  873. } catch(e){
  874. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  875. return cachedSetTimeout.call(this, fun, 0);
  876. }
  877. }
  878. }
  879. function runClearTimeout(marker) {
  880. if (cachedClearTimeout === clearTimeout) {
  881. //normal enviroments in sane situations
  882. return clearTimeout(marker);
  883. }
  884. // if clearTimeout wasn't available but was latter defined
  885. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  886. cachedClearTimeout = clearTimeout;
  887. return clearTimeout(marker);
  888. }
  889. try {
  890. // when when somebody has screwed with setTimeout but no I.E. maddness
  891. return cachedClearTimeout(marker);
  892. } catch (e){
  893. try {
  894. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  895. return cachedClearTimeout.call(null, marker);
  896. } catch (e){
  897. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  898. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  899. return cachedClearTimeout.call(this, marker);
  900. }
  901. }
  902. }
  903. var queue = [];
  904. var draining = false;
  905. var currentQueue;
  906. var queueIndex = -1;
  907. function cleanUpNextTick() {
  908. if (!draining || !currentQueue) {
  909. return;
  910. }
  911. draining = false;
  912. if (currentQueue.length) {
  913. queue = currentQueue.concat(queue);
  914. } else {
  915. queueIndex = -1;
  916. }
  917. if (queue.length) {
  918. drainQueue();
  919. }
  920. }
  921. function drainQueue() {
  922. if (draining) {
  923. return;
  924. }
  925. var timeout = runTimeout(cleanUpNextTick);
  926. draining = true;
  927. var len = queue.length;
  928. while(len) {
  929. currentQueue = queue;
  930. queue = [];
  931. while (++queueIndex < len) {
  932. if (currentQueue) {
  933. currentQueue[queueIndex].run();
  934. }
  935. }
  936. queueIndex = -1;
  937. len = queue.length;
  938. }
  939. currentQueue = null;
  940. draining = false;
  941. runClearTimeout(timeout);
  942. }
  943. process.nextTick = function (fun) {
  944. var args = new Array(arguments.length - 1);
  945. if (arguments.length > 1) {
  946. for (var i = 1; i < arguments.length; i++) {
  947. args[i - 1] = arguments[i];
  948. }
  949. }
  950. queue.push(new Item(fun, args));
  951. if (queue.length === 1 && !draining) {
  952. runTimeout(drainQueue);
  953. }
  954. };
  955. // v8 likes predictible objects
  956. function Item(fun, array) {
  957. this.fun = fun;
  958. this.array = array;
  959. }
  960. Item.prototype.run = function () {
  961. this.fun.apply(null, this.array);
  962. };
  963. process.title = 'browser';
  964. process.browser = true;
  965. process.env = {};
  966. process.argv = [];
  967. process.version = ''; // empty string to avoid regexp issues
  968. process.versions = {};
  969. function noop() {}
  970. process.on = noop;
  971. process.addListener = noop;
  972. process.once = noop;
  973. process.off = noop;
  974. process.removeListener = noop;
  975. process.removeAllListeners = noop;
  976. process.emit = noop;
  977. process.prependListener = noop;
  978. process.prependOnceListener = noop;
  979. process.listeners = function (name) { return [] }
  980. process.binding = function (name) {
  981. throw new Error('process.binding is not supported');
  982. };
  983. process.cwd = function () { return '/' };
  984. process.chdir = function (dir) {
  985. throw new Error('process.chdir is not supported');
  986. };
  987. process.umask = function() { return 0; };
  988. },{}],9:[function(require,module,exports){
  989. (function (process){(function (){
  990. /** @license React v16.13.1
  991. * react-is.development.js
  992. *
  993. * Copyright (c) Facebook, Inc. and its affiliates.
  994. *
  995. * This source code is licensed under the MIT license found in the
  996. * LICENSE file in the root directory of this source tree.
  997. */
  998. 'use strict';
  999. if (process.env.NODE_ENV !== "production") {
  1000. (function() {
  1001. 'use strict';
  1002. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  1003. // nor polyfill, then a plain number is used for performance.
  1004. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  1005. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  1006. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  1007. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  1008. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  1009. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  1010. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  1011. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  1012. // (unstable) APIs that have been removed. Can we remove the symbols?
  1013. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  1014. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  1015. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  1016. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  1017. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  1018. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  1019. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  1020. var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
  1021. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  1022. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  1023. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  1024. function isValidElementType(type) {
  1025. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  1026. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
  1027. }
  1028. function typeOf(object) {
  1029. if (typeof object === 'object' && object !== null) {
  1030. var $$typeof = object.$$typeof;
  1031. switch ($$typeof) {
  1032. case REACT_ELEMENT_TYPE:
  1033. var type = object.type;
  1034. switch (type) {
  1035. case REACT_ASYNC_MODE_TYPE:
  1036. case REACT_CONCURRENT_MODE_TYPE:
  1037. case REACT_FRAGMENT_TYPE:
  1038. case REACT_PROFILER_TYPE:
  1039. case REACT_STRICT_MODE_TYPE:
  1040. case REACT_SUSPENSE_TYPE:
  1041. return type;
  1042. default:
  1043. var $$typeofType = type && type.$$typeof;
  1044. switch ($$typeofType) {
  1045. case REACT_CONTEXT_TYPE:
  1046. case REACT_FORWARD_REF_TYPE:
  1047. case REACT_LAZY_TYPE:
  1048. case REACT_MEMO_TYPE:
  1049. case REACT_PROVIDER_TYPE:
  1050. return $$typeofType;
  1051. default:
  1052. return $$typeof;
  1053. }
  1054. }
  1055. case REACT_PORTAL_TYPE:
  1056. return $$typeof;
  1057. }
  1058. }
  1059. return undefined;
  1060. } // AsyncMode is deprecated along with isAsyncMode
  1061. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  1062. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  1063. var ContextConsumer = REACT_CONTEXT_TYPE;
  1064. var ContextProvider = REACT_PROVIDER_TYPE;
  1065. var Element = REACT_ELEMENT_TYPE;
  1066. var ForwardRef = REACT_FORWARD_REF_TYPE;
  1067. var Fragment = REACT_FRAGMENT_TYPE;
  1068. var Lazy = REACT_LAZY_TYPE;
  1069. var Memo = REACT_MEMO_TYPE;
  1070. var Portal = REACT_PORTAL_TYPE;
  1071. var Profiler = REACT_PROFILER_TYPE;
  1072. var StrictMode = REACT_STRICT_MODE_TYPE;
  1073. var Suspense = REACT_SUSPENSE_TYPE;
  1074. var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  1075. function isAsyncMode(object) {
  1076. {
  1077. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  1078. hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
  1079. console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
  1080. }
  1081. }
  1082. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  1083. }
  1084. function isConcurrentMode(object) {
  1085. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  1086. }
  1087. function isContextConsumer(object) {
  1088. return typeOf(object) === REACT_CONTEXT_TYPE;
  1089. }
  1090. function isContextProvider(object) {
  1091. return typeOf(object) === REACT_PROVIDER_TYPE;
  1092. }
  1093. function isElement(object) {
  1094. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  1095. }
  1096. function isForwardRef(object) {
  1097. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  1098. }
  1099. function isFragment(object) {
  1100. return typeOf(object) === REACT_FRAGMENT_TYPE;
  1101. }
  1102. function isLazy(object) {
  1103. return typeOf(object) === REACT_LAZY_TYPE;
  1104. }
  1105. function isMemo(object) {
  1106. return typeOf(object) === REACT_MEMO_TYPE;
  1107. }
  1108. function isPortal(object) {
  1109. return typeOf(object) === REACT_PORTAL_TYPE;
  1110. }
  1111. function isProfiler(object) {
  1112. return typeOf(object) === REACT_PROFILER_TYPE;
  1113. }
  1114. function isStrictMode(object) {
  1115. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  1116. }
  1117. function isSuspense(object) {
  1118. return typeOf(object) === REACT_SUSPENSE_TYPE;
  1119. }
  1120. exports.AsyncMode = AsyncMode;
  1121. exports.ConcurrentMode = ConcurrentMode;
  1122. exports.ContextConsumer = ContextConsumer;
  1123. exports.ContextProvider = ContextProvider;
  1124. exports.Element = Element;
  1125. exports.ForwardRef = ForwardRef;
  1126. exports.Fragment = Fragment;
  1127. exports.Lazy = Lazy;
  1128. exports.Memo = Memo;
  1129. exports.Portal = Portal;
  1130. exports.Profiler = Profiler;
  1131. exports.StrictMode = StrictMode;
  1132. exports.Suspense = Suspense;
  1133. exports.isAsyncMode = isAsyncMode;
  1134. exports.isConcurrentMode = isConcurrentMode;
  1135. exports.isContextConsumer = isContextConsumer;
  1136. exports.isContextProvider = isContextProvider;
  1137. exports.isElement = isElement;
  1138. exports.isForwardRef = isForwardRef;
  1139. exports.isFragment = isFragment;
  1140. exports.isLazy = isLazy;
  1141. exports.isMemo = isMemo;
  1142. exports.isPortal = isPortal;
  1143. exports.isProfiler = isProfiler;
  1144. exports.isStrictMode = isStrictMode;
  1145. exports.isSuspense = isSuspense;
  1146. exports.isValidElementType = isValidElementType;
  1147. exports.typeOf = typeOf;
  1148. })();
  1149. }
  1150. }).call(this)}).call(this,require('_process'))
  1151. },{"_process":8}],10:[function(require,module,exports){
  1152. /** @license React v16.13.1
  1153. * react-is.production.min.js
  1154. *
  1155. * Copyright (c) Facebook, Inc. and its affiliates.
  1156. *
  1157. * This source code is licensed under the MIT license found in the
  1158. * LICENSE file in the root directory of this source tree.
  1159. */
  1160. 'use strict';var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
  1161. Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
  1162. function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
  1163. exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
  1164. exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
  1165. exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
  1166. },{}],11:[function(require,module,exports){
  1167. (function (process){(function (){
  1168. 'use strict';
  1169. if (process.env.NODE_ENV === 'production') {
  1170. module.exports = require('./cjs/react-is.production.min.js');
  1171. } else {
  1172. module.exports = require('./cjs/react-is.development.js');
  1173. }
  1174. }).call(this)}).call(this,require('_process'))
  1175. },{"./cjs/react-is.development.js":9,"./cjs/react-is.production.min.js":10,"_process":8}]},{},[4])(4)
  1176. });