From 0e980167a3b71429cd7ad18a6a19117a7ba878d2 Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 6 Apr 2022 22:36:13 +0100 Subject: [PATCH 1/3] rake react:update ujs:update --- .../react-source/development/react-server.js | 4256 +- lib/assets/react-source/development/react.js | 42612 ++++++++-------- .../react-source/production/react-server.js | 8 +- lib/assets/react-source/production/react.js | 16 +- react-builds/yarn.lock | 666 +- yarn.lock | 419 +- 6 files changed, 23203 insertions(+), 24774 deletions(-) diff --git a/lib/assets/react-source/development/react-server.js b/lib/assets/react-source/development/react-server.js index 6bdded76d..72b3a653d 100644 --- a/lib/assets/react-source/development/react-server.js +++ b/lib/assets/react-source/development/react-server.js @@ -45,9 +45,9 @@ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var React = __webpack_require__(1); - var ReactDOMServer = __webpack_require__(29); - var createReactClass = __webpack_require__(17); - var PropTypes = __webpack_require__(23); + var ReactDOMServer = __webpack_require__(26); + var createReactClass = __webpack_require__(18); + var PropTypes = __webpack_require__(20); global.React = React; global.ReactDOMServer = ReactDOMServer; @@ -264,7 +264,7 @@ /* 3 */ /***/ (function(module, exports, __webpack_require__) { - /** @license React v16.9.0 + /** @license React v16.14.0 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -273,22 +273,22 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict';var h=__webpack_require__(4),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113,aa=n?Symbol.for("react.suspense_list"):60120,ba=n?Symbol.for("react.memo"): - 60115,ca=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.fundamental");n&&Symbol.for("react.responder");var z="function"===typeof Symbol&&Symbol.iterator; - function A(a){for(var b=a.message,d="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;cP.length&&P.push(a)} - function S(a,b,d,c){var e=typeof a;if("undefined"===e||"boolean"===e)a=null;var g=!1;if(null===a)g=!0;else switch(e){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return d(c,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;kQ.length&&Q.push(a)} + function T(a,b,c,e){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,""===b?"."+U(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;k 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + if (source) { + var path = source.fileName; + var fileName = path.replace(BEFORE_SLASH_RE, ''); + + { + // In DEV, include code for a common special case: + // prefer "folder/index.js" instead of just "index.js". + if (/^index\./.test(fileName)) { + var match = path.match(BEFORE_SLASH_RE); + + if (match) { + var pathBeforeSlash = match[1]; + + if (pathBeforeSlash) { + var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); + fileName = folderName + '/' + fileName; + } + } + } } - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; + } else if (ownerName) { + sourceInfo = ' (created by ' + ownerName + ')'; + } + + return '\n in ' + (name || 'Unknown') + sourceInfo; + } + + var Resolved = 1; + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ''; + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); + } + + function getComponentName(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + { + if (typeof type.tag === 'number') { + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; + } - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + if (typeof type === 'function') { + return type.displayName || type.name || null; + } + + if (typeof type === 'string') { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'Fragment'; + + case REACT_PORTAL_TYPE: + return 'Portal'; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return 'StrictMode'; + + case REACT_SUSPENSE_TYPE: + return 'Suspense'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + if (typeof type === 'object') { + switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return 'Context.Consumer'; + + case REACT_PROVIDER_TYPE: + return 'Context.Provider'; + + case REACT_FORWARD_REF_TYPE: + return getWrappedName(type, type.render, 'ForwardRef'); + + case REACT_MEMO_TYPE: + return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } + } - printWarning.apply(undefined, [format].concat(args)); + return null; + } + + var ReactDebugCurrentFrame = {}; + var currentlyValidatingElement = null; + function setCurrentlyValidatingElement(element) { + { + currentlyValidatingElement = element; + } + } + + { + // Stack implementation injected by the current renderer. + ReactDebugCurrentFrame.getCurrentStack = null; + + ReactDebugCurrentFrame.getStackAddendum = function () { + var stack = ''; // Add an extra top frame while an element is being validated + + if (currentlyValidatingElement) { + var name = getComponentName(currentlyValidatingElement.type); + var owner = currentlyValidatingElement._owner; + stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); + } // Delegate to the injected renderer-specific implementation + + + var impl = ReactDebugCurrentFrame.getCurrentStack; + + if (impl) { + stack += impl() || ''; } + + return stack; }; } - var lowPriorityWarning$1 = lowPriorityWarning; - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. + * Used by act() to track whether you're inside an act() scope. */ + var IsSomeRendererActing = { + current: false + }; - var warningWithoutStack = function () {}; + var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // Used by renderers to avoid bundling object-assign twice in UMD bundles: + assign: _assign + }; { - warningWithoutStack = function (condition, format) { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } + _assign(ReactSharedInternals, { + // These should not be included in production. + ReactDebugCurrentFrame: ReactDebugCurrentFrame, + // Shim for React DOM 16.0.0 which still destructured (but not used) this. + // TODO: remove in React 17.0. + ReactComponentTreeHook: {} + }); + } - if (format === undefined) { - throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (args.length > 8) { - // Check before the condition to catch violations early. - throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. + + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - if (condition) { - return; + + printWarning('warn', format, args); + } + } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } - if (typeof console !== 'undefined') { - var argsWithFormat = args.map(function (item) { - return '' + item; - }); - argsWithFormat.unshift('Warning: ' + format); - // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - Function.prototype.apply.call(console.error, console, argsWithFormat); + printWarning('error', format, args); + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack @@ -574,29 +717,31 @@ }); throw new Error(message); } catch (x) {} - }; + } } - var warningWithoutStack$1 = warningWithoutStack; - var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; - var warningKey = componentName + '.' + callerName; + var warningKey = componentName + "." + callerName; + if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } - warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + + error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); + didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } - /** * This is the abstract API for an update queue. */ + + var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. @@ -663,25 +808,26 @@ }; var emptyObject = {}; + { Object.freeze(emptyObject); } - /** * Base class helpers for the updating state of a component. */ + + function Component(props, context, updater) { this.props = props; - this.context = context; - // If a component has string refs, we will assign a different object later. - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the + this.context = context; // If a component has string refs, we will assign a different object later. + + this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. + this.updater = updater || ReactNoopUpdateQueue; } Component.prototype.isReactComponent = {}; - /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. @@ -707,17 +853,16 @@ * @final * @protected */ + Component.prototype.setState = function (partialState, callback) { - (function () { - if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { - { - throw ReactError(Error('setState(...): takes an object of state variables to update or a function which returns an object of state variables.')); - } + if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { + { + throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); } - })(); + } + this.updater.enqueueSetState(this, partialState, callback, 'setState'); }; - /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. @@ -732,28 +877,34 @@ * @final * @protected */ + + Component.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); }; - /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ + + { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; + var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { - lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; } }); }; + for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); @@ -762,23 +913,25 @@ } function ComponentDummy() {} - ComponentDummy.prototype = Component.prototype; + ComponentDummy.prototype = Component.prototype; /** * Convenience component with default shallow equality check for sCU. */ + function PureComponent(props, context, updater) { this.props = props; - this.context = context; - // If a component has string refs, we will assign a different object later. + this.context = context; // If a component has string refs, we will assign a different object later. + this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); - pureComponentPrototype.constructor = PureComponent; - // Avoid an extra prototype jump for these methods. + pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. + _assign(pureComponentPrototype, Component.prototype); + pureComponentPrototype.isPureReactComponent = true; // an immutable object with a single mutable value @@ -786,249 +939,38 @@ var refObject = { current: null }; - { - Object.seal(refObject); - } - return refObject; - } - - /** - * Keeps track of the current dispatcher. - */ - var ReactCurrentDispatcher = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - - /** - * Keeps track of the current batch's configuration such as how long an update - * should suspend for if it needs to. - */ - var ReactCurrentBatchConfig = { - suspense: null - }; - - /** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ - var ReactCurrentOwner = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }; - - var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - - var describeComponentFrame = function (name, source, ownerName) { - var sourceInfo = ''; - if (source) { - var path = source.fileName; - var fileName = path.replace(BEFORE_SLASH_RE, ''); - { - // In DEV, include code for a common special case: - // prefer "folder/index.js" instead of just "index.js". - if (/^index\./.test(fileName)) { - var match = path.match(BEFORE_SLASH_RE); - if (match) { - var pathBeforeSlash = match[1]; - if (pathBeforeSlash) { - var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); - fileName = folderName + '/' + fileName; - } - } - } - } - sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; - } else if (ownerName) { - sourceInfo = ' (created by ' + ownerName + ')'; - } - return '\n in ' + (name || 'Unknown') + sourceInfo; - }; - - var Resolved = 1; - - - function refineResolvedLazyComponent(lazyComponent) { - return lazyComponent._status === Resolved ? lazyComponent._result : null; - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName); - } - - function getComponentName(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - { - if (typeof type.tag === 'number') { - warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); - } - } - if (typeof type === 'function') { - return type.displayName || type.name || null; - } - if (typeof type === 'string') { - return type; - } - switch (type) { - case REACT_FRAGMENT_TYPE: - return 'Fragment'; - case REACT_PORTAL_TYPE: - return 'Portal'; - case REACT_PROFILER_TYPE: - return 'Profiler'; - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - case REACT_SUSPENSE_TYPE: - return 'Suspense'; - case REACT_SUSPENSE_LIST_TYPE: - return 'SuspenseList'; - } - if (typeof type === 'object') { - switch (type.$$typeof) { - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, 'ForwardRef'); - case REACT_MEMO_TYPE: - return getComponentName(type.type); - case REACT_LAZY_TYPE: - { - var thenable = type; - var resolvedThenable = refineResolvedLazyComponent(thenable); - if (resolvedThenable) { - return getComponentName(resolvedThenable); - } - break; - } - } - } - return null; - } - var ReactDebugCurrentFrame = {}; - - var currentlyValidatingElement = null; - - function setCurrentlyValidatingElement(element) { { - currentlyValidatingElement = element; + Object.seal(refObject); } - } - - { - // Stack implementation injected by the current renderer. - ReactDebugCurrentFrame.getCurrentStack = null; - - ReactDebugCurrentFrame.getStackAddendum = function () { - var stack = ''; - - // Add an extra top frame while an element is being validated - if (currentlyValidatingElement) { - var name = getComponentName(currentlyValidatingElement.type); - var owner = currentlyValidatingElement._owner; - stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type)); - } - - // Delegate to the injected renderer-specific implementation - var impl = ReactDebugCurrentFrame.getCurrentStack; - if (impl) { - stack += impl() || ''; - } - - return stack; - }; - } - - /** - * Used by act() to track whether you're inside an act() scope. - */ - - var IsSomeRendererActing = { - current: false - }; - - var ReactSharedInternals = { - ReactCurrentDispatcher: ReactCurrentDispatcher, - ReactCurrentBatchConfig: ReactCurrentBatchConfig, - ReactCurrentOwner: ReactCurrentOwner, - IsSomeRendererActing: IsSomeRendererActing, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: _assign - }; - - { - _assign(ReactSharedInternals, { - // These should not be included in production. - ReactDebugCurrentFrame: ReactDebugCurrentFrame, - // Shim for React DOM 16.0.0 which still destructured (but not used) this. - // TODO: remove in React 17.0. - ReactComponentTreeHook: {} - }); - } - - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = warningWithoutStack$1; - { - warning = function (condition, format) { - if (condition) { - return; - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - // eslint-disable-next-line react-internal/warning-and-invariant-args - - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack])); - }; + return refObject; } - var warning$1 = warning; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; + var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; - var specialPropKeyWarningShown = void 0; - var specialPropRefWarningShown = void 0; + { + didWarnAboutStringRefs = {}; + } function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { return false; } } } + return config.ref !== undefined; } @@ -1036,21 +978,27 @@ { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { return false; } } } + return config.key !== undefined; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + + error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } } }; + warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, @@ -1060,11 +1008,15 @@ function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + + error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName); + } } }; + warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, @@ -1072,10 +1024,23 @@ }); } + function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = true; + } + } + } + } /** * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, no instanceof check - * will work. Instead test $$typeof field against Symbol.for('react.element') to check + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type @@ -1092,17 +1057,17 @@ * indicating filename, line number, and/or other information. * @internal */ + + var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, - // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, - // Record the component responsible for creating this element. _owner: owner }; @@ -1112,33 +1077,33 @@ // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. - element._store = {}; - - // To make comparing ReactElements easier for testing purposes, we make + element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. + Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false - }); - // self and source are DEV only properties. + }); // self and source are DEV only properties. + Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self - }); - // Two elements created in two different places should be considered + }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. + Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); + if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); @@ -1147,84 +1112,15 @@ return element; }; - - /** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ - - - /** - * https://github.com/reactjs/rfcs/pull/107 - * @param {*} type - * @param {object} props - * @param {string} key - */ - function jsxDEV(type, config, maybeKey, source, self) { - var propName = void 0; - - // Reserved names are extracted - var props = {}; - - var key = null; - var ref = null; - - if (hasValidRef(config)) { - ref = config.ref; - } - - if (hasValidKey(config)) { - key = '' + config.key; - } - - // Remaining properties are added to a new props object - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - - // intentionally not checking if key was set above - // this key is higher priority as it's static - if (maybeKey !== undefined) { - key = '' + maybeKey; - } - - // Resolve default props - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - - if (key || ref) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); - } - /** * Create and return a new ReactElement of the given type. * See https://reactjs.org/docs/react-api.html#createelement */ + function createElement(type, config, children) { - var propName = void 0; + var propName; // Reserved names are extracted - // Reserved names are extracted var props = {}; - var key = null; var ref = null; var self = null; @@ -1233,103 +1129,105 @@ if (config != null) { if (hasValidRef(config)) { ref = config.ref; + + { + warnIfStringRefCannotBeAutoConverted(config); + } } + if (hasValidKey(config)) { key = '' + config.key; } self = config.__self === undefined ? null : config.__self; - source = config.__source === undefined ? null : config.__source; - // Remaining properties are added to a new props object + source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object + for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } - } - - // Children can be more than one argument, and those are transferred onto + } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } + { if (Object.freeze) { Object.freeze(childArray); } } + props.children = childArray; - } + } // Resolve default props + - // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; + for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } + { if (key || ref) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { defineKeyPropWarningGetter(props, displayName); } + if (ref) { defineRefPropWarningGetter(props, displayName); } } } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } - - /** - * Return a function that produces ReactElements of a given type. - * See https://reactjs.org/docs/react-api.html#createfactory - */ - - function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - return newElement; } - /** * Clone and return a new ReactElement using element as the starting point. * See https://reactjs.org/docs/react-api.html#cloneelement */ + function cloneElement(element, config, children) { - (function () { - if (!!(element === null || element === undefined)) { - { - throw ReactError(Error('React.cloneElement(...): The argument must be a React element, but you passed ' + element + '.')); - } + if (!!(element === null || element === undefined)) { + { + throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); } - })(); + } - var propName = void 0; + var propName; // Original props are copied + + var props = _assign({}, element.props); // Reserved names are extracted - // Original props are copied - var props = _assign({}, element.props); - // Reserved names are extracted var key = element.key; - var ref = element.ref; - // Self is preserved since the owner is preserved. - var self = element._self; - // Source is preserved since cloneElement is unlikely to be targeted by a + var ref = element.ref; // Self is preserved since the owner is preserved. + + var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. - var source = element._source; - // Owner will be preserved, unless ref is overridden + var source = element._source; // Owner will be preserved, unless ref is overridden + var owner = element._owner; if (config != null) { @@ -1338,15 +1236,18 @@ ref = config.ref; owner = ReactCurrentOwner.current; } + if (hasValidKey(config)) { key = '' + config.key; - } + } // Remaining properties override existing props + + + var defaultProps; - // Remaining properties override existing props - var defaultProps = void 0; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } + for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { @@ -1357,24 +1258,26 @@ } } } - } - - // Children can be more than one argument, and those are transferred onto + } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. + + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } + props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); } - /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement @@ -1382,19 +1285,20 @@ * @return {boolean} True if `object` is a ReactElement. * @final */ + function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = '.'; var SUBSEPARATOR = ':'; - /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ + function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { @@ -1404,24 +1308,24 @@ var escapedString = ('' + key).replace(escapeRegex, function (match) { return escaperLookup[match]; }); - return '$' + escapedString; } - /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ - var didWarnAboutMaps = false; + var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; + function escapeUserProvidedKey(text) { return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); } var POOL_SIZE = 10; var traverseContextPool = []; + function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) { if (traverseContextPool.length) { var traverseContext = traverseContextPool.pop(); @@ -1448,11 +1352,11 @@ traverseContext.func = null; traverseContext.context = null; traverseContext.count = 0; + if (traverseContextPool.length < POOL_SIZE) { traverseContextPool.push(traverseContext); } } - /** * @param {?*} children Children tree container. * @param {!string} nameSoFar Name of the key path so far. @@ -1461,6 +1365,8 @@ * process. * @return {!number} The number of children in this subtree. */ + + function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; @@ -1479,26 +1385,28 @@ case 'number': invokeCallback = true; break; + case 'object': switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } + } } if (invokeCallback) { - callback(traverseContext, children, - // If it's the only child, treat the name as if it was wrapped in an array + callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); return 1; } - var child = void 0; - var nextName = void 0; + var child; + var nextName; var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) { @@ -1509,18 +1417,24 @@ } } else { var iteratorFn = getIteratorFn(children); + if (typeof iteratorFn === 'function') { + { // Warn about using Maps as children if (iteratorFn === children.entries) { - !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0; + if (!didWarnAboutMaps) { + warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.'); + } + didWarnAboutMaps = true; } } var iterator = iteratorFn.call(children); - var step = void 0; + var step; var ii = 0; + while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getComponentKey(child, ii++); @@ -1528,23 +1442,23 @@ } } else if (type === 'object') { var addendum = ''; + { addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum(); } + var childrenString = '' + children; - (function () { + + { { - { - throw ReactError(Error('Objects are not valid as a React child (found: ' + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ').' + addendum)); - } + throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum ); } - })(); + } } } return subtreeCount; } - /** * Traverses children that are typically specified as `props.children`, but * might also be specified through attributes: @@ -1561,6 +1475,8 @@ * @param {?*} traverseContext Context for traversal. * @return {!number} The number of children in this subtree. */ + + function traverseAllChildren(children, callback, traverseContext) { if (children == null) { return 0; @@ -1568,7 +1484,6 @@ return traverseAllChildrenImpl(children, '', callback, traverseContext); } - /** * Generate a key string that identifies a component within a set. * @@ -1576,24 +1491,25 @@ * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ + + function getComponentKey(component, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (typeof component === 'object' && component !== null && component.key != null) { // Explicit key return escape(component.key); - } - // Implicit key determined by the index in the set + } // Implicit key determined by the index in the set + + return index.toString(36); } function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func, context = bookKeeping.context; - func.call(context, child, bookKeeping.count++); } - /** * Iterates through children that are typically specified as `props.children`. * @@ -1606,10 +1522,13 @@ * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ + + function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } + var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); releaseTraverseContext(traverseContext); @@ -1620,34 +1539,34 @@ keyPrefix = bookKeeping.keyPrefix, func = bookKeeping.func, context = bookKeeping.context; - - var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { return c; }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { - mappedChild = cloneAndReplaceKey(mappedChild, - // Keep both the (mapped) and old keys if they differ, just as + mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); } + result.push(mappedChild); } } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ''; + if (prefix != null) { escapedPrefix = escapeUserProvidedKey(prefix) + '/'; } + var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); releaseTraverseContext(traverseContext); } - /** * Maps children that are typically specified as `props.children`. * @@ -1661,15 +1580,17 @@ * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ + + function mapChildren(children, func, context) { if (children == null) { return children; } + var result = []; mapIntoWithKeyPrefixInternal(children, result, null, func, context); return result; } - /** * Count the number of children that are typically specified as * `props.children`. @@ -1679,18 +1600,21 @@ * @param {?*} children Children tree container. * @return {number} The number of children. */ + + function countChildren(children) { return traverseAllChildren(children, function () { return null; }, null); } - /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#reactchildrentoarray */ + + function toArray(children) { var result = []; mapIntoWithKeyPrefixInternal(children, result, null, function (child) { @@ -1698,7 +1622,6 @@ }); return result; } - /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. @@ -1713,14 +1636,15 @@ * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ + + function onlyChild(children) { - (function () { - if (!isValidElement(children)) { - { - throw ReactError(Error('React.Children.only expected to receive a single React element child.')); - } + if (!isValidElement(children)) { + { + throw Error( "React.Children.only expected to receive a single React element child." ); } - })(); + } + return children; } @@ -1729,7 +1653,9 @@ calculateChangedBits = null; } else { { - !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0; + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } } } @@ -1750,12 +1676,10 @@ Provider: null, Consumer: null }; - context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; - var hasWarnedAboutUsingNestedContextConsumers = false; var hasWarnedAboutUsingConsumerProvider = false; @@ -1767,15 +1691,17 @@ $$typeof: REACT_CONTEXT_TYPE, _context: context, _calculateChangedBits: context._calculateChangedBits - }; - // $FlowFixMe: Flow complains about not setting a value, which is intentional here + }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here + Object.defineProperties(Consumer, { Provider: { get: function () { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; - warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); } + return context.Provider; }, set: function (_Provider) { @@ -1810,13 +1736,15 @@ get: function () { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; - warning$1(false, 'Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + + error('Rendering is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); } + return context.Consumer; } } - }); - // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + context.Consumer = Consumer; } @@ -1839,8 +1767,8 @@ { // In production, this would just set it on the object. - var defaultProps = void 0; - var propTypes = void 0; + var defaultProps; + var propTypes; Object.defineProperties(lazyType, { defaultProps: { configurable: true, @@ -1848,9 +1776,10 @@ return defaultProps; }, set: function (newDefaultProps) { - warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - defaultProps = newDefaultProps; - // Match production behavior more closely: + error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + defaultProps = newDefaultProps; // Match production behavior more closely: + Object.defineProperty(lazyType, 'defaultProps', { enumerable: true }); @@ -1862,9 +1791,10 @@ return propTypes; }, set: function (newPropTypes) { - warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); - propTypes = newPropTypes; - // Match production behavior more closely: + error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); + + propTypes = newPropTypes; // Match production behavior more closely: + Object.defineProperty(lazyType, 'propTypes', { enumerable: true }); @@ -1879,17 +1809,19 @@ function forwardRef(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { - warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); } else if (typeof render !== 'function') { - warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } else { - !( - // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object - render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0; + if (render.length !== 0 && render.length !== 2) { + error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); + } } if (render != null) { - !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0; + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } } } @@ -1900,17 +1832,17 @@ } function isValidElementType(type) { - return typeof type === 'string' || typeof type === 'function' || - // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - 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); + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + 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); } function memo(type, compare) { { if (!isValidElementType(type)) { - warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); + error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); } } + return { $$typeof: REACT_MEMO_TYPE, type: type, @@ -1920,76 +1852,71 @@ function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; - (function () { - if (!(dispatcher !== null)) { - { - throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.')); - } + + if (!(dispatcher !== null)) { + { + 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." ); } - })(); + } + return dispatcher; } function useContext(Context, unstable_observedBits) { var dispatcher = resolveDispatcher(); + { - !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; + if (unstable_observedBits !== undefined) { + error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : ''); + } // TODO: add a more generic warning for invalid values. + - // TODO: add a more generic warning for invalid values. if (Context._context !== undefined) { - var realContext = Context._context; - // Don't deduplicate because this legitimately causes bugs + var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs // and nobody should be using this in existing code. + if (realContext.Consumer === Context) { - warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); + error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); } else if (realContext.Provider === Context) { - warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); } } } + return dispatcher.useContext(Context, unstable_observedBits); } - function useState(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } - function useReducer(reducer, initialArg, init) { var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer, initialArg, init); } - function useRef(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } - - function useEffect(create, inputs) { + function useEffect(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useEffect(create, inputs); + return dispatcher.useEffect(create, deps); } - - function useLayoutEffect(create, inputs) { + function useLayoutEffect(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useLayoutEffect(create, inputs); + return dispatcher.useLayoutEffect(create, deps); } - - function useCallback(callback, inputs) { + function useCallback(callback, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useCallback(callback, inputs); + return dispatcher.useCallback(callback, deps); } - - function useMemo(create, inputs) { + function useMemo(create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useMemo(create, inputs); + return dispatcher.useMemo(create, deps); } - - function useImperativeHandle(ref, create, inputs) { + function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeHandle(ref, create, inputs); + return dispatcher.useImperativeHandle(ref, create, deps); } - function useDebugValue(value, formatterFn) { { var dispatcher = resolveDispatcher(); @@ -1997,38 +1924,7 @@ } } - var emptyObject$1 = {}; - - function useResponder(responder, listenerProps) { - var dispatcher = resolveDispatcher(); - { - if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) { - warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder); - return; - } - } - return dispatcher.useResponder(responder, listenerProps || emptyObject$1); - } - - // Within the scope of the callback, mark all updates as being allowed to suspend. - function withSuspenseConfig(scope, config) { - var previousConfig = ReactCurrentBatchConfig.suspense; - ReactCurrentBatchConfig.suspense = config === undefined ? null : config; - try { - scope(); - } finally { - ReactCurrentBatchConfig.suspense = previousConfig; - } - } - - /** - * ReactElementValidator provides a wrapper around a element factory - * which validates the props passed to the element. This is intended to be - * used only in DEV and could be replaced by a static type checker for languages - * that support it. - */ - - var propTypesMisspellWarningShown = void 0; + var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; @@ -2037,10 +1933,12 @@ function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentName(ReactCurrentOwner.current.type); + if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } + return ''; } @@ -2050,6 +1948,7 @@ var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } + return ''; } @@ -2057,14 +1956,16 @@ if (elementProps !== null && elementProps !== undefined) { return getSourceInfoErrorAddendum(elementProps.__source); } + return ''; } - /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ + + var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { @@ -2072,13 +1973,14 @@ if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { - info = '\n\nCheck the top-level render call using <' + parentName + '>.'; + info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } + return info; } - /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be @@ -2090,34 +1992,39 @@ * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ + + function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } - element._store.validated = true; + element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; - // Usually the current owner is the offender, but if it accepts children as a + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. - childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.'; + childOwner = " It was passed a child from " + getComponentName(element._owner.type) + "."; } setCurrentlyValidatingElement(element); + { - warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); + error('Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner); } + setCurrentlyValidatingElement(null); } - /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal @@ -2127,13 +2034,17 @@ * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ + + function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } + if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; + if (isValidElement(child)) { validateExplicitKey(child, parentType); } @@ -2145,12 +2056,14 @@ } } else if (node) { var iteratorFn = getIteratorFn(node); + if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); - var step = void 0; + var step; + while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); @@ -2160,196 +2073,127 @@ } } } - /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ - function validatePropTypes(element) { - var type = element.type; - if (type === null || type === undefined || typeof type === 'string') { - return; - } - var name = getComponentName(type); - var propTypes = void 0; - if (typeof type === 'function') { - propTypes = type.propTypes; - } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || - // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; - } else { - return; - } - if (propTypes) { - setCurrentlyValidatingElement(element); - checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); - setCurrentlyValidatingElement(null); - } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { - propTypesMisspellWarningShown = true; - warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); - } - if (typeof type.getDefaultProps === 'function') { - !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; - } - } - - /** - * Given a fragment, validate that it can only be provided with fragment props - * @param {ReactElement} fragment - */ - function validateFragmentProps(fragment) { - setCurrentlyValidatingElement(fragment); - - var keys = Object.keys(fragment.props); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== 'children' && key !== 'key') { - warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); - break; - } - } - - if (fragment.ref !== null) { - warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.'); - } - setCurrentlyValidatingElement(null); - } - function jsxWithValidation(type, props, key, isStaticChildren, source, self) { - var validType = isValidElementType(type); + function validatePropTypes(element) { + { + var type = element.type; - // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - if (!validType) { - var info = ''; - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - 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."; + if (type === null || type === undefined || typeof type === 'string') { + return; } - var sourceInfo = getSourceInfoErrorAddendum(source); - if (sourceInfo) { - info += sourceInfo; + var name = getComponentName(type); + var propTypes; + + if (typeof type === 'function') { + propTypes = type.propTypes; + } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. + // Inner props are checked in the reconciler. + type.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type.propTypes; } else { - info += getDeclarationErrorAddendum(); + return; } - var typeString = void 0; - if (type === null) { - typeString = 'null'; - } else if (Array.isArray(type)) { - typeString = 'array'; - } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />'; - info = ' Did you accidentally export a JSX literal instead of a component?'; - } else { - typeString = typeof type; + if (propTypes) { + setCurrentlyValidatingElement(element); + checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); + setCurrentlyValidatingElement(null); + } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { + propTypesMisspellWarningShown = true; + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); } - warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } } + } + /** + * Given a fragment, validate that it can only be provided with fragment props + * @param {ReactElement} fragment + */ - var element = jsxDEV(type, props, key, source, self); - // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - if (element == null) { - return element; - } + function validateFragmentProps(fragment) { + { + setCurrentlyValidatingElement(fragment); + var keys = Object.keys(fragment.props); - // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - if (validType) { - var children = props.children; - if (children !== undefined) { - if (isStaticChildren) { - for (var i = 0; i < children.length; i++) { - validateChildKeys(children[i], type); - } - } else { - validateChildKeys(children, type); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + + if (key !== 'children' && key !== 'key') { + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + break; } } - } - if (props.key !== undefined) { - warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. '); - } + if (fragment.ref !== null) { + error('Invalid attribute `ref` supplied to `React.Fragment`.'); + } - if (type === REACT_FRAGMENT_TYPE) { - validateFragmentProps(element); - } else { - validatePropTypes(element); + setCurrentlyValidatingElement(null); } - - return element; - } - - // These two functions exist to still get child warnings in dev - // even with the prod transform. This means that jsxDEV is purely - // opt-in behavior for better messages but that we won't stop - // giving you warnings if you use production apis. - function jsxWithValidationStatic(type, props, key) { - return jsxWithValidation(type, props, key, true); - } - - function jsxWithValidationDynamic(type, props, key) { - return jsxWithValidation(type, props, key, false); } - function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); - - // We warn in this case but don't throw. We expect the element creation to + var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. + if (!validType) { var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { 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."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); + if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } - var typeString = void 0; + var typeString; + if (type === null) { typeString = 'null'; } else if (Array.isArray(type)) { typeString = 'array'; } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />'; + typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />"; info = ' Did you accidentally export a JSX literal instead of a component?'; } else { typeString = typeof type; } - warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + { + error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); + } } - var element = createElement.apply(this, arguments); - - // The result can be nullish if a mock or a custom function is used. + var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { return element; - } - - // Skip key warning if the type isn't valid since our key validation logic + } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) + + if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); @@ -2364,16 +2208,24 @@ return element; } - + var didWarnAboutDeprecatedCreateFactory = false; function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; - // Legacy hook: remove it + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { - lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { value: type }); @@ -2384,246 +2236,71 @@ return validatedFactory; } - function cloneElementWithValidation(element, props, children) { var newElement = cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } + validatePropTypes(newElement); return newElement; } - var hasBadMapPolyfill = void 0; - { - hasBadMapPolyfill = false; + try { var frozenObject = Object.freeze({}); var testMap = new Map([[frozenObject, null]]); - var testSet = new Set([frozenObject]); - // This is necessary for Rollup to not consider these unused. + var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused. // https://github.com/rollup/rollup/issues/1771 // TODO: we can remove these if Rollup fixes the bug. + testMap.set(0, 0); testSet.add(0); } catch (e) { - // TODO: Consider warning about bad polyfills - hasBadMapPolyfill = true; - } - } - - function createFundamentalComponent(impl) { - // We use responder as a Map key later on. When we have a bad - // polyfill, then we can't use it as a key as the polyfill tries - // to add a property to the object. - if (true && !hasBadMapPolyfill) { - Object.freeze(impl); - } - var fundamantalComponent = { - $$typeof: REACT_FUNDAMENTAL_TYPE, - impl: impl - }; - { - Object.freeze(fundamantalComponent); - } - return fundamantalComponent; - } - - function createEventResponder(displayName, responderConfig) { - var getInitialState = responderConfig.getInitialState, - onEvent = responderConfig.onEvent, - onMount = responderConfig.onMount, - onUnmount = responderConfig.onUnmount, - onOwnershipChange = responderConfig.onOwnershipChange, - onRootEvent = responderConfig.onRootEvent, - rootEventTypes = responderConfig.rootEventTypes, - targetEventTypes = responderConfig.targetEventTypes; - - var eventResponder = { - $$typeof: REACT_RESPONDER_TYPE, - displayName: displayName, - getInitialState: getInitialState || null, - onEvent: onEvent || null, - onMount: onMount || null, - onOwnershipChange: onOwnershipChange || null, - onRootEvent: onRootEvent || null, - onUnmount: onUnmount || null, - rootEventTypes: rootEventTypes || null, - targetEventTypes: targetEventTypes || null - }; - // We use responder as a Map key later on. When we have a bad - // polyfill, then we can't use it as a key as the polyfill tries - // to add a property to the object. - if (true && !hasBadMapPolyfill) { - Object.freeze(eventResponder); } - return eventResponder; } - // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - - - // In some cases, StrictMode should also double-render lifecycles. - // This can be confusing for tests though, - // And it can be bad for performance in production. - // This feature flag can be used to control the behavior: - - - // To preserve the "Pause on caught exceptions" behavior of the debugger, we - // replay the begin phase of a failed component inside invokeGuardedCallback. - - - // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - - - // Gather advanced timing metrics for Profiler subtrees. - - - // Trace which interactions trigger each commit. - - - // Only used in www builds. - // TODO: true? Here it might just be false. - - // Only used in www builds. - - - // Only used in www builds. - - - // Disable javascript: URL strings in href for XSS protection. - - - // React Fire: prevent the value and checked attributes from syncing - // with their related DOM properties - - - // These APIs will no longer be "unstable" in the upcoming 16.7 release, - // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - - - - - // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information - // This is a flag so we can fix warnings in RN core before turning it on - - - // Experimental React Flare event system and event components support. - var enableFlareAPI = false; - - // Experimental Host Component support. - var enableFundamentalAPI = false; - - // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - var enableJSXTransformAPI = false; - - // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) - // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - - // Temporary flag to revert the fix in #15650 - - - // For tests, we flush suspense fallbacks in an act scope; - // *except* in some of our own tests, where we test incremental loading states. - - - // Changes priority of some events like mousemove to user-blocking priority, - // but without making them discrete. The flag exists in case it causes - // starvation problems. - - - // Add a callback property to suspense to notify which promises are currently - // in the update queue. This allows reporting and tracing of what is causing - // the user to see a loading state. - - - // Part of the simplification of React.createElement so we can eventually move - // from React.createElement to React.jsx - // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md - - var React = { - Children: { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray: toArray, - only: onlyChild - }, - - createRef: createRef, - Component: Component, - PureComponent: PureComponent, - - createContext: createContext, - forwardRef: forwardRef, - lazy: lazy, - memo: memo, - - useCallback: useCallback, - useContext: useContext, - useEffect: useEffect, - useImperativeHandle: useImperativeHandle, - useDebugValue: useDebugValue, - useLayoutEffect: useLayoutEffect, - useMemo: useMemo, - useReducer: useReducer, - useRef: useRef, - useState: useState, - - Fragment: REACT_FRAGMENT_TYPE, - Profiler: REACT_PROFILER_TYPE, - StrictMode: REACT_STRICT_MODE_TYPE, - Suspense: REACT_SUSPENSE_TYPE, - unstable_SuspenseList: REACT_SUSPENSE_LIST_TYPE, - - createElement: createElementWithValidation, - cloneElement: cloneElementWithValidation, - createFactory: createFactoryWithValidation, - isValidElement: isValidElement, - - version: ReactVersion, - - unstable_withSuspenseConfig: withSuspenseConfig, - - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals + var createElement$1 = createElementWithValidation ; + var cloneElement$1 = cloneElementWithValidation ; + var createFactory = createFactoryWithValidation ; + var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild }; - if (enableFlareAPI) { - React.unstable_useResponder = useResponder; - React.unstable_createResponder = createEventResponder; - } - - if (enableFundamentalAPI) { - React.unstable_createFundamental = createFundamentalComponent; - } - - // Note: some APIs are added with feature flags. - // Make sure that stable builds for open source - // don't modify the React object to avoid deopts. - // Also let's not expose their names in stable builds. - - if (enableJSXTransformAPI) { - { - React.jsxDEV = jsxWithValidation; - React.jsx = jsxWithValidationDynamic; - React.jsxs = jsxWithValidationStatic; - } - } - - - - var React$2 = Object.freeze({ - default: React - }); - - var React$3 = ( React$2 && React ) || React$2; - - // TODO: decide on the top-level export form. - // This is hacky but makes it work with both Rollup and Jest. - var react = React$3.default || React$3; - - module.exports = react; + exports.Children = Children; + exports.Component = Component; + exports.Fragment = REACT_FRAGMENT_TYPE; + exports.Profiler = REACT_PROFILER_TYPE; + exports.PureComponent = PureComponent; + exports.StrictMode = REACT_STRICT_MODE_TYPE; + exports.Suspense = REACT_SUSPENSE_TYPE; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + exports.cloneElement = cloneElement$1; + exports.createContext = createContext; + exports.createElement = createElement$1; + exports.createFactory = createFactory; + exports.createRef = createRef; + exports.forwardRef = forwardRef; + exports.isValidElement = isValidElement; + exports.lazy = lazy; + exports.memo = memo; + exports.useCallback = useCallback; + exports.useContext = useContext; + exports.useDebugValue = useDebugValue; + exports.useEffect = useEffect; + exports.useImperativeHandle = useImperativeHandle; + exports.useLayoutEffect = useLayoutEffect; + exports.useMemo = useMemo; + exports.useReducer = useReducer; + exports.useRef = useRef; + exports.useState = useState; + exports.version = ReactVersion; })(); } @@ -2647,7 +2324,7 @@ if (process.env.NODE_ENV !== 'production') { var ReactPropTypesSecret = __webpack_require__(7); var loggedTypeFailures = {}; - var has = Function.call.bind(Object.prototype.hasOwnProperty); + var has = __webpack_require__(8); printWarning = function(text) { var message = 'Warning: ' + text; @@ -2659,7 +2336,7 @@ // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); - } catch (x) {} + } catch (x) { /**/ } }; } @@ -2688,7 +2365,8 @@ if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + - 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' ); err.name = 'Invariant Violation'; throw err; @@ -2757,7 +2435,13 @@ /***/ }), -/* 8 */, +/* 8 */ +/***/ (function(module, exports) { + + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); + + +/***/ }), /* 9 */, /* 10 */, /* 11 */, @@ -2766,7 +2450,8 @@ /* 14 */, /* 15 */, /* 16 */, -/* 17 */ +/* 17 */, +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2780,7 +2465,7 @@ 'use strict'; var React = __webpack_require__(1); - var factory = __webpack_require__(18); + var factory = __webpack_require__(19); if (typeof React === 'undefined') { throw Error( @@ -2799,29 +2484,105 @@ ); -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + var _assign = __webpack_require__(4); + + // -- Inlined from fbjs -- + + var emptyObject = {}; + + if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); + } + + var validateFormat = function validateFormat(format) {}; + + if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; + } + + function _invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } + + var warning = function(){}; - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ + if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } - 'use strict'; + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; - var _assign = __webpack_require__(4); + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } - var emptyObject = __webpack_require__(19); - var _invariant = __webpack_require__(20); + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } - if (process.env.NODE_ENV !== 'production') { - var warning = __webpack_require__(21); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; } + // /-- Inlined from fbjs -- + var MIXINS_KEY = 'mixins'; // Helper function to allow the creation of anonymous functions which do not @@ -3732,199 +3493,8 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - 'use strict'; - - var emptyObject = {}; - - if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); - } - - module.exports = emptyObject; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) - /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - 'use strict'; - - /** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - - var validateFormat = function validateFormat(format) {}; - - if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; - } - - function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } - } - - module.exports = invariant; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - - /* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - 'use strict'; - - var emptyFunction = __webpack_require__(22); - - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = emptyFunction; - - if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; - } - - module.exports = warning; - /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - - "use strict"; - - /** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - function makeEmptyFunction(arg) { - return function () { - return arg; - }; - } - - /** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ - var emptyFunction = function emptyFunction() {}; - - emptyFunction.thatReturns = makeEmptyFunction; - emptyFunction.thatReturnsFalse = makeEmptyFunction(false); - emptyFunction.thatReturnsTrue = makeEmptyFunction(true); - emptyFunction.thatReturnsNull = makeEmptyFunction(null); - emptyFunction.thatReturnsThis = function () { - return this; - }; - emptyFunction.thatReturnsArgument = function (arg) { - return arg; - }; - - module.exports = emptyFunction; - -/***/ }), -/* 23 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3935,39 +3505,39 @@ */ if (process.env.NODE_ENV !== 'production') { - var ReactIs = __webpack_require__(24); + var ReactIs = __webpack_require__(21); // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; - module.exports = __webpack_require__(27)(ReactIs.isElement, throwOnDirectAccess); + module.exports = __webpack_require__(24)(ReactIs.isElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(28)(); + module.exports = __webpack_require__(25)(); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 24 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(25); + module.exports = __webpack_require__(22); } else { - module.exports = __webpack_require__(26); + module.exports = __webpack_require__(23); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 25 */ +/* 22 */ /***/ (function(module, exports) { - /** @license React v16.9.0 + /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -3976,19 +3546,19 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); - 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?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.fundamental"):60117,w=b?Symbol.for("react.responder"):60118;function x(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 h:return a;default:return u}}case t:case r:case d:return u}}}function y(a){return x(a)===m}exports.typeOf=x;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;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p; - 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===v||a.$$typeof===w)};exports.isAsyncMode=function(a){return y(a)||x(a)===l};exports.isConcurrentMode=y;exports.isContextConsumer=function(a){return x(a)===k};exports.isContextProvider=function(a){return x(a)===h}; - exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return x(a)===n};exports.isFragment=function(a){return x(a)===e};exports.isLazy=function(a){return x(a)===t};exports.isMemo=function(a){return x(a)===r};exports.isPortal=function(a){return x(a)===d};exports.isProfiler=function(a){return x(a)===g};exports.isStrictMode=function(a){return x(a)===f};exports.isSuspense=function(a){return x(a)===p}; + '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? + 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; + 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; + 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}; + 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}; + 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; /***/ }), -/* 26 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.9.0 + /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -4005,21 +3575,18 @@ (function() { 'use strict'; - Object.defineProperty(exports, '__esModule', { value: true }); - // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; - // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary // (unstable) APIs that have been removed. Can we remove the symbols? + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; @@ -4027,71 +3594,20 @@ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; - function isValidElementType(type) { - return typeof type === 'string' || typeof type === 'function' || - // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - 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); - } - - /** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var lowPriorityWarning = function () {}; - - { - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; - } - - var lowPriorityWarning$1 = lowPriorityWarning; + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + 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); + } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; + switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; @@ -4104,29 +3620,32 @@ case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; + default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; + default: return $$typeof; } + } - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; - } + } // AsyncMode is deprecated along with isAsyncMode - // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; @@ -4140,17 +3659,17 @@ var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated - var hasWarnedAboutDeprecatedIsAsyncMode = false; - - // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; - lowPriorityWarning$1(false, '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.'); + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint + + 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.'); } } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { @@ -4190,7 +3709,6 @@ return typeOf(object) === REACT_SUSPENSE_TYPE; } - exports.typeOf = typeOf; exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; @@ -4204,7 +3722,6 @@ exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; - exports.isValidElementType = isValidElementType; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; @@ -4218,13 +3735,15 @@ exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; })(); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 27 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -4236,13 +3755,13 @@ 'use strict'; - var ReactIs = __webpack_require__(24); + var ReactIs = __webpack_require__(21); var assign = __webpack_require__(4); var ReactPropTypesSecret = __webpack_require__(7); + var has = __webpack_require__(8); var checkPropTypes = __webpack_require__(6); - var has = Function.call.bind(Object.prototype.hasOwnProperty); var printWarning = function() {}; if (process.env.NODE_ENV !== 'production') { @@ -4343,6 +3862,7 @@ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), + bigint: createPrimitiveTypeChecker('bigint'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), @@ -4388,8 +3908,9 @@ * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ - function PropTypeError(message) { + function PropTypeError(message, data) { this.message = message; + this.data = data && typeof data === 'object' ? data: {}; this.stack = ''; } // Make `instanceof Error` still work for returned errors. @@ -4424,7 +3945,7 @@ ) { printWarning( 'You are manually calling a React.PropTypes validation ' + - 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' @@ -4463,7 +3984,10 @@ // 'of type `object`'. var preciseType = getPreciseType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), + {expectedType: expectedType} + ); } return null; } @@ -4607,14 +4131,19 @@ } function validate(props, propName, componentName, location, propFullName) { + var expectedTypes = []; for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { return null; } + if (checkerResult.data && has(checkerResult.data, 'expectedType')) { + expectedTypes.push(checkerResult.data.expectedType); + } } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); } return createChainableTypeChecker(validate); } @@ -4629,6 +4158,13 @@ return createChainableTypeChecker(validate); } + function invalidValidatorError(componentName, location, propFullName, key, type) { + return new PropTypeError( + (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' + ); + } + function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; @@ -4638,8 +4174,8 @@ } for (var key in shapeTypes) { var checker = shapeTypes[key]; - if (!checker) { - continue; + if (typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { @@ -4658,16 +4194,18 @@ if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } - // We need to check all keys in case some are required but missing from - // props. + // We need to check all keys in case some are required but missing from props. var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== 'function') { + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); + } if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); @@ -4822,7 +4360,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 28 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4862,6 +4400,7 @@ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, + bigint: shim, bool: shim, func: shim, number: shim, @@ -4892,24 +4431,24 @@ /***/ }), -/* 29 */ +/* 26 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(30); + module.exports = __webpack_require__(27); } else { - module.exports = __webpack_require__(31); + module.exports = __webpack_require__(28); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 30 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { - /** @license React v16.9.0 + /** @license React v16.14.0 * react-dom-server.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -4918,58 +4457,58 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict';var l=__webpack_require__(4),m=__webpack_require__(1);function r(a){for(var b=a.message,d="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;cG;G++)E[G]=G+1;E[15]=0; - var na=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,oa=Object.prototype.hasOwnProperty,pa={},qa={}; - function ra(a){if(oa.call(qa,a))return!0;if(oa.call(pa,a))return!1;if(na.test(a))return qa[a]=!0;pa[a]=!0;return!1}function sa(a,b,d,c){if(null!==d&&0===d.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==d)return!d.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} - function ta(a,b,d,c){if(null===b||"undefined"===typeof b||sa(a,b,d,c))return!0;if(c)return!1;if(null!==d)switch(d.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function I(a,b,d,c,f,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=e}var J={}; - "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){J[a]=new I(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];J[b]=new I(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){J[a]=new I(a,2,!1,a.toLowerCase(),null,!1)}); - ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){J[a]=new I(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){J[a]=new I(a,3,!1,a.toLowerCase(),null,!1)}); - ["checked","multiple","muted","selected"].forEach(function(a){J[a]=new I(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){J[a]=new I(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){J[a]=new I(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){J[a]=new I(a,5,!1,a.toLowerCase(),null,!1)});var K=/[\-:]([a-z])/g;function L(a){return a[1].toUpperCase()} - "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".split(" ").forEach(function(a){var b=a.replace(K, - L);J[b]=new I(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(K,L);J[b]=new I(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){J[a]=new I(a,1,!1,a.toLowerCase(),null,!1)}); - J.xlinkHref=new I("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){J[a]=new I(a,1,!1,a.toLowerCase(),null,!0)});var ua=/["'&<>]/; - function M(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ua.exec(a);if(b){var d="",c,f=0;for(c=b.index;cU))throw r(Error(301));if(a===N)if(R=!0,a={action:d,next:null},null===T&&(T=new Map),d=T.get(b),void 0===d)T.set(b,a);else{for(b=d;null!==b.next;)b=b.next;b.next=a}}function Ba(){} - var X=0,Ca={readContext:function(a){var b=X;D(a,b);return a[b]},useContext:function(a){V();var b=X;D(a,b);return a[b]},useMemo:function(a,b){N=V();P=W();b=void 0===b?null:b;if(null!==P){var d=P.memoizedState;if(null!==d&&null!==b){a:{var c=d[1];if(null===c)c=!1;else{for(var f=0;f=e))throw r(Error(304));var h=new Uint16Array(e);h.set(f);E=h;E[0]=c+1;for(f=c;f=g.children.length){var H=g.footer;""!==H&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===g.type)this.currentSelectValue=null;else if(null!=g.type&&null!=g.type.type&&g.type.type.$$typeof===x)this.popProvider(g.type);else if(g.type===A){this.suspenseDepth--;var F=f.pop();if(e){e=!1;var n=g.fallbackFrame;if(!n)throw r(Error(303));this.stack.push(n); - f[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else f[this.suspenseDepth]+=F}f[this.suspenseDepth]+=H}else{var w=g.children[g.childIndex++],p="";try{p+=this.render(w,g.context,g.domNamespace)}catch(k){throw k;}finally{}f.length<=this.suspenseDepth&&f.push("");f[this.suspenseDepth]+=p}}return f[0]}finally{Ka.current=c,X=b}};a.prototype.render=function(a,d,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return M(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+ - M(c);this.previousWasTextNode=!0;return M(c)}d=Ta(a,d,this.threadID);a=d.child;d=d.context;if(null===a||!1===a)return"";if(!m.isValidElement(a)){if(null!=a&&null!=a.$$typeof){c=a.$$typeof;if(c===aa)throw r(Error(257));throw r(Error(258),c.toString());}a=Z(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""});return""}var b=a.type;if("string"===typeof b)return this.renderDOM(a,d,c);switch(b){case ba:case ea:case ca:case ha:case v:return a=Z(a.props.children),this.stack.push({type:null, - domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case A:throw r(Error(294));}if("object"===typeof b&&null!==b)switch(b.$$typeof){case fa:N={};var e=b.render(a.props,a.ref);e=xa(b.render,a.props,e,a.ref);e=Z(e);this.stack.push({type:null,domNamespace:c,children:e,childIndex:0,context:d,footer:""});return"";case ia:return a=[m.createElement(b.type,l({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case x:return b=Z(a.props.children), - c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""},this.pushProvider(a),this.stack.push(c),"";case da:b=a.type;e=a.props;var h=this.threadID;D(b,h);b=Z(e.children(b[h]));this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""});return"";case ka:throw r(Error(338));case ja:throw r(Error(295));}throw r(Error(130),null==b?b:typeof b,"");};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===Da.html&&Ea(b);if(!Na.hasOwnProperty(b)){if(!Ma.test(b))throw r(Error(65), - b);Na[b]=!0}var e=a.props;if("input"===b)e=l({type:void 0},e,{defaultChecked:void 0,defaultValue:void 0,value:null!=e.value?e.value:e.defaultValue,checked:null!=e.checked?e.checked:e.defaultChecked});else if("textarea"===b){var h=e.value;if(null==h){h=e.defaultValue;var g=e.children;if(null!=g){if(null!=h)throw r(Error(92));if(Array.isArray(g)){if(!(1>=g.length))throw r(Error(93));g=g[0]}h=""+g}null==h&&(h="")}e=l({},e,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!= - e.value?e.value:e.defaultValue,e=l({},e,{value:void 0});else if("option"===b){g=this.currentSelectValue;var H=Pa(e.children);if(null!=g){var F=null!=e.value?e.value+"":H;h=!1;if(Array.isArray(g))for(var n=0;n":(z+=">",h="");a:{g=e.dangerouslySetInnerHTML;if(null!=g){if(null!=g.__html){g=g.__html;break a}}else if(g=e.children,"string"===typeof g||"number"===typeof g){g=M(g);break a}g=null}null!=g?(e=[],La[b]&&"\n"===g.charAt(0)&&(z+="\n"),z+=g):e=Z(e.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?Ea(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml": - c;this.stack.push({domNamespace:c,type:b,children:e,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return z};return a}(),Va={renderToString:function(a){a=new Ua(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Ua(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw r(Error(207));},renderToStaticNodeStream:function(){throw r(Error(208));},version:"16.9.0"},Wa={default:Va},Xa=Wa&&Va|| - Wa;module.exports=Xa.default||Xa; + 'use strict';var k=__webpack_require__(4),l=__webpack_require__(1);function q(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;cH;H++)F[H]=H+1;F[15]=0; + var qa=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ra=Object.prototype.hasOwnProperty,sa={},ta={}; + function ua(a){if(ra.call(ta,a))return!0;if(ra.call(sa,a))return!1;if(qa.test(a))return ta[a]=!0;sa[a]=!0;return!1}function va(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} + function wa(a,b,c,d){if(null===b||"undefined"===typeof b||va(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function J(a,b,c,d,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=f;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=g}var K={}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){K[a]=new J(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];K[b]=new J(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){K[a]=new J(a,2,!1,a.toLowerCase(),null,!1)}); + ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){K[a]=new J(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){K[a]=new J(a,3,!1,a.toLowerCase(),null,!1)}); + ["checked","multiple","muted","selected"].forEach(function(a){K[a]=new J(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){K[a]=new J(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){K[a]=new J(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){K[a]=new J(a,5,!1,a.toLowerCase(),null,!1)});var L=/[\-:]([a-z])/g;function M(a){return a[1].toUpperCase()} + "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".split(" ").forEach(function(a){var b=a.replace(L, + M);K[b]=new J(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(L,M);K[b]=new J(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!1)}); + K.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){K[a]=new J(a,1,!1,a.toLowerCase(),null,!0)});var xa=/["'&<>]/; + function N(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=xa.exec(a);if(b){var c="",d,f=0;for(d=b.index;dV))throw Error(q(301));if(a===O)if(S=!0,a={action:c,next:null},null===U&&(U=new Map),c=U.get(b),void 0===c)U.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function Ha(){} + var X=0,Ia={readContext:function(a){var b=X;E(a,b);return a[b]},useContext:function(a){W();var b=X;E(a,b);return a[b]},useMemo:function(a,b){O=W();Q=Ca();b=void 0===b?null:b;if(null!==Q){var c=Q.memoizedState;if(null!==c&&null!==b){a:{var d=c[1];if(null===d)d=!1;else{for(var f=0;f=d))throw Error(q(304));var h=new Uint16Array(d);h.set(g);F=h;F[0]=c+1;for(g=c;g= + e.children.length){var I=e.footer;""!==I&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===v)this.popProvider(e.type);else if(e.type===B){this.suspenseDepth--;var G=g.pop();if(x){x=!1;var n=e.fallbackFrame;if(!n)throw Error(q(303));this.stack.push(n);g[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}else g[this.suspenseDepth]+=G}g[this.suspenseDepth]+=I}else{var m=e.children[e.childIndex++], + w="";try{w+=this.render(m,e.context,e.domNamespace)}catch(r){if(null!=r&&"function"===typeof r.then)throw Error(q(294));throw r;}finally{}g.length<=this.suspenseDepth&&g.push("");g[this.suspenseDepth]+=w}}return g[0]}finally{Qa.current=c,X=b}};b.render=function(a,b,f){if("string"===typeof a||"number"===typeof a){f=""+a;if(""===f)return"";if(this.makeStaticMarkup)return N(f);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+N(f);this.previousWasTextNode=!0;return N(f)}b=Za(a,b,this.threadID);a=b.child; + b=b.context;if(null===a||!1===a)return"";if(!l.isValidElement(a)){if(null!=a&&null!=a.$$typeof){f=a.$$typeof;if(f===aa)throw Error(q(257));throw Error(q(258,f.toString()));}a=Z(a);this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""});return""}var c=a.type;if("string"===typeof c)return this.renderDOM(a,b,f);switch(c){case ba:case ea:case ca:case ha:case u:return a=Z(a.props.children),this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}), + "";case B:throw Error(q(294));}if("object"===typeof c&&null!==c)switch(c.$$typeof){case fa:O={};var d=c.render(a.props,a.ref);d=Da(c.render,a.props,d,a.ref);d=Z(d);this.stack.push({type:null,domNamespace:f,children:d,childIndex:0,context:b,footer:""});return"";case ia:return a=[l.createElement(c.type,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case v:return c=Z(a.props.children),f={type:a,domNamespace:f,children:c,childIndex:0, + context:b,footer:""},this.pushProvider(a),this.stack.push(f),"";case da:c=a.type;d=a.props;var h=this.threadID;E(c,h);c=Z(d.children(c[h]));this.stack.push({type:a,domNamespace:f,children:c,childIndex:0,context:b,footer:""});return"";case la:throw Error(q(338));case ja:switch(c=a.type,na(c),c._status){case 1:return a=[l.createElement(c._result,k({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:f,children:a,childIndex:0,context:b,footer:""}),"";case 2:throw c._result;default:throw Error(q(295)); + }case ma:throw Error(q(343));}throw Error(q(130,null==c?c:typeof c,""));};b.renderDOM=function(a,b,f){var c=a.type.toLowerCase();f===Ja.html&&Ka(c);if(!Ta.hasOwnProperty(c)){if(!Sa.test(c))throw Error(q(65,c));Ta[c]=!0}var d=a.props;if("input"===c)d=k({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===c){var h=d.value;if(null==h){h=d.defaultValue;var e=d.children;if(null!=e){if(null!= + h)throw Error(q(92));if(Array.isArray(e)){if(!(1>=e.length))throw Error(q(93));e=e[0]}h=""+e}null==h&&(h="")}d=k({},d,{value:void 0,children:""+h})}else if("select"===c)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=k({},d,{value:void 0});else if("option"===c){e=this.currentSelectValue;var I=Va(d.children);if(null!=e){var G=null!=d.value?d.value+"":I;h=!1;if(Array.isArray(e))for(var n=0;n":(z+=">",h="");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e=N(e);break a}e=null}null!=e?(d=[],Ra.hasOwnProperty(c)&&"\n"===e.charAt(0)&&(z+="\n"),z+=e):d=Z(d.children);a=a.type;f=null==f||"http://www.w3.org/1999/xhtml"=== + f?Ka(a):"http://www.w3.org/2000/svg"===f&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":f;this.stack.push({domNamespace:f,type:c,children:d,childIndex:0,context:b,footer:h});this.previousWasTextNode=!1;return z};return a}(),ab={renderToString:function(a){a=new $a(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new $a(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){throw Error(q(207));},renderToStaticNodeStream:function(){throw Error(q(208)); + },version:"16.14.0"};module.exports=ab.default||ab; /***/ }), -/* 31 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { - /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.9.0 + /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.14.0 * react-dom-server.browser.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -4986,73 +4525,91 @@ (function() { 'use strict'; - var _assign = __webpack_require__(4); var React = __webpack_require__(1); + var _assign = __webpack_require__(4); var checkPropTypes = __webpack_require__(6); // Do not require this module directly! Use normal `invariant` calls with - // template literal strings. The messages will be converted to ReactError during - // build, and in production they will be minified. + // template literal strings. The messages will be replaced with error codes + // during build. + function formatProdErrorMessage(code) { + var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code; - // Do not require this module directly! Use normal `invariant` calls with - // template literal strings. The messages will be converted to ReactError during - // build, and in production they will be minified. + for (var i = 1; i < arguments.length; i++) { + url += '&args[]=' + encodeURIComponent(arguments[i]); + } - function ReactError(error) { - error.name = 'Invariant Violation'; - return error; + 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.'; } - // TODO: this is special because it gets imported during build. + var ReactVersion = '16.14.0'; - var ReactVersion = '16.9.0'; + 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. + // Current owner and dispatcher used to share the same ref, + // but PR #14548 split them out to better support the react-debug-tools package. - /** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { + ReactSharedInternals.ReactCurrentDispatcher = { + current: null + }; + } - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ + if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; + } - var warningWithoutStack = function () {}; + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. - { - warningWithoutStack = function (condition, format) { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; + function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; } - if (format === undefined) { - throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (args.length > 8) { - // Check before the condition to catch violations early. - throw new Error('warningWithoutStack() currently supports at most 8 arguments.'); - } - if (condition) { - return; + printWarning('warn', format, args); + } + } + function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } - if (typeof console !== 'undefined') { - var argsWithFormat = args.map(function (item) { - return '' + item; - }); - argsWithFormat.unshift('Warning: ' + format); - // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - Function.prototype.apply.call(console.error, console, argsWithFormat); + printWarning('error', format, args); + } + } + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], console, argsWithFormat); + try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack @@ -5063,43 +4620,66 @@ }); throw new Error(message); } catch (x) {} - }; + } } - var warningWithoutStack$1 = warningWithoutStack; - // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; - - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; - // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary - // (unstable) APIs that have been removed. Can we remove the symbols? - + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; + var Uninitialized = -1; + var Pending = 0; var Resolved = 1; - - + var Rejected = 2; function refineResolvedLazyComponent(lazyComponent) { return lazyComponent._status === Resolved ? lazyComponent._result : null; } + function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + 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); + } + } + + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + } + } function getWrappedName(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; - return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName); + return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } function getComponentName(type) { @@ -5107,166 +4687,92 @@ // Host root, text node or just invalid type. return null; } + { if (typeof type.tag === 'number') { - warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); + error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.'); } } + if (typeof type === 'function') { return type.displayName || type.name || null; } + if (typeof type === 'string') { return type; } + switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; + case REACT_PORTAL_TYPE: return 'Portal'; + case REACT_PROFILER_TYPE: - return 'Profiler'; + return "Profiler"; + case REACT_STRICT_MODE_TYPE: return 'StrictMode'; + case REACT_SUSPENSE_TYPE: return 'Suspense'; + case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } + if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: return 'Context.Consumer'; + case REACT_PROVIDER_TYPE: return 'Context.Provider'; + case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); + case REACT_MEMO_TYPE: return getComponentName(type.type); + + case REACT_BLOCK_TYPE: + return getComponentName(type.render); + case REACT_LAZY_TYPE: { var thenable = type; var resolvedThenable = refineResolvedLazyComponent(thenable); + if (resolvedThenable) { return getComponentName(resolvedThenable); } + break; } } } - return null; - } - - /** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var lowPriorityWarning = function () {}; - - { - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; - } - - var lowPriorityWarning$1 = lowPriorityWarning; - - 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. - // Current owner and dispatcher used to share the same ref, - // but PR #14548 split them out to better support the react-debug-tools package. - if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) { - ReactSharedInternals.ReactCurrentDispatcher = { - current: null - }; - } - if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { - ReactSharedInternals.ReactCurrentBatchConfig = { - suspense: null - }; - } - - /** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - - var warning = warningWithoutStack$1; - - { - warning = function (condition, format) { - if (condition) { - return; - } - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - // eslint-disable-next-line react-internal/warning-and-invariant-args - - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack])); - }; + return null; } - var warning$1 = warning; - var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - - var describeComponentFrame = function (name, source, ownerName) { + function describeComponentFrame (name, source, ownerName) { var sourceInfo = ''; + if (source) { var path = source.fileName; var fileName = path.replace(BEFORE_SLASH_RE, ''); + { // In DEV, include code for a common special case: // prefer "folder/index.js" instead of just "index.js". if (/^index\./.test(fileName)) { var match = path.match(BEFORE_SLASH_RE); + if (match) { var pathBeforeSlash = match[1]; + if (pathBeforeSlash) { var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, ''); fileName = folderName + '/' + fileName; @@ -5274,124 +4780,52 @@ } } } + sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')'; } else if (ownerName) { sourceInfo = ' (created by ' + ownerName + ')'; } - return '\n in ' + (name || 'Unknown') + sourceInfo; - }; - - // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - - - // In some cases, StrictMode should also double-render lifecycles. - // This can be confusing for tests though, - // And it can be bad for performance in production. - // This feature flag can be used to control the behavior: - - - // To preserve the "Pause on caught exceptions" behavior of the debugger, we - // replay the begin phase of a failed component inside invokeGuardedCallback. - - - // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - var warnAboutDeprecatedLifecycles = true; - - // Gather advanced timing metrics for Profiler subtrees. - - - // Trace which interactions trigger each commit. - - - // Only used in www builds. - var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. - - // Only used in www builds. - - - // Only used in www builds. - - - // Disable javascript: URL strings in href for XSS protection. - var disableJavaScriptURLs = false; - - // React Fire: prevent the value and checked attributes from syncing - // with their related DOM properties - - - // These APIs will no longer be "unstable" in the upcoming 16.7 release, - // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. - - - - - // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information - // This is a flag so we can fix warnings in RN core before turning it on - - - // Experimental React Flare event system and event components support. - var enableFlareAPI = false; - - // Experimental Host Component support. - var enableFundamentalAPI = false; - - // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107 - - - // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) - // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version - - // Temporary flag to revert the fix in #15650 - - - // For tests, we flush suspense fallbacks in an act scope; - // *except* in some of our own tests, where we test incremental loading states. - - - // Changes priority of some events like mousemove to user-blocking priority, - // but without making them discrete. The flag exists in case it causes - // starvation problems. - - - // Add a callback property to suspense to notify which promises are currently - // in the update queue. This allows reporting and tracing of what is causing - // the user to see a loading state. + return '\n in ' + (name || 'Unknown') + sourceInfo; + } - // Part of the simplification of React.createElement so we can eventually move - // from React.createElement to React.jsx - // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md + var enableSuspenseServerRenderer = false; + var enableDeprecatedFlareAPI = false; // Experimental Host Component support. - var disableLegacyContext = false; + var ReactDebugCurrentFrame; + var didWarnAboutInvalidateContextType; - var ReactDebugCurrentFrame$1 = void 0; - var didWarnAboutInvalidateContextType = void 0; { - ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; didWarnAboutInvalidateContextType = new Set(); } var emptyObject = {}; + { Object.freeze(emptyObject); } function maskContext(type, context) { var contextTypes = type.contextTypes; + if (!contextTypes) { return emptyObject; } + var maskedContext = {}; + for (var contextName in contextTypes) { maskedContext[contextName] = context[contextName]; } + return maskedContext; } function checkContextTypes(typeSpecs, values, location) { { - checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame$1.getCurrentStack); + checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame.getCurrentStack); } } @@ -5408,20 +4842,19 @@ context._threadCount = i + 1; } } - function processContext(type, context, threadID, isClass) { if (isClass) { var contextType = type.contextType; + { if ('contextType' in type) { - var isValid = - // Allow null for conditional declaration + var isValid = // Allow null for conditional declaration contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a if (!isValid && !didWarnAboutInvalidateContextType.has(type)) { didWarnAboutInvalidateContextType.add(type); - var addendum = ''; + if (contextType === undefined) { 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.'; } else if (typeof contextType !== 'object') { @@ -5434,91 +4867,85 @@ } else { addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; } - warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum); + + error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum); } } } + if (typeof contextType === 'object' && contextType !== null) { validateContextBounds(contextType, threadID); return contextType[threadID]; } - if (disableLegacyContext) { - { - if (type.contextTypes) { - warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown'); - } - } - return emptyObject; - } else { + + { var maskedContext = maskContext(type, context); + { if (type.contextTypes) { checkContextTypes(type.contextTypes, maskedContext, 'context'); } } - return maskedContext; - } - } else { - if (disableLegacyContext) { - { - if (type.contextTypes) { - warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown'); - } - } - return undefined; - } else { + + return maskedContext; + } + } else { + { var _maskedContext = maskContext(type, context); + { if (type.contextTypes) { checkContextTypes(type.contextTypes, _maskedContext, 'context'); } } + return _maskedContext; } } } - // Allocates a new index for each request. Tries to stay as compact as possible so that these - // indices can be used to reference a tightly packaged array. As opposed to being used in a Map. - // The first allocated index is 1. - var nextAvailableThreadIDs = new Uint16Array(16); + for (var i = 0; i < 15; i++) { nextAvailableThreadIDs[i] = i + 1; } + nextAvailableThreadIDs[15] = 0; function growThreadCountAndReturnNextAvailable() { var oldArray = nextAvailableThreadIDs; var oldSize = oldArray.length; var newSize = oldSize * 2; - (function () { - if (!(newSize <= 0x10000)) { - { - throw ReactError(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.')); - } + + if (!(newSize <= 0x10000)) { + { + 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." ); } - })(); + } + var newArray = new Uint16Array(newSize); newArray.set(oldArray); nextAvailableThreadIDs = newArray; nextAvailableThreadIDs[0] = oldSize + 1; + for (var _i = oldSize; _i < newSize - 1; _i++) { nextAvailableThreadIDs[_i] = _i + 1; } + nextAvailableThreadIDs[newSize - 1] = 0; return oldSize; } function allocThreadID() { var nextID = nextAvailableThreadIDs[0]; + if (nextID === 0) { return growThreadCountAndReturnNextAvailable(); } + nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID]; return nextID; } - function freeThreadID(id) { nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0]; nextAvailableThreadIDs[0] = id; @@ -5526,96 +4953,96 @@ // A reserved attribute. // It is handled by React separately and shouldn't be written to the DOM. - var RESERVED = 0; - - // A simple string attribute. + var RESERVED = 0; // A simple string attribute. // Attributes that aren't in the whitelist are presumed to have this type. - var STRING = 1; - // A string attribute that accepts booleans in React. In HTML, these are called + var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called // "enumerated" attributes with "true" and "false" as possible values. // When true, it should be set to a "true" string. // When false, it should be set to a "false" string. - var BOOLEANISH_STRING = 2; - // A real boolean attribute. + var BOOLEANISH_STRING = 2; // A real boolean attribute. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. - var BOOLEAN = 3; - // An attribute that can be used as a flag as well as with a value. + var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. // For any other value, should be present with that value. - var OVERLOADED_BOOLEAN = 4; - // An attribute that must be numeric or parse as a numeric. + var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. // When falsy, it should be removed. - var NUMERIC = 5; - // An attribute that must be positive numeric or parse as a positive numeric. + var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. // When falsy, it should be removed. + var POSITIVE_NUMERIC = 6; /* eslint-disable max-len */ - 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'; + 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"; /* eslint-enable max-len */ - var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; - + var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var ROOT_ATTRIBUTE_NAME = 'data-reactroot'; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); - - var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var hasOwnProperty = Object.prototype.hasOwnProperty; var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; - function isAttributeNameSafe(attributeName) { - if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) { + if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } - if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) { + + if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } + illegalAttributeNameCache[attributeName] = true; + { - warning$1(false, 'Invalid attribute name: `%s`', attributeName); + error('Invalid attribute name: `%s`', attributeName); } + return false; } - function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } + if (isCustomComponentTag) { return false; } + if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { return true; } + return false; } - function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } + switch (typeof value) { - case 'function': - // $FlowIssue symbol is perfectly valid here + case 'function': // $FlowIssue symbol is perfectly valid here + case 'symbol': // eslint-disable-line return true; + case 'boolean': { if (isCustomComponentTag) { return false; } + if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { @@ -5623,36 +5050,42 @@ return prefix !== 'data-' && prefix !== 'aria-'; } } + default: return false; } } - function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === 'undefined') { return true; } + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } + if (isCustomComponentTag) { return false; } + if (propertyInfo !== null) { switch (propertyInfo.type) { case BOOLEAN: return !value; + case OVERLOADED_BOOLEAN: return value === false; + case NUMERIC: return isNaN(value); + case POSITIVE_NUMERIC: return isNaN(value) || value < 1; } } + return false; } - function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; } @@ -5665,182 +5098,168 @@ this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL; - } - - // When adding attributes to this list, be sure to also add them to + } // When adding attributes to this list, be sure to also add them to // the `possibleStandardNames` module to ensure casing and incorrect // name warnings. - var properties = {}; - // These props are reserved by React. They shouldn't be written to the DOM. - ['children', 'dangerouslySetInnerHTML', - // TODO: This prevents the assignment of defaultValue to regular + + var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. + + var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? - 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; + + reservedProps.forEach(function (name) { properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // A few React string attributes have a different name. + }); // A few React string attributes have a different name. // This is a mapping from React prop names to the attribute names. + [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { var name = _ref[0], attributeName = _ref[1]; - properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // These are "enumerated" HTML attributes that accept "true" and "false". + }); // These are "enumerated" HTML attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). + ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // These are "enumerated" SVG attributes that accept "true" and "false". + }); // These are "enumerated" SVG attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). // Since these are SVG attributes, their attribute names are case-sensitive. + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); + }); // These are HTML boolean attributes. - // These are HTML boolean attributes. - ['allowFullScreen', 'async', - // Note: there is a special case that prevents it from being written to the DOM + ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM // on the client side because the browsers are inconsistent. Instead we call focus(). - 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', - // Microdata + 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata 'itemScope'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // These are the few React props that we set as DOM properties + }); // These are the few React props that we set as DOM properties // rather than attributes. These are all booleans. - ['checked', - // Note: `option.selected` is not updated if `select.multiple` is + + ['checked', // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. - 'multiple', 'muted', 'selected'].forEach(function (name) { + 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // These are HTML attributes that are "overloaded booleans": they behave like + }); // These are HTML attributes that are "overloaded booleans": they behave like // booleans, but can also accept a string value. - ['capture', 'download'].forEach(function (name) { + + ['capture', 'download' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); + }); // These are HTML attributes that must be positive numbers. - // These are HTML attributes that must be positive numbers. - ['cols', 'rows', 'size', 'span'].forEach(function (name) { + ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); + }); // These are HTML attributes that must be numbers. - // These are HTML attributes that must be numbers. ['rowSpan', 'start'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - + }); var CAMELIZE = /[\-\:]([a-z])/g; + var capitalize = function (token) { return token[1].toUpperCase(); - }; - - // This is a list of all SVG attributes that need special casing, namespacing, + }; // This is a list of all SVG attributes that need special casing, namespacing, // or boolean value assignment. Regular attributes that just accept strings // and have the same names are omitted, just like in the HTML whitelist. // Some of these attributes can be hard to find. This list was created by - // scrapping the MDN documentation. - ['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'].forEach(function (attributeName) { + // scraping the MDN documentation. + + + ['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, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false); - } // sanitizeURL - ); + }); // String SVG attributes with the xlink namespace. - // String SVG attributes with the xlink namespace. - ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/1999/xlink', false); - } // sanitizeURL - ); + }); // String SVG attributes with the xml namespace. - // String SVG attributes with the xml namespace. - ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, + // you'll need to set attributeName to name.toLowerCase() + // instead in the assignment below. + ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/XML/1998/namespace', false); - } // sanitizeURL - ); - - // These attribute exists both in HTML and SVG. + }); // These attribute exists both in HTML and SVG. // The attribute name is case-sensitive in SVG so we can't just use // the React name like we do for attributes that exist only in HTML. + ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace false); - } // sanitizeURL - ); - - // These attributes accept URLs. These must not allow javascript: URLS. + }); // These attributes accept URLs. These must not allow javascript: URLS. // These will also need to accept Trusted Types object in the future. + var xlinkHref = 'xlinkHref'; properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty 'xlink:href', 'http://www.w3.org/1999/xlink', true); - ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace true); - } // sanitizeURL - ); + }); - var ReactDebugCurrentFrame$2 = null; - { - ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; - } + var ReactDebugCurrentFrame$1 = null; - // A javascript: URL can contain leading C0 control or \u0020 SPACE, + { + ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; + } // A javascript: URL can contain leading C0 control or \u0020 SPACE, // and any newline or tab are filtered out as if they're not part of the URL. // https://url.spec.whatwg.org/#url-parsing // Tab or newline are defined as \r\n\t: @@ -5850,33 +5269,28 @@ // https://infra.spec.whatwg.org/#c0-control-or-space /* eslint-disable max-len */ - 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; + + 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; var didWarn = false; function sanitizeURL(url) { - if (disableJavaScriptURLs) { - (function () { - if (!!isJavaScriptProtocol.test(url)) { - { - throw ReactError(Error('React has blocked a javascript: URL as a security precaution.' + (ReactDebugCurrentFrame$2.getStackAddendum()))); - } - } - })(); - } else if (true && !didWarn && isJavaScriptProtocol.test(url)) { - didWarn = true; - warning$1(false, '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)); + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + + 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)); + } } } // code copied and modified from escape-html + /** * Module variables. * @private */ - var matchHtmlRegExp = /["'&<>]/; - /** * Escapes special characters and HTML entities in a given html string. * @@ -5893,9 +5307,9 @@ return str; } - var escape = void 0; + var escape; var html = ''; - var index = void 0; + var index; var lastIndex = 0; for (index = match.index; index < str.length; index++) { @@ -5904,22 +5318,28 @@ // " escape = '"'; break; + case 38: // & escape = '&'; break; + case 39: // ' escape = '''; // modified from escape-html; used to be ''' + break; + case 60: // < escape = '<'; break; + case 62: // > escape = '>'; break; + default: continue; } @@ -5933,8 +5353,7 @@ } return lastIndex !== index ? html + str.substring(lastIndex, index) : html; - } - // end code copied and modified from escape-html + } // end code copied and modified from escape-html /** * Escapes text to prevent scripting attacks. @@ -5942,6 +5361,8 @@ * @param {*} text Text value to escape. * @return {string} An escaped string. */ + + function escapeTextForBrowser(text) { if (typeof text === 'boolean' || typeof text === 'number') { // this shortcircuit helps perf for types that we know will never have @@ -5949,6 +5370,7 @@ // for numeric dom ids. return '' + text; } + return escapeHtml(text); } @@ -5958,26 +5380,14 @@ * @param {*} value Value to escape. * @return {string} An escaped string. */ + function quoteAttributeValueForBrowser(value) { return '"' + escapeTextForBrowser(value) + '"'; } - /** - * Operations for dealing with DOM properties. - */ - - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ - - function createMarkupForRoot() { return ROOT_ATTRIBUTE_NAME + '=""'; } - /** * Creates markup for a property. * @@ -5985,14 +5395,18 @@ * @param {*} value * @return {?string} Markup string, or null if the property was invalid. */ + function createMarkupForProperty(name, value) { var propertyInfo = getPropertyInfo(name); + if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) { return ''; } + if (shouldRemoveAttribute(name, value, propertyInfo, false)) { return ''; } + if (propertyInfo !== null) { var attributeName = propertyInfo.attributeName; var type = propertyInfo.type; @@ -6004,14 +5418,15 @@ value = '' + value; sanitizeURL(value); } + return attributeName + '=' + quoteAttributeValueForBrowser(value); } } else if (isAttributeNameSafe(name)) { return name + '=' + quoteAttributeValueForBrowser(value); } + return ''; } - /** * Creates markup for a custom property. * @@ -6019,10 +5434,12 @@ * @param {*} value * @return {string} Markup string, or empty string if the property was invalid. */ + function createMarkupForCustomAttribute(name, value) { if (!isAttributeNameSafe(name) || value == null) { return ''; } + return name + '=' + quoteAttributeValueForBrowser(value); } @@ -6035,43 +5452,46 @@ ; } + var objectIs = typeof Object.is === 'function' ? Object.is : is; + var currentlyRenderingComponent = null; var firstWorkInProgressHook = null; - var workInProgressHook = null; - // Whether the work-in-progress hook is a re-rendered hook - var isReRender = false; - // Whether an update was scheduled during the currently executing render pass. - var didScheduleRenderPhaseUpdate = false; - // Lazily created map of render-phase updates - var renderPhaseUpdates = null; - // Counter to prevent infinite loops. + var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook + + var isReRender = false; // Whether an update was scheduled during the currently executing render pass. + + var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates + + var renderPhaseUpdates = null; // Counter to prevent infinite loops. + var numberOfReRenders = 0; var RE_RENDER_LIMIT = 25; + var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook - var isInHookUserCodeInDev = false; - - // In DEV, this is the name of the currently executing primitive hook - var currentHookNameInDev = void 0; + var currentHookNameInDev; function resolveCurrentlyRenderingComponent() { - (function () { - if (!(currentlyRenderingComponent !== null)) { - { - throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.')); - } + if (!(currentlyRenderingComponent !== null)) { + { + 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." ); } - })(); + } + { - !!isInHookUserCodeInDev ? warning$1(false, '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') : void 0; + if (isInHookUserCodeInDev) { + 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'); + } } + return currentlyRenderingComponent; } function areHookInputsEqual(nextDeps, prevDeps) { if (prevDeps === null) { { - warning$1(false, '%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); + 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); } + return false; } @@ -6079,28 +5499,30 @@ // Don't bother comparing lengths in prod because these arrays should be // passed inline. if (nextDeps.length !== prevDeps.length) { - warning$1(false, '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(', ') + ']'); + 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(', ') + "]"); } } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { - if (is(nextDeps[i], prevDeps[i])) { + if (objectIs(nextDeps[i], prevDeps[i])) { continue; } + return false; } + return true; } function createHook() { if (numberOfReRenders > 0) { - (function () { + { { - { - throw ReactError(Error('Rendered more hooks than during the previous render')); - } + throw Error( "Rendered more hooks than during the previous render" ); } - })(); + } } + return { memoizedState: null, queue: null, @@ -6121,8 +5543,8 @@ } } else { if (workInProgressHook.next === null) { - isReRender = false; - // Append to the end of the list + isReRender = false; // Append to the end of the list + workInProgressHook = workInProgressHook.next = createHook(); } else { // There's already a work-in-progress. Reuse it. @@ -6130,50 +5552,47 @@ workInProgressHook = workInProgressHook.next; } } + return workInProgressHook; } function prepareToUseHooks(componentIdentity) { currentlyRenderingComponent = componentIdentity; + { isInHookUserCodeInDev = false; - } - - // The following should have already been reset + } // The following should have already been reset // didScheduleRenderPhaseUpdate = false; // firstWorkInProgressHook = null; // numberOfReRenders = 0; // renderPhaseUpdates = null; // workInProgressHook = null; - } + } function finishHooks(Component, props, children, refOrContext) { // This must be called after every function component to prevent hooks from // being used in classes. - while (didScheduleRenderPhaseUpdate) { // Updates were scheduled during the render phase. They are stored in // the `renderPhaseUpdates` map. Call the component again, reusing the // work-in-progress hooks and applying the additional updates on top. Keep // restarting until no more updates are scheduled. didScheduleRenderPhaseUpdate = false; - numberOfReRenders += 1; + numberOfReRenders += 1; // Start over from the beginning of the list - // Start over from the beginning of the list workInProgressHook = null; - children = Component(props, refOrContext); } + currentlyRenderingComponent = null; firstWorkInProgressHook = null; numberOfReRenders = 0; renderPhaseUpdates = null; workInProgressHook = null; + { isInHookUserCodeInDev = false; - } - - // These were reset above + } // These were reset above // currentlyRenderingComponent = null; // didScheduleRenderPhaseUpdate = false; // firstWorkInProgressHook = null; @@ -6181,15 +5600,20 @@ // renderPhaseUpdates = null; // workInProgressHook = null; + return children; } function readContext(context, observedBits) { var threadID = currentThreadID; validateContextBounds(context, threadID); + { - !!isInHookUserCodeInDev ? warning$1(false, '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().') : void 0; + if (isInHookUserCodeInDev) { + 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().'); + } } + return context[threadID]; } @@ -6197,6 +5621,7 @@ { currentHookNameInDev = 'useContext'; } + resolveCurrentlyRenderingComponent(); var threadID = currentThreadID; validateContextBounds(context, threadID); @@ -6204,6 +5629,7 @@ } function basicStateReducer(state, action) { + // $FlowFixMe: Flow doesn't like mixed types return typeof action === 'function' ? action(state) : action; } @@ -6211,86 +5637,103 @@ { currentHookNameInDev = 'useState'; } - return useReducer(basicStateReducer, - // useReducer has a special case to support lazy useState initializers + + return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers initialState); } - function useReducer(reducer, initialArg, init) { { if (reducer !== basicStateReducer) { currentHookNameInDev = 'useReducer'; } } + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); + if (isReRender) { // This is a re-render. Apply the new render phase updates to the previous - var _queue = workInProgressHook.queue; - var _dispatch = _queue.dispatch; + // current hook. + var queue = workInProgressHook.queue; + var dispatch = queue.dispatch; + if (renderPhaseUpdates !== null) { // Render phase updates are stored in a map of queue -> linked list - var firstRenderPhaseUpdate = renderPhaseUpdates.get(_queue); + var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); + if (firstRenderPhaseUpdate !== undefined) { - renderPhaseUpdates.delete(_queue); + renderPhaseUpdates.delete(queue); var newState = workInProgressHook.memoizedState; var update = firstRenderPhaseUpdate; + do { // Process this render phase update. We don't have to check the // priority because it will always be the same as the current // render's. - var _action = update.action; + var action = update.action; + { isInHookUserCodeInDev = true; } - newState = reducer(newState, _action); + + newState = reducer(newState, action); + { isInHookUserCodeInDev = false; } + update = update.next; } while (update !== null); workInProgressHook.memoizedState = newState; - - return [newState, _dispatch]; + return [newState, dispatch]; } } - return [workInProgressHook.memoizedState, _dispatch]; + + return [workInProgressHook.memoizedState, dispatch]; } else { { isInHookUserCodeInDev = true; } - var initialState = void 0; + + var initialState; + if (reducer === basicStateReducer) { // Special case for `useState`. initialState = typeof initialArg === 'function' ? initialArg() : initialArg; } else { initialState = init !== undefined ? init(initialArg) : initialArg; } + { isInHookUserCodeInDev = false; } + workInProgressHook.memoizedState = initialState; - var _queue2 = workInProgressHook.queue = { + + var _queue = workInProgressHook.queue = { last: null, dispatch: null }; - var _dispatch2 = _queue2.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue2); - return [workInProgressHook.memoizedState, _dispatch2]; + + var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue); + + return [workInProgressHook.memoizedState, _dispatch]; } } function useMemo(nextCreate, deps) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); - var nextDeps = deps === undefined ? null : deps; if (workInProgressHook !== null) { var prevState = workInProgressHook.memoizedState; + if (prevState !== null) { if (nextDeps !== null) { var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } @@ -6301,10 +5744,13 @@ { isInHookUserCodeInDev = true; } + var nextValue = nextCreate(); + { isInHookUserCodeInDev = false; } + workInProgressHook.memoizedState = [nextValue, nextDeps]; return nextValue; } @@ -6313,11 +5759,16 @@ currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); var previousRef = workInProgressHook.memoizedState; + if (previousRef === null) { - var ref = { current: initialValue }; + var ref = { + current: initialValue + }; + { Object.seal(ref); } + workInProgressHook.memoizedState = ref; return ref; } else { @@ -6328,18 +5779,17 @@ function useLayoutEffect(create, inputs) { { currentHookNameInDev = 'useLayoutEffect'; + + 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.'); } - warning$1(false, '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.'); } function dispatchAction(componentIdentity, queue, action) { - (function () { - if (!(numberOfReRenders < RE_RENDER_LIMIT)) { - { - throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.')); - } + if (!(numberOfReRenders < RE_RENDER_LIMIT)) { + { + throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); } - })(); + } if (componentIdentity === currentlyRenderingComponent) { // This is a render phase update. Stash it in a lazily-created map of @@ -6350,24 +5800,25 @@ action: action, next: null }; + if (renderPhaseUpdates === null) { renderPhaseUpdates = new Map(); } + var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); + if (firstRenderPhaseUpdate === undefined) { renderPhaseUpdates.set(queue, update); } else { // Append the update to the end of the list. var lastRenderPhaseUpdate = firstRenderPhaseUpdate; + while (lastRenderPhaseUpdate.next !== null) { lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; } + lastRenderPhaseUpdate.next = update; } - } else { - // This means an update has happened after the function component has - // returned. On the server this is a no-op. In React Fiber, the update - // would be scheduled for a future render. } } @@ -6383,14 +5834,27 @@ }; } + function useDeferredValue(value, config) { + resolveCurrentlyRenderingComponent(); + return value; + } + + function useTransition(config) { + resolveCurrentlyRenderingComponent(); + + var startTransition = function (callback) { + callback(); + }; + + return [startTransition, false]; + } + function noop() {} var currentThreadID = 0; - function setCurrentThreadID(threadID) { currentThreadID = threadID; } - var Dispatcher = { readContext: readContext, useContext: useContext, @@ -6406,53 +5870,54 @@ useEffect: noop, // Debugging effect useDebugValue: noop, - useResponder: useResponder + useResponder: useResponder, + useDeferredValue: useDeferredValue, + useTransition: useTransition }; var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; - var Namespaces = { html: HTML_NAMESPACE, mathml: MATH_NAMESPACE, svg: SVG_NAMESPACE - }; + }; // Assumes there is no parent namespace. - // Assumes there is no parent namespace. function getIntrinsicNamespace(type) { switch (type) { case 'svg': return SVG_NAMESPACE; + case 'math': return MATH_NAMESPACE; + default: return HTML_NAMESPACE; } } - function getChildNamespace(parentNamespace, type) { if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { // No (or default) parent namespace: potential entry point. return getIntrinsicNamespace(type); } + if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { // We're leaving SVG. return HTML_NAMESPACE; - } - // By default, pass namespace below. + } // By default, pass namespace below. + + return parentNamespace; } - var ReactDebugCurrentFrame$3 = null; - + var ReactDebugCurrentFrame$2 = null; var ReactControlledValuePropTypes = { checkPropTypes: null }; { - ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame; - + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; var hasReadOnlyValue = { button: true, checkbox: true, @@ -6462,34 +5927,34 @@ reset: true, submit: true }; - var propTypes = { value: function (props, propName, componentName) { - if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { return null; } + 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`.'); }, checked: function (props, propName, componentName) { - if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) { return null; } + 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`.'); } }; - /** * Provide a linked `value` attribute for controlled forms. You should not use * this outside of the ReactDOM controlled form components. */ + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { - checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$3.getStackAddendum); + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); }; } // For HTML, certain tags should omit their close tag. We keep a whitelist for // those special-case tags. - var omittedCloseTags = { area: true, base: true, @@ -6505,66 +5970,62 @@ param: true, source: true, track: true, - wbr: true - // NOTE: menuitem's close tag should be omitted, but that causes problems. + wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems. + }; - // For HTML, certain tags cannot have children. This has the same purpose as // `omittedCloseTags` except that `menuitem` should still have its closing tag. var voidElementTags = _assign({ menuitem: true }, omittedCloseTags); - // TODO: We can remove this if we add invariantWithStack() - // or add stack by default to invariants where possible. var HTML = '__html'; + var ReactDebugCurrentFrame$3 = null; - var ReactDebugCurrentFrame$4 = null; { - ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame; + ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame; } function assertValidProps(tag, props) { if (!props) { return; - } - // Note the use of `==` which checks for null or undefined. + } // Note the use of `==` which checks for null or undefined. + + if (voidElementTags[tag]) { - (function () { - if (!(props.children == null && props.dangerouslySetInnerHTML == null)) { - { - throw ReactError(Error(tag + ' is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.' + (ReactDebugCurrentFrame$4.getStackAddendum()))); - } + if (!(props.children == null && props.dangerouslySetInnerHTML == null)) { + { + throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) ); } - })(); + } } + if (props.dangerouslySetInnerHTML != null) { - (function () { - if (!(props.children == null)) { - { - throw ReactError(Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.')); - } + if (!(props.children == null)) { + { + throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." ); } - })(); - (function () { - if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) { - { - throw ReactError(Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.')); - } + } + + if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) { + { + throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." ); } - })(); + } } + { - !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, '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.') : void 0; + if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { + 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.'); + } } - (function () { - if (!(props.style == null || typeof props.style === 'object')) { - { - throw ReactError(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$4.getStackAddendum()))); - } + + if (!(props.style == null || typeof props.style === 'object')) { + { + 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() ) ); } - })(); + } } /** @@ -6605,7 +6066,6 @@ widows: true, zIndex: true, zoom: true, - // SVG-related properties fillOpacity: true, floodOpacity: true, @@ -6616,25 +6076,25 @@ strokeOpacity: true, strokeWidth: true }; - /** * @param {string} prefix vendor-specific prefix, eg: Webkit * @param {string} key style name, eg: transitionDuration * @return {string} style name prefixed with `prefix`, properly camelCased, eg: * WebkitTransitionDuration */ + function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); } - /** * Support style names that may come passed in prefixed by adding permutations * of vendor prefixes. */ - var prefixes = ['Webkit', 'ms', 'Moz', 'O']; - // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an + + var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an // infinite loop, because it iterates over the newly added props too. + Object.keys(isUnitlessNumber).forEach(function (prop) { prefixes.forEach(function (prefix) { isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; @@ -6650,6 +6110,7 @@ * @param {*} value CSS property value such as `10px`. * @return {string} Normalized style value with dimensions applied. */ + function dangerousStyleValue(name, value, isCustomProperty) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into @@ -6660,8 +6121,8 @@ // This is not an XSS hole but instead a potential CSS injection issue // which has lead to a greater discussion about how we're going to // trust URLs moving forward. See #2115901 - var isEmpty = value == null || typeof value === 'boolean' || value === ''; + if (isEmpty) { return ''; } @@ -6675,7 +6136,6 @@ var uppercasePattern = /([A-Z])/g; var msPattern = /^ms-/; - /** * Hyphenates a camelcased CSS property name, for example: * @@ -6689,6 +6149,7 @@ * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix * is converted to `-ms-`. */ + function hyphenateStyleName(name) { return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); } @@ -6697,6 +6158,7 @@ if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; } + switch (tagName) { // These are reserved SVG and MathML elements. // We don't mind this whitelist too much because we expect it to never grow. @@ -6711,6 +6173,7 @@ case 'font-face-name': case 'missing-glyph': return false; + default: return true; } @@ -6722,11 +6185,9 @@ // 'msTransform' is correct, but the other prefixes should be capitalized var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; var msPattern$1 = /^-ms-/; - var hyphenPattern = /-(.)/g; + var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon - // style values shouldn't contain a semicolon var badStyleValueWithSemicolonPattern = /;\s*$/; - var warnedStyleNames = {}; var warnedStyleValues = {}; var warnedForNaNValue = false; @@ -6744,8 +6205,8 @@ } warnedStyleNames[name] = true; - warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, - // As Andi Smith suggests + + error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix // is converted to lowercase `ms`. camelize(name.replace(msPattern$1, 'ms-'))); @@ -6757,7 +6218,8 @@ } warnedStyleNames[name] = true; - warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); + + error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); }; var warnStyleValueWithSemicolon = function (name, value) { @@ -6766,7 +6228,8 @@ } warnedStyleValues[value] = true; - warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); + + error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); }; var warnStyleValueIsNaN = function (name, value) { @@ -6775,7 +6238,8 @@ } warnedForNaNValue = true; - warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name); + + error('`NaN` is an invalid value for the `%s` css style property.', name); }; var warnStyleValueIsInfinity = function (name, value) { @@ -6784,7 +6248,8 @@ } warnedForInfinityValue = true; - warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name); + + error('`Infinity` is an invalid value for the `%s` css style property.', name); }; warnValidStyle = function (name, value) { @@ -6809,11 +6274,15 @@ var warnValidStyle$1 = warnValidStyle; var ariaProperties = { - 'aria-current': 0, // state + 'aria-current': 0, + // state 'aria-details': 0, - 'aria-disabled': 0, // state - 'aria-hidden': 0, // state - 'aria-invalid': 0, // state + 'aria-disabled': 0, + // state + 'aria-hidden': 0, + // state + 'aria-invalid': 0, + // state 'aria-keyshortcuts': 0, 'aria-label': 0, 'aria-roledescription': 0, @@ -6866,48 +6335,52 @@ var warnedProperties = {}; var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); - - var hasOwnProperty$2 = Object.prototype.hasOwnProperty; + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; function validateProperty(tagName, name) { - if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) { - return true; - } - - if (rARIACamel.test(name)) { - var ariaName = 'aria-' + name.slice(4).toLowerCase(); - var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; - - // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - if (correctName == null) { - warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); - warnedProperties[name] = true; - return true; - } - // aria-* attributes should be lowercase; suggest the lowercase version. - if (name !== correctName) { - warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); - warnedProperties[name] = true; + { + if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) { return true; } - } - if (rARIA.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; + if (rARIACamel.test(name)) { + var ariaName = 'aria-' + name.slice(4).toLowerCase(); + var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM + // DOM properties, then it is an invalid aria-* attribute. - // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - if (standardName == null) { - warnedProperties[name] = true; - return false; + if (correctName == null) { + error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); + + warnedProperties[name] = true; + return true; + } // aria-* attributes should be lowercase; suggest the lowercase version. + + + if (name !== correctName) { + error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); + + warnedProperties[name] = true; + return true; + } } - // aria-* attributes should be lowercase; suggest the lowercase version. - if (name !== standardName) { - warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); - warnedProperties[name] = true; - return true; + + if (rARIA.test(name)) { + var lowerCasedName = name.toLowerCase(); + var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM + // DOM properties, then it is an invalid aria-* attribute. + + if (standardName == null) { + warnedProperties[name] = true; + return false; + } // aria-* attributes should be lowercase; suggest the lowercase version. + + + if (name !== standardName) { + error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); + + warnedProperties[name] = true; + return true; + } } } @@ -6915,23 +6388,26 @@ } function warnInvalidARIAProps(type, props) { - var invalidProps = []; + { + var invalidProps = []; + + for (var key in props) { + var isValid = validateProperty(type, key); - for (var key in props) { - var isValid = validateProperty(type, key); - if (!isValid) { - invalidProps.push(key); + if (!isValid) { + invalidProps.push(key); + } } - } - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); + var unknownPropString = invalidProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); - if (invalidProps.length === 1) { - warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); - } else if (invalidProps.length > 1) { - warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); + if (invalidProps.length === 1) { + error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); + } else if (invalidProps.length > 1) { + error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); + } } } @@ -6939,82 +6415,42 @@ if (isCustomComponent(type, props)) { return; } + warnInvalidARIAProps(type, props); } var didWarnValueNull = false; - function validateProperties$1(type, props) { - if (type !== 'input' && type !== 'textarea' && type !== 'select') { - return; - } + { + if (type !== 'input' && type !== 'textarea' && type !== 'select') { + return; + } - if (props != null && props.value === null && !didWarnValueNull) { - didWarnValueNull = true; - if (type === 'select' && props.multiple) { - warning$1(false, '`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); - } else { - warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); + if (props != null && props.value === null && !didWarnValueNull) { + didWarnValueNull = true; + + if (type === 'select' && props.multiple) { + 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); + } else { + error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); + } } } } - /** - * Registers plugins so that they can extract and dispatch events. - * - * @see {EventPluginHub} - */ - - /** - * Ordered list of injected plugins. - */ - - - /** - * Mapping from event name to dispatch config - */ - - /** * Mapping from registration name to plugin module */ - var registrationNameModules = {}; - - /** - * Mapping from registration name to event name - */ - + var registrationNameModules = {}; /** * Mapping from lowercase registration names to the properly cased version, * used to warn in the case of missing event handlers. Available * only in true. * @type {Object} */ - var possibleRegistrationNames = {}; - // Trust the developer to only use possibleRegistrationNames in true - - /** - * Injects an ordering of plugins (by plugin name). This allows the ordering - * to be decoupled from injection of the actual plugins so that ordering is - * always deterministic regardless of packaging, on-the-fly injection, etc. - * - * @param {array} InjectedEventPluginOrder - * @internal - * @see {EventPluginHub.injection.injectEventPluginOrder} - */ - - /** - * Injects plugins to be used by `EventPluginHub`. The plugin names must be - * in the ordering injected by `injectEventPluginOrder`. - * - * Plugins can be injected as part of page initialization or on-the-fly. - * - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - * @internal - * @see {EventPluginHub.injection.injectEventPluginsByName} - */ + var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true // When adding attributes to the HTML or SVG whitelist, be sure to // also add them to this module to ensure casing and incorrect name @@ -7166,7 +6602,6 @@ width: 'width', wmode: 'wmode', wrap: 'wrap', - // SVG about: 'about', accentheight: 'accentHeight', @@ -7522,25 +6957,32 @@ } var lowerCasedName = name.toLowerCase(); + if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - warning$1(false, '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.'); + 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.'); + warnedProperties$1[name] = true; return true; - } + } // We can't rely on the event system being injected on the server. + - // We can't rely on the event system being injected on the server. if (canUseEventSystem) { if (registrationNameModules.hasOwnProperty(name)) { return true; } + var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; + if (registrationName != null) { - warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); + error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); + warnedProperties$1[name] = true; return true; } + if (EVENT_NAME_REGEX.test(name)) { - warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name); + error('Unknown event handler property `%s`. It will be ignored.', name); + warnedProperties$1[name] = true; return true; } @@ -7549,85 +6991,94 @@ // So we can't tell if the event name is correct for sure, but we can filter // out known bad ones like `onclick`. We can't suggest a specific replacement though. if (INVALID_EVENT_NAME_REGEX.test(name)) { - warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); + error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); } + warnedProperties$1[name] = true; return true; - } + } // Let the ARIA attribute hook validate ARIA attributes + - // Let the ARIA attribute hook validate ARIA attributes if (rARIA$1.test(name) || rARIACamel$1.test(name)) { return true; } if (lowerCasedName === 'innerhtml') { - warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); + error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); + warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'aria') { - warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); + error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); + warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { - warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); + error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); + warnedProperties$1[name] = true; return true; } if (typeof value === 'number' && isNaN(value)) { - warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); + error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); + warnedProperties$1[name] = true; return true; } var propertyInfo = getPropertyInfo(name); - var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; + var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config. - // Known attributes should match the casing specified in the property config. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { var standardName = possibleStandardNames[lowerCasedName]; + if (standardName !== name) { - warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); + error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); + warnedProperties$1[name] = true; return true; } } else if (!isReserved && name !== lowerCasedName) { // Unknown attributes should have lowercase casing since that's how they // will be cased anyway with server rendering. - warning$1(false, '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); + 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); + warnedProperties$1[name] = true; return true; } if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { if (value) { - warning$1(false, '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); + 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); } else { - warning$1(false, '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); + 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); } + warnedProperties$1[name] = true; return true; - } - - // Now that we've validated casing, do not validate + } // Now that we've validated casing, do not validate // data types for reserved props + + if (isReserved) { return true; - } + } // Warn when a known attribute is a bad type + - // Warn when a known attribute is a bad type if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { warnedProperties$1[name] = true; return false; - } + } // Warn when passing the strings 'false' or 'true' into a boolean prop + - // Warn when passing the strings 'false' or 'true' into a boolean prop if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) { - warning$1(false, '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); + 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); + warnedProperties$1[name] = true; return true; } @@ -7637,21 +7088,26 @@ } var warnUnknownProperties = function (type, props, canUseEventSystem) { - var unknownProps = []; - for (var key in props) { - var isValid = validateProperty$1(type, key, props[key], canUseEventSystem); - if (!isValid) { - unknownProps.push(key); + { + var unknownProps = []; + + for (var key in props) { + var isValid = validateProperty$1(type, key, props[key], canUseEventSystem); + + if (!isValid) { + unknownProps.push(key); + } } - } - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - if (unknownProps.length === 1) { - warning$1(false, '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); - } else if (unknownProps.length > 1) { - warning$1(false, '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); + var unknownPropString = unknownProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); + + if (unknownProps.length === 1) { + 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); + } else if (unknownProps.length > 1) { + 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); + } } }; @@ -7659,44 +7115,47 @@ if (isCustomComponent(type, props)) { return; } + warnUnknownProperties(type, props, canUseEventSystem); } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - // Based on reading the React.Children implementation. TODO: type this somewhere? - - var toArray = React.Children.toArray; - - // This is only used in DEV. + var toArray = React.Children.toArray; // This is only used in DEV. // Each entry is `this.stack` from a currently executing renderer instance. // (There may be more than one because ReactDOMServer is reentrant). // Each stack is an array of frames which may contain nested stacks of elements. - var currentDebugStacks = []; + var currentDebugStacks = []; var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; - var ReactDebugCurrentFrame = void 0; + var ReactDebugCurrentFrame$4; var prevGetCurrentStackImpl = null; + var getCurrentServerStackImpl = function () { return ''; }; + var describeStackFrame = function (element) { return ''; }; var validatePropertiesInDevelopment = function (type, props) {}; + var pushCurrentDebugStack = function (stack) {}; + var pushElementToDebugStack = function (element) {}; + var popCurrentDebugStack = function () {}; + var hasWarnedAboutUsingContextAsConsumer = false; { - ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame; validatePropertiesInDevelopment = function (type, props) { validateProperties(type, props); validateProperties$1(type, props); - validateProperties$2(type, props, /* canUseEventSystem */false); + validateProperties$2(type, props, + /* canUseEventSystem */ + false); }; describeStackFrame = function (element) { @@ -7713,19 +7172,18 @@ if (currentDebugStacks.length === 1) { // We are entering a server renderer. // Remember the previous (e.g. client) global stack implementation. - prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack; - ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl; + prevGetCurrentStackImpl = ReactDebugCurrentFrame$4.getCurrentStack; + ReactDebugCurrentFrame$4.getCurrentStack = getCurrentServerStackImpl; } }; pushElementToDebugStack = function (element) { // For the innermost executing ReactDOMServer call, - var stack = currentDebugStacks[currentDebugStacks.length - 1]; - // Take the innermost executing frame (e.g. ), - var frame = stack[stack.length - 1]; - // and record that it has one more element associated with it. - frame.debugElementStack.push(element); - // We only need this because we tail-optimize single-element + var stack = currentDebugStacks[currentDebugStacks.length - 1]; // Take the innermost executing frame (e.g. ), + + var frame = stack[stack.length - 1]; // and record that it has one more element associated with it. + + frame.debugElementStack.push(element); // We only need this because we tail-optimize single-element // children and directly handle them in an inner loop instead of // creating separate frames for them. }; @@ -7736,7 +7194,7 @@ if (currentDebugStacks.length === 0) { // We are exiting the server renderer. // Restore the previous (e.g. client) global stack implementation. - ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl; + ReactDebugCurrentFrame$4.getCurrentStack = prevGetCurrentStackImpl; prevGetCurrentStackImpl = null; } }; @@ -7745,22 +7203,25 @@ if (currentDebugStacks.length === 0) { // Nothing is currently rendering. return ''; - } - // ReactDOMServer is reentrant so there may be multiple calls at the same time. + } // ReactDOMServer is reentrant so there may be multiple calls at the same time. // Take the frames from the innermost call which is the last in the array. + + var frames = currentDebugStacks[currentDebugStacks.length - 1]; - var stack = ''; - // Go through every frame in the stack from the innermost one. + var stack = ''; // Go through every frame in the stack from the innermost one. + for (var i = frames.length - 1; i >= 0; i--) { - var frame = frames[i]; - // Every frame might have more than one debug element stack entry associated with it. + var frame = frames[i]; // Every frame might have more than one debug element stack entry associated with it. // This is because single-child nesting doesn't create materialized frames. // Instead it would push them through `pushElementToDebugStack()`. - var _debugElementStack = frame.debugElementStack; - for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) { - stack += describeStackFrame(_debugElementStack[ii]); + + var debugElementStack = frame.debugElementStack; + + for (var ii = debugElementStack.length - 1; ii >= 0; ii--) { + stack += describeStackFrame(debugElementStack[ii]); } } + return stack; }; } @@ -7781,31 +7242,33 @@ listing: true, pre: true, textarea: true - }; - - // We accept any tag to be rendered but since this gets injected into arbitrary + }; // We accept any tag to be rendered but since this gets injected into arbitrary // HTML, we want to make sure that it's a safe tag. // http://www.w3.org/TR/REC-xml/#NT-Name + var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset + var validatedTagCache = {}; + function validateDangerousTag(tag) { if (!validatedTagCache.hasOwnProperty(tag)) { - (function () { - if (!VALID_TAG_REGEX.test(tag)) { - { - throw ReactError(Error('Invalid tag: ' + tag)); - } + if (!VALID_TAG_REGEX.test(tag)) { + { + throw Error( "Invalid tag: " + tag ); } - })(); + } + validatedTagCache[tag] = true; } } var styleNameCache = {}; + var processStyleName = function (styleName) { if (styleNameCache.hasOwnProperty(styleName)) { return styleNameCache[styleName]; } + var result = hyphenateStyleName(styleName); styleNameCache[styleName] = result; return result; @@ -7814,24 +7277,28 @@ function createMarkupForStyles(styles) { var serialized = ''; var delimiter = ''; + for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } + var isCustomProperty = styleName.indexOf('--') === 0; var styleValue = styles[styleName]; + { if (!isCustomProperty) { warnValidStyle$1(styleName, styleValue); } } + if (styleValue != null) { serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':'; serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); - delimiter = ';'; } } + return serialized || null; } @@ -7840,11 +7307,13 @@ var _constructor = publicInstance.constructor; var componentName = _constructor && getComponentName(_constructor) || 'ReactClass'; var warningKey = componentName + '.' + callerName; + if (didWarnAboutNoopUpdateForComponent[warningKey]) { return; } - warningWithoutStack$1(false, '%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); + 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); + didWarnAboutNoopUpdateForComponent[warningKey] = true; } } @@ -7855,16 +7324,19 @@ function getNonChildrenInnerMarkup(props) { var innerHTML = props.dangerouslySetInnerHTML; + if (innerHTML != null) { if (innerHTML.__html != null) { return innerHTML.__html; } } else { var content = props.children; + if (typeof content === 'string' || typeof content === 'number') { return escapeTextForBrowser(content); } } + return null; } @@ -7872,14 +7344,19 @@ if (!React.isValidElement(children)) { return toArray(children); } + var element = children; + if (element.type !== REACT_FRAGMENT_TYPE) { return [element]; } + var fragmentChildren = element.props.children; + if (!React.isValidElement(fragmentChildren)) { return toArray(fragmentChildren); } + var fragmentChildElement = fragmentChildren; return [fragmentChildElement]; } @@ -7888,25 +7365,29 @@ if (children === undefined || children === null) { return children; } - var content = ''; - // Flatten children and warn if they aren't strings or numbers; + + var content = ''; // Flatten children and warn if they aren't strings or numbers; // invalid types are ignored. + React.Children.forEach(children, function (child) { if (child == null) { return; } + content += child; + { if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') { didWarnInvalidOptionChildren = true; - warning$1(false, 'Only strings and numbers are supported as