diff --git a/CHANGELOG.md b/CHANGELOG.md index 3136134d4..6ccbd8d70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,24 @@ #### Bug Fixes +## 2.5.0 + +#### Breaking Changes + +#### New Features + +- React 16.4.2 prebundled #977 +- Added `assert_react_component` test helper #957 +- Supports Webpacker 4, Ruby 2.6 #934 +- Supports camelize on ActionController::Parameters #932 + +#### Deprecation + +#### Bug Fixes + +- Linting fix to generated JS #941 +- (Meta) Tests for react-rails updated #892 #894 #916 + ## 2.4.7 #### New Features diff --git a/VERSIONS.md b/VERSIONS.md index 69b4ee15e..0b64070bd 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -9,7 +9,8 @@ You can control what version of React.js (and JSXTransformer) is used by `react- | Gem | React.js | |----------|----------| -| master | 16.4.2 | +| master | 16.8.6 | +| 2.5.0 | 16.8.6 | | 2.4.7 | 16.4.2 | | 2.4.6 | 16.4.1 | | 2.4.5 | 16.3.2 | diff --git a/lib/assets/react-source/development/react-server.js b/lib/assets/react-source/development/react-server.js index 81583f90b..20b6e0217 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__(30); - var createReactClass = __webpack_require__(25); - var PropTypes = __webpack_require__(27); + var ReactDOMServer = __webpack_require__(29); + var createReactClass = __webpack_require__(17); + var PropTypes = __webpack_require__(23); global.React = React; global.ReactDOMServer = ReactDOMServer; @@ -65,7 +65,7 @@ if (process.env.NODE_ENV === 'production') { module.exports = __webpack_require__(3); } else { - module.exports = __webpack_require__(8); + module.exports = __webpack_require__(5); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) @@ -264,28 +264,31 @@ /* 3 */ /***/ (function(module, exports, __webpack_require__) { - /** @license React v16.4.2 + /** @license React v16.8.6 * react.production.min.js * - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright (c) Facebook, Inc. and its affiliates. * * 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 k=__webpack_require__(4),n=__webpack_require__(5),p=__webpack_require__(6),q=__webpack_require__(7),r="function"===typeof Symbol&&Symbol.for,t=r?Symbol.for("react.element"):60103,u=r?Symbol.for("react.portal"):60106,v=r?Symbol.for("react.fragment"):60107,w=r?Symbol.for("react.strict_mode"):60108,x=r?Symbol.for("react.profiler"):60114,y=r?Symbol.for("react.provider"):60109,z=r?Symbol.for("react.context"):60110,A=r?Symbol.for("react.async_mode"):60111,B= - r?Symbol.for("react.forward_ref"):60112;r&&Symbol.for("react.timeout");var C="function"===typeof Symbol&&Symbol.iterator;function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cP.length&&P.push(a)} - function S(a,b,e,c){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 t:case u:g=!0}}if(g)return e(c,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;hP.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 h=0;h 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { @@ -656,6 +545,56 @@ 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. + */ + + var warningWithoutStack = function () {}; + + { + 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]; + } + + 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; + } + 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); + } + 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. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + }; + } + + var warningWithoutStack$1 = warningWithoutStack; + var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { @@ -666,7 +605,7 @@ if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } - warning(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); + 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); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } @@ -739,12 +678,18 @@ } }; + 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 // renderer. @@ -835,6 +780,7 @@ 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.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } @@ -856,6 +802,17 @@ return refObject; } + /** + * Keeps track of the current dispatcher. + */ + var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null + }; + /** * Keeps track of the current owner. * @@ -870,31 +827,203 @@ current: null }; - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true - }; - - var specialPropKeyWarningShown = void 0; - var specialPropRefWarningShown = void 0; + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; - function hasValidRef(config) { - { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - if (getter && getter.isReactWarning) { - return false; + 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 config.ref !== undefined; + return '\n in ' + (name || 'Unknown') + sourceInfo; + }; + + var Resolved = 1; + + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; } - function hasValidKey(config) { + 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_CONCURRENT_MODE_TYPE: + return 'ConcurrentMode'; + 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'; + } + 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); + } + } + } + } + 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 ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentOwner: ReactCurrentOwner, + // 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])); + }; + } + + var warning$1 = warning; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true + }; + + var specialPropKeyWarningShown = void 0; + var specialPropRefWarningShown = void 0; + + 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; + } + + function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; @@ -910,7 +1039,7 @@ var warnAboutAccessingKey = function () { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; - warning(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); + 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); } }; warnAboutAccessingKey.isReactWarning = true; @@ -924,7 +1053,7 @@ var warnAboutAccessingRef = function () { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; - warning(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); + 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); } }; warnAboutAccessingRef.isReactWarning = true; @@ -1072,14 +1201,12 @@ } { if (key || ref) { - if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); } } } @@ -1170,28 +1297,13 @@ * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object - * @return {boolean} True if `object` is a valid component. + * @return {boolean} True if `object` is a ReactElement. * @final */ function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } - var ReactDebugCurrentFrame = {}; - - { - // Component that is being worked on - ReactDebugCurrentFrame.getCurrentStack = null; - - ReactDebugCurrentFrame.getStackAddendum = function () { - var impl = ReactDebugCurrentFrame.getCurrentStack; - if (impl) { - return impl(); - } - return null; - }; - } - var SEPARATOR = '.'; var SUBSEPARATOR = ':'; @@ -1319,7 +1431,7 @@ { // Warn about using Maps as children if (iteratorFn === children.entries) { - !didWarnAboutMaps ? warning(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum()) : void 0; + !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; didWarnAboutMaps = true; } } @@ -1424,7 +1536,9 @@ var mappedChild = func.call(context, child, bookKeeping.count++); if (Array.isArray(mappedChild)) { - mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) { + return c; + }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { mappedChild = cloneAndReplaceKey(mappedChild, @@ -1478,7 +1592,9 @@ * @return {number} The number of children. */ function countChildren(children) { - return traverseAllChildren(children, emptyFunction.thatReturnsNull, null); + return traverseAllChildren(children, function () { + return null; + }, null); } /** @@ -1489,7 +1605,9 @@ */ function toArray(children) { var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + mapIntoWithKeyPrefixInternal(children, result, null, function (child) { + return child; + }); return result; } @@ -1517,23 +1635,23 @@ calculateChangedBits = null; } else { { - !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warning(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0; + !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0; } } var context = { $$typeof: REACT_CONTEXT_TYPE, _calculateChangedBits: calculateChangedBits, - _defaultValue: defaultValue, - _currentValue: defaultValue, // As a workaround to support multiple concurrent renderers, we categorize // some renderers as primary and others as secondary. We only expect // there to be two concurrent renderers at most: React Native (primary) and // Fabric (secondary); React DOM (primary) and React ART (secondary). // Secondary renderers store their context values on separate fields. + _currentValue: defaultValue, _currentValue2: defaultValue, - _changedBits: 0, - _changedBits2: 0, + // Used to track how many concurrent renderers this context currently + // supports within in a single renderer. Such as parallel server rendering. + _threadCount: 0, // These are circular Provider: null, Consumer: null @@ -1543,7 +1661,70 @@ $$typeof: REACT_PROVIDER_TYPE, _context: context }; - context.Consumer = context; + + var hasWarnedAboutUsingNestedContextConsumers = false; + var hasWarnedAboutUsingConsumerProvider = false; + + { + // A separate object, but proxies back to the original context object for + // backwards compatibility. It has a different $$typeof, so we can properly + // warn for the incorrect usage of Context as a Consumer. + var Consumer = { + $$typeof: REACT_CONTEXT_TYPE, + _context: context, + _calculateChangedBits: context._calculateChangedBits + }; + // $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?'); + } + return context.Provider; + }, + set: function (_Provider) { + context.Provider = _Provider; + } + }, + _currentValue: { + get: function () { + return context._currentValue; + }, + set: function (_currentValue) { + context._currentValue = _currentValue; + } + }, + _currentValue2: { + get: function () { + return context._currentValue2; + }, + set: function (_currentValue2) { + context._currentValue2 = _currentValue2; + } + }, + _threadCount: { + get: function () { + return context._threadCount; + }, + set: function (_threadCount) { + context._threadCount = _threadCount; + } + }, + Consumer: { + 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?'); + } + return context.Consumer; + } + } + }); + // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty + context.Consumer = Consumer; + } { context._currentRenderer = null; @@ -1553,12 +1734,68 @@ return context; } + function lazy(ctor) { + var lazyType = { + $$typeof: REACT_LAZY_TYPE, + _ctor: ctor, + // React uses these fields to store the result. + _status: -1, + _result: null + }; + + { + // In production, this would just set it on the object. + var defaultProps = void 0; + var propTypes = void 0; + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + 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: + Object.defineProperty(lazyType, 'defaultProps', { + enumerable: true + }); + } + }, + propTypes: { + configurable: true, + get: function () { + 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: + Object.defineProperty(lazyType, 'propTypes', { + enumerable: true + }); + } + } + }); + } + + return lazyType; + } + function forwardRef(render) { { - !(typeof render === 'function') ? warning(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render) : void 0; + 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(...)).'); + } else if (typeof render !== 'function') { + warningWithoutStack$1(false, '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 != null) { - !(render.defaultProps == null && render.propTypes == null) ? warning(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0; + !(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; } } @@ -1568,51 +1805,96 @@ }; } - var describeComponentFrame = function (name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); - }; - 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_ASYNC_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_TIMEOUT_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); } - function getComponentName(fiber) { - var type = fiber.type; - - if (typeof type === 'function') { - return type.displayName || type.name; - } - if (typeof type === 'string') { - return type; - } - switch (type) { - case REACT_ASYNC_MODE_TYPE: - return 'AsyncMode'; - case REACT_CONTEXT_TYPE: - return 'Context.Consumer'; - case REACT_FRAGMENT_TYPE: - return 'ReactFragment'; - case REACT_PORTAL_TYPE: - return 'ReactPortal'; - case REACT_PROFILER_TYPE: - return 'Profiler(' + fiber.pendingProps.id + ')'; - case REACT_PROVIDER_TYPE: - return 'Context.Provider'; - case REACT_STRICT_MODE_TYPE: - return 'StrictMode'; - case REACT_TIMEOUT_TYPE: - return 'Timeout'; + 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); + } } - if (typeof type === 'object' && type !== null) { - switch (type.$$typeof) { - case REACT_FORWARD_REF_TYPE: - var functionName = type.render.displayName || type.render.name || ''; - return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef'; + return { + $$typeof: REACT_MEMO_TYPE, + type: type, + compare: compare === undefined ? null : compare + }; + } + + function resolveDispatcher() { + var dispatcher = ReactCurrentDispatcher.current; + !(dispatcher !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0; + 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; + + // 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 + // 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?'); + } else if (realContext.Provider === Context) { + warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); + } } } - return null; + 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) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, inputs); + } + + function useLayoutEffect(create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, inputs); + } + + function useCallback(callback, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, inputs); + } + + function useMemo(create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, inputs); + } + + function useImperativeHandle(ref, create, inputs) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, inputs); + } + + function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } } /** @@ -1622,52 +1904,15 @@ * that support it. */ - var currentlyValidatingElement = void 0; var propTypesMisspellWarningShown = void 0; - var getDisplayName = function () {}; - var getStackAddendum = function () {}; - { - currentlyValidatingElement = null; - propTypesMisspellWarningShown = false; - - getDisplayName = function (element) { - if (element == null) { - return '#empty'; - } else if (typeof element === 'string' || typeof element === 'number') { - return '#text'; - } else if (typeof element.type === 'string') { - return element.type; - } - - var type = element.type; - if (type === REACT_FRAGMENT_TYPE) { - return 'React.Fragment'; - } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) { - var functionName = type.render.displayName || type.render.name || ''; - return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef'; - } else { - return type.displayName || type.name || 'Unknown'; - } - }; - - getStackAddendum = function () { - var stack = ''; - if (currentlyValidatingElement) { - var name = getDisplayName(currentlyValidatingElement); - var owner = currentlyValidatingElement._owner; - stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner)); - } - stack += ReactDebugCurrentFrame.getStackAddendum() || ''; - return stack; - }; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { - var name = getComponentName(ReactCurrentOwner.current); + var name = getComponentName(ReactCurrentOwner.current.type); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } @@ -1733,14 +1978,14 @@ 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) + '.'; + childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.'; } - currentlyValidatingElement = element; + setCurrentlyValidatingElement(element); { - warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum()); + 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); } - currentlyValidatingElement = null; + setCurrentlyValidatingElement(null); } /** @@ -1794,30 +2039,31 @@ */ function validatePropTypes(element) { var type = element.type; - var name = void 0, - propTypes = void 0; + if (type === null || type === undefined || typeof type === 'string') { + return; + } + var name = getComponentName(type); + var propTypes = void 0; if (typeof type === 'function') { - // Class or functional component - name = type.displayName || type.name; propTypes = type.propTypes; - } else if (typeof type === 'object' && type !== null && type.$$typeof === REACT_FORWARD_REF_TYPE) { - // ForwardRef - var functionName = type.render.displayName || type.render.name || ''; - name = functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef'; + } 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) { - currentlyValidatingElement = element; - checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum); - currentlyValidatingElement = null; + setCurrentlyValidatingElement(element); + checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum); + setCurrentlyValidatingElement(null); } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; - warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); + 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 ? warning(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; } } @@ -1826,22 +2072,22 @@ * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { - currentlyValidatingElement = 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(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); + 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(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); + warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.'); } - currentlyValidatingElement = null; + setCurrentlyValidatingElement(null); } function createElementWithValidation(type, props, children) { @@ -1862,18 +2108,19 @@ info += getDeclarationErrorAddendum(); } - info += getStackAddendum() || ''; - 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; } - warning(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); + 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); } var element = createElement.apply(this, arguments); @@ -1933,53 +2180,101 @@ return newElement; } - var React = { - Children: { - map: mapChildren, - forEach: forEachChildren, - count: countChildren, - toArray: toArray, - only: onlyChild - }, + // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - createRef: createRef, - Component: Component, - PureComponent: PureComponent, - createContext: createContext, - forwardRef: forwardRef, + // 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: - Fragment: REACT_FRAGMENT_TYPE, - StrictMode: REACT_STRICT_MODE_TYPE, - unstable_AsyncMode: REACT_ASYNC_MODE_TYPE, - unstable_Profiler: REACT_PROFILER_TYPE, - createElement: createElementWithValidation, + // 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. + + + // 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. + var enableStableConcurrentModeAPIs = false; + + 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, + StrictMode: REACT_STRICT_MODE_TYPE, + Suspense: REACT_SUSPENSE_TYPE, + + createElement: createElementWithValidation, cloneElement: cloneElementWithValidation, createFactory: createFactoryWithValidation, isValidElement: isValidElement, version: ReactVersion, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { - ReactCurrentOwner: ReactCurrentOwner, - // Used by renderers to avoid bundling object-assign twice in UMD bundles: - assign: _assign - } + unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE, + unstable_Profiler: REACT_PROFILER_TYPE, + + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals }; - if (enableSuspense) { - React.Timeout = REACT_TIMEOUT_TYPE; - } + // 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. - { - _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { - // 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 (enableStableConcurrentModeAPIs) { + React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + React.Profiler = REACT_PROFILER_TYPE; + React.unstable_ConcurrentMode = undefined; + React.unstable_Profiler = undefined; } @@ -1992,7 +2287,7 @@ // 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.default : React$3; + var react = React$3.default || React$3; module.exports = react; })(); @@ -2001,75 +2296,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 9 */ -/***/ (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__(7); - - /** - * 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))) - -/***/ }), -/* 10 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -2084,8 +2311,9 @@ var printWarning = function() {}; if (process.env.NODE_ENV !== 'production') { - var ReactPropTypesSecret = __webpack_require__(11); + var ReactPropTypesSecret = __webpack_require__(7); var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); printWarning = function(text) { var message = 'Warning: ' + text; @@ -2115,7 +2343,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (process.env.NODE_ENV !== 'production') { for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { + if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. @@ -2143,8 +2371,7 @@ 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' - ) - + ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the @@ -2162,12 +2389,23 @@ } } + /** + * Resets warning cache when testing. + * + * @private + */ + checkPropTypes.resetWarningCache = function() { + if (process.env.NODE_ENV !== 'production') { + loggedTypeFailures = {}; + } + } + module.exports = checkPropTypes; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 11 */ +/* 7 */ /***/ (function(module, exports) { /** @@ -2185,168 +2423,16 @@ /***/ }), +/* 8 */, +/* 9 */, +/* 10 */, +/* 11 */, /* 12 */, /* 13 */, /* 14 */, /* 15 */, /* 16 */, -/* 17 */, -/* 18 */, -/* 19 */, -/* 20 */, -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @typechecks - */ - - 'use strict'; - - var hyphenate = __webpack_require__(22); - - var msPattern = /^ms-/; - - /** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - * - * @param {string} string - * @return {string} - */ - function hyphenateStyleName(string) { - return hyphenate(string).replace(msPattern, '-ms-'); - } - - module.exports = hyphenateStyleName; - -/***/ }), -/* 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. - * - * @typechecks - */ - - var _uppercasePattern = /([A-Z])/g; - - /** - * Hyphenates a camelcased string, for example: - * - * > hyphenate('backgroundColor') - * < "background-color" - * - * For CSS style names, use `hyphenateStyleName` instead which works properly - * with all vendor prefixes, including `ms`. - * - * @param {string} string - * @return {string} - */ - function hyphenate(string) { - return string.replace(_uppercasePattern, '-$1').toLowerCase(); - } - - module.exports = hyphenate; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - - /** - * 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. - * - * @typechecks - */ - - 'use strict'; - - var camelize = __webpack_require__(24); - - var msPattern = /^-ms-/; - - /** - * Camelcases a hyphenated CSS property name, for example: - * - * > camelizeStyleName('background-color') - * < "backgroundColor" - * > camelizeStyleName('-moz-transition') - * < "MozTransition" - * > camelizeStyleName('-ms-transition') - * < "msTransition" - * - * As Andi Smith suggests - * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - * is converted to lowercase `ms`. - * - * @param {string} string - * @return {string} - */ - function camelizeStyleName(string) { - return camelize(string.replace(msPattern, 'ms-')); - } - - module.exports = camelizeStyleName; - -/***/ }), -/* 24 */ -/***/ (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. - * - * @typechecks - */ - - var _hyphenPattern = /-(.)/g; - - /** - * Camelcases a hyphenated string, for example: - * - * > camelize('background-color') - * < "backgroundColor" - * - * @param {string} string - * @return {string} - */ - function camelize(string) { - return string.replace(_hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); - } - - module.exports = camelize; - -/***/ }), -/* 25 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2360,7 +2446,7 @@ 'use strict'; var React = __webpack_require__(1); - var factory = __webpack_require__(26); + var factory = __webpack_require__(18); if (typeof React === 'undefined') { throw Error( @@ -2380,7 +2466,7 @@ /***/ }), -/* 26 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -2395,11 +2481,11 @@ var _assign = __webpack_require__(4); - var emptyObject = __webpack_require__(6); - var _invariant = __webpack_require__(5); + var emptyObject = __webpack_require__(19); + var _invariant = __webpack_require__(20); if (process.env.NODE_ENV !== 'production') { - var warning = __webpack_require__(9); + var warning = __webpack_require__(21); } var MIXINS_KEY = 'mixins'; @@ -3313,7 +3399,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 27 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3321,34 +3407,485 @@ * * 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 REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; + 'use strict'; - // 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__(28)(isValidElement, 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__(29)(); - } + 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) {/** + * 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 ReactIs = __webpack_require__(24); + + // 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); + } 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)(); + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {'use strict'; + + if (process.env.NODE_ENV === 'production') { + module.exports = __webpack_require__(25); + } else { + module.exports = __webpack_require__(26); + } + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + + /** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * 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.memo"): + 60115,r=b?Symbol.for("react.lazy"):60116;function t(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 r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; + exports.Fragment=e;exports.Lazy=r;exports.Memo=q;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||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; + exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; + exports.isSuspense=function(a){return t(a)===p}; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.8.6 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + + + if (process.env.NODE_ENV !== "production") { + (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; + 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; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + + 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 || 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); + } + + /** + * 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 typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + 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_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 + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + + 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.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + + exports.typeOf = typeOf; + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isValidElementType = isValidElementType; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + })(); + } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 28 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {/** @@ -3360,11 +3897,13 @@ 'use strict'; + var ReactIs = __webpack_require__(24); var assign = __webpack_require__(4); - var ReactPropTypesSecret = __webpack_require__(11); - var checkPropTypes = __webpack_require__(10); + var ReactPropTypesSecret = __webpack_require__(7); + var checkPropTypes = __webpack_require__(6); + var has = Function.call.bind(Object.prototype.hasOwnProperty); var printWarning = function() {}; if (process.env.NODE_ENV !== 'production') { @@ -3475,6 +4014,7 @@ any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, @@ -3628,6 +4168,18 @@ return createChainableTypeChecker(validate); } + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { @@ -3642,7 +4194,16 @@ function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + if (process.env.NODE_ENV !== 'production') { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } return emptyFunctionThatReturnsNull; } @@ -3654,8 +4215,14 @@ } } - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } @@ -3671,7 +4238,7 @@ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { + if (has(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; @@ -3828,6 +4395,11 @@ return true; } + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; @@ -3902,6 +4474,7 @@ } ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; @@ -3910,7 +4483,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 29 */ +/* 28 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3922,9 +4495,11 @@ 'use strict'; - var ReactPropTypesSecret = __webpack_require__(11); + var ReactPropTypesSecret = __webpack_require__(7); function emptyFunction() {} + function emptyFunctionWithReset() {} + emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { @@ -3958,16 +4533,19 @@ any: shim, arrayOf: getShim, element: shim, + elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, - exact: getShim + exact: getShim, + + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction }; - ReactPropTypes.checkPropTypes = emptyFunction; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; @@ -3975,136 +4553,282 @@ /***/ }), -/* 30 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {'use strict'; if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(31); + module.exports = __webpack_require__(30); } else { - module.exports = __webpack_require__(33); + module.exports = __webpack_require__(31); } /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) /***/ }), -/* 31 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { - /** @license React v16.4.2 + /** @license React v16.8.6 * react-dom-server.browser.production.min.js * - * Copyright (c) 2013-present, Facebook, Inc. + * Copyright (c) Facebook, Inc. and its affiliates. * * 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 p=__webpack_require__(5),r=__webpack_require__(4),t=__webpack_require__(1),w=__webpack_require__(7),x=__webpack_require__(6),aa=__webpack_require__(21),ba=__webpack_require__(32); - function y(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cb}return!1}function I(a,b,d,c,k){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=k;this.mustUseProperty=d;this.propertyName=a;this.type=b}var J={}; + 'use strict';var p=__webpack_require__(4),q=__webpack_require__(1);function aa(a,b,d,c,f,e,h,g){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var D=[d,c,f,e,h,g],B=0;a=Error(b.replace(/%s/g,function(){return D[B++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} + function r(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cH;H++)G[H]=H+1;G[15]=0; + var ma=/^[: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]*$/,na=Object.prototype.hasOwnProperty,oa={},pa={}; + function qa(a){if(na.call(pa,a))return!0;if(na.call(oa,a))return!1;if(ma.test(a))return pa[a]=!0;oa[a]=!0;return!1}function ra(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 sa(a,b,d,c){if(null===b||"undefined"===typeof b||ra(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){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b}var J={}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){J[a]=new I(a,0,!1,a,null)});[["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)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){J[a]=new I(a,2,!1,a.toLowerCase(),null)}); - ["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(a){J[a]=new I(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled 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)});["checked","multiple","muted","selected"].forEach(function(a){J[a]=new I(a,3,!0,a.toLowerCase(),null)}); - ["capture","download"].forEach(function(a){J[a]=new I(a,4,!1,a.toLowerCase(),null)});["cols","rows","size","span"].forEach(function(a){J[a]=new I(a,6,!1,a.toLowerCase(),null)});["rowSpan","start"].forEach(function(a){J[a]=new I(a,5,!1,a.toLowerCase(),null)});var K=/[\-:]([a-z])/g;function L(a){return a[1].toUpperCase()} + ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){J[a]=new I(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled 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)});["checked","multiple","muted","selected"].forEach(function(a){J[a]=new I(a,3,!0,a,null)}); + ["capture","download"].forEach(function(a){J[a]=new I(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){J[a]=new I(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){J[a]=new I(a,5,!1,a.toLowerCase(),null)});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)});"xlink:actuate xlink:arcrole xlink:href 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")});["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")});J.tabIndex=new I("tabIndex",1,!1,"tabindex",null);var ma=/["'&<>]/; - function M(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ma.exec(a);if(b){var d="",c,k=0;for(c=b.index;c=c.children.length){var k=c.footer;b+=k;""!==k&&(this.previousWasTextNode=!1);this.stack.pop();"select"===c.type?this.currentSelectValue=null:null!=c.type&&null!=c.type.type&&c.type.type.$$typeof===C&&this.popProvider(c.type)}else k=c.children[c.childIndex++],b+=this.render(k,c.context,c.domNamespace)}return 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=wa(a,d);a=d.child;d=d.context;if(null===a||!1===a)return"";if(!t.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===ca?y("257"):void 0;y("258",b.toString())}a=R(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,d,c);switch(b){case da:case ha:case ea:case A:return a=R(a.props.children),this.stack.push({type:null,domNamespace:c,children:a, - childIndex:0,context:d,footer:""}),""}if("object"===typeof b&&null!==b)switch(b.$$typeof){case ia:return a=R(b.render(a.props,a.ref)),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case C:return b=R(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""},this.pushProvider(a),this.stack.push(c),"";case fa:return b=R(a.props.children(a.type._currentValue)),this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d, - footer:""}),""}y("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===N.html&&O(b);U.hasOwnProperty(b)||(qa.test(b)?void 0:y("65",b),U[b]=!0);var f=a.props;if("input"===b)f=r({type:void 0},f,{defaultChecked:void 0,defaultValue:void 0,value:null!=f.value?f.value:f.defaultValue,checked:null!=f.checked?f.checked:f.defaultChecked});else if("textarea"===b){var h=f.value;if(null==h){h=f.defaultValue;var l=f.children;null!=l&&(null!=h?y("92"):void 0,Array.isArray(l)&& - (1>=l.length?void 0:y("93"),l=l[0]),h=""+l);null==h&&(h="")}f=r({},f,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=f.value?f.value:f.defaultValue,f=r({},f,{value:void 0});else if("option"===b){l=this.currentSelectValue;var D=sa(f.children);if(null!=l){var B=null!=f.value?f.value+"":D;h=!1;if(Array.isArray(l))for(var g=0;g":(q+=">",h="");a:{l=f.dangerouslySetInnerHTML;if(null!=l){if(null!=l.__html){l=l.__html; - break a}}else if(l=f.children,"string"===typeof l||"number"===typeof l){l=M(l);break a}l=null}null!=l?(f=[],pa[b]&&"\n"===l.charAt(0)&&(q+="\n"),q+=l):f=R(f.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?O(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:f,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return q};return a}(),X={renderToString:function(a){return(new W(a,!1)).read(Infinity)}, - renderToStaticMarkup:function(a){return(new W(a,!0)).read(Infinity)},renderToNodeStream:function(){y("207")},renderToStaticNodeStream:function(){y("208")},version:"16.4.2"},Y={default:X},Z=Y&&X||Y;module.exports=Z.default?Z.default:Z; + L);J[b]=new I(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href 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")});["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")});["tabIndex","crossOrigin"].forEach(function(a){J[a]=new I(a,1,!1,a.toLowerCase(),null)});var ta=/["'&<>]/; + function M(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ta.exec(a);if(b){var d="",c,f=0;for(c=b.index;cU?void 0:r("301");if(a===N)if(S=!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 za(){} + var X=0,Aa={readContext:function(a){var b=X;F(a,b);return a[b]},useContext:function(a){V();var b=X;F(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?void 0:r("304");var h=new Uint16Array(e);h.set(f);G=h;G[0]=c+1;for(f=c;f=g.children.length){var D=g.footer;""!==D&&(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===z)this.popProvider(g.type);else if(g.type===A){this.suspenseDepth--;var B=f.pop();if(e){e=!1;var n=g.fallbackFrame;n?void 0:r("303");this.stack.push(n);continue}else f[this.suspenseDepth]+=B}f[this.suspenseDepth]+= + D}else{var l=g.children[g.childIndex++],k="";try{k+=this.render(l,g.context,g.domNamespace)}catch(t){throw t;}finally{}f.length<=this.suspenseDepth&&f.push("");f[this.suspenseDepth]+=k}}return f[0]}finally{Ia.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=Ra(a,d,this.threadID);a=d.child;d=d.context; + if(null===a||!1===a)return"";if(!q.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===ba?r("257"):void 0;r("258",b.toString())}a=Z(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,d,c);switch(b){case ca:case fa:case da:case x:return a=Z(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case A:r("294")}if("object"=== + typeof b&&null!==b)switch(b.$$typeof){case ha:N={};var e=b.render(a.props,a.ref);e=va(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=[q.createElement(b.type,p({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case z: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 ea:b=a.type;e=a.props;var h=this.threadID;F(b,h);b=Z(e.children(b[h]));this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""});return"";case ja:r("295")}r("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===Ba.html&&Ca(b);La.hasOwnProperty(b)||(Ka.test(b)?void 0:r("65",b),La[b]=!0);var e=a.props;if("input"===b)e=p({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;null!=g&&(null!=h?r("92"):void 0,Array.isArray(g)&&(1>=g.length?void 0:r("93"),g=g[0]),h=""+g);null==h&&(h="")}e=p({},e,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=e.value?e.value:e.defaultValue,e=p({},e,{value:void 0});else if("option"===b){g=this.currentSelectValue;var D=Na(e.children);if(null!=g){var B=null!=e.value?e.value+ + "":D;h=!1;if(Array.isArray(g))for(var n=0;n":(y+=">",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=[],Ja[b]&&"\n"===g.charAt(0)&&(y+="\n"),y+=g):e=Z(e.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"=== + c?Ca(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 y};return a}(),Ta={renderToString:function(a){a=new Sa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Sa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){r("207")},renderToStaticNodeStream:function(){r("208")}, + version:"16.8.6"},Ua={default:Ta},Va=Ua&&Ta||Ua;module.exports=Va.default||Va; /***/ }), -/* 32 */ -/***/ (function(module, exports) { +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Copyright (c) 2013-present, Facebook, Inc. + /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.8.6 + * react-dom-server.browser.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - * - * - * @typechecks static-only */ 'use strict'; + + + if (process.env.NODE_ENV !== "production") { + (function() { + 'use strict'; + + var _assign = __webpack_require__(4); + var React = __webpack_require__(1); + var checkPropTypes = __webpack_require__(6); + /** - * Memoizes the return value of a function that accepts one string argument. + * 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. */ - function memoizeStringOnly(callback) { - var cache = {}; - return function (string) { - if (!cache.hasOwnProperty(string)) { - cache[string] = callback.call(this, string); + var validateFormat = function () {}; + + { + validateFormat = function (format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); } - return cache[string]; }; } - module.exports = memoizeStringOnly; + function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { + if (!condition) { + var error = void 0; + 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'; + } - /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.4.2 - * react-dom-server.browser.development.js - * - * 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. + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } + + // Relying on the `invariant()` implementation lets us + // preserve the format and params in the www builds. + + // TODO: this is special because it gets imported during build. + + var ReactVersion = '16.8.6'; + + /** + * 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. */ - 'use strict'; + var warningWithoutStack = function () {}; + { + 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]; + } + + 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; + } + 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); + } + 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. + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + throw new Error(message); + } catch (x) {} + }; + } - if (process.env.NODE_ENV !== "production") { - (function() { - 'use strict'; + var warningWithoutStack$1 = warningWithoutStack; - var invariant = __webpack_require__(5); - var _assign = __webpack_require__(4); - var React = __webpack_require__(1); - var emptyFunction = __webpack_require__(7); - var emptyObject = __webpack_require__(6); - var hyphenateStyleName = __webpack_require__(21); - var memoizeStringOnly = __webpack_require__(32); - var warning = __webpack_require__(9); - var checkPropTypes = __webpack_require__(10); - var camelizeStyleName = __webpack_require__(23); + // 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; - // Relying on the `invariant()` implementation lets us - // have preserve the format and params in the www builds. - // TODO: this is special because it gets imported during build. + 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; + + 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_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + + var Resolved = 1; + + + function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; + } - var ReactVersion = '16.4.2'; + 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_CONCURRENT_MODE_TYPE: + return 'ConcurrentMode'; + 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'; + } + 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); + } + } + } + } + return null; + } /** * Forked from fbjs/warning: @@ -4145,37 +4869,87 @@ lowPriorityWarning = function (condition, format) { if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + 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 + }; + } + + /** + * 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; } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + // eslint-disable-next-line react-internal/warning-and-invariant-args - printWarning.apply(undefined, [format].concat(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])); }; } - var lowPriorityWarning$1 = lowPriorityWarning; + var warning$1 = warning; + + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; var describeComponentFrame = function (name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + 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 ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - - var ReactCurrentOwner = ReactInternals.ReactCurrentOwner; - var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame; - - // Exports ReactDOM.createRoot - - - // Experimental error-boundary API that can recover from errors within a single - // render phase - - // Suspense - // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: @@ -4192,27 +4966,153 @@ // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: var warnAboutDeprecatedLifecycles = false; - // Warn about legacy context API + // Gather advanced timing metrics for Profiler subtrees. - // 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. - // 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; + // Only used in www builds. - 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; - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + // Only used in www builds. + + + // 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. + + var ReactDebugCurrentFrame$1 = void 0; + var didWarnAboutInvalidateContextType = void 0; + { + ReactDebugCurrentFrame$1 = 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); + } + } + + function validateContextBounds(context, threadID) { + // If we don't have enough slots in this context to store this threadID, + // fill it in without leaving any holes to ensure that the VM optimizes + // this as non-holey index properties. + // (Note: If `react` package is < 16.6, _threadCount is undefined.) + for (var i = context._threadCount | 0; i <= threadID; i++) { + // We assume that this is the same as the defaultValue which might not be + // true if we're rendering inside a secondary renderer but they are + // secondary because these use cases are very rare. + context[i] = context._currentValue2; + context._threadCount = i + 1; + } + } + + function processContext(type, context, threadID) { + var contextType = type.contextType; + { + if ('contextType' in type) { + 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') { + addendum = ' However, it is set to a ' + typeof contextType + '.'; + } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { + addendum = ' Did you accidentally pass the Context.Provider instead?'; + } else if (contextType._context !== undefined) { + // + addendum = ' Did you accidentally pass the Context.Consumer instead?'; + } 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); + } + } + } + if (typeof contextType === 'object' && contextType !== null) { + validateContextBounds(contextType, threadID); + return contextType[threadID]; + } 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; + !(newSize <= 0x10000) ? invariant(false, '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.') : void 0; + 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; + } // A reserved attribute. // It is handled by React separately and shouldn't be written to the DOM. @@ -4273,7 +5173,7 @@ } illegalAttributeNameCache[attributeName] = true; { - warning(false, 'Invalid attribute name: `%s`', attributeName); + warning$1(false, 'Invalid attribute name: `%s`', attributeName); } return false; } @@ -4399,7 +5299,7 @@ // 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', 'preserveAlpha'].forEach(function (name) { + ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null); @@ -4426,7 +5326,7 @@ // disabled with `removeAttribute`. We have special logic for handling this. 'multiple', 'muted', 'selected'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty - name.toLowerCase(), // attributeName + name, // attributeName null); } // attributeNamespace ); @@ -4435,7 +5335,7 @@ // booleans, but can also accept a string value. ['capture', 'download'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty - name.toLowerCase(), // attributeName + name, // attributeName null); } // attributeNamespace ); @@ -4443,7 +5343,7 @@ // These are HTML attributes that must be positive numbers. ['cols', 'rows', 'size', 'span'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty - name.toLowerCase(), // attributeName + name, // attributeName null); } // attributeNamespace ); @@ -4487,12 +5387,15 @@ attributeName, 'http://www.w3.org/XML/1998/namespace'); }); - // Special case: this attribute exists both in HTML and SVG. - // Its "tabindex" attribute name is case-sensitive in SVG so we can't just use - // its React `tabIndex` name, like we do for attributes that exist only in HTML. - properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false, // mustUseProperty - 'tabindex', // attributeName - null); + // 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 + ); // code copied and modified from escape-html /** @@ -4520,7 +5423,7 @@ var escape = void 0; var html = ''; - var index = 0; + var index = void 0; var lastIndex = 0; for (index = match.index; index < str.length; index++) { @@ -4574,79 +5477,436 @@ // for numeric dom ids. return '' + text; } - return escapeHtml(text); - } - - /** - * Escapes attribute value to prevent scripting attacks. - * - * @param {*} value Value to escape. - * @return {string} An escaped string. - */ - function quoteAttributeValueForBrowser(value) { - return '"' + escapeTextForBrowser(value) + '"'; + return escapeHtml(text); + } + + /** + * Escapes attribute value to prevent scripting attacks. + * + * @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. + * + * @param {string} name + * @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; + + if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) { + return attributeName + '=""'; + } else { + return attributeName + '=' + quoteAttributeValueForBrowser(value); + } + } else if (isAttributeNameSafe(name)) { + return name + '=' + quoteAttributeValueForBrowser(value); + } + return ''; + } + + /** + * Creates markup for a custom property. + * + * @param {string} name + * @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); + } + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + function is(x, y) { + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; + } + + 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 numberOfReRenders = 0; + var RE_RENDER_LIMIT = 25; + + var isInHookUserCodeInDev = false; + + // In DEV, this is the name of the currently executing primitive hook + var currentHookNameInDev = void 0; + + function resolveCurrentlyRenderingComponent() { + !(currentlyRenderingComponent !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0; + { + !!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; + } + 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); + } + return false; + } + + { + // 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(', ') + ']'); + } + } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (is(nextDeps[i], prevDeps[i])) { + continue; + } + return false; + } + return true; + } + + function createHook() { + if (numberOfReRenders > 0) { + invariant(false, 'Rendered more hooks than during the previous render'); + } + return { + memoizedState: null, + queue: null, + next: null + }; + } + + function createWorkInProgressHook() { + if (workInProgressHook === null) { + // This is the first hook in the list + if (firstWorkInProgressHook === null) { + isReRender = false; + firstWorkInProgressHook = workInProgressHook = createHook(); + } else { + // There's already a work-in-progress. Reuse it. + isReRender = true; + workInProgressHook = firstWorkInProgressHook; + } + } else { + if (workInProgressHook.next === null) { + isReRender = false; + // Append to the end of the list + workInProgressHook = workInProgressHook.next = createHook(); + } else { + // There's already a work-in-progress. Reuse it. + isReRender = true; + workInProgressHook = workInProgressHook.next; + } + } + return workInProgressHook; + } + + function prepareToUseHooks(componentIdentity) { + currentlyRenderingComponent = componentIdentity; + { + isInHookUserCodeInDev = false; + } + + // 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; + + // 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 + // currentlyRenderingComponent = null; + // didScheduleRenderPhaseUpdate = false; + // firstWorkInProgressHook = null; + // numberOfReRenders = 0; + // 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; + } + return context[threadID]; + } + + function useContext(context, observedBits) { + { + currentHookNameInDev = 'useContext'; + } + resolveCurrentlyRenderingComponent(); + var threadID = currentThreadID; + validateContextBounds(context, threadID); + return context[threadID]; + } + + function basicStateReducer(state, action) { + return typeof action === 'function' ? action(state) : action; + } + + function useState(initialState) { + { + currentHookNameInDev = 'useState'; + } + 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; + if (renderPhaseUpdates !== null) { + // Render phase updates are stored in a map of queue -> linked list + var firstRenderPhaseUpdate = renderPhaseUpdates.get(_queue); + if (firstRenderPhaseUpdate !== undefined) { + 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; + { + isInHookUserCodeInDev = true; + } + newState = reducer(newState, _action); + { + isInHookUserCodeInDev = false; + } + update = update.next; + } while (update !== null); + + workInProgressHook.memoizedState = newState; + + return [newState, _dispatch]; + } + } + return [workInProgressHook.memoizedState, _dispatch]; + } else { + { + isInHookUserCodeInDev = true; + } + var initialState = void 0; + 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 = { + last: null, + dispatch: null + }; + var _dispatch2 = _queue2.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue2); + return [workInProgressHook.memoizedState, _dispatch2]; + } } - /** - * Operations for dealing with DOM properties. - */ + function useMemo(nextCreate, deps) { + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); + workInProgressHook = createWorkInProgressHook(); - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ + 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]; + } + } + } + } - function createMarkupForRoot() { - return ROOT_ATTRIBUTE_NAME + '=""'; + { + isInHookUserCodeInDev = true; + } + var nextValue = nextCreate(); + { + isInHookUserCodeInDev = false; + } + workInProgressHook.memoizedState = [nextValue, nextDeps]; + return nextValue; } - /** - * Creates markup for a property. - * - * @param {string} name - * @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 ''; + function useRef(initialValue) { + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); + workInProgressHook = createWorkInProgressHook(); + var previousRef = workInProgressHook.memoizedState; + if (previousRef === null) { + var ref = { current: initialValue }; + { + Object.seal(ref); + } + workInProgressHook.memoizedState = ref; + return ref; + } else { + return previousRef; } - if (shouldRemoveAttribute(name, value, propertyInfo, false)) { - return ''; + } + + function useLayoutEffect(create, inputs) { + { + currentHookNameInDev = 'useLayoutEffect'; } - if (propertyInfo !== null) { - var attributeName = propertyInfo.attributeName; - var type = propertyInfo.type; + 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.'); + } - if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) { - return attributeName + '=""'; + function dispatchAction(componentIdentity, queue, action) { + !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0; + + if (componentIdentity === currentlyRenderingComponent) { + // This is a render phase update. Stash it in a lazily-created map of + // queue -> linked list of updates. After this render pass, we'll restart + // and apply the stashed updates on top of the work-in-progress hook. + didScheduleRenderPhaseUpdate = true; + var update = { + action: action, + next: null + }; + if (renderPhaseUpdates === null) { + renderPhaseUpdates = new Map(); + } + var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); + if (firstRenderPhaseUpdate === undefined) { + renderPhaseUpdates.set(queue, update); } else { - return attributeName + '=' + quoteAttributeValueForBrowser(value); + // Append the update to the end of the list. + var lastRenderPhaseUpdate = firstRenderPhaseUpdate; + while (lastRenderPhaseUpdate.next !== null) { + lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; + } + lastRenderPhaseUpdate.next = update; } - } else if (isAttributeNameSafe(name)) { - return name + '=' + quoteAttributeValueForBrowser(value); + } 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. } - return ''; } - /** - * Creates markup for a custom property. - * - * @param {string} name - * @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); + function useCallback(callback, deps) { + // Callbacks are passed as they are in the server environment. + return callback; } + function noop() {} + + var currentThreadID = 0; + + function setCurrentThreadID(threadID) { + currentThreadID = threadID; + } + + var Dispatcher = { + readContext: readContext, + useContext: useContext, + useMemo: useMemo, + useReducer: useReducer, + useRef: useRef, + useState: useState, + useLayoutEffect: useLayoutEffect, + useCallback: useCallback, + // useImperativeHandle is not run in the server environment + useImperativeHandle: noop, + // Effects are not run in the server environment. + useEffect: noop, + // Debugging effect + useDebugValue: noop + }; + 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'; @@ -4682,11 +5942,15 @@ return parentNamespace; } + var ReactDebugCurrentFrame$2 = null; + var ReactControlledValuePropTypes = { checkPropTypes: null }; { + ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame; + var hasReadOnlyValue = { button: true, checkbox: true, @@ -4699,13 +5963,13 @@ var propTypes = { value: function (props, propName, componentName) { - if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { + if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) { 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[propName] || props.onChange || props.readOnly || props.disabled) { + if (props.onChange || props.readOnly || props.disabled || props[propName] == null) { 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`.'); @@ -4716,8 +5980,8 @@ * 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, getStack) { - checkPropTypes(propTypes, props, 'prop', tagName, getStack); + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) { + checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum); }; } @@ -4750,24 +6014,31 @@ menuitem: true }, omittedCloseTags); + // TODO: We can remove this if we add invariantWithStack() + // or add stack by default to invariants where possible. var HTML = '__html'; - function assertValidProps(tag, props, getStack) { + var ReactDebugCurrentFrame$3 = null; + { + ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame; + } + + function assertValidProps(tag, props) { if (!props) { return; } // Note the use of `==` which checks for null or undefined. if (voidElementTags[tag]) { - !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, getStack()) : void 0; + !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, ReactDebugCurrentFrame$3.getStackAddendum()) : void 0; } if (props.dangerouslySetInnerHTML != null) { !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0; !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0; } { - !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning(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.%s', getStack()) : void 0; + !(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; } - !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getStack()) : void 0; + !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', ReactDebugCurrentFrame$3.getStackAddendum()) : void 0; } /** @@ -4789,6 +6060,7 @@ flexShrink: true, flexNegative: true, flexOrder: true, + gridArea: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, @@ -4875,6 +6147,26 @@ return ('' + value).trim(); } + var uppercasePattern = /([A-Z])/g; + var msPattern = /^ms-/; + + /** + * Hyphenates a camelcased CSS property name, for example: + * + * > hyphenateStyleName('backgroundColor') + * < "background-color" + * > hyphenateStyleName('MozTransition') + * < "-moz-transition" + * > hyphenateStyleName('msTransition') + * < "-ms-transition" + * + * 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-'); + } + function isCustomComponent(tagName, props) { if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; @@ -4898,11 +6190,13 @@ } } - var warnValidStyle = emptyFunction; + var warnValidStyle = function () {}; { // 'msTransform' is correct, but the other prefixes should be capitalized var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; + var msPattern$1 = /^-ms-/; + var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon var badStyleValueWithSemicolonPattern = /;\s*$/; @@ -4912,65 +6206,75 @@ var warnedForNaNValue = false; var warnedForInfinityValue = false; - var warnHyphenatedStyleName = function (name, getStack) { + var camelize = function (string) { + return string.replace(hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); + }; + + var warnHyphenatedStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; - warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), getStack()); + warning$1(false, '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-'))); }; - var warnBadVendoredStyleName = function (name, getStack) { + var warnBadVendoredStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; - warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), getStack()); + warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); }; - var warnStyleValueWithSemicolon = function (name, value, getStack) { + var warnStyleValueWithSemicolon = function (name, value) { if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { return; } warnedStyleValues[value] = true; - warning(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.%s', name, value.replace(badStyleValueWithSemicolonPattern, ''), getStack()); + warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); }; - var warnStyleValueIsNaN = function (name, value, getStack) { + var warnStyleValueIsNaN = function (name, value) { if (warnedForNaNValue) { return; } warnedForNaNValue = true; - warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, getStack()); + warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name); }; - var warnStyleValueIsInfinity = function (name, value, getStack) { + var warnStyleValueIsInfinity = function (name, value) { if (warnedForInfinityValue) { return; } warnedForInfinityValue = true; - warning(false, '`Infinity` is an invalid value for the `%s` css style property.%s', name, getStack()); + warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name); }; - warnValidStyle = function (name, value, getStack) { + warnValidStyle = function (name, value) { if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name, getStack); + warnHyphenatedStyleName(name); } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name, getStack); + warnBadVendoredStyleName(name); } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value, getStack); + warnStyleValueWithSemicolon(name, value); } if (typeof value === 'number') { if (isNaN(value)) { - warnStyleValueIsNaN(name, value, getStack); + warnStyleValueIsNaN(name, value); } else if (!isFinite(value)) { - warnStyleValueIsInfinity(name, value, getStack); + warnStyleValueIsInfinity(name, value); } } }; @@ -5039,11 +6343,6 @@ var hasOwnProperty$2 = Object.prototype.hasOwnProperty; - function getStackAddendum$1() { - var stack = ReactDebugCurrentFrame.getStackAddendum(); - return stack != null ? stack : ''; - } - function validateProperty(tagName, name) { if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) { return true; @@ -5056,13 +6355,13 @@ // 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(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.%s', name, getStackAddendum$1()); + 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(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?%s', name, correctName, getStackAddendum$1()); + warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); warnedProperties[name] = true; return true; } @@ -5080,7 +6379,7 @@ } // aria-* attributes should be lowercase; suggest the lowercase version. if (name !== standardName) { - warning(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$1()); + warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); warnedProperties[name] = true; return true; } @@ -5104,9 +6403,9 @@ }).join(', '); if (invalidProps.length === 1) { - warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$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(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum$1()); + warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); } } @@ -5119,11 +6418,6 @@ var didWarnValueNull = false; - function getStackAddendum$2() { - var stack = ReactDebugCurrentFrame.getStackAddendum(); - return stack != null ? stack : ''; - } - function validateProperties$1(type, props) { if (type !== 'input' && type !== 'textarea' && type !== 'select') { return; @@ -5132,9 +6426,9 @@ if (props != null && props.value === null && !didWarnValueNull) { didWarnValueNull = true; if (type === 'select' && props.multiple) { - warning(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.%s', type, getStackAddendum$2()); + 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(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', type, getStackAddendum$2()); + 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); } } } @@ -5685,11 +6979,6 @@ zoomandpan: 'zoomAndPan' }; - function getStackAddendum$3() { - var stack = ReactDebugCurrentFrame.getStackAddendum(); - return stack != null ? stack : ''; - } - var validateProperty$1 = function () {}; { @@ -5707,7 +6996,7 @@ var lowerCasedName = name.toLowerCase(); if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - warning(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.'); + 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.'); warnedProperties$1[name] = true; return true; } @@ -5719,12 +7008,12 @@ } var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; if (registrationName != null) { - warning(false, 'Invalid event handler property `%s`. Did you mean `%s`?%s', name, registrationName, getStackAddendum$3()); + warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); warnedProperties$1[name] = true; return true; } if (EVENT_NAME_REGEX.test(name)) { - warning(false, 'Unknown event handler property `%s`. It will be ignored.%s', name, getStackAddendum$3()); + warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name); warnedProperties$1[name] = true; return true; } @@ -5733,7 +7022,7 @@ // 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(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.%s', name, getStackAddendum$3()); + warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); } warnedProperties$1[name] = true; return true; @@ -5745,25 +7034,25 @@ } if (lowerCasedName === 'innerhtml') { - warning(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); + warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'aria') { - warning(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); + warning$1(false, '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(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum$3()); + warning$1(false, '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(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum$3()); + warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); warnedProperties$1[name] = true; return true; } @@ -5775,23 +7064,23 @@ if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { var standardName = possibleStandardNames[lowerCasedName]; if (standardName !== name) { - warning(false, 'Invalid DOM property `%s`. Did you mean `%s`?%s', name, standardName, getStackAddendum$3()); + warning$1(false, '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(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.%s', name, lowerCasedName, getStackAddendum$3()); + 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); warnedProperties$1[name] = true; return true; } if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { if (value) { - warning(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()}.%s', value, name, name, value, name, getStackAddendum$3()); + 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); } else { - warning(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.%s', value, name, name, value, name, name, name, getStackAddendum$3()); + 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); } warnedProperties$1[name] = true; return true; @@ -5809,6 +7098,13 @@ return false; } + // 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); + warnedProperties$1[name] = true; + return true; + } + return true; }; } @@ -5826,9 +7122,9 @@ return '`' + prop + '`'; }).join(', '); if (unknownProps.length === 1) { - warning(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%s', unknownPropString, type, getStackAddendum$3()); + 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(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%s', unknownPropString, type, getStackAddendum$3()); + 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); } }; @@ -5845,18 +7141,31 @@ var toArray = React.Children.toArray; - var currentDebugStack = void 0; - var currentDebugElementStack = void 0; + // 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 getStackAddendum = emptyFunction.thatReturns(''); - var describeStackFrame = emptyFunction.thatReturns(''); + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + var ReactDebugCurrentFrame = void 0; + var prevGetCurrentStackImpl = null; + var getCurrentServerStackImpl = function () { + return ''; + }; + var describeStackFrame = function (element) { + return ''; + }; var validatePropertiesInDevelopment = function (type, props) {}; - var setCurrentDebugStack = function (stack) {}; + var pushCurrentDebugStack = function (stack) {}; var pushElementToDebugStack = function (element) {}; - var resetCurrentDebugStack = function () {}; + var popCurrentDebugStack = function () {}; + var hasWarnedAboutUsingContextAsConsumer = false; { + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + validatePropertiesInDevelopment = function (type, props) { validateProperties(type, props); validateProperties$1(type, props); @@ -5871,34 +7180,55 @@ return describeComponentFrame(name, source, ownerName); }; - currentDebugStack = null; - currentDebugElementStack = null; - setCurrentDebugStack = function (stack) { - var frame = stack[stack.length - 1]; - currentDebugElementStack = frame.debugElementStack; - // We are about to enter a new composite stack, reset the array. - currentDebugElementStack.length = 0; - currentDebugStack = stack; - ReactDebugCurrentFrame.getCurrentStack = getStackAddendum; + pushCurrentDebugStack = function (stack) { + currentDebugStacks.push(stack); + + 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; + } }; + pushElementToDebugStack = function (element) { - if (currentDebugElementStack !== null) { - currentDebugElementStack.push(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 + // children and directly handle them in an inner loop instead of + // creating separate frames for them. }; - resetCurrentDebugStack = function () { - currentDebugElementStack = null; - currentDebugStack = null; - ReactDebugCurrentFrame.getCurrentStack = null; + + popCurrentDebugStack = function () { + currentDebugStacks.pop(); + + if (currentDebugStacks.length === 0) { + // We are exiting the server renderer. + // Restore the previous (e.g. client) global stack implementation. + ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl; + prevGetCurrentStackImpl = null; + } }; - getStackAddendum = function () { - if (currentDebugStack === null) { + + getCurrentServerStackImpl = function () { + if (currentDebugStacks.length === 0) { + // Nothing is currently rendering. return ''; } + // 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 = ''; - var debugStack = currentDebugStack; - for (var i = debugStack.length - 1; i >= 0; i--) { - var frame = debugStack[i]; + // 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. + // 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]); @@ -5925,10 +7255,6 @@ textarea: true }; - function getComponentName(type) { - return typeof type === 'string' ? type : typeof type === 'function' ? type.displayName || type.name : null; - } - // 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 @@ -5941,9 +7267,15 @@ } } - var processStyleName = memoizeStringOnly(function (styleName) { - return hyphenateStyleName(styleName); - }); + var styleNameCache = {}; + var processStyleName = function (styleName) { + if (styleNameCache.hasOwnProperty(styleName)) { + return styleNameCache[styleName]; + } + var result = hyphenateStyleName(styleName); + styleNameCache[styleName] = result; + return result; + }; function createMarkupForStyles(styles) { var serialized = ''; @@ -5956,7 +7288,7 @@ var styleValue = styles[styleName]; { if (!isCustomProperty) { - warnValidStyle$1(styleName, styleValue, getStackAddendum); + warnValidStyle$1(styleName, styleValue); } } if (styleValue != null) { @@ -5978,7 +7310,7 @@ return; } - warning(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); + 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); didWarnAboutNoopUpdateForComponent[warningKey] = true; } } @@ -6019,6 +7351,9 @@ } function flattenOptionChildren(children) { + if (children === undefined || children === null) { + return children; + } var content = ''; // Flatten children and warn if they aren't strings or numbers; // invalid types are ignored. @@ -6026,48 +7361,17 @@ if (child == null) { return; } - if (typeof child === 'string' || typeof child === 'number') { - content += child; - } else { - { - if (!didWarnInvalidOptionChildren) { - didWarnInvalidOptionChildren = true; - warning(false, 'Only strings and numbers are supported as