From 69ca915dfa2c530716d3bce67adfa02f5558e651 Mon Sep 17 00:00:00 2001 From: sxw Date: Thu, 18 Apr 2019 19:52:39 -0400 Subject: [PATCH] implemented navbar --- .../react-dom-server.browser.development.js | 322 +- ...react-dom-server.browser.production.min.js | 80 +- .../cjs/react-dom-server.node.development.js | 325 +- .../react-dom-server.node.production.min.js | 84 +- .../cjs/react-dom-test-utils.development.js | 55 +- .../react-dom-test-utils.production.min.js | 46 +- ...nstable-native-dependencies.development.js | 4 +- ...able-native-dependencies.production.min.js | 2 +- .../react-dom/cjs/react-dom.development.js | 8683 +++++++++------- .../react-dom/cjs/react-dom.production.min.js | 488 +- .../react-dom/cjs/react-dom.profiling.min.js | 460 +- frontend/node_modules/react-dom/package.json | 56 +- .../react-dom-server.browser.development.js | 322 +- ...react-dom-server.browser.production.min.js | 70 +- .../umd/react-dom-test-utils.development.js | 55 +- .../react-dom-test-utils.production.min.js | 43 +- ...nstable-native-dependencies.development.js | 4 +- ...able-native-dependencies.production.min.js | 2 +- .../react-dom/umd/react-dom.development.js | 8694 ++++++++++------- .../react-dom/umd/react-dom.production.min.js | 400 +- .../react-dom/umd/react-dom.profiling.min.js | 416 +- .../react/cjs/react.development.js | 221 +- .../react/cjs/react.production.min.js | 33 +- frontend/node_modules/react/package.json | 47 +- .../react/umd/react.development.js | 358 +- .../react/umd/react.production.min.js | 50 +- .../react/umd/react.profiling.min.js | 58 +- .../cjs/scheduler-tracing.development.js | 5 +- .../cjs/scheduler-tracing.production.min.js | 2 +- .../cjs/scheduler-tracing.profiling.min.js | 2 +- .../scheduler/cjs/scheduler.development.js | 132 +- .../scheduler/cjs/scheduler.production.min.js | 24 +- frontend/node_modules/scheduler/package.json | 43 +- .../scheduler/umd/scheduler.development.js | 52 + .../scheduler/umd/scheduler.production.min.js | 46 + .../scheduler/umd/scheduler.profiling.min.js | 46 + frontend/package-lock.json | 249 +- frontend/package.json | 8 +- frontend/src/App.js | 2 + frontend/src/Navbar.js | 38 + frontend/src/index.js | 1 + 41 files changed, 13162 insertions(+), 8866 deletions(-) create mode 100644 frontend/src/Navbar.js diff --git a/frontend/node_modules/react-dom/cjs/react-dom-server.browser.development.js b/frontend/node_modules/react-dom/cjs/react-dom-server.browser.development.js index f1041315..4e83e075 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-server.browser.development.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-server.browser.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-server.browser.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -66,7 +66,7 @@ function invariant(condition, format, a, b, c, d, e, f) { // TODO: this is special because it gets imported during build. -var ReactVersion = '16.6.3'; +var ReactVersion = '16.8.6'; /** * Similar to invariant but only logs a warning if the condition is not met. @@ -256,6 +256,15 @@ 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 @@ -312,7 +321,6 @@ var describeComponentFrame = function (name, source, ownerName) { return '\n in ' + (name || 'Unknown') + sourceInfo; }; -var enableHooks = false; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: @@ -336,7 +344,10 @@ var warnAboutDeprecatedLifecycles = false; // Only used in www builds. -var enableSuspenseServerRenderer = false; +var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + +// Only used in www builds. + // Only used in www builds. @@ -349,12 +360,12 @@ var enableSuspenseServerRenderer = false; // 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 didWarnAboutInvalidateContextType = {}; - var emptyObject = {}; { Object.freeze(emptyObject); @@ -382,7 +393,8 @@ 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. - for (var i = context._threadCount; i <= threadID; i++) { + // (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. @@ -393,16 +405,33 @@ function validateContextBounds(context, threadID) { function processContext(type, context, threadID) { var contextType = type.contextType; - if (typeof contextType === 'object' && contextType !== null) { - { - if (contextType.$$typeof !== REACT_CONTEXT_TYPE) { - var name = getComponentName(type) || 'Component'; - if (!didWarnAboutInvalidateContextType[name]) { - didWarnAboutInvalidateContextType[name] = true; - warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', name); + { + 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 { @@ -729,12 +758,15 @@ var capitalize = function (token) { 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 /** @@ -889,24 +921,13 @@ function createMarkupForCustomAttribute(name, value) { return name + '=' + quoteAttributeValueForBrowser(value); } -function areHookInputsEqual(arr1, arr2) { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - { - !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0; - } - for (var i = 0; i < arr1.length; i++) { - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - var val1 = arr1[i]; - var val2 = arr2[i]; - if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2 // eslint-disable-line no-self-compare - ) { - continue; - } - return false; - } - return true; +/** + * 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; @@ -922,12 +943,47 @@ var renderPhaseUpdates = null; 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, 'Hooks can only be called inside the body of a function component.') : void 0; + !(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, @@ -962,6 +1018,9 @@ function createWorkInProgressHook() { function prepareToUseHooks(componentIdentity) { currentlyRenderingComponent = componentIdentity; + { + isInHookUserCodeInDev = false; + } // The following should have already been reset // didScheduleRenderPhaseUpdate = false; @@ -993,6 +1052,9 @@ function finishHooks(Component, props, children, refOrContext) { numberOfReRenders = 0; renderPhaseUpdates = null; workInProgressHook = null; + { + isInHookUserCodeInDev = false; + } // These were reset above // currentlyRenderingComponent = null; @@ -1008,10 +1070,16 @@ function finishHooks(Component, props, children, refOrContext) { 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); @@ -1023,12 +1091,20 @@ function basicStateReducer(state, action) { } function useState(initialState) { + { + currentHookNameInDev = 'useState'; + } return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers initialState); } -function useReducer(reducer, initialState, initialAction) { +function useReducer(reducer, initialArg, init) { + { + if (reducer !== basicStateReducer) { + currentHookNameInDev = 'useReducer'; + } + } currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); if (isReRender) { @@ -1047,7 +1123,13 @@ function useReducer(reducer, initialState, initialAction) { // 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); @@ -1058,13 +1140,18 @@ function useReducer(reducer, initialState, initialAction) { } return [workInProgressHook.memoizedState, _dispatch]; } else { + { + isInHookUserCodeInDev = true; + } + var initialState = void 0; if (reducer === basicStateReducer) { // Special case for `useState`. - if (typeof initialState === 'function') { - initialState = initialState(); - } - } else if (initialAction !== undefined && initialAction !== null) { - initialState = reducer(initialState, initialAction); + initialState = typeof initialArg === 'function' ? initialArg() : initialArg; + } else { + initialState = init !== undefined ? init(initialArg) : initialArg; + } + { + isInHookUserCodeInDev = false; } workInProgressHook.memoizedState = initialState; var _queue2 = workInProgressHook.queue = { @@ -1076,22 +1163,32 @@ function useReducer(reducer, initialState, initialAction) { } } -function useMemo(nextCreate, inputs) { +function useMemo(nextCreate, deps) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate]; + var nextDeps = deps === undefined ? null : deps; - if (workInProgressHook !== null && workInProgressHook.memoizedState !== null) { + if (workInProgressHook !== null) { var prevState = workInProgressHook.memoizedState; - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } } } + { + isInHookUserCodeInDev = true; + } var nextValue = nextCreate(); - workInProgressHook.memoizedState = [nextValue, nextInputs]; + { + isInHookUserCodeInDev = false; + } + workInProgressHook.memoizedState = [nextValue, nextDeps]; return nextValue; } @@ -1111,12 +1208,11 @@ function useRef(initialValue) { } } -function useMutationEffect(create, inputs) { - warning$1(false, 'useMutationEffect 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, useMutationEffect should only be used in ' + 'components that render exclusively on the client.'); -} - function useLayoutEffect(create, inputs) { - 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.'); + { + currentHookNameInDev = 'useLayoutEffect'; + } + warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.'); } function dispatchAction(componentIdentity, queue, action) { @@ -1152,6 +1248,11 @@ function dispatchAction(componentIdentity, queue, action) { } } +function useCallback(callback, deps) { + // Callbacks are passed as they are in the server environment. + return callback; +} + function noop() {} var currentThreadID = 0; @@ -1167,17 +1268,14 @@ var Dispatcher = { useReducer: useReducer, useRef: useRef, useState: useState, - useMutationEffect: useMutationEffect, useLayoutEffect: useLayoutEffect, - // useImperativeMethods is not run in the server environment - useImperativeMethods: noop, - // Callbacks are not run in the server environment. - useCallback: noop, + useCallback: useCallback, + // useImperativeHandle is not run in the server environment + useImperativeHandle: noop, // Effects are not run in the server environment. - useEffect: noop -}; -var DispatcherWithoutHooks = { - readContext: readContext + useEffect: noop, + // Debugging effect + useDebugValue: noop }; var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; @@ -2420,7 +2518,7 @@ var toArray = React.Children.toArray; // Each stack is an array of frames which may contain nested stacks of elements. var currentDebugStacks = []; -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var ReactDebugCurrentFrame = void 0; var prevGetCurrentStackImpl = null; var getCurrentServerStackImpl = function () { @@ -2929,6 +3027,7 @@ var ReactDOMServerRenderer = function () { ReactDOMServerRenderer.prototype.destroy = function destroy() { if (!this.exhausted) { this.exhausted = true; + this.clearProviders(); freeThreadID(this.threadID); } }; @@ -2987,6 +3086,15 @@ var ReactDOMServerRenderer = function () { context[this.threadID] = previousValue; }; + ReactDOMServerRenderer.prototype.clearProviders = function clearProviders() { + // Restore any remaining providers on the stack to previous values + for (var index = this.contextIndex; index >= 0; index--) { + var _context = this.contextStack[index]; + var previousValue = this.contextValueStack[index]; + _context[this.threadID] = previousValue; + } + }; + ReactDOMServerRenderer.prototype.read = function read(bytes) { if (this.exhausted) { return null; @@ -2994,12 +3102,8 @@ var ReactDOMServerRenderer = function () { var prevThreadID = currentThreadID; setCurrentThreadID(this.threadID); - var prevDispatcher = ReactCurrentOwner.currentDispatcher; - if (enableHooks) { - ReactCurrentOwner.currentDispatcher = Dispatcher; - } else { - ReactCurrentOwner.currentDispatcher = DispatcherWithoutHooks; - } + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = Dispatcher; try { // Markup generated within ends up buffered until we know // nothing in that boundary suspended @@ -3072,7 +3176,7 @@ var ReactDOMServerRenderer = function () { } return out[0]; } finally { - ReactCurrentOwner.currentDispatcher = prevDispatcher; + ReactCurrentDispatcher.current = prevDispatcher; setCurrentThreadID(prevThreadID); } }; @@ -3156,7 +3260,25 @@ var ReactDOMServerRenderer = function () { case REACT_SUSPENSE_TYPE: { if (enableSuspenseServerRenderer) { - var fallbackChildren = toArray(nextChild.props.fallback); + var fallback = nextChild.props.fallback; + if (fallback === undefined) { + // If there is no fallback, then this just behaves as a fragment. + var _nextChildren3 = toArray(nextChild.props.children); + var _frame3 = { + type: null, + domNamespace: parentNamespace, + children: _nextChildren3, + childIndex: 0, + context: context, + footer: '' + }; + { + _frame3.debugElementStack = []; + } + this.stack.push(_frame3); + return ''; + } + var fallbackChildren = toArray(fallback); var _nextChildren2 = toArray(nextChild.props.children); var _fallbackFrame2 = { type: null, @@ -3174,7 +3296,7 @@ var ReactDOMServerRenderer = function () { children: _nextChildren2, childIndex: 0, context: context, - footer: '' + footer: '' }; { _frame2.debugElementStack = []; @@ -3182,7 +3304,7 @@ var ReactDOMServerRenderer = function () { } this.stack.push(_frame2); this.suspenseDepth++; - return ''; + return ''; } else { invariant(false, 'ReactDOMServer does not yet support Suspense.'); } @@ -3196,64 +3318,64 @@ var ReactDOMServerRenderer = function () { case REACT_FORWARD_REF_TYPE: { var element = nextChild; - var _nextChildren3 = void 0; + var _nextChildren4 = void 0; var componentIdentity = {}; prepareToUseHooks(componentIdentity); - _nextChildren3 = elementType.render(element.props, element.ref); - _nextChildren3 = finishHooks(elementType.render, element.props, _nextChildren3, element.ref); - _nextChildren3 = toArray(_nextChildren3); - var _frame3 = { + _nextChildren4 = elementType.render(element.props, element.ref); + _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref); + _nextChildren4 = toArray(_nextChildren4); + var _frame4 = { type: null, domNamespace: parentNamespace, - children: _nextChildren3, + children: _nextChildren4, childIndex: 0, context: context, footer: '' }; { - _frame3.debugElementStack = []; + _frame4.debugElementStack = []; } - this.stack.push(_frame3); + this.stack.push(_frame4); return ''; } case REACT_MEMO_TYPE: { var _element = nextChild; - var _nextChildren4 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; - var _frame4 = { + var _nextChildren5 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; + var _frame5 = { type: null, domNamespace: parentNamespace, - children: _nextChildren4, + children: _nextChildren5, childIndex: 0, context: context, footer: '' }; { - _frame4.debugElementStack = []; + _frame5.debugElementStack = []; } - this.stack.push(_frame4); + this.stack.push(_frame5); return ''; } case REACT_PROVIDER_TYPE: { var provider = nextChild; var nextProps = provider.props; - var _nextChildren5 = toArray(nextProps.children); - var _frame5 = { + var _nextChildren6 = toArray(nextProps.children); + var _frame6 = { type: provider, domNamespace: parentNamespace, - children: _nextChildren5, + children: _nextChildren6, childIndex: 0, context: context, footer: '' }; { - _frame5.debugElementStack = []; + _frame6.debugElementStack = []; } this.pushProvider(provider); - this.stack.push(_frame5); + this.stack.push(_frame6); return ''; } case REACT_CONTEXT_TYPE: @@ -3286,19 +3408,19 @@ var ReactDOMServerRenderer = function () { validateContextBounds(reactContext, threadID); var nextValue = reactContext[threadID]; - var _nextChildren6 = toArray(_nextProps.children(nextValue)); - var _frame6 = { + var _nextChildren7 = toArray(_nextProps.children(nextValue)); + var _frame7 = { type: nextChild, domNamespace: parentNamespace, - children: _nextChildren6, + children: _nextChildren7, childIndex: 0, context: context, footer: '' }; { - _frame6.debugElementStack = []; + _frame7.debugElementStack = []; } - this.stack.push(_frame6); + this.stack.push(_frame7); return ''; } case REACT_LAZY_TYPE: diff --git a/frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js b/frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js index 2edb521e..7079a207 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-server.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -7,39 +7,45 @@ * LICENSE file in the root directory of this source tree. */ -'use strict';var p=require("object-assign"),q=require("react");function aa(a,b,e,c,g,d,h,f){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 B=[e,c,g,d,h,f],A=0;a=Error(b.replace(/%s/g,function(){return B[A++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} -function u(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cP;P++)O[P]=P+1;O[15]=0; -var ea=/^[: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]*$/,fa=Object.prototype.hasOwnProperty,ha={},ia={}; -function ja(a){if(fa.call(ia,a))return!0;if(fa.call(ha,a))return!1;if(ea.test(a))return ia[a]=!0;ha[a]=!0;return!1}function ka(a,b,e,c){if(null!==e&&0===e.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==e)return!e.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} -function la(a,b,e,c){if(null===b||"undefined"===typeof b||ka(a,b,e,c))return!0;if(c)return!1;if(null!==e)switch(e.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 Q(a,b,e,c,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=g;this.mustUseProperty=e;this.propertyName=a;this.type=b}var R={}; -"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){R[a]=new Q(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];R[b]=new Q(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){R[a]=new Q(a,2,!1,a.toLowerCase(),null)}); -["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){R[a]=new Q(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){R[a]=new Q(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){R[a]=new Q(a,3,!0,a,null)}); -["capture","download"].forEach(function(a){R[a]=new Q(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){R[a]=new Q(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){R[a]=new Q(a,5,!1,a.toLowerCase(),null)});var S=/[\-:]([a-z])/g;function T(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(S, -T);R[b]=new Q(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(S,T);R[b]=new Q(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(S,T);R[b]=new Q(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});R.tabIndex=new Q("tabIndex",1,!1,"tabindex",null);var ma=/["'&<>]/; -function U(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ma.exec(a);if(b){var e="",c,g=0;for(c=b.index;c=d?void 0:u("304");var h=new Uint16Array(d);h.set(g);O=h;O[0]=c+1;for(g=c;g=f.children.length){var B= -f.footer;""!==B&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===f.type)this.currentSelectValue=null;else if(null!=f.type&&null!=f.type.type&&f.type.type.$$typeof===E)this.popProvider(f.type);else if(f.type===I){this.suspenseDepth--;var A=g.pop();if(d){d=!1;var n=f.fallbackFrame;n?void 0:u("303");this.stack.push(n);continue}else g[this.suspenseDepth]+=A}g[this.suspenseDepth]+=B}else{var l=f.children[f.childIndex++],k="";try{k+=this.render(l,f.context,f.domNamespace)}catch(r){throw r; -}finally{}g.length<=this.suspenseDepth&&g.push("");g[this.suspenseDepth]+=k}}return g[0]}finally{Y.currentDispatcher=c,V=b}};a.prototype.render=function(a,e,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return U(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+U(c);this.previousWasTextNode=!0;return U(c)}e=Ea(a,e,this.threadID);a=e.child;e=e.context;if(null===a||!1===a)return"";if(!q.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof; -b===y?u("257"):void 0;u("258",b.toString())}a=X(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,e,c);switch(b){case C:case G:case D:case z:return a=X(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""}),"";case I:u("294")}if("object"===typeof b&&null!==b)switch(b.$$typeof){case H:var d=b.render(a.props,a.ref);d=oa(b.render,a.props,d,a.ref); -d=X(d);this.stack.push({type:null,domNamespace:c,children:d,childIndex:0,context:e,footer:""});return"";case J:return a=[q.createElement(b.type,p({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:e,footer:""}),"";case E:return b=X(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:e,footer:""},this.pushProvider(a),this.stack.push(c),"";case F:b=a.type;d=a.props;var h=this.threadID;N(b,h);b=X(d.children(b[h]));this.stack.push({type:a, -domNamespace:c,children:b,childIndex:0,context:e,footer:""});return"";case L:u("295")}u("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,e,c){var b=a.type.toLowerCase();c===qa.html&&ra(b);za.hasOwnProperty(b)||(ya.test(b)?void 0:u("65",b),za[b]=!0);var d=a.props;if("input"===b)d=p({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===b){var h=d.value;if(null==h){h= -d.defaultValue;var f=d.children;null!=f&&(null!=h?u("92"):void 0,Array.isArray(f)&&(1>=f.length?void 0:u("93"),f=f[0]),h=""+f);null==h&&(h="")}d=p({},d,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=p({},d,{value:void 0});else if("option"===b){f=this.currentSelectValue;var B=Aa(d.children);if(null!=f){var A=null!=d.value?d.value+"":B;h=!1;if(Array.isArray(f))for(var n=0;n":(x+=">",h="");a:{f=d.dangerouslySetInnerHTML;if(null!=f){if(null!=f.__html){f=f.__html;break a}}else if(f=d.children,"string"===typeof f||"number"===typeof f){f=U(f);break a}f=null}null!=f?(d=[],xa[b]&&"\n"===f.charAt(0)&&(x+="\n"),x+=f):d=X(d.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?ra(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:d,childIndex:0,context:e,footer:h});this.previousWasTextNode= -!1;return x};return a}(),Ga={renderToString:function(a){a=new Fa(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Fa(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.6.3"},Ha={default:Ga},Ia=Ha&&Ga||Ha;module.exports=Ia.default||Ia; +'use strict';var p=require("object-assign"),q=require("react");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","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")});["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; diff --git a/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js b/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js index a43ab6d5..bd682f01 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-server.node.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -22,7 +22,7 @@ var stream = require('stream'); // TODO: this is special because it gets imported during build. -var ReactVersion = '16.6.3'; +var ReactVersion = '16.8.6'; /** * Use invariant() to assert state which your program assumes to be true. @@ -257,6 +257,15 @@ 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 @@ -313,7 +322,6 @@ var describeComponentFrame = function (name, source, ownerName) { return '\n in ' + (name || 'Unknown') + sourceInfo; }; -var enableHooks = false; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: @@ -337,7 +345,10 @@ var warnAboutDeprecatedLifecycles = false; // Only used in www builds. -var enableSuspenseServerRenderer = false; +var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + +// Only used in www builds. + // Only used in www builds. @@ -350,12 +361,12 @@ var enableSuspenseServerRenderer = false; // 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 didWarnAboutInvalidateContextType = {}; - var emptyObject = {}; { Object.freeze(emptyObject); @@ -383,7 +394,8 @@ 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. - for (var i = context._threadCount; i <= threadID; i++) { + // (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. @@ -394,16 +406,33 @@ function validateContextBounds(context, threadID) { function processContext(type, context, threadID) { var contextType = type.contextType; - if (typeof contextType === 'object' && contextType !== null) { - { - if (contextType.$$typeof !== REACT_CONTEXT_TYPE) { - var name = getComponentName(type) || 'Component'; - if (!didWarnAboutInvalidateContextType[name]) { - didWarnAboutInvalidateContextType[name] = true; - warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', name); + { + 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 { @@ -730,12 +759,15 @@ var capitalize = function (token) { 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 /** @@ -890,24 +922,13 @@ function createMarkupForCustomAttribute(name, value) { return name + '=' + quoteAttributeValueForBrowser(value); } -function areHookInputsEqual(arr1, arr2) { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - { - !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0; - } - for (var i = 0; i < arr1.length; i++) { - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - var val1 = arr1[i]; - var val2 = arr2[i]; - if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2 // eslint-disable-line no-self-compare - ) { - continue; - } - return false; - } - return true; +/** + * 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; @@ -923,12 +944,47 @@ var renderPhaseUpdates = null; 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, 'Hooks can only be called inside the body of a function component.') : void 0; + !(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, @@ -963,6 +1019,9 @@ function createWorkInProgressHook() { function prepareToUseHooks(componentIdentity) { currentlyRenderingComponent = componentIdentity; + { + isInHookUserCodeInDev = false; + } // The following should have already been reset // didScheduleRenderPhaseUpdate = false; @@ -994,6 +1053,9 @@ function finishHooks(Component, props, children, refOrContext) { numberOfReRenders = 0; renderPhaseUpdates = null; workInProgressHook = null; + { + isInHookUserCodeInDev = false; + } // These were reset above // currentlyRenderingComponent = null; @@ -1009,10 +1071,16 @@ function finishHooks(Component, props, children, refOrContext) { 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); @@ -1024,12 +1092,20 @@ function basicStateReducer(state, action) { } function useState(initialState) { + { + currentHookNameInDev = 'useState'; + } return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers initialState); } -function useReducer(reducer, initialState, initialAction) { +function useReducer(reducer, initialArg, init) { + { + if (reducer !== basicStateReducer) { + currentHookNameInDev = 'useReducer'; + } + } currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); if (isReRender) { @@ -1048,7 +1124,13 @@ function useReducer(reducer, initialState, initialAction) { // 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); @@ -1059,13 +1141,18 @@ function useReducer(reducer, initialState, initialAction) { } return [workInProgressHook.memoizedState, _dispatch]; } else { + { + isInHookUserCodeInDev = true; + } + var initialState = void 0; if (reducer === basicStateReducer) { // Special case for `useState`. - if (typeof initialState === 'function') { - initialState = initialState(); - } - } else if (initialAction !== undefined && initialAction !== null) { - initialState = reducer(initialState, initialAction); + initialState = typeof initialArg === 'function' ? initialArg() : initialArg; + } else { + initialState = init !== undefined ? init(initialArg) : initialArg; + } + { + isInHookUserCodeInDev = false; } workInProgressHook.memoizedState = initialState; var _queue2 = workInProgressHook.queue = { @@ -1077,22 +1164,32 @@ function useReducer(reducer, initialState, initialAction) { } } -function useMemo(nextCreate, inputs) { +function useMemo(nextCreate, deps) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate]; + var nextDeps = deps === undefined ? null : deps; - if (workInProgressHook !== null && workInProgressHook.memoizedState !== null) { + if (workInProgressHook !== null) { var prevState = workInProgressHook.memoizedState; - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } } } + { + isInHookUserCodeInDev = true; + } var nextValue = nextCreate(); - workInProgressHook.memoizedState = [nextValue, nextInputs]; + { + isInHookUserCodeInDev = false; + } + workInProgressHook.memoizedState = [nextValue, nextDeps]; return nextValue; } @@ -1112,12 +1209,11 @@ function useRef(initialValue) { } } -function useMutationEffect(create, inputs) { - warning$1(false, 'useMutationEffect 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, useMutationEffect should only be used in ' + 'components that render exclusively on the client.'); -} - function useLayoutEffect(create, inputs) { - 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.'); + { + currentHookNameInDev = 'useLayoutEffect'; + } + warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.'); } function dispatchAction(componentIdentity, queue, action) { @@ -1153,6 +1249,11 @@ function dispatchAction(componentIdentity, queue, action) { } } +function useCallback(callback, deps) { + // Callbacks are passed as they are in the server environment. + return callback; +} + function noop() {} var currentThreadID = 0; @@ -1168,17 +1269,14 @@ var Dispatcher = { useReducer: useReducer, useRef: useRef, useState: useState, - useMutationEffect: useMutationEffect, useLayoutEffect: useLayoutEffect, - // useImperativeMethods is not run in the server environment - useImperativeMethods: noop, - // Callbacks are not run in the server environment. - useCallback: noop, + useCallback: useCallback, + // useImperativeHandle is not run in the server environment + useImperativeHandle: noop, // Effects are not run in the server environment. - useEffect: noop -}; -var DispatcherWithoutHooks = { - readContext: readContext + useEffect: noop, + // Debugging effect + useDebugValue: noop }; var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; @@ -2421,7 +2519,7 @@ var toArray = React.Children.toArray; // Each stack is an array of frames which may contain nested stacks of elements. var currentDebugStacks = []; -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var ReactDebugCurrentFrame = void 0; var prevGetCurrentStackImpl = null; var getCurrentServerStackImpl = function () { @@ -2930,6 +3028,7 @@ var ReactDOMServerRenderer = function () { ReactDOMServerRenderer.prototype.destroy = function destroy() { if (!this.exhausted) { this.exhausted = true; + this.clearProviders(); freeThreadID(this.threadID); } }; @@ -2988,6 +3087,15 @@ var ReactDOMServerRenderer = function () { context[this.threadID] = previousValue; }; + ReactDOMServerRenderer.prototype.clearProviders = function clearProviders() { + // Restore any remaining providers on the stack to previous values + for (var index = this.contextIndex; index >= 0; index--) { + var _context = this.contextStack[index]; + var previousValue = this.contextValueStack[index]; + _context[this.threadID] = previousValue; + } + }; + ReactDOMServerRenderer.prototype.read = function read(bytes) { if (this.exhausted) { return null; @@ -2995,12 +3103,8 @@ var ReactDOMServerRenderer = function () { var prevThreadID = currentThreadID; setCurrentThreadID(this.threadID); - var prevDispatcher = ReactCurrentOwner.currentDispatcher; - if (enableHooks) { - ReactCurrentOwner.currentDispatcher = Dispatcher; - } else { - ReactCurrentOwner.currentDispatcher = DispatcherWithoutHooks; - } + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = Dispatcher; try { // Markup generated within ends up buffered until we know // nothing in that boundary suspended @@ -3073,7 +3177,7 @@ var ReactDOMServerRenderer = function () { } return out[0]; } finally { - ReactCurrentOwner.currentDispatcher = prevDispatcher; + ReactCurrentDispatcher.current = prevDispatcher; setCurrentThreadID(prevThreadID); } }; @@ -3157,7 +3261,25 @@ var ReactDOMServerRenderer = function () { case REACT_SUSPENSE_TYPE: { if (enableSuspenseServerRenderer) { - var fallbackChildren = toArray(nextChild.props.fallback); + var fallback = nextChild.props.fallback; + if (fallback === undefined) { + // If there is no fallback, then this just behaves as a fragment. + var _nextChildren3 = toArray(nextChild.props.children); + var _frame3 = { + type: null, + domNamespace: parentNamespace, + children: _nextChildren3, + childIndex: 0, + context: context, + footer: '' + }; + { + _frame3.debugElementStack = []; + } + this.stack.push(_frame3); + return ''; + } + var fallbackChildren = toArray(fallback); var _nextChildren2 = toArray(nextChild.props.children); var _fallbackFrame2 = { type: null, @@ -3175,7 +3297,7 @@ var ReactDOMServerRenderer = function () { children: _nextChildren2, childIndex: 0, context: context, - footer: '' + footer: '' }; { _frame2.debugElementStack = []; @@ -3183,7 +3305,7 @@ var ReactDOMServerRenderer = function () { } this.stack.push(_frame2); this.suspenseDepth++; - return ''; + return ''; } else { invariant(false, 'ReactDOMServer does not yet support Suspense.'); } @@ -3197,64 +3319,64 @@ var ReactDOMServerRenderer = function () { case REACT_FORWARD_REF_TYPE: { var element = nextChild; - var _nextChildren3 = void 0; + var _nextChildren4 = void 0; var componentIdentity = {}; prepareToUseHooks(componentIdentity); - _nextChildren3 = elementType.render(element.props, element.ref); - _nextChildren3 = finishHooks(elementType.render, element.props, _nextChildren3, element.ref); - _nextChildren3 = toArray(_nextChildren3); - var _frame3 = { + _nextChildren4 = elementType.render(element.props, element.ref); + _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref); + _nextChildren4 = toArray(_nextChildren4); + var _frame4 = { type: null, domNamespace: parentNamespace, - children: _nextChildren3, + children: _nextChildren4, childIndex: 0, context: context, footer: '' }; { - _frame3.debugElementStack = []; + _frame4.debugElementStack = []; } - this.stack.push(_frame3); + this.stack.push(_frame4); return ''; } case REACT_MEMO_TYPE: { var _element = nextChild; - var _nextChildren4 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; - var _frame4 = { + var _nextChildren5 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; + var _frame5 = { type: null, domNamespace: parentNamespace, - children: _nextChildren4, + children: _nextChildren5, childIndex: 0, context: context, footer: '' }; { - _frame4.debugElementStack = []; + _frame5.debugElementStack = []; } - this.stack.push(_frame4); + this.stack.push(_frame5); return ''; } case REACT_PROVIDER_TYPE: { var provider = nextChild; var nextProps = provider.props; - var _nextChildren5 = toArray(nextProps.children); - var _frame5 = { + var _nextChildren6 = toArray(nextProps.children); + var _frame6 = { type: provider, domNamespace: parentNamespace, - children: _nextChildren5, + children: _nextChildren6, childIndex: 0, context: context, footer: '' }; { - _frame5.debugElementStack = []; + _frame6.debugElementStack = []; } this.pushProvider(provider); - this.stack.push(_frame5); + this.stack.push(_frame6); return ''; } case REACT_CONTEXT_TYPE: @@ -3287,19 +3409,19 @@ var ReactDOMServerRenderer = function () { validateContextBounds(reactContext, threadID); var nextValue = reactContext[threadID]; - var _nextChildren6 = toArray(_nextProps.children(nextValue)); - var _frame6 = { + var _nextChildren7 = toArray(_nextProps.children(nextValue)); + var _frame7 = { type: nextChild, domNamespace: parentNamespace, - children: _nextChildren6, + children: _nextChildren7, childIndex: 0, context: context, footer: '' }; { - _frame6.debugElementStack = []; + _frame7.debugElementStack = []; } - this.stack.push(_frame6); + this.stack.push(_frame7); return ''; } case REACT_LAZY_TYPE: @@ -3566,8 +3688,9 @@ var ReactMarkupReadableStream = function (_Readable) { return _this; } - ReactMarkupReadableStream.prototype._destroy = function _destroy() { + ReactMarkupReadableStream.prototype._destroy = function _destroy(err, callback) { this.partialRenderer.destroy(); + callback(err); }; ReactMarkupReadableStream.prototype._read = function _read(size) { diff --git a/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js b/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js index 63b485cd..6465dfb6 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-server.node.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-server.node.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -7,41 +7,47 @@ * LICENSE file in the root directory of this source tree. */ -'use strict';var p=require("object-assign"),q=require("react"),aa=require("stream");function ba(a,b,f,c,e,d,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 B=[f,c,e,d,h,g],A=0;a=Error(b.replace(/%s/g,function(){return B[A++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} -function u(a){for(var b=arguments.length-1,f="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cO;O++)N[O]=O+1;N[15]=0; -var ha=/^[: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]*$/,ia=Object.prototype.hasOwnProperty,ja={},ka={}; -function la(a){if(ia.call(ka,a))return!0;if(ia.call(ja,a))return!1;if(ha.test(a))return ka[a]=!0;ja[a]=!0;return!1}function ma(a,b,f,c){if(null!==f&&0===f.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==f)return!f.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} -function na(a,b,f,c){if(null===b||"undefined"===typeof b||ma(a,b,f,c))return!0;if(c)return!1;if(null!==f)switch(f.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 P(a,b,f,c,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=e;this.mustUseProperty=f;this.propertyName=a;this.type=b}var Q={}; -"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){Q[a]=new P(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];Q[b]=new P(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){Q[a]=new P(a,2,!1,a.toLowerCase(),null)}); -["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){Q[a]=new P(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){Q[a]=new P(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){Q[a]=new P(a,3,!0,a,null)}); -["capture","download"].forEach(function(a){Q[a]=new P(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){Q[a]=new P(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){Q[a]=new P(a,5,!1,a.toLowerCase(),null)});var R=/[\-:]([a-z])/g;function S(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(R, -S);Q[b]=new P(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(R,S);Q[b]=new P(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(R,S);Q[b]=new P(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});Q.tabIndex=new P("tabIndex",1,!1,"tabindex",null);var oa=/["'&<>]/; -function T(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=oa.exec(a);if(b){var f="",c,e=0;for(c=b.index;c=d?void 0:u("304");var h=new Uint16Array(d);h.set(e);N=h;N[0]=c+1;for(e=c;e=g.children.length){var B= -g.footer;""!==B&&(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===E)this.popProvider(g.type);else if(g.type===I){this.suspenseDepth--;var A=e.pop();if(d){d=!1;var n=g.fallbackFrame;n?void 0:u("303");this.stack.push(n);continue}else e[this.suspenseDepth]+=A}e[this.suspenseDepth]+=B}else{var l=g.children[g.childIndex++],k="";try{k+=this.render(l,g.context,g.domNamespace)}catch(r){throw r; -}finally{}e.length<=this.suspenseDepth&&e.push("");e[this.suspenseDepth]+=k}}return e[0]}finally{X.currentDispatcher=c,U=b}};a.prototype.render=function(a,f,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return T(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+T(c);this.previousWasTextNode=!0;return T(c)}f=Ga(a,f,this.threadID);a=f.child;f=f.context;if(null===a||!1===a)return"";if(!q.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof; -b===y?u("257"):void 0;u("258",b.toString())}a=W(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,f,c);switch(b){case C:case G:case D:case z:return a=W(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""}),"";case I:u("294")}if("object"===typeof b&&null!==b)switch(b.$$typeof){case H:var d=b.render(a.props,a.ref);d=qa(b.render,a.props,d,a.ref); -d=W(d);this.stack.push({type:null,domNamespace:c,children:d,childIndex:0,context:f,footer:""});return"";case J:return a=[q.createElement(b.type,p({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""}),"";case E:return b=W(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:f,footer:""},this.pushProvider(a),this.stack.push(c),"";case F:b=a.type;d=a.props;var h=this.threadID;M(b,h);b=W(d.children(b[h]));this.stack.push({type:a, -domNamespace:c,children:b,childIndex:0,context:f,footer:""});return"";case ca:u("295")}u("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,f,c){var b=a.type.toLowerCase();c===sa.html&&ta(b);Ba.hasOwnProperty(b)||(Aa.test(b)?void 0:u("65",b),Ba[b]=!0);var d=a.props;if("input"===b)d=p({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===b){var h=d.value;if(null==h){h= -d.defaultValue;var g=d.children;null!=g&&(null!=h?u("92"):void 0,Array.isArray(g)&&(1>=g.length?void 0:u("93"),g=g[0]),h=""+g);null==h&&(h="")}d=p({},d,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=d.value?d.value:d.defaultValue,d=p({},d,{value:void 0});else if("option"===b){g=this.currentSelectValue;var B=Ca(d.children);if(null!=g){var A=null!=d.value?d.value+"":B;h=!1;if(Array.isArray(g))for(var n=0;n":(x+=">",h="");a:{g=d.dangerouslySetInnerHTML;if(null!=g){if(null!=g.__html){g=g.__html;break a}}else if(g=d.children,"string"===typeof g||"number"===typeof g){g=T(g);break a}g=null}null!=g?(d=[],za[b]&&"\n"===g.charAt(0)&&(x+="\n"),x+=g):d=W(d.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?ta(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:d,childIndex:0,context:f,footer:h});this.previousWasTextNode= -!1;return x};return a}();function Ha(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)} -var Ia=function(a){function b(f,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var e=a.call(this,{});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");e=!e||"object"!==typeof e&&"function"!==typeof e?this:e;e.partialRenderer=new Z(f,c);return e}Ha(b,a);b.prototype._destroy=function(){this.partialRenderer.destroy()};b.prototype._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(c){this.destroy(c)}};return b}(aa.Readable), -Ja={renderToString:function(a){a=new Z(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Z(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new Ia(a,!1)},renderToStaticNodeStream:function(a){return new Ia(a,!0)},version:"16.6.3"},Ka={default:Ja},La=Ka&&Ja||Ka;module.exports=La.default||La; +'use strict';var p=require("object-assign"),q=require("react"),aa=require("stream");function ba(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 na=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,oa=Object.prototype.hasOwnProperty,pa={},qa={}; +function ra(a){if(oa.call(qa,a))return!0;if(oa.call(pa,a))return!1;if(na.test(a))return qa[a]=!0;pa[a]=!0;return!1}function sa(a,b,d,c){if(null!==d&&0===d.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(c)return!1;if(null!==d)return!d.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} +function ta(a,b,d,c){if(null===b||"undefined"===typeof b||sa(a,b,d,c))return!0;if(c)return!1;if(null!==d)switch(d.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function I(a,b,d,c,f){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","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")});["tabIndex","crossOrigin"].forEach(function(a){J[a]=new I(a,1,!1,a.toLowerCase(),null)});var ua=/["'&<>]/; +function M(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=ua.exec(a);if(b){var d="",c,f=0;for(c=b.index;cU?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 Aa(){} +var X=0,Ba={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{Ja.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=Sa(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===ca?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 da:case ha:case ea: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 ia:N={};var e=b.render(a.props,a.ref);e=wa(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 ja: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 fa: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 ka:r("295")}r("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();c===Ca.html&&Da(b);Ma.hasOwnProperty(b)||(La.test(b)?void 0:r("65",b),Ma[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=Oa(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=[],Ka[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?Da(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}(); +function Ua(a,b){if("function"!==typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)} +var Va=function(a){function b(d,c){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");var f=a.call(this,{});if(!this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");f=!f||"object"!==typeof f&&"function"!==typeof f?this:f;f.partialRenderer=new Ta(d,c);return f}Ua(b,a);b.prototype._destroy=function(a,b){this.partialRenderer.destroy();b(a)};b.prototype._read=function(a){try{this.push(this.partialRenderer.read(a))}catch(c){this.destroy(c)}}; +return b}(aa.Readable),Wa={renderToString:function(a){a=new Ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new Ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(a){return new Va(a,!1)},renderToStaticNodeStream:function(a){return new Va(a,!0)},version:"16.8.6"},Xa={default:Wa},Ya=Xa&&Wa||Xa;module.exports=Ya.default||Ya; diff --git a/frontend/node_modules/react-dom/cjs/react-dom-test-utils.development.js b/frontend/node_modules/react-dom/cjs/react-dom-test-utils.development.js index 3f61630a..fc2a5b52 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-test-utils.development.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-test-utils.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-test-utils.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -137,6 +137,15 @@ function get(key) { 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 + }; +} + // 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. @@ -831,6 +840,7 @@ var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // Note that events in this list will *not* be listened to at the top level // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. +// for .act's return value var findDOMNode = ReactDOM.findDOMNode; // Keep in sync with ReactDOMUnstableNativeDependencies.js // and ReactDOM.js: @@ -939,6 +949,9 @@ function validateClassInstance(inst, methodName) { invariant(false, '%s(...): the first argument must be a React class instance. Instead received: %s.', methodName, received); } +// a stub element, lazily initialized, used by act() when flushing effects +var actContainerElement = null; + /** * Utilities for making it easy to test React components. * @@ -1133,7 +1146,43 @@ var ReactTestUtils = { }, Simulate: null, - SimulateNative: {} + SimulateNative: {}, + + act: function (callback) { + if (actContainerElement === null) { + // warn if we can't actually create the stub element + { + !(typeof document !== 'undefined' && document !== null && typeof document.createElement === 'function') ? warningWithoutStack$1(false, 'It looks like you called TestUtils.act(...) in a non-browser environment. ' + "If you're using TestRenderer for your tests, you should call " + 'TestRenderer.act(...) instead of TestUtils.act(...).') : void 0; + } + // then make it + actContainerElement = document.createElement('div'); + } + + var result = ReactDOM.unstable_batchedUpdates(callback); + // note: keep these warning messages in sync with + // createReactNoop.js and ReactTestRenderer.js + { + if (result !== undefined) { + var addendum = void 0; + if (result !== null && typeof result.then === 'function') { + addendum = '\n\nIt looks like you wrote ReactTestUtils.act(async () => ...), ' + 'or returned a Promise from the callback passed to it. ' + 'Putting asynchronous logic inside ReactTestUtils.act(...) is not supported.\n'; + } else { + addendum = ' You returned: ' + result; + } + warningWithoutStack$1(false, 'The callback passed to ReactTestUtils.act(...) function must not return anything.%s', addendum); + } + } + ReactDOM.render(React.createElement('div', null), actContainerElement); + // we want the user to not expect a return, + // but we want to warn if they use it like they can await on it. + return { + then: function () { + { + warningWithoutStack$1(false, 'Do not await the result of calling ReactTestUtils.act(...), it is not a Promise.'); + } + } + }; + } }; /** @@ -1173,7 +1222,7 @@ function makeSimulator(eventType) { ReactDOM.unstable_batchedUpdates(function () { // Normally extractEvent enqueues a state restore, but we'll just always - // do that since we we're by-passing it here. + // do that since we're by-passing it here. enqueueStateRestore(domNode); runEventsInBatch(event); }); diff --git a/frontend/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js b/frontend/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js index e70da77c..2988cfe5 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-test-utils.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -7,27 +7,27 @@ * LICENSE file in the root directory of this source tree. */ -'use strict';var g=require("object-assign"),l=require("react"),m=require("react-dom");function n(a,b,c,e,d,k,f,h){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 L=[c,e,d,k,f,h],M=0;a=Error(b.replace(/%s/g,function(){return L[M++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} -function p(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;ethis.eventPool.length&&this.eventPool.push(a)} -function x(a){a.eventPool=[];a.getPooled=y;a.release=z}var A=!("undefined"===typeof window||!window.document||!window.document.createElement);function B(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var C={animationend:B("Animation","AnimationEnd"),animationiteration:B("Animation","AnimationIteration"),animationstart:B("Animation","AnimationStart"),transitionend:B("Transition","TransitionEnd")},D={},E={}; -A&&(E=document.createElement("div").style,"AnimationEvent"in window||(delete C.animationend.animation,delete C.animationiteration.animation,delete C.animationstart.animation),"TransitionEvent"in window||delete C.transitionend.transition);function F(a){if(D[a])return D[a];if(!C[a])return a;var b=C[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in E)return D[a]=b[c];return a} -var G=F("animationend"),H=F("animationiteration"),I=F("animationstart"),J=F("transitionend"),K=m.findDOMNode,N=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,O=N[0],P=N[4],Q=N[5],R=N[6],S=N[7],aa=N[8],T=N[9],ba=N[10];function U(){} -function ca(a,b){if(!a)return[];a=t(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}} -function V(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;p("286",b,a)}} -var W={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return l.isValidElement(a)},isElementOfType:function(a,b){return l.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&l.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return W.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a, -b){return W.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){V(a,"findAllInRenderedTree");return a?ca(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){V(a,"scryRenderedDOMComponentsWithClass");return W.findAllInRenderedTree(a,function(a){if(W.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?p("11"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!== -d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){V(a,"findRenderedDOMComponentWithClass");a=W.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){V(a,"scryRenderedDOMComponentsWithTag");return W.findAllInRenderedTree(a,function(a){return W.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a, -b){V(a,"findRenderedDOMComponentWithTag");a=W.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){V(a,"scryRenderedComponentsWithType");return W.findAllInRenderedTree(a,function(a){return W.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){V(a,"findRenderedComponentWithType");a=W.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+ -a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return l.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{}}; -function da(a){return function(b,c){l.isValidElement(b)?p("228"):void 0;W.isCompositeComponent(b)?p("229"):void 0;var e=P[a],d=new U;d.target=b;d.type=a.toLowerCase();var k=O(b),f=new w(e,k,d,b);f.persist();g(f,c);e.phasedRegistrationNames?Q(f):R(f);m.unstable_batchedUpdates(function(){S(b);ba(f)});aa()}}W.Simulate={};var X=void 0;for(X in P)W.Simulate[X]=da(X); -function ea(a,b){return function(c,e){var d=new U(a);g(d,e);W.isDOMComponent(c)?(c=K(c),d.target=c,T(b,d)):c.tagName&&(d.target=c,T(b,d))}} -[["abort","abort"],[G,"animationEnd"],[H,"animationIteration"],[I,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"], +'use strict';var g=require("object-assign"),l=require("react"),m=require("react-dom");function n(a,b,c,e,d,k,f,h){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 N=[c,e,d,k,f,h],O=0;a=Error(b.replace(/%s/g,function(){return N[O++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} +function p(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;ethis.eventPool.length&&this.eventPool.push(a)} +function y(a){a.eventPool=[];a.getPooled=z;a.release=A}var B=!("undefined"===typeof window||!window.document||!window.document.createElement);function C(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var D={animationend:C("Animation","AnimationEnd"),animationiteration:C("Animation","AnimationIteration"),animationstart:C("Animation","AnimationStart"),transitionend:C("Transition","TransitionEnd")},E={},F={}; +B&&(F=document.createElement("div").style,"AnimationEvent"in window||(delete D.animationend.animation,delete D.animationiteration.animation,delete D.animationstart.animation),"TransitionEvent"in window||delete D.transitionend.transition);function G(a){if(E[a])return E[a];if(!D[a])return a;var b=D[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in F)return E[a]=b[c];return a} +var H=G("animationend"),I=G("animationiteration"),J=G("animationstart"),K=G("transitionend"),L=m.findDOMNode,M=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,P=M[0],Q=M[4],R=M[5],aa=M[6],ba=M[7],ca=M[8],S=M[9],da=M[10];function T(){} +function ea(a,b){if(!a)return[];a=u(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}} +function U(a,b){if(a&&!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;p("286",b,a)}} +var V=null,W={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return l.isValidElement(a)},isElementOfType:function(a,b){return l.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&l.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return W.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState}, +isCompositeComponentWithType:function(a,b){return W.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){U(a,"findAllInRenderedTree");return a?ea(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){U(a,"scryRenderedDOMComponentsWithClass");return W.findAllInRenderedTree(a,function(a){if(W.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?p("11"): +void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){U(a,"findRenderedDOMComponentWithClass");a=W.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){U(a,"scryRenderedDOMComponentsWithTag");return W.findAllInRenderedTree(a,function(a){return W.isDOMComponent(a)&&a.tagName.toUpperCase()=== +b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){U(a,"findRenderedDOMComponentWithTag");a=W.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){U(a,"scryRenderedComponentsWithType");return W.findAllInRenderedTree(a,function(a){return W.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){U(a,"findRenderedComponentWithType"); +a=W.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return l.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){null===V&&(V=document.createElement("div"));m.unstable_batchedUpdates(a); +m.render(l.createElement("div",null),V);return{then:function(){}}}};function fa(a){return function(b,c){l.isValidElement(b)?p("228"):void 0;W.isCompositeComponent(b)?p("229"):void 0;var e=Q[a],d=new T;d.target=b;d.type=a.toLowerCase();var k=P(b),f=new x(e,k,d,b);f.persist();g(f,c);e.phasedRegistrationNames?R(f):aa(f);m.unstable_batchedUpdates(function(){ba(b);da(f)});ca()}}W.Simulate={};var X=void 0;for(X in Q)W.Simulate[X]=fa(X); +function ha(a,b){return function(c,e){var d=new T(a);g(d,e);W.isDOMComponent(c)?(c=L(c),d.target=c,S(b,d)):c.tagName&&(d.target=c,S(b,d))}} +[["abort","abort"],[H,"animationEnd"],[I,"animationIteration"],[J,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"], ["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"], ["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart", -"touchStart"],[J,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];W.SimulateNative[b]=ea(b,a[0])});var Y={default:W},Z=Y&&W||Y;module.exports=Z.default||Z; +"touchStart"],[K,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];W.SimulateNative[b]=ha(b,a[0])});var Y={default:W},Z=Y&&W||Y;module.exports=Z.default||Z; diff --git a/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.development.js b/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.development.js index fe0458e4..0fc3886d 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.development.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-unstable-native-dependencies.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -71,7 +71,7 @@ function invariant(condition, format, a, b, c, d, e, f) { // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is - // untintuitive, though, because even though React has caught the error, from + // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a diff --git a/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js b/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js index 8ad65739..86914e07 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js +++ b/frontend/node_modules/react-dom/cjs/react-dom-unstable-native-dependencies.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-unstable-native-dependencies.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. diff --git a/frontend/node_modules/react-dom/cjs/react-dom.development.js b/frontend/node_modules/react-dom/cjs/react-dom.development.js index 130478fe..6ea9a5c9 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom.development.js +++ b/frontend/node_modules/react-dom/cjs/react-dom.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -85,7 +85,7 @@ var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is - // untintuitive, though, because even though React has caught the error, from + // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a @@ -842,6 +842,7 @@ var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; +var DehydratedSuspenseComponent = 18; var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = '__reactInternalInstance$' + randomKey; @@ -2384,6 +2385,15 @@ function updateValueIfChanged(node) { 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 + }; +} + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; var describeComponentFrame = function (name, source, ownerName) { @@ -2514,13 +2524,14 @@ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; function describeFiber(fiber) { switch (fiber.tag) { - case IndeterminateComponent: - case LazyComponent: - case FunctionComponent: - case ClassComponent: - case HostComponent: - case Mode: - case SuspenseComponent: + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + default: var owner = fiber._debugOwner; var source = fiber._debugSource; var name = getComponentName(fiber.type); @@ -2529,8 +2540,6 @@ function describeFiber(fiber) { ownerName = getComponentName(owner.type); } return describeComponentFrame(name, source, ownerName); - default: - return ''; } } @@ -2895,12 +2904,15 @@ var capitalize = function (token) { 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 +); /** * Get the value for a property on a node. Only used in DEV for SSR validation. @@ -3116,7 +3128,6 @@ var ReactControlledValuePropTypes = { var enableUserTimingAPI = true; -var enableHooks = false; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: var debugRenderPhaseSideEffects = false; @@ -3139,6 +3150,9 @@ var enableProfilerTimer = true; // Trace which interactions trigger each commit. var enableSchedulerTracing = true; +// Only used in www builds. +var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + // Only used in www builds. @@ -3153,6 +3167,8 @@ var disableInputAttributeSyncing = false; // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. var enableStableConcurrentModeAPIs = false; +var warnAboutShorthandPropertyCollision = false; + // TODO: direct imports like some-package/src/* are bad. Fix me. var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; @@ -3946,27 +3962,17 @@ var EnterLeaveEventPlugin = { } }; -/*eslint-disable no-self-compare */ - -var hasOwnProperty$1 = Object.prototype.hasOwnProperty; - /** * 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) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; } +var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. @@ -5326,15 +5332,29 @@ function isInDocument(node) { return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); } +function isSameOriginFrame(iframe) { + try { + // Accessing the contentDocument of a HTMLIframeElement can cause the browser + // to throw, e.g. if it has a cross-origin src attribute. + // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: + // iframe.contentDocument.defaultView; + // A safety way is to access one of the cross origin properties: Window or Location + // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. + // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl + + return typeof iframe.contentWindow.location.href === 'string'; + } catch (err) { + return false; + } +} + function getActiveElementDeep() { var win = window; var element = getActiveElement(); while (element instanceof win.HTMLIFrameElement) { - // Accessing the contentDocument of a HTMLIframeElement can cause the browser - // to throw, e.g. if it has a cross-origin src attribute - try { - win = element.contentDocument.defaultView; - } catch (e) { + if (isSameOriginFrame(element)) { + win = element.contentWindow; + } else { return element; } element = getActiveElement(win.document); @@ -6090,6 +6110,58 @@ var setTextContent = function (node, text) { node.textContent = text; }; +// List derived from Gecko source code: +// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js +var shorthandToLonghand = { + animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'], + background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'], + backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], + border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'], + borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'], + borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], + borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'], + borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'], + borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'], + borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'], + borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], + borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'], + borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], + borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'], + borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'], + columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], + columns: ['columnCount', 'columnWidth'], + flex: ['flexBasis', 'flexGrow', 'flexShrink'], + flexFlow: ['flexDirection', 'flexWrap'], + font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'], + fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'], + gap: ['columnGap', 'rowGap'], + grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], + gridColumn: ['gridColumnEnd', 'gridColumnStart'], + gridColumnGap: ['columnGap'], + gridGap: ['columnGap', 'rowGap'], + gridRow: ['gridRowEnd', 'gridRowStart'], + gridRowGap: ['rowGap'], + gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], + margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], + marker: ['markerEnd', 'markerMid', 'markerStart'], + mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'], + maskPosition: ['maskPositionX', 'maskPositionY'], + outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], + overflow: ['overflowX', 'overflowY'], + padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], + placeContent: ['alignContent', 'justifyContent'], + placeItems: ['alignItems', 'justifyItems'], + placeSelf: ['alignSelf', 'justifySelf'], + textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'], + textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], + transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'], + wordWrap: ['overflowWrap'] +}; + /** * CSS properties which accept numbers but are not in units of "px". */ @@ -6370,6 +6442,69 @@ function setValueForStyles(node, styles) { } } +function isValueEmpty(value) { + return value == null || typeof value === 'boolean' || value === ''; +} + +/** + * Given {color: 'red', overflow: 'hidden'} returns { + * color: 'color', + * overflowX: 'overflow', + * overflowY: 'overflow', + * }. This can be read as "the overflowY property was set by the overflow + * shorthand". That is, the values are the property that each was derived from. + */ +function expandShorthandMap(styles) { + var expanded = {}; + for (var key in styles) { + var longhands = shorthandToLonghand[key] || [key]; + for (var i = 0; i < longhands.length; i++) { + expanded[longhands[i]] = key; + } + } + return expanded; +} + +/** + * When mixing shorthand and longhand property names, we warn during updates if + * we expect an incorrect result to occur. In particular, we warn for: + * + * Updating a shorthand property (longhand gets overwritten): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} + * becomes .style.font = 'baz' + * Removing a shorthand property (longhand gets lost too): + * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} + * becomes .style.font = '' + * Removing a longhand property (should revert to shorthand; doesn't): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} + * becomes .style.fontVariant = '' + */ +function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { + if (!warnAboutShorthandPropertyCollision) { + return; + } + + if (!nextStyles) { + return; + } + + var expandedUpdates = expandShorthandMap(styleUpdates); + var expandedStyles = expandShorthandMap(nextStyles); + var warnedAbout = {}; + for (var key in expandedUpdates) { + var originalKey = expandedUpdates[key]; + var correctOriginalKey = expandedStyles[key]; + if (correctOriginalKey && originalKey !== correctOriginalKey) { + var warningKey = originalKey + ',' + correctOriginalKey; + if (warnedAbout[warningKey]) { + continue; + } + warnedAbout[warningKey] = true; + warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey); + } + } +} + // For HTML, certain tags should omit their close tag. We keep a whitelist for // those special-case tags. @@ -7509,14 +7644,25 @@ function createElement(type, props, rootContainerElement, parentNamespace) { // See discussion in https://github.com/facebook/react/pull/6896 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 domElement = ownerDocument.createElement(type); - // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` - // attribute on `select`s needs to be added before `option`s are inserted. This prevents - // a bug where the `select` does not scroll to the correct option because singular - // `select` elements automatically pick the first item. + // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size` + // attributes on `select`s needs to be added before `option`s are inserted. + // This prevents: + // - a bug where the `select` does not scroll to the correct option because singular + // `select` elements automatically pick the first item #13222 + // - a bug where the `select` set the first item as selected despite the `size` attribute #14239 // See https://github.com/facebook/react/issues/13222 - if (type === 'select' && props.multiple) { + // and https://github.com/facebook/react/issues/14239 + if (type === 'select') { var node = domElement; - node.multiple = true; + if (props.multiple) { + node.multiple = true; + } else if (props.size) { + // Setting a size greater than 1 causes a select to behave like `multiple=true`, where + // it is possible that no option is selected. + // + // This is only necessary when a select in "single selection mode". + node.size = props.size; + } } } } else { @@ -7809,6 +7955,9 @@ function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContain } } if (styleUpdates) { + { + validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]); + } (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates); } return updatePayload; @@ -8502,6 +8651,9 @@ var SUPPRESS_HYDRATION_WARNING = void 0; SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; } +var SUSPENSE_START_DATA = '$'; +var SUSPENSE_END_DATA = '/$'; + var STYLE = 'style'; var eventsEnabled = null; @@ -8641,6 +8793,8 @@ var isPrimaryRenderer = true; var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; var noTimeout = -1; +var schedulePassiveEffects = scheduler.unstable_scheduleCallback; +var cancelPassiveEffects = scheduler.unstable_cancelCallback; // ------------------- // Mutation @@ -8728,6 +8882,43 @@ function removeChildFromContainer(container, child) { } } +function clearSuspenseBoundary(parentInstance, suspenseInstance) { + var node = suspenseInstance; + // Delete all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + var depth = 0; + do { + var nextNode = node.nextSibling; + parentInstance.removeChild(node); + if (nextNode && nextNode.nodeType === COMMENT_NODE) { + var data = nextNode.data; + if (data === SUSPENSE_END_DATA) { + if (depth === 0) { + parentInstance.removeChild(nextNode); + return; + } else { + depth--; + } + } else if (data === SUSPENSE_START_DATA) { + depth++; + } + } + node = nextNode; + } while (node); + // TODO: Warn, we didn't find the end comment boundary. +} + +function clearSuspenseBoundaryFromContainer(container, suspenseInstance) { + if (container.nodeType === COMMENT_NODE) { + clearSuspenseBoundary(container.parentNode, suspenseInstance); + } else if (container.nodeType === ELEMENT_NODE) { + clearSuspenseBoundary(container, suspenseInstance); + } else { + // Document nodes should never contain suspense boundaries. + } +} + function hideInstance(instance) { // TODO: Does this work for all element types? What about MathML? Should we // pass host context to this method? @@ -8773,10 +8964,19 @@ function canHydrateTextInstance(instance, text) { return instance; } +function canHydrateSuspenseInstance(instance) { + if (instance.nodeType !== COMMENT_NODE) { + // Empty strings are not parsed by HTML so there won't be a correct match here. + return null; + } + // This has now been refined to a suspense node. + return instance; +} + function getNextHydratableSibling(instance) { var node = instance.nextSibling; // Skip non-hydratable nodes. - while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE) { + while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || node.nodeType !== COMMENT_NODE || node.data !== SUSPENSE_START_DATA)) { node = node.nextSibling; } return node; @@ -8785,7 +8985,7 @@ function getNextHydratableSibling(instance) { function getFirstHydratableChild(parentInstance) { var next = parentInstance.firstChild; // Skip non-hydratable nodes. - while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE) { + while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || next.nodeType !== COMMENT_NODE || next.data !== SUSPENSE_START_DATA)) { next = next.nextSibling; } return next; @@ -8809,6 +9009,31 @@ function hydrateTextInstance(textInstance, text, internalInstanceHandle) { return diffHydratedText(textInstance, text); } +function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { + var node = suspenseInstance.nextSibling; + // Skip past all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + var depth = 0; + while (node) { + if (node.nodeType === COMMENT_NODE) { + var data = node.data; + if (data === SUSPENSE_END_DATA) { + if (depth === 0) { + return getNextHydratableSibling(node); + } else { + depth--; + } + } else if (data === SUSPENSE_START_DATA) { + depth++; + } + } + node = node.nextSibling; + } + // TODO: Warn, we didn't find the end comment boundary. + return null; +} + function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) { { warnForUnmatchedText(textInstance, text); @@ -8825,6 +9050,8 @@ function didNotHydrateContainerInstance(parentContainer, instance) { { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentContainer, instance); + } else if (instance.nodeType === COMMENT_NODE) { + // TODO: warnForDeletedHydratableSuspenseBoundary } else { warnForDeletedHydratableText(parentContainer, instance); } @@ -8835,6 +9062,8 @@ function didNotHydrateInstance(parentType, parentProps, parentInstance, instance if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentInstance, instance); + } else if (instance.nodeType === COMMENT_NODE) { + // TODO: warnForDeletedHydratableSuspenseBoundary } else { warnForDeletedHydratableText(parentInstance, instance); } @@ -8853,6 +9082,8 @@ function didNotFindHydratableContainerTextInstance(parentContainer, text) { } } + + function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) { if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { warnForInsertedHydratedElement(parentInstance, type, props); @@ -8865,6 +9096,12 @@ function didNotFindHydratableTextInstance(parentType, parentProps, parentInstanc } } +function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) { + if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { + // TODO: warnForInsertedHydratedSuspense(parentInstance); + } +} + // Prefix measurements so that it's possible to filter them. // Longer prefixes are hard to read in DevTools. var reactEmoji = '\u269B'; @@ -9120,7 +9357,7 @@ function stopFailedWorkTimer(fiber) { return; } fiber._debugIsCurrentlyTiming = false; - var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary'; + var warning = fiber.tag === SuspenseComponent || fiber.tag === DehydratedSuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary'; endFiberMark(fiber, null, warning); } } @@ -9741,7 +9978,7 @@ function FiberNode(tag, pendingProps, key, mode) { this.memoizedProps = null; this.updateQueue = null; this.memoizedState = null; - this.firstContextDependency = null; + this.contextDependencies = null; this.mode = mode; @@ -9758,6 +9995,26 @@ function FiberNode(tag, pendingProps, key, mode) { this.alternate = null; if (enableProfilerTimer) { + // Note: The following is done to avoid a v8 performance cliff. + // + // Initializing the fields below to smis and later updating them with + // double values will cause Fibers to end up having separate shapes. + // This behavior/bug has something to do with Object.preventExtension(). + // Fortunately this only impacts DEV builds. + // Unfortunately it makes React unusably slow for some applications. + // To work around this, initialize the fields below with doubles. + // + // Learn more about this here: + // https://github.com/facebook/react/issues/14365 + // https://bugs.chromium.org/p/v8/issues/detail?id=8538 + this.actualDuration = Number.NaN; + this.actualStartTime = Number.NaN; + this.selfBaseDuration = Number.NaN; + this.treeBaseDuration = Number.NaN; + + // It's okay to replace the initial doubles with smis after initialization. + // This won't trigger the performance cliff mentioned above, + // and it simplifies other profiler code (including DevTools). this.actualDuration = 0; this.actualStartTime = -1; this.selfBaseDuration = 0; @@ -9769,6 +10026,7 @@ function FiberNode(tag, pendingProps, key, mode) { this._debugSource = null; this._debugOwner = null; this._debugIsCurrentlyTiming = false; + this._debugHookTypes = null; if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { Object.preventExtensions(this); } @@ -9836,6 +10094,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) { workInProgress._debugID = current._debugID; workInProgress._debugSource = current._debugSource; workInProgress._debugOwner = current._debugOwner; + workInProgress._debugHookTypes = current._debugHookTypes; } workInProgress.alternate = current; @@ -9869,7 +10128,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) { workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; - workInProgress.firstContextDependency = current.firstContextDependency; + workInProgress.contextDependencies = current.contextDependencies; // These will be overridden during the parent's reconciliation workInProgress.sibling = current.sibling; @@ -10084,7 +10343,7 @@ function assignFiberPropertiesInDEV(target, source) { target.memoizedProps = source.memoizedProps; target.updateQueue = source.updateQueue; target.memoizedState = source.memoizedState; - target.firstContextDependency = source.firstContextDependency; + target.contextDependencies = source.contextDependencies; target.mode = source.mode; target.effectTag = source.effectTag; target.nextEffect = source.nextEffect; @@ -10103,6 +10362,7 @@ function assignFiberPropertiesInDEV(target, source) { target._debugSource = source._debugSource; target._debugOwner = source._debugOwner; target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming; + target._debugHookTypes = source._debugHookTypes; return target; } @@ -10140,6 +10400,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) { latestSuspendedTime: NoWork, latestPingedTime: NoWork, + pingCache: null, + didError: false, pendingCommitExpirationTime: NoWork, @@ -10163,6 +10425,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) { containerInfo: containerInfo, pendingChildren: null, + pingCache: null, + earliestPendingTime: NoWork, latestPendingTime: NoWork, earliestSuspendedTime: NoWork, @@ -10292,7 +10556,7 @@ var ReactStrictModeWarnings = { ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { pendingUnsafeLifecycleWarnings.forEach(function (lifecycleWarningsMap, strictRoot) { - var lifecyclesWarningMesages = []; + var lifecyclesWarningMessages = []; Object.keys(lifecycleWarningsMap).forEach(function (lifecycle) { var lifecycleWarnings = lifecycleWarningsMap[lifecycle]; @@ -10307,14 +10571,14 @@ var ReactStrictModeWarnings = { var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle]; var sortedComponentNames = setToSortedString(componentNames); - lifecyclesWarningMesages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames)); + lifecyclesWarningMessages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames)); } }); - if (lifecyclesWarningMesages.length > 0) { + if (lifecyclesWarningMessages.length > 0) { var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot); - warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMesages.join('\n\n')); + warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMessages.join('\n\n')); } }); @@ -10537,6 +10801,10 @@ function markCommittedPriorityLevels(root, earliestRemainingTime) { return; } + if (earliestRemainingTime < root.latestPingedTime) { + root.latestPingedTime = NoWork; + } + // Let's see if the previous latest known pending level was just flushed. var latestPendingTime = root.latestPendingTime; if (latestPendingTime !== NoWork) { @@ -10662,10 +10930,8 @@ function markPingedPriorityLevel(root, pingedTime) { } function clearPing(root, completedTime) { - // TODO: Track whether the root was pinged during the render phase. If so, - // we need to make sure we don't lose track of it. var latestPingedTime = root.latestPingedTime; - if (latestPingedTime !== NoWork && latestPingedTime >= completedTime) { + if (latestPingedTime >= completedTime) { root.latestPingedTime = NoWork; } } @@ -10721,3511 +10987,3677 @@ function findNextExpirationTimeToWorkOn(completedExpirationTime, root) { root.expirationTime = expirationTime; } -// UpdateQueue is a linked list of prioritized updates. -// -// Like fibers, update queues come in pairs: a current queue, which represents -// the visible state of the screen, and a work-in-progress queue, which is -// can be mutated and processed asynchronously before it is committed — a form -// of double buffering. If a work-in-progress render is discarded before -// finishing, we create a new work-in-progress by cloning the current queue. -// -// Both queues share a persistent, singly-linked list structure. To schedule an -// update, we append it to the end of both queues. Each queue maintains a -// pointer to first update in the persistent list that hasn't been processed. -// The work-in-progress pointer always has a position equal to or greater than -// the current queue, since we always work on that one. The current queue's -// pointer is only updated during the commit phase, when we swap in the -// work-in-progress. -// -// For example: -// -// Current pointer: A - B - C - D - E - F -// Work-in-progress pointer: D - E - F -// ^ -// The work-in-progress queue has -// processed more updates than current. -// -// The reason we append to both queues is because otherwise we might drop -// updates without ever processing them. For example, if we only add updates to -// the work-in-progress queue, some updates could be lost whenever a work-in -// -progress render restarts by cloning from current. Similarly, if we only add -// updates to the current queue, the updates will be lost whenever an already -// in-progress queue commits and swaps with the current queue. However, by -// adding to both queues, we guarantee that the update will be part of the next -// work-in-progress. (And because the work-in-progress queue becomes the -// current queue once it commits, there's no danger of applying the same -// update twice.) -// -// Prioritization -// -------------- -// -// Updates are not sorted by priority, but by insertion; new updates are always -// appended to the end of the list. -// -// The priority is still important, though. When processing the update queue -// during the render phase, only the updates with sufficient priority are -// included in the result. If we skip an update because it has insufficient -// priority, it remains in the queue to be processed later, during a lower -// priority render. Crucially, all updates subsequent to a skipped update also -// remain in the queue *regardless of their priority*. That means high priority -// updates are sometimes processed twice, at two separate priorities. We also -// keep track of a base state, that represents the state before the first -// update in the queue is applied. -// -// For example: -// -// Given a base state of '', and the following queue of updates -// -// A1 - B2 - C1 - D2 -// -// where the number indicates the priority, and the update is applied to the -// previous state by appending a letter, React will process these updates as -// two separate renders, one per distinct priority level: -// -// First render, at priority 1: -// Base state: '' -// Updates: [A1, C1] -// Result state: 'AC' -// -// Second render, at priority 2: -// Base state: 'A' <- The base state does not include C1, -// because B2 was skipped. -// Updates: [B2, C1, D2] <- C1 was rebased on top of B2 -// Result state: 'ABCD' -// -// Because we process updates in insertion order, and rebase high priority -// updates when preceding updates are skipped, the final result is deterministic -// regardless of priority. Intermediate state may vary according to system -// resources, but the final state is always the same. - -var UpdateState = 0; -var ReplaceState = 1; -var ForceUpdate = 2; -var CaptureUpdate = 3; - -// Global state that is reset at the beginning of calling `processUpdateQueue`. -// It should only be read right after calling `processUpdateQueue`, via -// `checkHasForceUpdateAfterProcessing`. -var hasForceUpdate = false; - -var didWarnUpdateInsideUpdate = void 0; -var currentlyProcessingQueue = void 0; -var resetCurrentlyProcessingQueue = void 0; -{ - didWarnUpdateInsideUpdate = false; - currentlyProcessingQueue = null; - resetCurrentlyProcessingQueue = function () { - currentlyProcessingQueue = null; - }; -} - -function createUpdateQueue(baseState) { - var queue = { - baseState: baseState, - firstUpdate: null, - lastUpdate: null, - firstCapturedUpdate: null, - lastCapturedUpdate: null, - firstEffect: null, - lastEffect: null, - firstCapturedEffect: null, - lastCapturedEffect: null - }; - return queue; -} - -function cloneUpdateQueue(currentQueue) { - var queue = { - baseState: currentQueue.baseState, - firstUpdate: currentQueue.firstUpdate, - lastUpdate: currentQueue.lastUpdate, - - // TODO: With resuming, if we bail out and resuse the child tree, we should - // keep these effects. - firstCapturedUpdate: null, - lastCapturedUpdate: null, - - firstEffect: null, - lastEffect: null, - - firstCapturedEffect: null, - lastCapturedEffect: null - }; - return queue; +function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + // Resolve default props. Taken from ReactElement + var props = _assign({}, baseProps); + var defaultProps = Component.defaultProps; + for (var propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + return props; + } + return baseProps; } -function createUpdate(expirationTime) { - return { - expirationTime: expirationTime, +function readLazyComponentType(lazyComponent) { + var status = lazyComponent._status; + var result = lazyComponent._result; + switch (status) { + case Resolved: + { + var Component = result; + return Component; + } + case Rejected: + { + var error = result; + throw error; + } + case Pending: + { + var thenable = result; + throw thenable; + } + default: + { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var _thenable = ctor(); + _thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + { + if (defaultExport === undefined) { + warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + // Handle synchronous thenables. + switch (lazyComponent._status) { + case Resolved: + return lazyComponent._result; + case Rejected: + throw lazyComponent._result; + } + lazyComponent._result = _thenable; + throw _thenable; + } + } +} - tag: UpdateState, - payload: null, - callback: null, +var fakeInternalInstance = {}; +var isArray$1 = Array.isArray; - next: null, - nextEffect: null - }; -} +// React.Component uses a shared frozen object by default. +// We'll use it to determine whether we need to initialize legacy refs. +var emptyRefsObject = new React.Component().refs; -function appendUpdateToQueue(queue, update) { - // Append the update to the end of the list. - if (queue.lastUpdate === null) { - // Queue is empty - queue.firstUpdate = queue.lastUpdate = update; - } else { - queue.lastUpdate.next = update; - queue.lastUpdate = update; - } -} +var didWarnAboutStateAssignmentForComponent = void 0; +var didWarnAboutUninitializedState = void 0; +var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0; +var didWarnAboutLegacyLifecyclesAndDerivedState = void 0; +var didWarnAboutUndefinedDerivedState = void 0; +var warnOnUndefinedDerivedState = void 0; +var warnOnInvalidCallback$1 = void 0; +var didWarnAboutDirectlyAssigningPropsToState = void 0; +var didWarnAboutContextTypeAndContextTypes = void 0; +var didWarnAboutInvalidateContextType = void 0; -function enqueueUpdate(fiber, update) { - // Update queues are created lazily. - var alternate = fiber.alternate; - var queue1 = void 0; - var queue2 = void 0; - if (alternate === null) { - // There's only one fiber. - queue1 = fiber.updateQueue; - queue2 = null; - if (queue1 === null) { - queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); +{ + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + didWarnAboutDirectlyAssigningPropsToState = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutContextTypeAndContextTypes = new Set(); + didWarnAboutInvalidateContextType = new Set(); + + var didWarnOnInvalidCallback = new Set(); + + warnOnInvalidCallback$1 = function (callback, callerName) { + if (callback === null || typeof callback === 'function') { + return; } - } else { - // There are two owners. - queue1 = fiber.updateQueue; - queue2 = alternate.updateQueue; - if (queue1 === null) { - if (queue2 === null) { - // Neither fiber has an update queue. Create new ones. - queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); - queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState); - } else { - // Only one fiber has an update queue. Clone to create a new one. - queue1 = fiber.updateQueue = cloneUpdateQueue(queue2); - } - } else { - if (queue2 === null) { - // Only one fiber has an update queue. Clone to create a new one. - queue2 = alternate.updateQueue = cloneUpdateQueue(queue1); - } else { - // Both owners have an update queue. + var key = callerName + '_' + callback; + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + } + }; + + warnOnUndefinedDerivedState = function (type, partialState) { + if (partialState === undefined) { + var componentName = getComponentName(type) || 'Component'; + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); } } - } - if (queue2 === null || queue1 === queue2) { - // There's only a single queue. - appendUpdateToQueue(queue1, update); - } else { - // There are two queues. We need to append the update to both queues, - // while accounting for the persistent structure of the list — we don't - // want the same update to be added multiple times. - if (queue1.lastUpdate === null || queue2.lastUpdate === null) { - // One of the queues is not empty. We must add the update to both queues. - appendUpdateToQueue(queue1, update); - appendUpdateToQueue(queue2, update); - } else { - // Both queues are non-empty. The last update is the same in both lists, - // because of structural sharing. So, only append to one of the lists. - appendUpdateToQueue(queue1, update); - // But we still need to update the `lastUpdate` pointer of queue2. - queue2.lastUpdate = update; + }; + + // This is so gross but it's at least non-critical and can be removed if + // it causes problems. This is meant to give a nicer error message for + // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, + // ...)) which otherwise throws a "_processChildContext is not a function" + // exception. + Object.defineProperty(fakeInternalInstance, '_processChildContext', { + enumerable: false, + value: function () { + invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'); } - } + }); + Object.freeze(fakeInternalInstance); +} + +function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + var prevState = workInProgress.memoizedState; { - if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) { - warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); - didWarnUpdateInsideUpdate = true; + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Invoke the function an extra time to help detect side-effects. + getDerivedStateFromProps(nextProps, prevState); } } -} -function enqueueCapturedUpdate(workInProgress, update) { - // Captured updates go into a separate list, and only on the work-in- - // progress queue. - var workInProgressQueue = workInProgress.updateQueue; - if (workInProgressQueue === null) { - workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState); - } else { - // TODO: I put this here rather than createWorkInProgress so that we don't - // clone the queue unnecessarily. There's probably a better way to - // structure this. - workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue); - } + var partialState = getDerivedStateFromProps(nextProps, prevState); - // Append the update to the end of the list. - if (workInProgressQueue.lastCapturedUpdate === null) { - // This is the first render phase update - workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update; - } else { - workInProgressQueue.lastCapturedUpdate.next = update; - workInProgressQueue.lastCapturedUpdate = update; + { + warnOnUndefinedDerivedState(ctor, partialState); } -} + // Merge the partial state and the previous state. + var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState); + workInProgress.memoizedState = memoizedState; -function ensureWorkInProgressQueueIsAClone(workInProgress, queue) { - var current = workInProgress.alternate; - if (current !== null) { - // If the work-in-progress queue is equal to the current queue, - // we need to clone it first. - if (queue === current.updateQueue) { - queue = workInProgress.updateQueue = cloneUpdateQueue(queue); - } + // Once the update queue is empty, persist the derived state onto the + // base state. + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && workInProgress.expirationTime === NoWork) { + updateQueue.baseState = memoizedState; } - return queue; } -function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { - switch (update.tag) { - case ReplaceState: - { - var _payload = update.payload; - if (typeof _payload === 'function') { - // Updater function - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - _payload.call(instance, prevState, nextProps); - } - } - return _payload.call(instance, prevState, nextProps); - } - // State object - return _payload; - } - case CaptureUpdate: +var classComponentUpdater = { + isMounted: isMounted, + enqueueSetState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); + + var update = createUpdate(expirationTime); + update.payload = payload; + if (callback !== undefined && callback !== null) { { - workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture; + warnOnInvalidCallback$1(callback, 'setState'); } - // Intentional fallthrough - case UpdateState: - { - var _payload2 = update.payload; - var partialState = void 0; - if (typeof _payload2 === 'function') { - // Updater function - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - _payload2.call(instance, prevState, nextProps); - } - } - partialState = _payload2.call(instance, prevState, nextProps); - } else { - // Partial state object - partialState = _payload2; - } - if (partialState === null || partialState === undefined) { - // Null and undefined are treated as no-ops. - return prevState; - } - // Merge the partial state and the previous state. - return _assign({}, prevState, partialState); - } - case ForceUpdate: - { - hasForceUpdate = true; - return prevState; - } - } - return prevState; -} - -function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) { - hasForceUpdate = false; - - queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue); + update.callback = callback; + } - { - currentlyProcessingQueue = queue; - } + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueReplaceState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); - // These values may change as we process the queue. - var newBaseState = queue.baseState; - var newFirstUpdate = null; - var newExpirationTime = NoWork; + var update = createUpdate(expirationTime); + update.tag = ReplaceState; + update.payload = payload; - // Iterate through the list of updates to compute the result. - var update = queue.firstUpdate; - var resultState = newBaseState; - while (update !== null) { - var updateExpirationTime = update.expirationTime; - if (updateExpirationTime < renderExpirationTime) { - // This update does not have sufficient priority. Skip it. - if (newFirstUpdate === null) { - // This is the first skipped update. It will be the first update in - // the new list. - newFirstUpdate = update; - // Since this is the first update that was skipped, the current result - // is the new base state. - newBaseState = resultState; - } - // Since this update will remain in the list, update the remaining - // expiration time. - if (newExpirationTime < updateExpirationTime) { - newExpirationTime = updateExpirationTime; - } - } else { - // This update does have sufficient priority. Process it and compute - // a new result. - resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); - var _callback = update.callback; - if (_callback !== null) { - workInProgress.effectTag |= Callback; - // Set this to null, in case it was mutated during an aborted render. - update.nextEffect = null; - if (queue.lastEffect === null) { - queue.firstEffect = queue.lastEffect = update; - } else { - queue.lastEffect.nextEffect = update; - queue.lastEffect = update; - } + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback$1(callback, 'replaceState'); } + update.callback = callback; } - // Continue to the next update. - update = update.next; - } - // Separately, iterate though the list of captured updates. - var newFirstCapturedUpdate = null; - update = queue.firstCapturedUpdate; - while (update !== null) { - var _updateExpirationTime = update.expirationTime; - if (_updateExpirationTime < renderExpirationTime) { - // This update does not have sufficient priority. Skip it. - if (newFirstCapturedUpdate === null) { - // This is the first skipped captured update. It will be the first - // update in the new list. - newFirstCapturedUpdate = update; - // If this is the first update that was skipped, the current result is - // the new base state. - if (newFirstUpdate === null) { - newBaseState = resultState; - } - } - // Since this update will remain in the list, update the remaining - // expiration time. - if (newExpirationTime < _updateExpirationTime) { - newExpirationTime = _updateExpirationTime; - } - } else { - // This update does have sufficient priority. Process it and compute - // a new result. - resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); - var _callback2 = update.callback; - if (_callback2 !== null) { - workInProgress.effectTag |= Callback; - // Set this to null, in case it was mutated during an aborted render. - update.nextEffect = null; - if (queue.lastCapturedEffect === null) { - queue.firstCapturedEffect = queue.lastCapturedEffect = update; - } else { - queue.lastCapturedEffect.nextEffect = update; - queue.lastCapturedEffect = update; - } + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueForceUpdate: function (inst, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); + + var update = createUpdate(expirationTime); + update.tag = ForceUpdate; + + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback$1(callback, 'forceUpdate'); } + update.callback = callback; } - update = update.next; - } - if (newFirstUpdate === null) { - queue.lastUpdate = null; - } - if (newFirstCapturedUpdate === null) { - queue.lastCapturedUpdate = null; - } else { - workInProgress.effectTag |= Callback; - } - if (newFirstUpdate === null && newFirstCapturedUpdate === null) { - // We processed every update, without skipping. That means the new base - // state is the same as the result state. - newBaseState = resultState; + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); } +}; - queue.baseState = newBaseState; - queue.firstUpdate = newFirstUpdate; - queue.firstCapturedUpdate = newFirstCapturedUpdate; +function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + var instance = workInProgress.stateNode; + if (typeof instance.shouldComponentUpdate === 'function') { + startPhaseTimer(workInProgress, 'shouldComponentUpdate'); + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); + stopPhaseTimer(); - // Set the remaining expiration time to be whatever is remaining in the queue. - // This should be fine because the only two other things that contribute to - // expiration time are props and context. We're already in the middle of the - // begin phase by the time we start processing the queue, so we've already - // dealt with the props. Context in components that specify - // shouldComponentUpdate is tricky; but we'll have to account for - // that regardless. - workInProgress.expirationTime = newExpirationTime; - workInProgress.memoizedState = resultState; + { + !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0; + } - { - currentlyProcessingQueue = null; + return shouldUpdate; } -} -function callCallback(callback, context) { - !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0; - callback.call(context); -} + if (ctor.prototype && ctor.prototype.isPureReactComponent) { + return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + } -function resetHasForceUpdateBeforeProcessing() { - hasForceUpdate = false; + return true; } -function checkHasForceUpdateAfterProcessing() { - return hasForceUpdate; -} +function checkClassInstance(workInProgress, ctor, newProps) { + var instance = workInProgress.stateNode; + { + var name = getComponentName(ctor) || 'Component'; + var renderPresent = instance.render; -function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) { - // If the finished render included captured updates, and there are still - // lower priority updates left over, we need to keep the captured updates - // in the queue so that they are rebased and not dropped once we process the - // queue again at the lower priority. - if (finishedQueue.firstCapturedUpdate !== null) { - // Join the captured update list to the end of the normal list. - if (finishedQueue.lastUpdate !== null) { - finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate; - finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate; + if (!renderPresent) { + if (ctor.prototype && typeof ctor.prototype.render === 'function') { + warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); + } else { + warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); + } } - // Clear the list of captured updates. - finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null; - } - - // Commit the effects - commitUpdateEffects(finishedQueue.firstEffect, instance); - finishedQueue.firstEffect = finishedQueue.lastEffect = null; - commitUpdateEffects(finishedQueue.firstCapturedEffect, instance); - finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null; -} + var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; + !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0; + var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; + !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0; + var noInstancePropTypes = !instance.propTypes; + !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0; + var noInstanceContextType = !instance.contextType; + !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0; + var noInstanceContextTypes = !instance.contextTypes; + !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0; -function commitUpdateEffects(effect, instance) { - while (effect !== null) { - var _callback3 = effect.callback; - if (_callback3 !== null) { - effect.callback = null; - callCallback(_callback3, instance); + if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { + didWarnAboutContextTypeAndContextTypes.add(ctor); + warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); } - effect = effect.nextEffect; - } -} -function createCapturedValue(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; -} + var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function'; + !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0; + if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { + warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component'); + } + var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function'; + !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0; + var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function'; + !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0; + var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; + !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0; + var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function'; + !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0; + var hasMutatedProps = instance.props !== newProps; + !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0; + var noInstanceDefaultProps = !instance.defaultProps; + !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0; -var valueCursor = createCursor(null); + if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); + warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor)); + } -var rendererSigil = void 0; -{ - // Use this to detect multiple renderers using the same context - rendererSigil = {}; + var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function'; + !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; + var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function'; + !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; + var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function'; + !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0; + var _state = instance.state; + if (_state && (typeof _state !== 'object' || isArray$1(_state))) { + warningWithoutStack$1(false, '%s.state: must be set to an object or null', name); + } + if (typeof instance.getChildContext === 'function') { + !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0; + } + } } -var currentlyRenderingFiber = null; -var lastContextDependency = null; -var lastContextWithAllBitsObserved = null; - -function resetContextDependences() { - // This is called right before React yields execution, to ensure `readContext` - // cannot be called outside the render phase. - currentlyRenderingFiber = null; - lastContextDependency = null; - lastContextWithAllBitsObserved = null; +function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; + // The instance needs access to the fiber so that it can schedule updates + set(instance, workInProgress); + { + instance._reactInternalInstance = fakeInternalInstance; + } } -function pushProvider(providerFiber, nextValue) { - var context = providerFiber.type._context; +function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) { + var isLegacyContextConsumer = false; + var unmaskedContext = emptyContextObject; + var context = null; + var contextType = ctor.contextType; - if (isPrimaryRenderer) { - push(valueCursor, context._currentValue, providerFiber); + { + if ('contextType' in ctor) { + var isValid = + // Allow null for conditional declaration + contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a - context._currentValue = nextValue; - { - !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; - context._currentRenderer = rendererSigil; - } - } else { - push(valueCursor, context._currentValue2, providerFiber); + if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { + didWarnAboutInvalidateContextType.add(ctor); - context._currentValue2 = nextValue; - { - !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; - context._currentRenderer2 = rendererSigil; + 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(ctor) || 'Component', addendum); + } } } -} - -function popProvider(providerFiber) { - var currentValue = valueCursor.current; - - pop(valueCursor, providerFiber); - var context = providerFiber.type._context; - if (isPrimaryRenderer) { - context._currentValue = currentValue; + if (typeof contextType === 'object' && contextType !== null) { + context = readContext(contextType); } else { - context._currentValue2 = currentValue; + unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + var contextTypes = ctor.contextTypes; + isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; + context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; } -} - -function calculateChangedBits(context, newValue, oldValue) { - // Use Object.is to compare the new context value to the old value. Inlined - // Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - if (oldValue === newValue && (oldValue !== 0 || 1 / oldValue === 1 / newValue) || oldValue !== oldValue && newValue !== newValue // eslint-disable-line no-self-compare - ) { - // No change - return 0; - } else { - var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt; - { - !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0; + // Instantiate twice to help detect side-effects. + { + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + new ctor(props, context); // eslint-disable-line no-new } - return changedBits | 0; - } -} - -function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { - var fiber = workInProgress.child; - if (fiber !== null) { - // Set the return pointer of the child to the work-in-progress fiber. - fiber.return = workInProgress; } - while (fiber !== null) { - var nextFiber = void 0; - - // Visit this fiber. - var dependency = fiber.firstContextDependency; - if (dependency !== null) { - do { - // Check if the context matches. - if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) { - // Match! Schedule an update on this fiber. - if (fiber.tag === ClassComponent) { - // Schedule a force update on the work-in-progress. - var update = createUpdate(renderExpirationTime); - update.tag = ForceUpdate; - // TODO: Because we don't have a work-in-progress, this will add the - // update to the current fiber, too, which means it will persist even if - // this render is thrown away. Since it's a race condition, not sure it's - // worth fixing. - enqueueUpdate(fiber, update); - } + var instance = new ctor(props, context); + var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; + adoptClassInstance(workInProgress, instance); - if (fiber.expirationTime < renderExpirationTime) { - fiber.expirationTime = renderExpirationTime; - } - var alternate = fiber.alternate; - if (alternate !== null && alternate.expirationTime < renderExpirationTime) { - alternate.expirationTime = renderExpirationTime; - } - // Update the child expiration time of all the ancestors, including - // the alternates. - var node = fiber.return; - while (node !== null) { - alternate = node.alternate; - if (node.childExpirationTime < renderExpirationTime) { - node.childExpirationTime = renderExpirationTime; - if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { - alternate.childExpirationTime = renderExpirationTime; - } - } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { - alternate.childExpirationTime = renderExpirationTime; - } else { - // Neither alternate was updated, which means the rest of the - // ancestor path already has sufficient priority. - break; - } - node = node.return; - } - } - nextFiber = fiber.child; - dependency = dependency.next; - } while (dependency !== null); - } else if (fiber.tag === ContextProvider) { - // Don't scan deeper if this is a matching provider - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - } else { - // Traverse down. - nextFiber = fiber.child; + { + if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { + var componentName = getComponentName(ctor) || 'Component'; + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); + } } - if (nextFiber !== null) { - // Set the return pointer of the child to the work-in-progress fiber. - nextFiber.return = fiber; - } else { - // No child. Traverse to next sibling. - nextFiber = fiber; - while (nextFiber !== null) { - if (nextFiber === workInProgress) { - // We're back to the root of this subtree. Exit. - nextFiber = null; - break; - } - var sibling = nextFiber.sibling; - if (sibling !== null) { - // Set the return pointer of the sibling to the work-in-progress fiber. - sibling.return = nextFiber.return; - nextFiber = sibling; - break; + // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { + foundWillMountName = 'componentWillMount'; + } else if (typeof instance.UNSAFE_componentWillMount === 'function') { + foundWillMountName = 'UNSAFE_componentWillMount'; + } + if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + foundWillReceivePropsName = 'componentWillReceiveProps'; + } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; + } + if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + foundWillUpdateName = 'componentWillUpdate'; + } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + foundWillUpdateName = 'UNSAFE_componentWillUpdate'; + } + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var _componentName = getComponentName(ctor) || 'Component'; + var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : ''); } - // No more siblings. Traverse up. - nextFiber = nextFiber.return; } } - fiber = nextFiber; } -} -function prepareToReadContext(workInProgress, renderExpirationTime) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - lastContextWithAllBitsObserved = null; + // Cache unmasked context so we can avoid recreating masked context unless necessary. + // ReactFiberContext usually updates this cache but can't for newly-created instances. + if (isLegacyContextConsumer) { + cacheContext(workInProgress, unmaskedContext, context); + } - // Reset the work-in-progress list - workInProgress.firstContextDependency = null; + return instance; } -function readContext(context, observedBits) { - if (lastContextWithAllBitsObserved === context) { - // Nothing to do. We already observe everything in this context. - } else if (observedBits === false || observedBits === 0) { - // Do not observe any updates. - } else { - var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types. - if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) { - // Observe all updates. - lastContextWithAllBitsObserved = context; - resolvedObservedBits = maxSigned31BitInt; - } else { - resolvedObservedBits = observedBits; - } +function callComponentWillMount(workInProgress, instance) { + startPhaseTimer(workInProgress, 'componentWillMount'); + var oldState = instance.state; - var contextItem = { - context: context, - observedBits: resolvedObservedBits, - next: null - }; + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } - if (lastContextDependency === null) { - !(currentlyRenderingFiber !== null) ? invariant(false, 'Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps.') : void 0; - // This is the first dependency in the list - currentlyRenderingFiber.firstContextDependency = lastContextDependency = contextItem; - } else { - // Append a new context item. - lastContextDependency = lastContextDependency.next = contextItem; + stopPhaseTimer(); + + if (oldState !== instance.state) { + { + warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component'); } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } - return isPrimaryRenderer ? context._currentValue : context._currentValue2; } -var NoEffect$1 = /* */0; -var UnmountSnapshot = /* */2; -var UnmountMutation = /* */4; -var MountMutation = /* */8; -var UnmountLayout = /* */16; -var MountLayout = /* */32; -var MountPassive = /* */64; -var UnmountPassive = /* */128; +function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + var oldState = instance.state; + startPhaseTimer(workInProgress, 'componentWillReceiveProps'); + if (typeof instance.componentWillReceiveProps === 'function') { + instance.componentWillReceiveProps(newProps, nextContext); + } + if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + } + stopPhaseTimer(); -function areHookInputsEqual(arr1, arr2) { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - { - !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0; - } - for (var i = 0; i < arr1.length; i++) { - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - var val1 = arr1[i]; - var val2 = arr2[i]; - if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2 // eslint-disable-line no-self-compare - ) { - continue; + if (instance.state !== oldState) { + { + var componentName = getComponentName(workInProgress.type) || 'Component'; + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); + warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); } - return false; + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } - return true; } -// These are set right before calling the component. -var renderExpirationTime = NoWork; -// The work-in-progress fiber. I've named it differently to distinguish it from -// the work-in-progress hook. -var currentlyRenderingFiber$1 = null; +// Invokes the mount life-cycles on a previously never rendered instance. +function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + { + checkClassInstance(workInProgress, ctor, newProps); + } -// Hooks are stored as a linked list on the fiber's memoizedState field. The -// current hook list is the list that belongs to the current fiber. The -// work-in-progress hook list is a new list that will be added to the -// work-in-progress fiber. -var firstCurrentHook = null; -var currentHook = null; -var firstWorkInProgressHook = null; -var workInProgressHook = null; + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; -var remainingExpirationTime = NoWork; -var componentUpdateQueue = null; + var contextType = ctor.contextType; + if (typeof contextType === 'object' && contextType !== null) { + instance.context = readContext(contextType); + } else { + var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + instance.context = getMaskedContext(workInProgress, unmaskedContext); + } -// Updates scheduled during render will trigger an immediate re-render at the -// end of the current pass. We can't store these updates on the normal queue, -// because if the work is aborted, they should be discarded. Because this is -// a relatively rare case, we also don't want to add an additional field to -// either the hook or queue object types. So we store them in a lazily create -// map of queue -> render-phase updates, which are discarded once the component -// completes without re-rendering. + { + if (instance.state === newProps) { + var componentName = getComponentName(ctor) || 'Component'; + if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { + didWarnAboutDirectlyAssigningPropsToState.add(componentName); + warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); + } + } -// 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; + if (workInProgress.mode & StrictMode) { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); -function resolveCurrentlyRenderingFiber() { - !(currentlyRenderingFiber$1 !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0; - return currentlyRenderingFiber$1; -} + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); + } -function prepareToUseHooks(current, workInProgress, nextRenderExpirationTime) { - if (!enableHooks) { - return; + if (warnAboutDeprecatedLifecycles) { + ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); + } } - renderExpirationTime = nextRenderExpirationTime; - currentlyRenderingFiber$1 = workInProgress; - firstCurrentHook = current !== null ? current.memoizedState : null; - // The following should have already been reset - // currentHook = null; - // workInProgressHook = null; - - // remainingExpirationTime = NoWork; - // componentUpdateQueue = null; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + } - // isReRender = false; - // didScheduleRenderPhaseUpdate = false; - // renderPhaseUpdates = null; - // numberOfReRenders = 0; -} + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + instance.state = workInProgress.memoizedState; + } -function finishHooks(Component, props, children, refOrContext) { - if (!enableHooks) { - return children; + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + callComponentWillMount(workInProgress, instance); + // If we had additional state updates during this life-cycle, let's + // process them now. + updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + } } - // This must be called after every function component to prevent hooks from - // being used in classes. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } +} - 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; +function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; - // Start over from the beginning of the list - currentHook = null; - workInProgressHook = null; - componentUpdateQueue = null; + var oldProps = workInProgress.memoizedProps; + instance.props = oldProps; - children = Component(props, refOrContext); + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = void 0; + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); } - renderPhaseUpdates = null; - numberOfReRenders = 0; - var renderedWork = currentlyRenderingFiber$1; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; - renderedWork.memoizedState = firstWorkInProgressHook; - renderedWork.expirationTime = remainingExpirationTime; - renderedWork.updateQueue = componentUpdateQueue; + // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. - var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } - renderExpirationTime = NoWork; - currentlyRenderingFiber$1 = null; + resetHasForceUpdateBeforeProcessing(); - firstCurrentHook = null; - currentHook = null; - firstWorkInProgressHook = null; - workInProgressHook = null; + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + } + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + return false; + } - remainingExpirationTime = NoWork; - componentUpdateQueue = null; + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } - // Always set during createWorkInProgress - // isReRender = false; + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); - // These were reset above - // didScheduleRenderPhaseUpdate = false; - // renderPhaseUpdates = null; - // numberOfReRenders = 0; + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + startPhaseTimer(workInProgress, 'componentWillMount'); + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } + stopPhaseTimer(); + } + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } - !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0; + // If shouldComponentUpdate returned false, we should still update the + // memoized state to indicate that this work can be reused. + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } - return children; + // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + + return shouldUpdate; } -function resetHooks() { - if (!enableHooks) { - return; - } +// Invokes the update life-cycles and returns false if it shouldn't rerender. +function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; - // This is called instead of `finishHooks` if the component throws. It's also - // called inside mountIndeterminateComponent if we determine the component - // is a module-style component. - renderExpirationTime = NoWork; - currentlyRenderingFiber$1 = null; + var oldProps = workInProgress.memoizedProps; + instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); - firstCurrentHook = null; - currentHook = null; - firstWorkInProgressHook = null; - workInProgressHook = null; - - remainingExpirationTime = NoWork; - componentUpdateQueue = null; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = void 0; + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); + } - // Always set during createWorkInProgress - // isReRender = false; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; - didScheduleRenderPhaseUpdate = false; - renderPhaseUpdates = null; - numberOfReRenders = 0; -} + // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. -function createHook() { - return { - memoizedState: null, + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } - baseState: null, - queue: null, - baseUpdate: null, + resetHasForceUpdateBeforeProcessing(); - next: null - }; -} + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + } -function cloneHook(hook) { - return { - memoizedState: hook.memoizedState, + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } + return false; + } - baseState: hook.memoizedState, - queue: hook.queue, - baseUpdate: hook.baseUpdate, + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } - next: null - }; -} + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); -function createWorkInProgressHook() { - if (workInProgressHook === null) { - // This is the first hook in the list - if (firstWorkInProgressHook === null) { - isReRender = false; - currentHook = firstCurrentHook; - if (currentHook === null) { - // This is a newly mounted hook - workInProgressHook = createHook(); - } else { - // Clone the current hook. - workInProgressHook = cloneHook(currentHook); + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { + startPhaseTimer(workInProgress, 'componentWillUpdate'); + if (typeof instance.componentWillUpdate === 'function') { + instance.componentWillUpdate(newProps, newState, nextContext); } - firstWorkInProgressHook = workInProgressHook; - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - currentHook = firstCurrentHook; - workInProgressHook = firstWorkInProgressHook; + if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); + } + stopPhaseTimer(); + } + if (typeof instance.componentDidUpdate === 'function') { + workInProgress.effectTag |= Update; + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + workInProgress.effectTag |= Snapshot; } } else { - if (workInProgressHook.next === null) { - isReRender = false; - var hook = void 0; - if (currentHook === null) { - // This is a newly mounted hook - hook = createHook(); - } else { - currentHook = currentHook.next; - if (currentHook === null) { - // This is a newly mounted hook - hook = createHook(); - } else { - // Clone the current hook. - hook = cloneHook(currentHook); - } + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; } - // Append to the end of the list - workInProgressHook = workInProgressHook.next = hook; - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - workInProgressHook = workInProgressHook.next; - currentHook = currentHook !== null ? currentHook.next : null; } + + // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { - lastEffect: null - }; -} + // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; -function basicStateReducer(state, action) { - return typeof action === 'function' ? action(state) : action; + return shouldUpdate; } -function useContext(context, observedBits) { - // Ensure we're in a function component (class components support only the - // .unstable_read() form) - resolveCurrentlyRenderingFiber(); - return readContext(context, observedBits); -} - -function useState(initialState) { - return useReducer(basicStateReducer, - // useReducer has a special case to support lazy useState initializers - initialState); -} - -function useReducer(reducer, initialState, initialAction) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var queue = workInProgressHook.queue; - if (queue !== null) { - // Already have a queue, so this is an update. - if (isReRender) { - // This is a re-render. Apply the new render phase updates to the previous - var _dispatch2 = 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; - newState = reducer(newState, _action); - update = update.next; - } while (update !== null); - - workInProgressHook.memoizedState = newState; - - // Don't persist the state accumlated from the render phase updates to - // the base state unless the queue is empty. - // TODO: Not sure if this is the desired semantics, but it's what we - // do for gDSFP. I can't remember why. - if (workInProgressHook.baseUpdate === queue.last) { - workInProgressHook.baseState = newState; - } - - return [newState, _dispatch2]; - } - } - return [workInProgressHook.memoizedState, _dispatch2]; - } +var didWarnAboutMaps = void 0; +var didWarnAboutGenerators = void 0; +var didWarnAboutStringRefInStrictMode = void 0; +var ownerHasKeyUseWarning = void 0; +var ownerHasFunctionTypeWarning = void 0; +var warnForMissingKey = function (child) {}; - // The last update in the entire queue - var _last = queue.last; - // The last update that is part of the base state. - var _baseUpdate = workInProgressHook.baseUpdate; - - // Find the first unprocessed update. - var first = void 0; - if (_baseUpdate !== null) { - if (_last !== null) { - // For the first update, the queue is a circular linked list where - // `queue.last.next = queue.first`. Once the first update commits, and - // the `baseUpdate` is no longer empty, we can unravel the list. - _last.next = null; - } - first = _baseUpdate.next; - } else { - first = _last !== null ? _last.next : null; - } - if (first !== null) { - var _newState = workInProgressHook.baseState; - var newBaseState = null; - var newBaseUpdate = null; - var prevUpdate = _baseUpdate; - var _update = first; - var didSkip = false; - do { - var updateExpirationTime = _update.expirationTime; - if (updateExpirationTime < renderExpirationTime) { - // Priority is insufficient. Skip this update. If this is the first - // skipped update, the previous update/state is the new base - // update/state. - if (!didSkip) { - didSkip = true; - newBaseUpdate = prevUpdate; - newBaseState = _newState; - } - // Update the remaining priority in the queue. - if (updateExpirationTime > remainingExpirationTime) { - remainingExpirationTime = updateExpirationTime; - } - } else { - // Process this update. - var _action2 = _update.action; - _newState = reducer(_newState, _action2); - } - prevUpdate = _update; - _update = _update.next; - } while (_update !== null && _update !== first); +{ + didWarnAboutMaps = false; + didWarnAboutGenerators = false; + didWarnAboutStringRefInStrictMode = {}; - if (!didSkip) { - newBaseUpdate = prevUpdate; - newBaseState = _newState; - } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; - workInProgressHook.memoizedState = _newState; - workInProgressHook.baseUpdate = newBaseUpdate; - workInProgressHook.baseState = newBaseState; + warnForMissingKey = function (child) { + if (child === null || typeof child !== 'object') { + return; } + if (!child._store || child._store.validated || child.key != null) { + return; + } + !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; + child._store.validated = true; - var _dispatch = queue.dispatch; - return [workInProgressHook.memoizedState, _dispatch]; - } - - // There's no existing queue, so this is the initial render. - if (reducer === basicStateReducer) { - // Special case for `useState`. - if (typeof initialState === 'function') { - initialState = initialState(); + var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev(); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; } - } else if (initialAction !== undefined && initialAction !== null) { - initialState = reducer(initialState, initialAction); - } - workInProgressHook.memoizedState = workInProgressHook.baseState = initialState; - queue = workInProgressHook.queue = { - last: null, - dispatch: null + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + + warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.'); }; - var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue); - return [workInProgressHook.memoizedState, dispatch]; } -function pushEffect(tag, create, destroy, inputs) { - var effect = { - tag: tag, - create: create, - destroy: destroy, - inputs: inputs, - // Circular - next: null - }; - if (componentUpdateQueue === null) { - componentUpdateQueue = createFunctionComponentUpdateQueue(); - componentUpdateQueue.lastEffect = effect.next = effect; - } else { - var _lastEffect = componentUpdateQueue.lastEffect; - if (_lastEffect === null) { - componentUpdateQueue.lastEffect = effect.next = effect; +var isArray = Array.isArray; + +function coerceRef(returnFiber, current$$1, element) { + var mixedRef = element.ref; + if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { + { + if (returnFiber.mode & StrictMode) { + var componentName = getComponentName(returnFiber.type) || 'Component'; + if (!didWarnAboutStringRefInStrictMode[componentName]) { + warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber)); + didWarnAboutStringRefInStrictMode[componentName] = true; + } + } + } + + if (element._owner) { + var owner = element._owner; + var inst = void 0; + if (owner) { + var ownerFiber = owner; + !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs. Did you mean to use React.forwardRef()?') : void 0; + inst = ownerFiber.stateNode; + } + !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0; + var stringRef = '' + mixedRef; + // Check if previous string ref matches new string ref + if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) { + return current$$1.ref; + } + var ref = function (value) { + var refs = inst.refs; + if (refs === emptyRefsObject) { + // This is a lazy pooled frozen object, so we need to initialize. + refs = inst.refs = {}; + } + if (value === null) { + delete refs[stringRef]; + } else { + refs[stringRef] = value; + } + }; + ref._stringRef = stringRef; + return ref; } else { - var firstEffect = _lastEffect.next; - _lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; + !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0; + !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0; } } - return effect; + return mixedRef; } -function useRef(initialValue) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var ref = void 0; - - if (workInProgressHook.memoizedState === null) { - ref = { current: initialValue }; +function throwOnInvalidObjectType(returnFiber, newChild) { + if (returnFiber.type !== 'textarea') { + var addendum = ''; { - Object.seal(ref); + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev(); } - workInProgressHook.memoizedState = ref; - } else { - ref = workInProgressHook.memoizedState; + invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum); } - return ref; } -function useMutationEffect(create, inputs) { - useEffectImpl(Snapshot | Update, UnmountSnapshot | MountMutation, create, inputs); -} +function warnOnFunctionType() { + var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev(); -function useLayoutEffect(create, inputs) { - useEffectImpl(Update, UnmountMutation | MountLayout, create, inputs); -} + if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { + return; + } + ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; -function useEffect(create, inputs) { - useEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, inputs); + warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.'); } -function useEffectImpl(fiberEffectTag, hookEffectTag, create, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [create]; - var destroy = null; - if (currentHook !== null) { - var prevEffect = currentHook.memoizedState; - destroy = prevEffect.destroy; - if (areHookInputsEqual(nextInputs, prevEffect.inputs)) { - pushEffect(NoEffect$1, create, destroy, nextInputs); +// This wrapper function exists because I expect to clone the code in each path +// to be able to optimize each path individually by branching early. This needs +// a compiler or we can do it manually. Helpers that don't need this branching +// live outside of this function. +function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (!shouldTrackSideEffects) { + // Noop. return; } + // Deletions are added in reversed order so we add it to the front. + // At this point, the return fiber's effect list is empty except for + // deletions, so we can just append the deletion to the list. The remaining + // effects aren't added until the complete phase. Once we implement + // resuming, this may not be true. + var last = returnFiber.lastEffect; + if (last !== null) { + last.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } + childToDelete.nextEffect = null; + childToDelete.effectTag = Deletion; } - currentlyRenderingFiber$1.effectTag |= fiberEffectTag; - workInProgressHook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextInputs); -} - -function useImperativeMethods(ref, create, inputs) { - // TODO: If inputs are provided, should we skip comparing the ref itself? - var nextInputs = inputs !== null && inputs !== undefined ? inputs.concat([ref]) : [ref, create]; - - // TODO: I've implemented this on top of useEffect because it's almost the - // same thing, and it would require an equal amount of code. It doesn't seem - // like a common enough use case to justify the additional size. - useEffectImpl(Update, UnmountMutation | MountLayout, function () { - if (typeof ref === 'function') { - var refCallback = ref; - var _inst = create(); - refCallback(_inst); - return function () { - return refCallback(null); - }; - } else if (ref !== null && ref !== undefined) { - var refObject = ref; - var _inst2 = create(); - refObject.current = _inst2; - return function () { - refObject.current = null; - }; + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) { + // Noop. + return null; } - }, nextInputs); -} -function useCallback(callback, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); + // TODO: For the shouldClone case, this could be micro-optimized a bit by + // assuming that after the first child we've already added everything. + var childToDelete = currentFirstChild; + while (childToDelete !== null) { + deleteChild(returnFiber, childToDelete); + childToDelete = childToDelete.sibling; + } + return null; + } - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [callback]; + function mapRemainingChildren(returnFiber, currentFirstChild) { + // Add the remaining children to a temporary map so that we can find them by + // keys quickly. Implicit (null) keys get added to this set with their index + var existingChildren = new Map(); - var prevState = workInProgressHook.memoizedState; - if (prevState !== null) { - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + var existingChild = currentFirstChild; + while (existingChild !== null) { + if (existingChild.key !== null) { + existingChildren.set(existingChild.key, existingChild); + } else { + existingChildren.set(existingChild.index, existingChild); + } + existingChild = existingChild.sibling; } + return existingChildren; } - workInProgressHook.memoizedState = [callback, nextInputs]; - return callback; -} - -function useMemo(nextCreate, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate]; + function useFiber(fiber, pendingProps, expirationTime) { + // We currently set sibling to null and index to 0 here because it is easy + // to forget to do before returning it. E.g. for the single child case. + var clone = createWorkInProgress(fiber, pendingProps, expirationTime); + clone.index = 0; + clone.sibling = null; + return clone; + } - var prevState = workInProgressHook.memoizedState; - if (prevState !== null) { - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) { + // Noop. + return lastPlacedIndex; + } + var current$$1 = newFiber.alternate; + if (current$$1 !== null) { + var oldIndex = current$$1.index; + if (oldIndex < lastPlacedIndex) { + // This is a move. + newFiber.effectTag = Placement; + return lastPlacedIndex; + } else { + // This item can stay in place. + return oldIndex; + } + } else { + // This is an insertion. + newFiber.effectTag = Placement; + return lastPlacedIndex; } } - var nextValue = nextCreate(); - workInProgressHook.memoizedState = [nextValue, nextInputs]; - return nextValue; -} + function placeSingleChild(newFiber) { + // This is simpler for the single child case. We only need to do a + // placement for inserting new children. + if (shouldTrackSideEffects && newFiber.alternate === null) { + newFiber.effectTag = Placement; + } + return newFiber; + } -function dispatchAction(fiber, 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; + function updateTextNode(returnFiber, current$$1, textContent, expirationTime) { + if (current$$1 === null || current$$1.tag !== HostText) { + // Insert + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current$$1, textContent, expirationTime); + existing.return = returnFiber; + return existing; + } + } - var alternate = fiber.alternate; - if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) { - // 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 = { - expirationTime: renderExpirationTime, - action: action, - next: null - }; - if (renderPhaseUpdates === null) { - renderPhaseUpdates = new Map(); + function updateElement(returnFiber, current$$1, element, expirationTime) { + if (current$$1 !== null && current$$1.elementType === element.type) { + // Move based on index + var existing = useFiber(current$$1, element.props, expirationTime); + existing.ref = coerceRef(returnFiber, current$$1, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } else { + // Insert + var created = createFiberFromElement(element, returnFiber.mode, expirationTime); + created.ref = coerceRef(returnFiber, current$$1, element); + created.return = returnFiber; + return created; } - var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); - if (firstRenderPhaseUpdate === undefined) { - renderPhaseUpdates.set(queue, update); + } + + function updatePortal(returnFiber, current$$1, portal, expirationTime) { + if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) { + // Insert + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } else { - // Append the update to the end of the list. - var lastRenderPhaseUpdate = firstRenderPhaseUpdate; - while (lastRenderPhaseUpdate.next !== null) { - lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; - } - lastRenderPhaseUpdate.next = update; + // Update + var existing = useFiber(current$$1, portal.children || [], expirationTime); + existing.return = returnFiber; + return existing; } - } else { - var currentTime = requestCurrentTime(); - var _expirationTime = computeExpirationForFiber(currentTime, fiber); - var _update2 = { - expirationTime: _expirationTime, - action: action, - next: null - }; - flushPassiveEffects(); - // Append the update to the end of the list. - var _last2 = queue.last; - if (_last2 === null) { - // This is the first update. Create a circular list. - _update2.next = _update2; + } + + function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) { + if (current$$1 === null || current$$1.tag !== Fragment) { + // Insert + var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); + created.return = returnFiber; + return created; } else { - var first = _last2.next; - if (first !== null) { - // Still circular. - _update2.next = first; - } - _last2.next = _update2; + // Update + var existing = useFiber(current$$1, fragment, expirationTime); + existing.return = returnFiber; + return existing; } - queue.last = _update2; - scheduleWork(fiber, _expirationTime); } -} -var NO_CONTEXT = {}; + function createChild(returnFiber, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } -var contextStackCursor$1 = createCursor(NO_CONTEXT); -var contextFiberStackCursor = createCursor(NO_CONTEXT); -var rootInstanceStackCursor = createCursor(NO_CONTEXT); + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); + _created.ref = coerceRef(returnFiber, null, newChild); + _created.return = returnFiber; + return _created; + } + case REACT_PORTAL_TYPE: + { + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); + _created2.return = returnFiber; + return _created2; + } + } -function requiredContext(c) { - !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0; - return c; -} + if (isArray(newChild) || getIteratorFn(newChild)) { + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); + _created3.return = returnFiber; + return _created3; + } -function getRootHostContainer() { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - return rootInstance; -} + throwOnInvalidObjectType(returnFiber, newChild); + } -function pushHostContainer(fiber, nextRootInstance) { - // Push current root instance onto the stack; - // This allows us to reset root when portals are popped. - push(rootInstanceStackCursor, nextRootInstance, fiber); - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } - // Finally, we need to push the host context to the stack. - // However, we can't just call getRootHostContext() and push it because - // we'd have a different number of entries on the stack depending on - // whether getRootHostContext() throws somewhere in renderer code or not. - // So we push an empty value first. This lets us safely unwind on errors. - push(contextStackCursor$1, NO_CONTEXT, fiber); - var nextRootContext = getRootHostContext(nextRootInstance); - // Now that we know this function doesn't throw, replace it. - pop(contextStackCursor$1, fiber); - push(contextStackCursor$1, nextRootContext, fiber); -} - -function popHostContainer(fiber) { - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); -} - -function getHostContext() { - var context = requiredContext(contextStackCursor$1.current); - return context; -} - -function pushHostContext(fiber) { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - var context = requiredContext(contextStackCursor$1.current); - var nextContext = getChildHostContext(context, fiber.type, rootInstance); - - // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; + return null; } - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor$1, nextContext, fiber); -} + function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { + // Update the fiber if the keys match, otherwise return null. -function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; - } + var key = oldFiber !== null ? oldFiber.key : null; - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); -} + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + if (key !== null) { + return null; + } + return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); + } -var commitTime = 0; -var profilerStartTime = -1; + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + if (newChild.key === key) { + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); + } + return updateElement(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + case REACT_PORTAL_TYPE: + { + if (newChild.key === key) { + return updatePortal(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + } -function getCommitTime() { - return commitTime; -} + if (isArray(newChild) || getIteratorFn(newChild)) { + if (key !== null) { + return null; + } -function recordCommitTime() { - if (!enableProfilerTimer) { - return; - } - commitTime = scheduler.unstable_now(); -} + return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); + } -function startProfilerTimer(fiber) { - if (!enableProfilerTimer) { - return; - } + throwOnInvalidObjectType(returnFiber, newChild); + } - profilerStartTime = scheduler.unstable_now(); + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } - if (fiber.actualStartTime < 0) { - fiber.actualStartTime = scheduler.unstable_now(); + return null; } -} -function stopProfilerTimerIfRunning(fiber) { - if (!enableProfilerTimer) { - return; - } - profilerStartTime = -1; -} + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys, so we neither have to check the old nor + // new node for the key. If both are text nodes, they match. + var matchedFiber = existingChildren.get(newIdx) || null; + return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); + } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (!enableProfilerTimer) { - return; - } + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); + } + return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); + } + case REACT_PORTAL_TYPE: + { + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); + } + } - if (profilerStartTime >= 0) { - var elapsedTime = scheduler.unstable_now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - if (overrideBaseTime) { - fiber.selfBaseDuration = elapsedTime; + if (isArray(newChild) || getIteratorFn(newChild)) { + var _matchedFiber3 = existingChildren.get(newIdx) || null; + return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); + } + + throwOnInvalidObjectType(returnFiber, newChild); } - profilerStartTime = -1; - } -} -function resolveDefaultProps(Component, baseProps) { - if (Component && Component.defaultProps) { - // Resolve default props. Taken from ReactElement - var props = _assign({}, baseProps); - var defaultProps = Component.defaultProps; - for (var propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; + { + if (typeof newChild === 'function') { + warnOnFunctionType(); } } - return props; + + return null; } - return baseProps; -} -function readLazyComponentType(lazyComponent) { - var status = lazyComponent._status; - var result = lazyComponent._result; - switch (status) { - case Resolved: - { - var Component = result; - return Component; - } - case Rejected: - { - var error = result; - throw error; - } - case Pending: - { - var thenable = result; - throw thenable; + /** + * Warns if there is a duplicate or missing key + */ + function warnOnInvalidKey(child, knownKeys) { + { + if (typeof child !== 'object' || child === null) { + return knownKeys; } - default: - { - lazyComponent._status = Pending; - var ctor = lazyComponent._ctor; - var _thenable = ctor(); - _thenable.then(function (moduleObject) { - if (lazyComponent._status === Pending) { - var defaultExport = moduleObject.default; - { - if (defaultExport === undefined) { - warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } - lazyComponent._status = Resolved; - lazyComponent._result = defaultExport; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(child); + var key = child.key; + if (typeof key !== 'string') { + break; } - }, function (error) { - if (lazyComponent._status === Pending) { - lazyComponent._status = Rejected; - lazyComponent._result = error; + if (knownKeys === null) { + knownKeys = new Set(); + knownKeys.add(key); + break; } - }); - lazyComponent._result = _thenable; - throw _thenable; + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); + break; + default: + break; } + } + return knownKeys; } -} -var ReactCurrentOwner$4 = ReactSharedInternals.ReactCurrentOwner; + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { + // This algorithm can't optimize by searching from both ends since we + // don't have backpointers on fibers. I'm trying to see how far we can get + // with that model. If it ends up not being worth the tradeoffs, we can + // add it later. -function readContext$1(contextType) { - var dispatcher = ReactCurrentOwner$4.currentDispatcher; - return dispatcher.readContext(contextType); -} + // Even with a two ended optimization, we'd want to optimize for the case + // where there are few changes and brute force the comparison instead of + // going for the Map. It'd like to explore hitting that path first in + // forward-only mode and only go for the Map once we notice that we need + // lots of look ahead. This doesn't handle reversal as well as two ended + // search but that's unusual. Besides, for the two ended optimization to + // work on Iterables, we'd need to copy the whole set. -var fakeInternalInstance = {}; -var isArray$1 = Array.isArray; - -// React.Component uses a shared frozen object by default. -// We'll use it to determine whether we need to initialize legacy refs. -var emptyRefsObject = new React.Component().refs; + // In this first iteration, we'll just live with hitting the bad case + // (adding everything to a Map) in for every insert/move. -var didWarnAboutStateAssignmentForComponent = void 0; -var didWarnAboutUninitializedState = void 0; -var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0; -var didWarnAboutLegacyLifecyclesAndDerivedState = void 0; -var didWarnAboutUndefinedDerivedState = void 0; -var warnOnUndefinedDerivedState = void 0; -var warnOnInvalidCallback$1 = void 0; -var didWarnAboutDirectlyAssigningPropsToState = void 0; -var didWarnAboutContextTypeAndContextTypes = void 0; -var didWarnAboutInvalidateContextType = void 0; + // If you change this code, also update reconcileChildrenIterator() which + // uses the same algorithm. -{ - didWarnAboutStateAssignmentForComponent = new Set(); - didWarnAboutUninitializedState = new Set(); - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - didWarnAboutDirectlyAssigningPropsToState = new Set(); - didWarnAboutUndefinedDerivedState = new Set(); - didWarnAboutContextTypeAndContextTypes = new Set(); - didWarnAboutInvalidateContextType = new Set(); + { + // First, validate keys. + var knownKeys = null; + for (var i = 0; i < newChildren.length; i++) { + var child = newChildren[i]; + knownKeys = warnOnInvalidKey(child, knownKeys); + } + } - var didWarnOnInvalidCallback = new Set(); + var resultingFirstChild = null; + var previousNewFiber = null; - warnOnInvalidCallback$1 = function (callback, callerName) { - if (callback === null || typeof callback === 'function') { - return; - } - var key = callerName + '_' + callback; - if (!didWarnOnInvalidCallback.has(key)) { - didWarnOnInvalidCallback.add(key); - warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - }; - warnOnUndefinedDerivedState = function (type, partialState) { - if (partialState === undefined) { - var componentName = getComponentName(type) || 'Component'; - if (!didWarnAboutUndefinedDerivedState.has(componentName)) { - didWarnAboutUndefinedDerivedState.add(componentName); - warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); - } + if (newIdx === newChildren.length) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; } - }; - // This is so gross but it's at least non-critical and can be removed if - // it causes problems. This is meant to give a nicer error message for - // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, - // ...)) which otherwise throws a "_processChildContext is not a function" - // exception. - Object.defineProperty(fakeInternalInstance, '_processChildContext', { - enumerable: false, - value: function () { - invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'); + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); + if (!_newFiber) { + continue; + } + lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber; + } else { + previousNewFiber.sibling = _newFiber; + } + previousNewFiber = _newFiber; + } + return resultingFirstChild; } - }); - Object.freeze(fakeInternalInstance); -} -function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { - var prevState = workInProgress.memoizedState; + // Add all children to a key map for quick lookups. + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - // Invoke the function an extra time to help detect side-effects. - getDerivedStateFromProps(nextProps, prevState); + // Keep scanning and use the map to restore deleted items as moves. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); + if (_newFiber2) { + if (shouldTrackSideEffects) { + if (_newFiber2.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); + } + } + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber2; + } else { + previousNewFiber.sibling = _newFiber2; + } + previousNewFiber = _newFiber2; + } } - } - var partialState = getDerivedStateFromProps(nextProps, prevState); + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } - { - warnOnUndefinedDerivedState(ctor, partialState); + return resultingFirstChild; } - // Merge the partial state and the previous state. - var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState); - workInProgress.memoizedState = memoizedState; - // Once the update queue is empty, persist the derived state onto the - // base state. - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null && workInProgress.expirationTime === NoWork) { - updateQueue.baseState = memoizedState; - } -} + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { + // This is the same implementation as reconcileChildrenArray(), + // but using the iterator instead. -var classComponentUpdater = { - isMounted: isMounted, - enqueueSetState: function (inst, payload, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); + var iteratorFn = getIteratorFn(newChildrenIterable); + !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var update = createUpdate(expirationTime); - update.payload = payload; - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'setState'); + { + // We don't support rendering Generators because it's a mutation. + // See https://github.com/facebook/react/issues/12995 + if (typeof Symbol === 'function' && + // $FlowFixMe Flow doesn't know about toStringTag + newChildrenIterable[Symbol.toStringTag] === 'Generator') { + !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0; + didWarnAboutGenerators = true; } - update.callback = callback; - } - - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueReplaceState: function (inst, payload, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); - var update = createUpdate(expirationTime); - update.tag = ReplaceState; - update.payload = payload; + // Warn about using Maps as children + if (newChildrenIterable.entries === iteratorFn) { + !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; + } - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'replaceState'); + // First, validate keys. + // We'll get a different iterator later for the main pass. + var _newChildren = iteratorFn.call(newChildrenIterable); + if (_newChildren) { + var knownKeys = null; + var _step = _newChildren.next(); + for (; !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys); + } } - update.callback = callback; } - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueForceUpdate: function (inst, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); + var newChildren = iteratorFn.call(newChildrenIterable); + !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0; - var update = createUpdate(expirationTime); - update.tag = ForceUpdate; + var resultingFirstChild = null; + var previousNewFiber = null; - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'forceUpdate'); + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + + var step = newChildren.next(); + for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; } - update.callback = callback; + var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (!oldFiber) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - } -}; - -function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { - var instance = workInProgress.stateNode; - if (typeof instance.shouldComponentUpdate === 'function') { - startPhaseTimer(workInProgress, 'shouldComponentUpdate'); - var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); - stopPhaseTimer(); - - { - !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0; + if (step.done) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; } - return shouldUpdate; - } - - if (ctor.prototype && ctor.prototype.isPureReactComponent) { - return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); - } - - return true; -} - -function checkClassInstance(workInProgress, ctor, newProps) { - var instance = workInProgress.stateNode; - { - var name = getComponentName(ctor) || 'Component'; - var renderPresent = instance.render; - - if (!renderPresent) { - if (ctor.prototype && typeof ctor.prototype.render === 'function') { - warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); - } else { - warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, expirationTime); + if (_newFiber3 === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber3; + } else { + previousNewFiber.sibling = _newFiber3; + } + previousNewFiber = _newFiber3; } + return resultingFirstChild; } - var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; - !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0; - var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; - !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0; - var noInstancePropTypes = !instance.propTypes; - !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0; - var noInstanceContextType = !instance.contextType; - !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0; - var noInstanceContextTypes = !instance.contextTypes; - !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0; - - if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { - didWarnAboutContextTypeAndContextTypes.add(ctor); - warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); - } + // Add all children to a key map for quick lookups. + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function'; - !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0; - if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { - warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component'); + // Keep scanning and use the map to restore deleted items as moves. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); + if (_newFiber4 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber4.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); + } + } + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber4; + } else { + previousNewFiber.sibling = _newFiber4; + } + previousNewFiber = _newFiber4; + } } - var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function'; - !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0; - var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function'; - !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0; - var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; - !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0; - var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function'; - !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0; - var hasMutatedProps = instance.props !== newProps; - !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0; - var noInstanceDefaultProps = !instance.defaultProps; - !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0; - if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); - warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor)); + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); } - var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function'; - !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; - var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function'; - !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; - var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function'; - !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0; - var _state = instance.state; - if (_state && (typeof _state !== 'object' || isArray$1(_state))) { - warningWithoutStack$1(false, '%s.state: must be set to an object or null', name); - } - if (typeof instance.getChildContext === 'function') { - !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0; - } + return resultingFirstChild; } -} -function adoptClassInstance(workInProgress, instance) { - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - // The instance needs access to the fiber so that it can schedule updates - set(instance, workInProgress); - { - instance._reactInternalInstance = fakeInternalInstance; + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { + // There's no need to check for keys on text nodes since we don't have a + // way to define them. + if (currentFirstChild !== null && currentFirstChild.tag === HostText) { + // We already have an existing node so let's just update it and delete + // the rest. + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, textContent, expirationTime); + existing.return = returnFiber; + return existing; + } + // The existing first child is not a text node so we need to create one + // and delete the existing ones. + deleteRemainingChildren(returnFiber, currentFirstChild); + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } -} -function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) { - var isLegacyContextConsumer = false; - var unmaskedContext = emptyContextObject; - var context = null; - var contextType = ctor.contextType; - if (typeof contextType === 'object' && contextType !== null) { - { - if (contextType.$$typeof !== REACT_CONTEXT_TYPE && !didWarnAboutInvalidateContextType.has(ctor)) { - didWarnAboutInvalidateContextType.add(ctor); - warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', getComponentName(ctor) || 'Component'); + function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { + var key = element.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); + existing.ref = coerceRef(returnFiber, child, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); } + child = child.sibling; } - context = readContext$1(contextType); - } else { - unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - var contextTypes = ctor.contextTypes; - isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; - context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; + if (element.type === REACT_FRAGMENT_TYPE) { + var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); + created.return = returnFiber; + return created; + } else { + var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4.return = returnFiber; + return _created4; + } } - // Instantiate twice to help detect side-effects. - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - new ctor(props, context); // eslint-disable-line no-new + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { + var key = portal.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, portal.children || [], expirationTime); + existing.return = returnFiber; + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; } + + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } - var instance = new ctor(props, context); - var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; - adoptClassInstance(workInProgress, instance); + // This API will tag the children with the side-effect of the reconciliation + // itself. They will be added to the side-effect list as we pass through the + // children and the parent. + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { + // This function is not recursive. + // If the top level item is an array, we treat it as a set of children, + // not as a fragment. Nested arrays on the other hand will be treated as + // fragment nodes. Recursion happens at the normal flow. - { - if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { - var componentName = getComponentName(ctor) || 'Component'; - if (!didWarnAboutUninitializedState.has(componentName)) { - didWarnAboutUninitializedState.add(componentName); - warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); - } + // Handle top level unkeyed fragments as if they were arrays. + // This leads to an ambiguity between <>{[...]} and <>.... + // We treat the ambiguous cases above the same. + var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; + if (isUnkeyedTopLevelFragment) { + newChild = newChild.props.children; } - // If new component APIs are defined, "unsafe" lifecycles won't be called. - // Warn about these lifecycles if they are present. - // Don't warn about react-lifecycles-compat polyfilled methods though. - if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { - var foundWillMountName = null; - var foundWillReceivePropsName = null; - var foundWillUpdateName = null; - if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { - foundWillMountName = 'componentWillMount'; - } else if (typeof instance.UNSAFE_componentWillMount === 'function') { - foundWillMountName = 'UNSAFE_componentWillMount'; - } - if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { - foundWillReceivePropsName = 'componentWillReceiveProps'; - } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { - foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; - } - if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { - foundWillUpdateName = 'componentWillUpdate'; - } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { - foundWillUpdateName = 'UNSAFE_componentWillUpdate'; - } - if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { - var _componentName = getComponentName(ctor) || 'Component'; - var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; - if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { - didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); - warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : ''); - } + // Handle object types + var isObject = typeof newChild === 'object' && newChild !== null; + + if (isObject) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); + case REACT_PORTAL_TYPE: + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); } } - } - - // Cache unmasked context so we can avoid recreating masked context unless necessary. - // ReactFiberContext usually updates this cache but can't for newly-created instances. - if (isLegacyContextConsumer) { - cacheContext(workInProgress, unmaskedContext, context); - } - - return instance; -} -function callComponentWillMount(workInProgress, instance) { - startPhaseTimer(workInProgress, 'componentWillMount'); - var oldState = instance.state; - - if (typeof instance.componentWillMount === 'function') { - instance.componentWillMount(); - } - if (typeof instance.UNSAFE_componentWillMount === 'function') { - instance.UNSAFE_componentWillMount(); - } + if (typeof newChild === 'string' || typeof newChild === 'number') { + return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); + } - stopPhaseTimer(); + if (isArray(newChild)) { + return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); + } - if (oldState !== instance.state) { - { - warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component'); + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); } - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); - } -} -function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { - var oldState = instance.state; - startPhaseTimer(workInProgress, 'componentWillReceiveProps'); - if (typeof instance.componentWillReceiveProps === 'function') { - instance.componentWillReceiveProps(newProps, nextContext); - } - if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - } - stopPhaseTimer(); + if (isObject) { + throwOnInvalidObjectType(returnFiber, newChild); + } - if (instance.state !== oldState) { { - var componentName = getComponentName(workInProgress.type) || 'Component'; - if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { - didWarnAboutStateAssignmentForComponent.add(componentName); - warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); + if (typeof newChild === 'function') { + warnOnFunctionType(); } } - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); - } -} - -// Invokes the mount life-cycles on a previously never rendered instance. -function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { - { - checkClassInstance(workInProgress, ctor, newProps); - } - - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = emptyRefsObject; - - var contextType = ctor.contextType; - if (typeof contextType === 'object' && contextType !== null) { - instance.context = readContext$1(contextType); - } else { - var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - instance.context = getMaskedContext(workInProgress, unmaskedContext); - } - - { - if (instance.state === newProps) { - var componentName = getComponentName(ctor) || 'Component'; - if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { - didWarnAboutDirectlyAssigningPropsToState.add(componentName); - warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); + if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) { + // If the new child is undefined, and the return fiber is a composite + // component, throw an error. If Fiber return types are disabled, + // we already threw above. + switch (returnFiber.tag) { + case ClassComponent: + { + { + var instance = returnFiber.stateNode; + if (instance.render._isMockFunction) { + // We allow auto-mocks to proceed as if they're returning null. + break; + } + } + } + // Intentionally fall through to the next case, which handles both + // functions and classes + // eslint-disable-next-lined no-fallthrough + case FunctionComponent: + { + var Component = returnFiber.type; + invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component'); + } } } - if (workInProgress.mode & StrictMode) { - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + // Remaining cases are all treated as empty. + return deleteRemainingChildren(returnFiber, currentFirstChild); + } - ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); - } + return reconcileChildFibers; +} - if (warnAboutDeprecatedLifecycles) { - ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); - } - } +var reconcileChildFibers = ChildReconciler(true); +var mountChildFibers = ChildReconciler(false); - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - instance.state = workInProgress.memoizedState; - } +function cloneChildFibers(current$$1, workInProgress) { + !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - instance.state = workInProgress.memoizedState; + if (workInProgress.child === null) { + return; } - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { - callComponentWillMount(workInProgress, instance); - // If we had additional state updates during this life-cycle, let's - // process them now. - updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - instance.state = workInProgress.memoizedState; - } - } + var currentChild = workInProgress.child; + var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); + workInProgress.child = newChild; - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; + newChild.return = workInProgress; + while (currentChild.sibling !== null) { + currentChild = currentChild.sibling; + newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); + newChild.return = workInProgress; } + newChild.sibling = null; } -function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { - var instance = workInProgress.stateNode; +var NO_CONTEXT = {}; - var oldProps = workInProgress.memoizedProps; - instance.props = oldProps; +var contextStackCursor$1 = createCursor(NO_CONTEXT); +var contextFiberStackCursor = createCursor(NO_CONTEXT); +var rootInstanceStackCursor = createCursor(NO_CONTEXT); - var oldContext = instance.context; - var contextType = ctor.contextType; - var nextContext = void 0; - if (typeof contextType === 'object' && contextType !== null) { - nextContext = readContext$1(contextType); - } else { - var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); - } +function requiredContext(c) { + !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0; + return c; +} - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; +function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; +} - // Note: During these life-cycles, instance.props/instance.state are what - // ever the previously attempted to render - not the "current". However, - // during componentDidUpdate we pass the "current" props. +function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { - if (oldProps !== newProps || oldContext !== nextContext) { - callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); - } - } + // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + push(contextStackCursor$1, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); + // Now that we know this function doesn't throw, replace it. + pop(contextStackCursor$1, fiber); + push(contextStackCursor$1, nextRootContext, fiber); +} - resetHasForceUpdateBeforeProcessing(); +function popHostContainer(fiber) { + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); +} - var oldState = workInProgress.memoizedState; - var newState = instance.state = oldState; - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - newState = workInProgress.memoizedState; +function getHostContext() { + var context = requiredContext(contextStackCursor$1.current); + return context; +} + +function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var nextContext = getChildHostContext(context, fiber.type, rootInstance); + + // Don't push this Fiber's context unless it's unique. + if (context === nextContext) { + return; } - if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; - } - return false; + + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); +} + +function popHostContext(fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + if (contextFiberStackCursor.current !== fiber) { + return; } - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - newState = workInProgress.memoizedState; + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); +} + +var NoEffect$1 = /* */0; +var UnmountSnapshot = /* */2; +var UnmountMutation = /* */4; +var MountMutation = /* */8; +var UnmountLayout = /* */16; +var MountLayout = /* */32; +var MountPassive = /* */64; +var UnmountPassive = /* */128; + +var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; + + +var didWarnAboutMismatchedHooksForComponent = void 0; +{ + didWarnAboutMismatchedHooksForComponent = new Set(); +} + +// These are set right before calling the component. +var renderExpirationTime = NoWork; +// The work-in-progress fiber. I've named it differently to distinguish it from +// the work-in-progress hook. +var currentlyRenderingFiber$1 = null; + +// Hooks are stored as a linked list on the fiber's memoizedState field. The +// current hook list is the list that belongs to the current fiber. The +// work-in-progress hook list is a new list that will be added to the +// work-in-progress fiber. +var currentHook = null; +var nextCurrentHook = null; +var firstWorkInProgressHook = null; +var workInProgressHook = null; +var nextWorkInProgressHook = null; + +var remainingExpirationTime = NoWork; +var componentUpdateQueue = null; +var sideEffectTag = 0; + +// Updates scheduled during render will trigger an immediate re-render at the +// end of the current pass. We can't store these updates on the normal queue, +// because if the work is aborted, they should be discarded. Because this is +// a relatively rare case, we also don't want to add an additional field to +// either the hook or queue object types. So we store them in a lazily create +// map of queue -> render-phase updates, which are discarded once the component +// completes without re-rendering. + +// 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; + +// In DEV, this is the name of the currently executing primitive hook +var currentHookNameInDev = null; + +// In DEV, this list ensures that hooks are called in the same order between renders. +// The list stores the order of hooks used during the initial render (mount). +// Subsequent renders (updates) reference this list. +var hookTypesDev = null; +var hookTypesUpdateIndexDev = -1; + +function mountHookTypesDev() { + { + var hookName = currentHookNameInDev; + + if (hookTypesDev === null) { + hookTypesDev = [hookName]; + } else { + hookTypesDev.push(hookName); + } } +} - var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); +function updateHookTypesDev() { + { + var hookName = currentHookNameInDev; - if (shouldUpdate) { - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { - startPhaseTimer(workInProgress, 'componentWillMount'); - if (typeof instance.componentWillMount === 'function') { - instance.componentWillMount(); - } - if (typeof instance.UNSAFE_componentWillMount === 'function') { - instance.UNSAFE_componentWillMount(); + if (hookTypesDev !== null) { + hookTypesUpdateIndexDev++; + if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { + warnOnHookMismatchInDev(hookName); } - stopPhaseTimer(); - } - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; - } - } else { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; } - - // If shouldComponentUpdate returned false, we should still update the - // memoized state to indicate that this work can be reused. - workInProgress.memoizedProps = newProps; - workInProgress.memoizedState = newState; } +} - // Update the existing instance's state, props, and context pointers even - // if shouldComponentUpdate returns false. - instance.props = newProps; - instance.state = newState; - instance.context = nextContext; +function warnOnHookMismatchInDev(currentHookName) { + { + var componentName = getComponentName(currentlyRenderingFiber$1.type); + if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { + didWarnAboutMismatchedHooksForComponent.add(componentName); - return shouldUpdate; -} + if (hookTypesDev !== null) { + var table = ''; -// Invokes the update life-cycles and returns false if it shouldn't rerender. -function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) { - var instance = workInProgress.stateNode; + var secondColumnStart = 30; - var oldProps = workInProgress.memoizedProps; - instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); + for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i]; + var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; - var oldContext = instance.context; - var contextType = ctor.contextType; - var nextContext = void 0; - if (typeof contextType === 'object' && contextType !== null) { - nextContext = readContext$1(contextType); - } else { - var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); - } + var row = i + 1 + '. ' + oldHookName; - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; + // Extra space so second column lines up + // lol @ IE not supporting String#repeat + while (row.length < secondColumnStart) { + row += ' '; + } - // Note: During these life-cycles, instance.props/instance.state are what - // ever the previously attempted to render - not the "current". However, - // during componentDidUpdate we pass the "current" props. + row += newHookName + '\n'; - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { - if (oldProps !== newProps || oldContext !== nextContext) { - callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + table += row; + } + + warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table); + } } } +} - resetHasForceUpdateBeforeProcessing(); +function throwInvalidHookError() { + 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.'); +} - var oldState = workInProgress.memoizedState; - var newState = instance.state = oldState; - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - newState = workInProgress.memoizedState; +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; } - if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } + { + // 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(', ') + ']'); } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Snapshot; - } + } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (is(nextDeps[i], prevDeps[i])) { + continue; } return false; } + return true; +} - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - newState = workInProgress.memoizedState; +function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) { + renderExpirationTime = nextRenderExpirationTime; + currentlyRenderingFiber$1 = workInProgress; + nextCurrentHook = current !== null ? current.memoizedState : null; + + { + hookTypesDev = current !== null ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; } - var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + // The following should have already been reset + // currentHook = null; + // workInProgressHook = null; - if (shouldUpdate) { - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { - startPhaseTimer(workInProgress, 'componentWillUpdate'); - if (typeof instance.componentWillUpdate === 'function') { - instance.componentWillUpdate(newProps, newState, nextContext); - } - if (typeof instance.UNSAFE_componentWillUpdate === 'function') { - instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); - } - stopPhaseTimer(); - } - if (typeof instance.componentDidUpdate === 'function') { - workInProgress.effectTag |= Update; - } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - workInProgress.effectTag |= Snapshot; - } - } else { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } + // remainingExpirationTime = NoWork; + // componentUpdateQueue = null; + + // didScheduleRenderPhaseUpdate = false; + // renderPhaseUpdates = null; + // numberOfReRenders = 0; + // sideEffectTag = 0; + + // TODO Warn if no hooks are used at all during mount, then some are used during update. + // Currently we will identify the update render as a mount because nextCurrentHook === null. + // This is tricky because it's valid for certain types of components (e.g. React.lazy) + + // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used. + // Non-stateful hooks (e.g. context) don't get added to memoizedState, + // so nextCurrentHook would be null during updates and mounts. + { + if (nextCurrentHook !== null) { + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + } else if (hookTypesDev !== null) { + // This dispatcher handles an edge case where a component is updating, + // but no stateful hooks have been used. + // We want to match the production code behavior (which will use HooksDispatcherOnMount), + // but with the extra DEV validation to ensure hooks ordering hasn't changed. + // This dispatcher does that. + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; + } else { + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Snapshot; + } + + var children = Component(props, refOrContext); + + if (didScheduleRenderPhaseUpdate) { + do { + didScheduleRenderPhaseUpdate = false; + numberOfReRenders += 1; + + // Start over from the beginning of the list + nextCurrentHook = current !== null ? current.memoizedState : null; + nextWorkInProgressHook = firstWorkInProgressHook; + + currentHook = null; + workInProgressHook = null; + componentUpdateQueue = null; + + { + // Also validate hook order for cascading updates. + hookTypesUpdateIndexDev = -1; } - } - // If shouldComponentUpdate returned false, we should still update the - // memoized props/state to indicate that this work can be reused. - workInProgress.memoizedProps = newProps; - workInProgress.memoizedState = newState; + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + + children = Component(props, refOrContext); + } while (didScheduleRenderPhaseUpdate); + + renderPhaseUpdates = null; + numberOfReRenders = 0; } - // Update the existing instance's state, props, and context pointers even - // if shouldComponentUpdate returns false. - instance.props = newProps; - instance.state = newState; - instance.context = nextContext; + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - return shouldUpdate; + var renderedWork = currentlyRenderingFiber$1; + + renderedWork.memoizedState = firstWorkInProgressHook; + renderedWork.expirationTime = remainingExpirationTime; + renderedWork.updateQueue = componentUpdateQueue; + renderedWork.effectTag |= sideEffectTag; + + { + renderedWork._debugHookTypes = hookTypesDev; + } + + // This check uses currentHook so that it works the same in DEV and prod bundles. + // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. + var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; + + currentHook = null; + nextCurrentHook = null; + firstWorkInProgressHook = null; + workInProgressHook = null; + nextWorkInProgressHook = null; + + { + currentHookNameInDev = null; + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + } + + remainingExpirationTime = NoWork; + componentUpdateQueue = null; + sideEffectTag = 0; + + // These were reset above + // didScheduleRenderPhaseUpdate = false; + // renderPhaseUpdates = null; + // numberOfReRenders = 0; + + !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0; + + return children; } -var didWarnAboutMaps = void 0; -var didWarnAboutGenerators = void 0; -var didWarnAboutStringRefInStrictMode = void 0; -var ownerHasKeyUseWarning = void 0; -var ownerHasFunctionTypeWarning = void 0; -var warnForMissingKey = function (child) {}; +function bailoutHooks(current, workInProgress, expirationTime) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.effectTag &= ~(Passive | Update); + if (current.expirationTime <= expirationTime) { + current.expirationTime = NoWork; + } +} -{ - didWarnAboutMaps = false; - didWarnAboutGenerators = false; - didWarnAboutStringRefInStrictMode = {}; +function resetHooks() { + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - ownerHasKeyUseWarning = {}; - ownerHasFunctionTypeWarning = {}; + // This is used to reset the state of this module when a component throws. + // It's also called inside mountIndeterminateComponent if we determine the + // component is a module-style component. + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; - warnForMissingKey = function (child) { - if (child === null || typeof child !== 'object') { - return; - } - if (!child._store || child._store.validated || child.key != null) { - return; - } - !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; - child._store.validated = true; + currentHook = null; + nextCurrentHook = null; + firstWorkInProgressHook = null; + workInProgressHook = null; + nextWorkInProgressHook = null; - var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev(); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; + { + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + + currentHookNameInDev = null; + } + + remainingExpirationTime = NoWork; + componentUpdateQueue = null; + sideEffectTag = 0; + + didScheduleRenderPhaseUpdate = false; + renderPhaseUpdates = null; + numberOfReRenders = 0; +} + +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + + baseState: null, + queue: null, + baseUpdate: null, + + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list + firstWorkInProgressHook = workInProgressHook = hook; + } else { + // Append to the end of the list + workInProgressHook = workInProgressHook.next = hook; + } + return workInProgressHook; +} + +function updateWorkInProgressHook() { + // This function is used both for updates and for re-renders triggered by a + // render phase update. It assumes there is either a current hook we can + // clone, or a work-in-progress hook from a previous render pass that we can + // use as a base. When we reach the end of the base list, we must switch to + // the dispatcher used for mounts. + if (nextWorkInProgressHook !== null) { + // There's already a work-in-progress. Reuse it. + workInProgressHook = nextWorkInProgressHook; + nextWorkInProgressHook = workInProgressHook.next; + + currentHook = nextCurrentHook; + nextCurrentHook = currentHook !== null ? currentHook.next : null; + } else { + // Clone from the current hook. + !(nextCurrentHook !== null) ? invariant(false, 'Rendered more hooks than during the previous render.') : void 0; + currentHook = nextCurrentHook; + + var newHook = { + memoizedState: currentHook.memoizedState, + + baseState: currentHook.baseState, + queue: currentHook.queue, + baseUpdate: currentHook.baseUpdate, + + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list. + workInProgressHook = firstWorkInProgressHook = newHook; + } else { + // Append to the end of the list. + workInProgressHook = workInProgressHook.next = newHook; } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + nextCurrentHook = currentHook.next; + } + return workInProgressHook; +} - warning$1(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.'); +function createFunctionComponentUpdateQueue() { + return { + lastEffect: null }; } -var isArray = Array.isArray; +function basicStateReducer(state, action) { + return typeof action === 'function' ? action(state) : action; +} -function coerceRef(returnFiber, current$$1, element) { - var mixedRef = element.ref; - if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { - { - if (returnFiber.mode & StrictMode) { - var componentName = getComponentName(returnFiber.type) || 'Component'; - if (!didWarnAboutStringRefInStrictMode[componentName]) { - warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber)); - didWarnAboutStringRefInStrictMode[componentName] = true; +function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + var initialState = void 0; + if (init !== undefined) { + initialState = init(initialArg); + } else { + initialState = initialArg; + } + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + last: null, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, + // Flow doesn't know this is non-null, but we do. + currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} + +function updateReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + !(queue !== null) ? invariant(false, 'Should have a queue. This is likely a bug in React. Please file an issue.') : void 0; + + queue.lastRenderedReducer = reducer; + + if (numberOfReRenders > 0) { + // This is a re-render. Apply the new render phase updates to the previous + 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 = hook.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; + newState = reducer(newState, _action); + update = update.next; + } while (update !== null); + + // Mark that the fiber performed work, but only if the new state is + // different from the current state. + if (!is(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); } + + hook.memoizedState = newState; + // Don't persist the state accumlated from the render phase updates to + // the base state unless the queue is empty. + // TODO: Not sure if this is the desired semantics, but it's what we + // do for gDSFP. I can't remember why. + if (hook.baseUpdate === queue.last) { + hook.baseState = newState; + } + + queue.lastRenderedState = newState; + + return [newState, _dispatch]; } } + return [hook.memoizedState, _dispatch]; + } - if (element._owner) { - var owner = element._owner; - var inst = void 0; - if (owner) { - var ownerFiber = owner; - !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs.') : void 0; - inst = ownerFiber.stateNode; - } - !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0; - var stringRef = '' + mixedRef; - // Check if previous string ref matches new string ref - if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) { - return current$$1.ref; - } - var ref = function (value) { - var refs = inst.refs; - if (refs === emptyRefsObject) { - // This is a lazy pooled frozen object, so we need to initialize. - refs = inst.refs = {}; + // The last update in the entire queue + var last = queue.last; + // The last update that is part of the base state. + var baseUpdate = hook.baseUpdate; + var baseState = hook.baseState; + + // Find the first unprocessed update. + var first = void 0; + if (baseUpdate !== null) { + if (last !== null) { + // For the first update, the queue is a circular linked list where + // `queue.last.next = queue.first`. Once the first update commits, and + // the `baseUpdate` is no longer empty, we can unravel the list. + last.next = null; + } + first = baseUpdate.next; + } else { + first = last !== null ? last.next : null; + } + if (first !== null) { + var _newState = baseState; + var newBaseState = null; + var newBaseUpdate = null; + var prevUpdate = baseUpdate; + var _update = first; + var didSkip = false; + do { + var updateExpirationTime = _update.expirationTime; + if (updateExpirationTime < renderExpirationTime) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + if (!didSkip) { + didSkip = true; + newBaseUpdate = prevUpdate; + newBaseState = _newState; } - if (value === null) { - delete refs[stringRef]; + // Update the remaining priority in the queue. + if (updateExpirationTime > remainingExpirationTime) { + remainingExpirationTime = updateExpirationTime; + } + } else { + // Process this update. + if (_update.eagerReducer === reducer) { + // If this update was processed eagerly, and its reducer matches the + // current reducer, we can use the eagerly computed state. + _newState = _update.eagerState; } else { - refs[stringRef] = value; + var _action2 = _update.action; + _newState = reducer(_newState, _action2); } - }; - ref._stringRef = stringRef; - return ref; - } else { - !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0; - !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0; + } + prevUpdate = _update; + _update = _update.next; + } while (_update !== null && _update !== first); + + if (!didSkip) { + newBaseUpdate = prevUpdate; + newBaseState = _newState; } - } - return mixedRef; -} -function throwOnInvalidObjectType(returnFiber, newChild) { - if (returnFiber.type !== 'textarea') { - var addendum = ''; - { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev(); + // Mark that the fiber performed work, but only if the new state is + // different from the current state. + if (!is(_newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); } - invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum); + + hook.memoizedState = _newState; + hook.baseUpdate = newBaseUpdate; + hook.baseState = newBaseState; + + queue.lastRenderedState = _newState; } -} -function warnOnFunctionType() { - var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev(); + var dispatch = queue.dispatch; + return [hook.memoizedState, dispatch]; +} - if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { - return; +function mountState(initialState) { + var hook = mountWorkInProgressHook(); + if (typeof initialState === 'function') { + initialState = initialState(); } - ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + last: null, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, + // Flow doesn't know this is non-null, but we do. + currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} - warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.'); +function updateState(initialState) { + return updateReducer(basicStateReducer, initialState); } -// This wrapper function exists because I expect to clone the code in each path -// to be able to optimize each path individually by branching early. This needs -// a compiler or we can do it manually. Helpers that don't need this branching -// live outside of this function. -function ChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (!shouldTrackSideEffects) { - // Noop. - return; - } - // Deletions are added in reversed order so we add it to the front. - // At this point, the return fiber's effect list is empty except for - // deletions, so we can just append the deletion to the list. The remaining - // effects aren't added until the complete phase. Once we implement - // resuming, this may not be true. - var last = returnFiber.lastEffect; - if (last !== null) { - last.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; +function pushEffect(tag, create, destroy, deps) { + var effect = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + // Circular + next: null + }; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var _lastEffect = componentUpdateQueue.lastEffect; + if (_lastEffect === null) { + componentUpdateQueue.lastEffect = effect.next = effect; } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + var firstEffect = _lastEffect.next; + _lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } - childToDelete.nextEffect = null; - childToDelete.effectTag = Deletion; } + return effect; +} - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) { - // Noop. - return null; - } - - // TODO: For the shouldClone case, this could be micro-optimized a bit by - // assuming that after the first child we've already added everything. - var childToDelete = currentFirstChild; - while (childToDelete !== null) { - deleteChild(returnFiber, childToDelete); - childToDelete = childToDelete.sibling; - } - return null; +function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + var ref = { current: initialValue }; + { + Object.seal(ref); } + hook.memoizedState = ref; + return ref; +} - function mapRemainingChildren(returnFiber, currentFirstChild) { - // Add the remaining children to a temporary map so that we can find them by - // keys quickly. Implicit (null) keys get added to this set with their index - var existingChildren = new Map(); +function updateRef(initialValue) { + var hook = updateWorkInProgressHook(); + return hook.memoizedState; +} - var existingChild = currentFirstChild; - while (existingChild !== null) { - if (existingChild.key !== null) { - existingChildren.set(existingChild.key, existingChild); - } else { - existingChildren.set(existingChild.index, existingChild); - } - existingChild = existingChild.sibling; - } - return existingChildren; - } +function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + sideEffectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps); +} - function useFiber(fiber, pendingProps, expirationTime) { - // We currently set sibling to null and index to 0 here because it is easy - // to forget to do before returning it. E.g. for the single child case. - var clone = createWorkInProgress(fiber, pendingProps, expirationTime); - clone.index = 0; - clone.sibling = null; - return clone; - } +function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var destroy = undefined; - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) { - // Noop. - return lastPlacedIndex; - } - var current$$1 = newFiber.alternate; - if (current$$1 !== null) { - var oldIndex = current$$1.index; - if (oldIndex < lastPlacedIndex) { - // This is a move. - newFiber.effectTag = Placement; - return lastPlacedIndex; - } else { - // This item can stay in place. - return oldIndex; + if (currentHook !== null) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + if (nextDeps !== null) { + var prevDeps = prevEffect.deps; + if (areHookInputsEqual(nextDeps, prevDeps)) { + pushEffect(NoEffect$1, create, destroy, nextDeps); + return; } - } else { - // This is an insertion. - newFiber.effectTag = Placement; - return lastPlacedIndex; } } - function placeSingleChild(newFiber) { - // This is simpler for the single child case. We only need to do a - // placement for inserting new children. - if (shouldTrackSideEffects && newFiber.alternate === null) { - newFiber.effectTag = Placement; - } - return newFiber; - } + sideEffectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps); +} - function updateTextNode(returnFiber, current$$1, textContent, expirationTime) { - if (current$$1 === null || current$$1.tag !== HostText) { - // Insert - var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, textContent, expirationTime); - existing.return = returnFiber; - return existing; - } - } +function mountEffect(create, deps) { + return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps); +} - function updateElement(returnFiber, current$$1, element, expirationTime) { - if (current$$1 !== null && current$$1.elementType === element.type) { - // Move based on index - var existing = useFiber(current$$1, element.props, expirationTime); - existing.ref = coerceRef(returnFiber, current$$1, element); - existing.return = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - // Insert - var created = createFiberFromElement(element, returnFiber.mode, expirationTime); - created.ref = coerceRef(returnFiber, current$$1, element); - created.return = returnFiber; - return created; +function updateEffect(create, deps) { + return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps); +} + +function mountLayoutEffect(create, deps) { + return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps); +} + +function updateLayoutEffect(create, deps) { + return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps); +} + +function imperativeHandleEffect(create, ref) { + if (typeof ref === 'function') { + var refCallback = ref; + var _inst = create(); + refCallback(_inst); + return function () { + refCallback(null); + }; + } else if (ref !== null && ref !== undefined) { + var refObject = ref; + { + !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0; } + var _inst2 = create(); + refObject.current = _inst2; + return function () { + refObject.current = null; + }; } +} - function updatePortal(returnFiber, current$$1, portal, expirationTime) { - if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) { - // Insert - var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, portal.children || [], expirationTime); - existing.return = returnFiber; - return existing; - } +function mountImperativeHandle(ref, create, deps) { + { + !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0; } - function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) { - if (current$$1 === null || current$$1.tag !== Fragment) { - // Insert - var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, fragment, expirationTime); - existing.return = returnFiber; - return existing; - } + // TODO: If deps are provided, should we skip comparing the ref itself? + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + + return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} + +function updateImperativeHandle(ref, create, deps) { + { + !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0; } - function createChild(returnFiber, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } + // TODO: If deps are provided, should we skip comparing the ref itself? + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); - _created.ref = coerceRef(returnFiber, null, newChild); - _created.return = returnFiber; - return _created; - } - case REACT_PORTAL_TYPE: - { - var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); - _created2.return = returnFiber; - return _created2; - } - } + return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} - if (isArray(newChild) || getIteratorFn(newChild)) { - var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); - _created3.return = returnFiber; - return _created3; - } +function mountDebugValue(value, formatterFn) { + // This hook is normally a no-op. + // The react-debug-hooks package injects its own implementation + // so that e.g. DevTools can display custom hook values. +} - throwOnInvalidObjectType(returnFiber, newChild); - } +var updateDebugValue = mountDebugValue; - { - if (typeof newChild === 'function') { - warnOnFunctionType(); +function mountCallback(callback, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + hook.memoizedState = [callback, nextDeps]; + return callback; +} + +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; } } - - return null; } + hook.memoizedState = [callback, nextDeps]; + return callback; +} - function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { - // Update the fiber if the keys match, otherwise return null. - - var key = oldFiber !== null ? oldFiber.key : null; +function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - if (key !== null) { - return null; +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + // Assume these are defined. If they're not, areHookInputsEqual will warn. + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; } - return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); } + } + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - if (newChild.key === key) { - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); - } - return updateElement(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - case REACT_PORTAL_TYPE: - { - if (newChild.key === key) { - return updatePortal(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - } +// in a test-like environment, we want to warn if dispatchAction() +// is called outside of a batchedUpdates/TestUtils.act(...) call. +var shouldWarnForUnbatchedSetState = false; - if (isArray(newChild) || getIteratorFn(newChild)) { - if (key !== null) { - return null; - } +{ + // jest isn't a 'global', it's just exposed to tests via a wrapped function + // further, this isn't a test file, so flow doesn't recognize the symbol. So... + // $FlowExpectedError - because requirements don't give a damn about your type sigs. + if ('undefined' !== typeof jest) { + shouldWarnForUnbatchedSetState = true; + } +} - return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); - } +function dispatchAction(fiber, 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; - throwOnInvalidObjectType(returnFiber, newChild); - } + { + !(arguments.length <= 3) ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0; + } - { - if (typeof newChild === 'function') { - warnOnFunctionType(); + var alternate = fiber.alternate; + if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) { + // 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 = { + expirationTime: renderExpirationTime, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }; + if (renderPhaseUpdates === null) { + renderPhaseUpdates = new Map(); + } + var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); + if (firstRenderPhaseUpdate === undefined) { + renderPhaseUpdates.set(queue, update); + } else { + // Append the update to the end of the list. + var lastRenderPhaseUpdate = firstRenderPhaseUpdate; + while (lastRenderPhaseUpdate.next !== null) { + lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; } + lastRenderPhaseUpdate.next = update; } + } else { + flushPassiveEffects(); - return null; - } + var currentTime = requestCurrentTime(); + var _expirationTime = computeExpirationForFiber(currentTime, fiber); - function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys, so we neither have to check the old nor - // new node for the key. If both are text nodes, they match. - var matchedFiber = existingChildren.get(newIdx) || null; - return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); + var _update2 = { + expirationTime: _expirationTime, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }; + + // Append the update to the end of the list. + var _last = queue.last; + if (_last === null) { + // This is the first update. Create a circular list. + _update2.next = _update2; + } else { + var first = _last.next; + if (first !== null) { + // Still circular. + _update2.next = first; + } + _last.next = _update2; } + queue.last = _update2; - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); - } - return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); + if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) { + // The queue is currently empty, which means we can eagerly compute the + // next state before entering the render phase. If the new state is the + // same as the current state, we may be able to bail out entirely. + var _lastRenderedReducer = queue.lastRenderedReducer; + if (_lastRenderedReducer !== null) { + var prevDispatcher = void 0; + { + prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + } + try { + var currentState = queue.lastRenderedState; + var _eagerState = _lastRenderedReducer(currentState, action); + // Stash the eagerly computed state, and the reducer used to compute + // it, on the update object. If the reducer hasn't changed by the + // time we enter the render phase, then the eager state can be used + // without calling the reducer again. + _update2.eagerReducer = _lastRenderedReducer; + _update2.eagerState = _eagerState; + if (is(_eagerState, currentState)) { + // Fast path. We can bail out without scheduling React to re-render. + // It's still possible that we'll need to rebase this update later, + // if the component re-renders for a different reason and by that + // time the reducer has changed. + return; } - case REACT_PORTAL_TYPE: + } catch (error) { + // Suppress the error. It will throw again in the render phase. + } finally { { - var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); + ReactCurrentDispatcher$1.current = prevDispatcher; } + } } - - if (isArray(newChild) || getIteratorFn(newChild)) { - var _matchedFiber3 = existingChildren.get(newIdx) || null; - return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); - } - - throwOnInvalidObjectType(returnFiber, newChild); } - { - if (typeof newChild === 'function') { - warnOnFunctionType(); + if (shouldWarnForUnbatchedSetState === true) { + warnIfNotCurrentlyBatchingInDev(fiber); } } - - return null; + scheduleWork(fiber, _expirationTime); } +} - /** - * Warns if there is a duplicate or missing key - */ - function warnOnInvalidKey(child, knownKeys) { - { - if (typeof child !== 'object' || child === null) { - return knownKeys; - } - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(child); - var key = child.key; - if (typeof key !== 'string') { - break; - } - if (knownKeys === null) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); - break; - default: - break; - } - } - return knownKeys; - } +var ContextOnlyDispatcher = { + readContext: readContext, - function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { - // This algorithm can't optimize by searching from boths ends since we - // don't have backpointers on fibers. I'm trying to see how far we can get - // with that model. If it ends up not being worth the tradeoffs, we can - // add it later. + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError +}; - // Even with a two ended optimization, we'd want to optimize for the case - // where there are few changes and brute force the comparison instead of - // going for the Map. It'd like to explore hitting that path first in - // forward-only mode and only go for the Map once we notice that we need - // lots of look ahead. This doesn't handle reversal as well as two ended - // search but that's unusual. Besides, for the two ended optimization to - // work on Iterables, we'd need to copy the whole set. +var HooksDispatcherOnMountInDEV = null; +var HooksDispatcherOnMountWithHookTypesInDEV = null; +var HooksDispatcherOnUpdateInDEV = null; +var InvalidNestedHooksDispatcherOnMountInDEV = null; +var InvalidNestedHooksDispatcherOnUpdateInDEV = null; - // In this first iteration, we'll just live with hitting the bad case - // (adding everything to a Map) in for every insert/move. +{ + var warnInvalidContextAccess = function () { + 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().'); + }; - // If you change this code, also update reconcileChildrenIterator() which - // uses the same algorithm. + var warnInvalidHookAccess = function () { + 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'); + }; - { - // First, validate keys. - var knownKeys = null; - for (var i = 0; i < newChildren.length; i++) { - var child = newChildren[i]; - knownKeys = warnOnInvalidKey(child, knownKeys); + HooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + mountHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - var resultingFirstChild = null; - var previousNewFiber = null; - - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; - for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (oldFiber === null) { - oldFiber = nextOldFiber; - } - break; + HooksDispatcherOnMountWithHookTypesInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - - if (newIdx === newChildren.length) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); - if (!_newFiber) { - continue; - } - lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber; - } else { - previousNewFiber.sibling = _newFiber; - } - previousNewFiber = _newFiber; + HooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - return resultingFirstChild; + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return updateRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return updateDebugValue(value, formatterFn); } + }; - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); - if (_newFiber2) { - if (shouldTrackSideEffects) { - if (_newFiber2.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); - } - } - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber2; - } else { - previousNewFiber.sibling = _newFiber2; - } - previousNewFiber = _newFiber2; + InvalidNestedHooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); + InvalidNestedHooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(value, formatterFn); } + }; +} - return resultingFirstChild; +var commitTime = 0; +var profilerStartTime = -1; + +function getCommitTime() { + return commitTime; +} + +function recordCommitTime() { + if (!enableProfilerTimer) { + return; } + commitTime = scheduler.unstable_now(); +} - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { - // This is the same implementation as reconcileChildrenArray(), - // but using the iterator instead. +function startProfilerTimer(fiber) { + if (!enableProfilerTimer) { + return; + } - var iteratorFn = getIteratorFn(newChildrenIterable); - !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0; + profilerStartTime = scheduler.unstable_now(); - { - // We don't support rendering Generators because it's a mutation. - // See https://github.com/facebook/react/issues/12995 - if (typeof Symbol === 'function' && - // $FlowFixMe Flow doesn't know about toStringTag - newChildrenIterable[Symbol.toStringTag] === 'Generator') { - !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0; - didWarnAboutGenerators = true; - } + if (fiber.actualStartTime < 0) { + fiber.actualStartTime = scheduler.unstable_now(); + } +} - // Warn about using Maps as children - if (newChildrenIterable.entries === iteratorFn) { - !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; - } +function stopProfilerTimerIfRunning(fiber) { + if (!enableProfilerTimer) { + return; + } + profilerStartTime = -1; +} - // First, validate keys. - // We'll get a different iterator later for the main pass. - var _newChildren = iteratorFn.call(newChildrenIterable); - if (_newChildren) { - var knownKeys = null; - var _step = _newChildren.next(); - for (; !_step.done; _step = _newChildren.next()) { - var child = _step.value; - knownKeys = warnOnInvalidKey(child, knownKeys); - } - } +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (!enableProfilerTimer) { + return; + } + + if (profilerStartTime >= 0) { + var elapsedTime = scheduler.unstable_now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + if (overrideBaseTime) { + fiber.selfBaseDuration = elapsedTime; } + profilerStartTime = -1; + } +} - var newChildren = iteratorFn.call(newChildrenIterable); - !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0; +// The deepest Fiber on the stack involved in a hydration context. +// This may have been an insertion or a hydration. +var hydrationParentFiber = null; +var nextHydratableInstance = null; +var isHydrating = false; - var resultingFirstChild = null; - var previousNewFiber = null; +function enterHydrationState(fiber) { + if (!supportsHydration) { + return false; + } - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; + var parentInstance = fiber.stateNode.containerInfo; + nextHydratableInstance = getFirstHydratableChild(parentInstance); + hydrationParentFiber = fiber; + isHydrating = true; + return true; +} - var step = newChildren.next(); - for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (!oldFiber) { - oldFiber = nextOldFiber; - } +function reenterHydrationStateFromDehydratedSuspenseInstance(fiber) { + if (!supportsHydration) { + return false; + } + + var suspenseInstance = fiber.stateNode; + nextHydratableInstance = getNextHydratableSibling(suspenseInstance); + popToNextHostParent(fiber); + isHydrating = true; + return true; +} + +function deleteHydratableInstance(returnFiber, instance) { + { + switch (returnFiber.tag) { + case HostRoot: + didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); + break; + case HostComponent: + didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); break; - } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } - } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; - } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; } + } - if (step.done) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; - } + var childToDelete = createFiberFromHostInstanceForDeletion(); + childToDelete.stateNode = instance; + childToDelete.return = returnFiber; + childToDelete.effectTag = Deletion; - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber3 = createChild(returnFiber, step.value, expirationTime); - if (_newFiber3 === null) { - continue; + // This might seem like it belongs on progressedFirstDeletion. However, + // these children are not part of the reconciliation list of children. + // Even if we abort and rereconcile the children, that will try to hydrate + // again and the nodes are still in the host tree so these will be + // recreated. + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } +} + +function insertNonHydratedInstance(returnFiber, fiber) { + fiber.effectTag |= Placement; + { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + switch (fiber.tag) { + case HostComponent: + var type = fiber.type; + var props = fiber.pendingProps; + didNotFindHydratableContainerInstance(parentContainer, type, props); + break; + case HostText: + var text = fiber.pendingProps; + didNotFindHydratableContainerTextInstance(parentContainer, text); + break; + case SuspenseComponent: + + break; + } + break; } - lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber3; - } else { - previousNewFiber.sibling = _newFiber3; + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + switch (fiber.tag) { + case HostComponent: + var _type = fiber.type; + var _props = fiber.pendingProps; + didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props); + break; + case HostText: + var _text = fiber.pendingProps; + didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); + break; + case SuspenseComponent: + didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance); + break; + } + break; } - previousNewFiber = _newFiber3; - } - return resultingFirstChild; + default: + return; } + } +} - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); - if (_newFiber4 !== null) { - if (shouldTrackSideEffects) { - if (_newFiber4.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); - } +function tryHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent: + { + var type = fiber.type; + var props = fiber.pendingProps; + var instance = canHydrateInstance(nextInstance, type, props); + if (instance !== null) { + fiber.stateNode = instance; + return true; } - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber4; - } else { - previousNewFiber.sibling = _newFiber4; + return false; + } + case HostText: + { + var text = fiber.pendingProps; + var textInstance = canHydrateTextInstance(nextInstance, text); + if (textInstance !== null) { + fiber.stateNode = textInstance; + return true; } - previousNewFiber = _newFiber4; + return false; } - } + case SuspenseComponent: + { + if (enableSuspenseServerRenderer) { + var suspenseInstance = canHydrateSuspenseInstance(nextInstance); + if (suspenseInstance !== null) { + // Downgrade the tag to a dehydrated component until we've hydrated it. + fiber.tag = DehydratedSuspenseComponent; + fiber.stateNode = suspenseInstance; + return true; + } + } + return false; + } + default: + return false; + } +} - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); +function tryToClaimNextHydratableInstance(fiber) { + if (!isHydrating) { + return; + } + var nextInstance = nextHydratableInstance; + if (!nextInstance) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; + } + var firstAttemptedInstance = nextInstance; + if (!tryHydrate(fiber, nextInstance)) { + // If we can't hydrate this instance let's try the next one. + // We use this as a heuristic. It's based on intuition and not data so it + // might be flawed or unnecessary. + nextInstance = getNextHydratableSibling(firstAttemptedInstance); + if (!nextInstance || !tryHydrate(fiber, nextInstance)) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; } + // We matched the next one, we'll now assume that the first one was + // superfluous and we'll delete it. Since we can't eagerly delete it + // we'll have to schedule a deletion. To do that, this node needs a dummy + // fiber associated with it. + deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance); + } + hydrationParentFiber = fiber; + nextHydratableInstance = getFirstHydratableChild(nextInstance); +} - return resultingFirstChild; +function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { + if (!supportsHydration) { + invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); } - function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { - // There's no need to check for keys on text nodes since we don't have a - // way to define them. - if (currentFirstChild !== null && currentFirstChild.tag === HostText) { - // We already have an existing node so let's just update it and delete - // the rest. - deleteRemainingChildren(returnFiber, currentFirstChild.sibling); - var existing = useFiber(currentFirstChild, textContent, expirationTime); - existing.return = returnFiber; - return existing; - } - // The existing first child is not a text node so we need to create one - // and delete the existing ones. - deleteRemainingChildren(returnFiber, currentFirstChild); - var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; + var instance = fiber.stateNode; + var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); + // TODO: Type this specific to this type of component. + fiber.updateQueue = updatePayload; + // If the update payload indicates that there is a change or if there + // is a new ref we mark this as an update. + if (updatePayload !== null) { + return true; } + return false; +} - function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { - var key = element.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); - existing.ref = coerceRef(returnFiber, child, element); - existing.return = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; +function prepareToHydrateHostTextInstance(fiber) { + if (!supportsHydration) { + invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); + } + + var textInstance = fiber.stateNode; + var textContent = fiber.memoizedProps; + var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); + { + if (shouldUpdate) { + // We assume that prepareToHydrateHostTextInstance is called in a context where the + // hydration parent is the parent host component of this host text. + var returnFiber = hydrationParentFiber; + if (returnFiber !== null) { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); + break; + } + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); + break; + } } - } else { - deleteChild(returnFiber, child); } - child = child.sibling; } + } + return shouldUpdate; +} - if (element.type === REACT_FRAGMENT_TYPE) { - var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); - created.return = returnFiber; - return created; - } else { - var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); - _created4.ref = coerceRef(returnFiber, currentFirstChild, element); - _created4.return = returnFiber; - return _created4; - } +function skipPastDehydratedSuspenseInstance(fiber) { + if (!supportsHydration) { + invariant(false, 'Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); } + var suspenseInstance = fiber.stateNode; + !suspenseInstance ? invariant(false, 'Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.') : void 0; + nextHydratableInstance = getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); +} - function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { - var key = portal.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, portal.children || [], expirationTime); - existing.return = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; +function popToNextHostParent(fiber) { + var parent = fiber.return; + while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== DehydratedSuspenseComponent) { + parent = parent.return; } + hydrationParentFiber = parent; +} - // This API will tag the children with the side-effect of the reconciliation - // itself. They will be added to the side-effect list as we pass through the - // children and the parent. - function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { - // This function is not recursive. - // If the top level item is an array, we treat it as a set of children, - // not as a fragment. Nested arrays on the other hand will be treated as - // fragment nodes. Recursion happens at the normal flow. - - // Handle top level unkeyed fragments as if they were arrays. - // This leads to an ambiguity between <>{[...]} and <>.... - // We treat the ambiguous cases above the same. - var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; - if (isUnkeyedTopLevelFragment) { - newChild = newChild.props.children; - } +function popHydrationState(fiber) { + if (!supportsHydration) { + return false; + } + if (fiber !== hydrationParentFiber) { + // We're deeper than the current hydration context, inside an inserted + // tree. + return false; + } + if (!isHydrating) { + // If we're not currently hydrating but we're in a hydration context, then + // we were an insertion and now need to pop up reenter hydration of our + // siblings. + popToNextHostParent(fiber); + isHydrating = true; + return false; + } - // Handle object types - var isObject = typeof newChild === 'object' && newChild !== null; + var type = fiber.type; - if (isObject) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); - case REACT_PORTAL_TYPE: - return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); - } + // If we have any remaining hydratable nodes, we need to delete them now. + // We only do this deeper than head and body since they tend to have random + // other nodes in them. We also ignore components with pure text content in + // side of them. + // TODO: Better heuristic. + if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { + var nextInstance = nextHydratableInstance; + while (nextInstance) { + deleteHydratableInstance(fiber, nextInstance); + nextInstance = getNextHydratableSibling(nextInstance); } + } - if (typeof newChild === 'string' || typeof newChild === 'number') { - return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); - } + popToNextHostParent(fiber); + nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; + return true; +} - if (isArray(newChild)) { - return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); - } +function resetHydrationState() { + if (!supportsHydration) { + return; + } - if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); - } + hydrationParentFiber = null; + nextHydratableInstance = null; + isHydrating = false; +} - if (isObject) { - throwOnInvalidObjectType(returnFiber, newChild); - } +var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) { - // If the new child is undefined, and the return fiber is a composite - // component, throw an error. If Fiber return types are disabled, - // we already threw above. - switch (returnFiber.tag) { - case ClassComponent: - { - { - var instance = returnFiber.stateNode; - if (instance.render._isMockFunction) { - // We allow auto-mocks to proceed as if they're returning null. - break; - } - } - } - // Intentionally fall through to the next case, which handles both - // functions and classes - // eslint-disable-next-lined no-fallthrough - case FunctionComponent: - { - var Component = returnFiber.type; - invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component'); - } - } - } +var didReceiveUpdate = false; - // Remaining cases are all treated as empty. - return deleteRemainingChildren(returnFiber, currentFirstChild); - } +var didWarnAboutBadClass = void 0; +var didWarnAboutContextTypeOnFunctionComponent = void 0; +var didWarnAboutGetDerivedStateOnFunctionComponent = void 0; +var didWarnAboutFunctionRefs = void 0; +var didWarnAboutReassigningProps = void 0; - return reconcileChildFibers; +{ + didWarnAboutBadClass = {}; + didWarnAboutContextTypeOnFunctionComponent = {}; + didWarnAboutGetDerivedStateOnFunctionComponent = {}; + didWarnAboutFunctionRefs = {}; + didWarnAboutReassigningProps = false; } -var reconcileChildFibers = ChildReconciler(true); -var mountChildFibers = ChildReconciler(false); - -function cloneChildFibers(current$$1, workInProgress) { - !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; +function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) { + if (current$$1 === null) { + // If this is a fresh new component that hasn't been rendered yet, we + // won't update its child set by applying minimal side-effects. Instead, + // we will add them all to the child before it gets rendered. That means + // we can optimize this reconciliation pass by not tracking side-effects. + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + // If the current child is the same as the work in progress, it means that + // we haven't yet started any work on these children. Therefore, we use + // the clone algorithm to create a copy of all the current children. - if (workInProgress.child === null) { - return; + // If we had any progressed work already, that is invalid at this point so + // let's throw it out. + workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime); } +} - var currentChild = workInProgress.child; - var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - workInProgress.child = newChild; - - newChild.return = workInProgress; - while (currentChild.sibling !== null) { - currentChild = currentChild.sibling; - newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - newChild.return = workInProgress; - } - newChild.sibling = null; +function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) { + // This function is fork of reconcileChildren. It's used in cases where we + // want to reconcile without matching against the existing set. This has the + // effect of all current children being unmounted; even if the type and key + // are the same, the old child is unmounted and a new child is created. + // + // To do this, we're going to go through the reconcile algorithm twice. In + // the first pass, we schedule a deletion for all the current children by + // passing null. + workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); + // In the second pass, we mount the new children. The trick here is that we + // pass null in place of where we usually pass the current child set. This has + // the effect of remounting all children regardless of whether their their + // identity matches. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); } -// The deepest Fiber on the stack involved in a hydration context. -// This may have been an insertion or a hydration. -var hydrationParentFiber = null; -var nextHydratableInstance = null; -var isHydrating = false; +function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens after the first render suspends. + // We'll need to figure out if this is fine or can cause issues. -function enterHydrationState(fiber) { - if (!supportsHydration) { - return false; + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var parentInstance = fiber.stateNode.containerInfo; - nextHydratableInstance = getFirstHydratableChild(parentInstance); - hydrationParentFiber = fiber; - isHydrating = true; - return true; -} + var render = Component.render; + var ref = workInProgress.ref; -function deleteHydratableInstance(returnFiber, instance) { + // The rest is a fork of updateFunctionComponent + var nextChildren = void 0; + prepareToReadContext(workInProgress, renderExpirationTime); { - switch (returnFiber.tag) { - case HostRoot: - didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); - break; - case HostComponent: - didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); - break; + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime); + } } + setCurrentPhase(null); } - var childToDelete = createFiberFromHostInstanceForDeletion(); - childToDelete.stateNode = instance; - childToDelete.return = returnFiber; - childToDelete.effectTag = Deletion; - - // This might seem like it belongs on progressedFirstDeletion. However, - // these children are not part of the reconciliation list of children. - // Even if we abort and rereconcile the children, that will try to hydrate - // again and the nodes are still in the host tree so these will be - // recreated. - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; - } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + if (current$$1 !== null && !didReceiveUpdate) { + bailoutHooks(current$$1, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; } -function insertNonHydratedInstance(returnFiber, fiber) { - fiber.effectTag |= Placement; +function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + if (current$$1 === null) { + var type = Component.type; + if (isSimpleFunctionComponent(type) && Component.compare === null && + // SimpleMemoComponent codepath doesn't resolve outer props either. + Component.defaultProps === undefined) { + // If this is a plain function component without default props, + // and with only the default shallow comparison, we upgrade it + // to a SimpleMemoComponent to allow fast path updates. + workInProgress.tag = SimpleMemoComponent; + workInProgress.type = type; + { + validateFunctionComponentInDev(workInProgress, type); + } + return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime); + } + { + var innerPropTypes = type.propTypes; + if (innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(type), getCurrentFiberStackInDev); + } + } + var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime); + child.ref = workInProgress.ref; + child.return = workInProgress; + workInProgress.child = child; + return child; + } { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - switch (fiber.tag) { - case HostComponent: - var type = fiber.type; - var props = fiber.pendingProps; - didNotFindHydratableContainerInstance(parentContainer, type, props); - break; - case HostText: - var text = fiber.pendingProps; - didNotFindHydratableContainerTextInstance(parentContainer, text); - break; - } - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - switch (fiber.tag) { - case HostComponent: - var _type = fiber.type; - var _props = fiber.pendingProps; - didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props); - break; - case HostText: - var _text = fiber.pendingProps; - didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); - break; - } - break; - } - default: - return; + var _type = Component.type; + var _innerPropTypes = _type.propTypes; + if (_innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(_innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(_type), getCurrentFiberStackInDev); + } + } + var currentChild = current$$1.child; // This is always exactly one child + if (updateExpirationTime < renderExpirationTime) { + // This will be the props with resolved defaultProps, + // unlike current.memoizedProps which will be the unresolved ones. + var prevProps = currentChild.memoizedProps; + // Default to shallow comparison + var compare = Component.compare; + compare = compare !== null ? compare : shallowEqual; + if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } } + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime); + newChild.ref = workInProgress.ref; + newChild.return = workInProgress; + workInProgress.child = newChild; + return newChild; } -function tryHydrate(fiber, nextInstance) { - switch (fiber.tag) { - case HostComponent: - { - var type = fiber.type; - var props = fiber.pendingProps; - var instance = canHydrateInstance(nextInstance, type, props); - if (instance !== null) { - fiber.stateNode = instance; - return true; - } - return false; +function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens when the inner render suspends. + // We'll need to figure out if this is fine or can cause issues. + + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var outerMemoType = workInProgress.elementType; + if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { + // We warn when you define propTypes on lazy() + // so let's just skip over it to find memo() outer wrapper. + // Inner props for memo are validated later. + outerMemoType = refineResolvedLazyComponent(outerMemoType); } - case HostText: - { - var text = fiber.pendingProps; - var textInstance = canHydrateTextInstance(nextInstance, text); - if (textInstance !== null) { - fiber.stateNode = textInstance; - return true; - } - return false; + var outerPropTypes = outerMemoType && outerMemoType.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps) + 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev); } - default: - return false; - } -} - -function tryToClaimNextHydratableInstance(fiber) { - if (!isHydrating) { - return; - } - var nextInstance = nextHydratableInstance; - if (!nextInstance) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; + // Inner propTypes will be validated in the function component path. + } } - var firstAttemptedInstance = nextInstance; - if (!tryHydrate(fiber, nextInstance)) { - // If we can't hydrate this instance let's try the next one. - // We use this as a heuristic. It's based on intuition and not data so it - // might be flawed or unnecessary. - nextInstance = getNextHydratableSibling(firstAttemptedInstance); - if (!nextInstance || !tryHydrate(fiber, nextInstance)) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; + if (current$$1 !== null) { + var prevProps = current$$1.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { + didReceiveUpdate = false; + if (updateExpirationTime < renderExpirationTime) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } } - // We matched the next one, we'll now assume that the first one was - // superfluous and we'll delete it. Since we can't eagerly delete it - // we'll have to schedule a deletion. To do that, this node needs a dummy - // fiber associated with it. - deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance); } - hydrationParentFiber = fiber; - nextHydratableInstance = getFirstHydratableChild(nextInstance); + return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime); } -function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { - if (!supportsHydration) { - invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); +function updateFragment(current$$1, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateMode(current$$1, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps.children; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateProfiler(current$$1, workInProgress, renderExpirationTime) { + if (enableProfilerTimer) { + workInProgress.effectTag |= Update; } + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} - var instance = fiber.stateNode; - var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); - // TODO: Type this specific to this type of component. - fiber.updateQueue = updatePayload; - // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. - if (updatePayload !== null) { - return true; +function markRef(current$$1, workInProgress) { + var ref = workInProgress.ref; + if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) { + // Schedule a Ref effect + workInProgress.effectTag |= Ref; } - return false; } -function prepareToHydrateHostTextInstance(fiber) { - if (!supportsHydration) { - invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); +function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var textInstance = fiber.stateNode; - var textContent = fiber.memoizedProps; - var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); + var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); + var context = getMaskedContext(workInProgress, unmaskedContext); + + var nextChildren = void 0; + prepareToReadContext(workInProgress, renderExpirationTime); { - if (shouldUpdate) { - // We assume that prepareToHydrateHostTextInstance is called in a context where the - // hydration parent is the parent host component of this host text. - var returnFiber = hydrationParentFiber; - if (returnFiber !== null) { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); - break; - } - } + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime); } } + setCurrentPhase(null); } - return shouldUpdate; -} -function popToNextHostParent(fiber) { - var parent = fiber.return; - while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) { - parent = parent.return; + if (current$$1 !== null && !didReceiveUpdate) { + bailoutHooks(current$$1, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } - hydrationParentFiber = parent; + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; } -function popHydrationState(fiber) { - if (!supportsHydration) { - return false; - } - if (fiber !== hydrationParentFiber) { - // We're deeper than the current hydration context, inside an inserted - // tree. - return false; - } - if (!isHydrating) { - // If we're not currently hydrating but we're in a hydration context, then - // we were an insertion and now need to pop up reenter hydration of our - // siblings. - popToNextHostParent(fiber); - isHydrating = true; - return false; +function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var type = fiber.type; - - // If we have any remaining hydratable nodes, we need to delete them now. - // We only do this deeper than head and body since they tend to have random - // other nodes in them. We also ignore components with pure text content in - // side of them. - // TODO: Better heuristic. - if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { - var nextInstance = nextHydratableInstance; - while (nextInstance) { - deleteHydratableInstance(fiber, nextInstance); - nextInstance = getNextHydratableSibling(nextInstance); - } - } - - popToNextHostParent(fiber); - nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; - return true; -} - -function resetHydrationState() { - if (!supportsHydration) { - return; - } - - hydrationParentFiber = null; - nextHydratableInstance = null; - isHydrating = false; -} - -var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; - -var didWarnAboutBadClass = void 0; -var didWarnAboutContextTypeOnFunctionComponent = void 0; -var didWarnAboutGetDerivedStateOnFunctionComponent = void 0; -var didWarnAboutFunctionRefs = void 0; - -{ - didWarnAboutBadClass = {}; - didWarnAboutContextTypeOnFunctionComponent = {}; - didWarnAboutGetDerivedStateOnFunctionComponent = {}; - didWarnAboutFunctionRefs = {}; -} - -function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) { - if (current$$1 === null) { - // If this is a fresh new component that hasn't been rendered yet, we - // won't update its child set by applying minimal side-effects. Instead, - // we will add them all to the child before it gets rendered. That means - // we can optimize this reconciliation pass by not tracking side-effects. - workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); - } else { - // If the current child is the same as the work in progress, it means that - // we haven't yet started any work on these children. Therefore, we use - // the clone algorithm to create a copy of all the current children. - - // If we had any progressed work already, that is invalid at this point so - // let's throw it out. - workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime); - } -} - -function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) { - // This function is fork of reconcileChildren. It's used in cases where we - // want to reconcile without matching against the existing set. This has the - // effect of all current children being unmounted; even if the type and key - // are the same, the old child is unmounted and a new child is created. - // - // To do this, we're going to go through the reconcile algorithm twice. In - // the first pass, we schedule a deletion for all the current children by - // passing null. - workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); - // In the second pass, we mount the new children. The trick here is that we - // pass null in place of where we usually pass the current child set. This has - // the effect of remounting all children regardless of whether their their - // identity matches. - workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); -} - -function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { - var render = Component.render; - var ref = workInProgress.ref; - - // The rest is a fork of updateFunctionComponent - var nextChildren = void 0; - prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(current$$1, workInProgress, renderExpirationTime); - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - nextChildren = render(nextProps, ref); - setCurrentPhase(null); - } - nextChildren = finishHooks(render, nextProps, nextChildren, ref); - - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { - if (current$$1 === null) { - var type = Component.type; - if (isSimpleFunctionComponent(type) && Component.compare === null) { - // If this is a plain function component without default props, - // and with only the default shallow comparison, we upgrade it - // to a SimpleMemoComponent to allow fast path updates. - workInProgress.tag = SimpleMemoComponent; - workInProgress.type = type; - return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime); - } - var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime); - child.ref = workInProgress.ref; - child.return = workInProgress; - workInProgress.child = child; - return child; - } - var currentChild = current$$1.child; // This is always exactly one child - if (updateExpirationTime < renderExpirationTime) { - // This will be the props with resolved defaultProps, - // unlike current.memoizedProps which will be the unresolved ones. - var prevProps = currentChild.memoizedProps; - // Default to shallow comparison - var compare = Component.compare; - compare = compare !== null ? compare : shallowEqual; - if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - } - } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime); - newChild.ref = workInProgress.ref; - newChild.return = workInProgress; - workInProgress.child = newChild; - return newChild; -} - -function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { - if (current$$1 !== null && updateExpirationTime < renderExpirationTime) { - var prevProps = current$$1.memoizedProps; - if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - } - } - return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime); -} - -function updateFragment(current$$1, workInProgress, renderExpirationTime) { - var nextChildren = workInProgress.pendingProps; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateMode(current$$1, workInProgress, renderExpirationTime) { - var nextChildren = workInProgress.pendingProps.children; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateProfiler(current$$1, workInProgress, renderExpirationTime) { - if (enableProfilerTimer) { - workInProgress.effectTag |= Update; - } - var nextProps = workInProgress.pendingProps; - var nextChildren = nextProps.children; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function markRef(current$$1, workInProgress) { - var ref = workInProgress.ref; - if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) { - // Schedule a Ref effect - workInProgress.effectTag |= Ref; - } -} - -function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { - var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); - var context = getMaskedContext(workInProgress, unmaskedContext); - - var nextChildren = void 0; - prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(current$$1, workInProgress, renderExpirationTime); - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - nextChildren = Component(nextProps, context); - setCurrentPhase(null); - } - nextChildren = finishHooks(Component, nextProps, nextChildren, context); - - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. @@ -14261,7 +14693,15 @@ function updateClassComponent(current$$1, workInProgress, Component, nextProps, } else { shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime); } - return finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime); + var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime); + { + var inst = workInProgress.stateNode; + if (inst.props !== nextProps) { + !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0; + didWarnAboutReassigningProps = true; + } + } + return nextUnitOfWork; } function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) { @@ -14416,7 +14856,7 @@ function updateHostComponent(current$$1, workInProgress, renderExpirationTime) { // Check the host config to see if the children are offscreen/hidden. if (renderExpirationTime !== Never && workInProgress.mode & ConcurrentMode && shouldDeprioritizeSubtree(type, nextProps)) { // Schedule this fiber to re-render at offscreen priority. Then bailout. - workInProgress.expirationTime = Never; + workInProgress.expirationTime = workInProgress.childExpirationTime = Never; return null; } @@ -14459,6 +14899,9 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat switch (resolvedTag) { case FunctionComponent: { + { + validateFunctionComponentInDev(workInProgress, Component); + } child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime); break; } @@ -14474,16 +14917,31 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat } case MemoComponent: { + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = Component.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too updateExpirationTime, renderExpirationTime); break; } default: { + var hint = ''; + { + if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) { + hint = ' Did you wrap a component in React.lazy() more than once?'; + } + } // This message intentionally doesn't mention ForwardRef or MemoComponent // because the fact that it's a separate type of work is an // implementation detail. - invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Promise elements must resolve to a class or function.', Component); + invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Lazy element type must resolve to a class or function.%s', Component, hint); } } return child; @@ -14541,7 +14999,6 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render var context = getMaskedContext(workInProgress, unmaskedContext); prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(null, workInProgress, renderExpirationTime); var value = void 0; @@ -14560,7 +15017,7 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render } ReactCurrentOwner$3.current = workInProgress; - value = Component(props, context); + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); } // React DevTools reads this flag. workInProgress.effectTag |= PerformedWork; @@ -14596,49 +15053,60 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render } else { // Proceed under the assumption that this is a function component workInProgress.tag = FunctionComponent; - value = finishHooks(Component, props, value, context); { - if (Component) { - !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0; - } - if (workInProgress.ref !== null) { - var info = ''; - var ownerName = getCurrentFiberOwnerNameInDevOrNull(); - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - - var warningKey = ownerName || workInProgress._debugID || ''; - var debugSource = workInProgress._debugSource; - if (debugSource) { - warningKey = debugSource.fileName + ':' + debugSource.lineNumber; - } - if (!didWarnAboutFunctionRefs[warningKey]) { - didWarnAboutFunctionRefs[warningKey] = true; - warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s', info); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); } } + } + reconcileChildren(null, workInProgress, value, renderExpirationTime); + { + validateFunctionComponentInDev(workInProgress, Component); + } + return workInProgress.child; + } +} - if (typeof Component.getDerivedStateFromProps === 'function') { - var _componentName = getComponentName(Component) || 'Unknown'; +function validateFunctionComponentInDev(workInProgress, Component) { + if (Component) { + !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0; + } + if (workInProgress.ref !== null) { + var info = ''; + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + if (ownerName) { + info += '\n\nCheck the render method of `' + ownerName + '`.'; + } - if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) { - warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true; - } - } + var warningKey = ownerName || workInProgress._debugID || ''; + var debugSource = workInProgress._debugSource; + if (debugSource) { + warningKey = debugSource.fileName + ':' + debugSource.lineNumber; + } + if (!didWarnAboutFunctionRefs[warningKey]) { + didWarnAboutFunctionRefs[warningKey] = true; + warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); + } + } - if (typeof Component.contextType === 'object' && Component.contextType !== null) { - var _componentName2 = getComponentName(Component) || 'Unknown'; + if (typeof Component.getDerivedStateFromProps === 'function') { + var componentName = getComponentName(Component) || 'Unknown'; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) { - warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName2); - didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true; - } - } + if (!didWarnAboutGetDerivedStateOnFunctionComponent[componentName]) { + warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', componentName); + didWarnAboutGetDerivedStateOnFunctionComponent[componentName] = true; + } + } + + if (typeof Component.contextType === 'object' && Component.contextType !== null) { + var _componentName = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName]) { + warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName); + didWarnAboutContextTypeOnFunctionComponent[_componentName] = true; } - reconcileChildren(null, workInProgress, value, renderExpirationTime); - return workInProgress.child; } } @@ -14697,6 +15165,18 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim // children -- we skip over the primary children entirely. var next = void 0; if (current$$1 === null) { + if (enableSuspenseServerRenderer) { + // If we're currently hydrating, try to hydrate this boundary. + // But only if this has a fallback. + if (nextProps.fallback !== undefined) { + tryToClaimNextHydratableInstance(workInProgress); + // This could've changed the tag if this was a dehydrated suspense component. + if (workInProgress.tag === DehydratedSuspenseComponent) { + return updateDehydratedSuspenseComponent(null, workInProgress, renderExpirationTime); + } + } + } + // This is the initial mount. This branch is pretty simple because there's // no previous state that needs to be preserved. if (nextDidTimeout) { @@ -14782,355 +15262,1229 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim // TODO: Would it be better to store the fallback fragment on // the stateNode? - // Continue rendering the children, like we normally do. - child = next = primaryChild; - } - } else { - // The current tree has not already timed out. That means the primary - // children are not wrapped in a fragment fiber. - var _currentPrimaryChild = current$$1.child; - if (nextDidTimeout) { - // Timed out. Wrap the children in a fragment fiber to keep them - // separate from the fallback children. - var _nextFallbackChildren2 = nextProps.fallback; - var _primaryChildFragment2 = createFiberFromFragment( - // It shouldn't matter what the pending props are because we aren't - // going to render this fragment. - null, mode, NoWork, null); - _primaryChildFragment2.child = _currentPrimaryChild; + // Continue rendering the children, like we normally do. + child = next = primaryChild; + } + } else { + // The current tree has not already timed out. That means the primary + // children are not wrapped in a fragment fiber. + var _currentPrimaryChild = current$$1.child; + if (nextDidTimeout) { + // Timed out. Wrap the children in a fragment fiber to keep them + // separate from the fallback children. + var _nextFallbackChildren2 = nextProps.fallback; + var _primaryChildFragment2 = createFiberFromFragment( + // It shouldn't matter what the pending props are because we aren't + // going to render this fragment. + null, mode, NoWork, null); + _primaryChildFragment2.child = _currentPrimaryChild; + + // Even though we're creating a new fiber, there are no new children, + // because we're reusing an already mounted tree. So we don't need to + // schedule a placement. + // primaryChildFragment.effectTag |= Placement; + + if ((workInProgress.mode & ConcurrentMode) === NoContext) { + // Outside of concurrent mode, we commit the effects from the + var _progressedState2 = workInProgress.memoizedState; + var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child; + _primaryChildFragment2.child = _progressedPrimaryChild2; + } + + // Because primaryChildFragment is a new fiber that we're inserting as the + // parent of a new tree, we need to set its treeBaseDuration. + if (enableProfilerTimer && workInProgress.mode & ProfileMode) { + // treeBaseDuration is the sum of all the child tree base durations. + var _treeBaseDuration = 0; + var _hiddenChild = _primaryChildFragment2.child; + while (_hiddenChild !== null) { + _treeBaseDuration += _hiddenChild.treeBaseDuration; + _hiddenChild = _hiddenChild.sibling; + } + _primaryChildFragment2.treeBaseDuration = _treeBaseDuration; + } + + // Create a fragment from the fallback children, too. + var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null); + _fallbackChildFragment2.effectTag |= Placement; + child = _primaryChildFragment2; + _primaryChildFragment2.childExpirationTime = NoWork; + // Skip the primary children, and continue working on the + // fallback children. + next = _fallbackChildFragment2; + child.return = next.return = workInProgress; + } else { + // Still haven't timed out. Continue rendering the children, like we + // normally do. + var _nextPrimaryChildren2 = nextProps.children; + next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime); + } + } + workInProgress.stateNode = current$$1.stateNode; + } + + workInProgress.memoizedState = nextState; + workInProgress.child = child; + return next; +} + +function updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime) { + if (current$$1 === null) { + // During the first pass, we'll bail out and not drill into the children. + // Instead, we'll leave the content in place and try to hydrate it later. + workInProgress.expirationTime = Never; + return null; + } + // We use childExpirationTime to indicate that a child might depend on context, so if + // any context has changed, we need to treat is as if the input might have changed. + var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime; + if (didReceiveUpdate || hasContextChanged$$1) { + // This boundary has changed since the first render. This means that we are now unable to + // hydrate it. We might still be able to hydrate it using an earlier expiration time but + // during this render we can't. Instead, we're going to delete the whole subtree and + // instead inject a new real Suspense boundary to take its place, which may render content + // or fallback. The real Suspense boundary will suspend for a while so we have some time + // to ensure it can produce real content, but all state and pending events will be lost. + + // Detach from the current dehydrated boundary. + current$$1.alternate = null; + workInProgress.alternate = null; + + // Insert a deletion in the effect list. + var returnFiber = workInProgress.return; + !(returnFiber !== null) ? invariant(false, 'Suspense boundaries are never on the root. This is probably a bug in React.') : void 0; + var last = returnFiber.lastEffect; + if (last !== null) { + last.nextEffect = current$$1; + returnFiber.lastEffect = current$$1; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = current$$1; + } + current$$1.nextEffect = null; + current$$1.effectTag = Deletion; + + // Upgrade this work in progress to a real Suspense component. + workInProgress.tag = SuspenseComponent; + workInProgress.stateNode = null; + workInProgress.memoizedState = null; + // This is now an insertion. + workInProgress.effectTag |= Placement; + // Retry as a real Suspense component. + return updateSuspenseComponent(null, workInProgress, renderExpirationTime); + } + if ((workInProgress.effectTag & DidCapture) === NoEffect) { + // This is the first attempt. + reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress); + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + return workInProgress.child; + } else { + // Something suspended. Leave the existing children in place. + // TODO: In non-concurrent mode, should we commit the nodes we have hydrated so far? + workInProgress.child = null; + return null; + } +} + +function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) { + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var nextChildren = workInProgress.pendingProps; + if (current$$1 === null) { + // Portals are special because we don't append the children during mount + // but at commit. Therefore we need to track insertions which the normal + // flow doesn't do during mount. This doesn't happen at the root because + // the root always starts with a "current" with a null child. + // TODO: Consider unifying this with how the root works. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + } + return workInProgress.child; +} + +function updateContextProvider(current$$1, workInProgress, renderExpirationTime) { + var providerType = workInProgress.type; + var context = providerType._context; + + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + + var newValue = newProps.value; + + { + var providerPropTypes = workInProgress.type.propTypes; + + if (providerPropTypes) { + checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); + } + } + + pushProvider(workInProgress, newValue); + + if (oldProps !== null) { + var oldValue = oldProps.value; + var changedBits = calculateChangedBits(context, newValue, oldValue); + if (changedBits === 0) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children && !hasContextChanged()) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } + } else { + // The context value changed. Search for matching consumers and schedule + // them to update. + propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + } + } + + var newChildren = newProps.children; + reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +var hasWarnedAboutUsingContextAsConsumer = false; + +function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) { + var context = workInProgress.type; + // The logic below for Context differs depending on PROD or DEV mode. In + // DEV mode, we create a separate object for Context.Consumer that acts + // like a proxy to Context. This proxy object adds unnecessary code in PROD + // so we use the old behaviour (Context.Consumer references Context) to + // reduce size and overhead. The separate object references context via + // a property called "_context", which also gives us the ability to check + // in DEV mode if this property exists or not and warn if it does not. + { + if (context._context === undefined) { + // This may be because it's a Context (rather than a Consumer). + // Or it may be because it's older React where they're the same thing. + // We only want to warn if we're sure it's a new React. + if (context !== context.Consumer) { + if (!hasWarnedAboutUsingContextAsConsumer) { + hasWarnedAboutUsingContextAsConsumer = true; + warning$1(false, 'Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + } + } else { + context = context._context; + } + } + var newProps = workInProgress.pendingProps; + var render = newProps.children; + + { + !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0; + } + + prepareToReadContext(workInProgress, renderExpirationTime); + var newValue = readContext(context, newProps.unstable_observedBits); + var newChildren = void 0; + { + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + newChildren = render(newValue); + setCurrentPhase(null); + } + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +function markWorkInProgressReceivedUpdate() { + didReceiveUpdate = true; +} + +function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) { + cancelWorkTimer(workInProgress); + + if (current$$1 !== null) { + // Reuse previous context list + workInProgress.contextDependencies = current$$1.contextDependencies; + } + + if (enableProfilerTimer) { + // Don't update "base" render times for bailouts. + stopProfilerTimerIfRunning(workInProgress); + } + + // Check if the children have any pending work. + var childExpirationTime = workInProgress.childExpirationTime; + if (childExpirationTime < renderExpirationTime) { + // The children don't have any work either. We can skip them. + // TODO: Once we add back resuming, we should check if the children are + // a work-in-progress set. If so, we need to transfer their effects. + return null; + } else { + // This fiber doesn't have work, but its subtree does. Clone the child + // fibers and continue. + cloneChildFibers(current$$1, workInProgress); + return workInProgress.child; + } +} + +function beginWork(current$$1, workInProgress, renderExpirationTime) { + var updateExpirationTime = workInProgress.expirationTime; + + if (current$$1 !== null) { + var oldProps = current$$1.memoizedProps; + var newProps = workInProgress.pendingProps; + + if (oldProps !== newProps || hasContextChanged()) { + // If props or context changed, mark the fiber as having performed work. + // This may be unset if the props are determined to be equal later (memo). + didReceiveUpdate = true; + } else if (updateExpirationTime < renderExpirationTime) { + didReceiveUpdate = false; + // This fiber does not have any pending work. Bailout without entering + // the begin phase. There's still some bookkeeping we that needs to be done + // in this optimized path, mostly pushing stuff onto the stack. + switch (workInProgress.tag) { + case HostRoot: + pushHostRootContext(workInProgress); + resetHydrationState(); + break; + case HostComponent: + pushHostContext(workInProgress); + break; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + pushContextProvider(workInProgress); + } + break; + } + case HostPortal: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case ContextProvider: + { + var newValue = workInProgress.memoizedProps.value; + pushProvider(workInProgress, newValue); + break; + } + case Profiler: + if (enableProfilerTimer) { + workInProgress.effectTag |= Update; + } + break; + case SuspenseComponent: + { + var state = workInProgress.memoizedState; + var didTimeout = state !== null; + if (didTimeout) { + // If this boundary is currently timed out, we need to decide + // whether to retry the primary children, or to skip over it and + // go straight to the fallback. Check the priority of the primary + var primaryChildFragment = workInProgress.child; + var primaryChildExpirationTime = primaryChildFragment.childExpirationTime; + if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) { + // The primary children have pending work. Use the normal path + // to attempt to render the primary children again. + return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + } else { + // The primary children do not have pending work with sufficient + // priority. Bailout. + var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + if (child !== null) { + // The fallback children have pending work. Skip over the + // primary children and work on the fallback. + return child.sibling; + } else { + return null; + } + } + } + break; + } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + // We know that this component will suspend again because if it has + // been unsuspended it has committed as a regular Suspense component. + // If it needs to be retried, it should have work scheduled on it. + workInProgress.effectTag |= DidCapture; + break; + } + } + } + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } + } else { + didReceiveUpdate = false; + } + + // Before entering the begin phase, clear the expiration time. + workInProgress.expirationTime = NoWork; + + switch (workInProgress.tag) { + case IndeterminateComponent: + { + var elementType = workInProgress.elementType; + return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime); + } + case LazyComponent: + { + var _elementType = workInProgress.elementType; + return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime); + } + case FunctionComponent: + { + var _Component = workInProgress.type; + var unresolvedProps = workInProgress.pendingProps; + var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps); + return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime); + } + case ClassComponent: + { + var _Component2 = workInProgress.type; + var _unresolvedProps = workInProgress.pendingProps; + var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps); + return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime); + } + case HostRoot: + return updateHostRoot(current$$1, workInProgress, renderExpirationTime); + case HostComponent: + return updateHostComponent(current$$1, workInProgress, renderExpirationTime); + case HostText: + return updateHostText(current$$1, workInProgress); + case SuspenseComponent: + return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + case HostPortal: + return updatePortalComponent(current$$1, workInProgress, renderExpirationTime); + case ForwardRef: + { + var type = workInProgress.type; + var _unresolvedProps2 = workInProgress.pendingProps; + var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); + return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime); + } + case Fragment: + return updateFragment(current$$1, workInProgress, renderExpirationTime); + case Mode: + return updateMode(current$$1, workInProgress, renderExpirationTime); + case Profiler: + return updateProfiler(current$$1, workInProgress, renderExpirationTime); + case ContextProvider: + return updateContextProvider(current$$1, workInProgress, renderExpirationTime); + case ContextConsumer: + return updateContextConsumer(current$$1, workInProgress, renderExpirationTime); + case MemoComponent: + { + var _type2 = workInProgress.type; + var _unresolvedProps3 = workInProgress.pendingProps; + // Resolve outer props first, then resolve inner props. + var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = _type2.propTypes; + if (outerPropTypes) { + checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only + 'prop', getComponentName(_type2), getCurrentFiberStackInDev); + } + } + } + _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); + return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime); + } + case SimpleMemoComponent: + { + return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime); + } + case IncompleteClassComponent: + { + var _Component3 = workInProgress.type; + var _unresolvedProps4 = workInProgress.pendingProps; + var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4); + return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime); + } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + return updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + } + break; + } + } + invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); +} + +var valueCursor = createCursor(null); + +var rendererSigil = void 0; +{ + // Use this to detect multiple renderers using the same context + rendererSigil = {}; +} + +var currentlyRenderingFiber = null; +var lastContextDependency = null; +var lastContextWithAllBitsObserved = null; + +var isDisallowedContextReadInDEV = false; + +function resetContextDependences() { + // This is called right before React yields execution, to ensure `readContext` + // cannot be called outside the render phase. + currentlyRenderingFiber = null; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + { + isDisallowedContextReadInDEV = false; + } +} + +function enterDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = true; + } +} + +function exitDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = false; + } +} + +function pushProvider(providerFiber, nextValue) { + var context = providerFiber.type._context; + + if (isPrimaryRenderer) { + push(valueCursor, context._currentValue, providerFiber); + + context._currentValue = nextValue; + { + !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; + context._currentRenderer = rendererSigil; + } + } else { + push(valueCursor, context._currentValue2, providerFiber); + + context._currentValue2 = nextValue; + { + !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; + context._currentRenderer2 = rendererSigil; + } + } +} + +function popProvider(providerFiber) { + var currentValue = valueCursor.current; + + pop(valueCursor, providerFiber); + + var context = providerFiber.type._context; + if (isPrimaryRenderer) { + context._currentValue = currentValue; + } else { + context._currentValue2 = currentValue; + } +} + +function calculateChangedBits(context, newValue, oldValue) { + if (is(oldValue, newValue)) { + // No change + return 0; + } else { + var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt; + + { + !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0; + } + return changedBits | 0; + } +} + +function scheduleWorkOnParentPath(parent, renderExpirationTime) { + // Update the child expiration time of all the ancestors, including + // the alternates. + var node = parent; + while (node !== null) { + var alternate = node.alternate; + if (node.childExpirationTime < renderExpirationTime) { + node.childExpirationTime = renderExpirationTime; + if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } + } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } else { + // Neither alternate was updated, which means the rest of the + // ancestor path already has sufficient priority. + break; + } + node = node.return; + } +} + +function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { + var fiber = workInProgress.child; + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber.return = workInProgress; + } + while (fiber !== null) { + var nextFiber = void 0; + + // Visit this fiber. + var list = fiber.contextDependencies; + if (list !== null) { + nextFiber = fiber.child; + + var dependency = list.first; + while (dependency !== null) { + // Check if the context matches. + if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) { + // Match! Schedule an update on this fiber. + + if (fiber.tag === ClassComponent) { + // Schedule a force update on the work-in-progress. + var update = createUpdate(renderExpirationTime); + update.tag = ForceUpdate; + // TODO: Because we don't have a work-in-progress, this will add the + // update to the current fiber, too, which means it will persist even if + // this render is thrown away. Since it's a race condition, not sure it's + // worth fixing. + enqueueUpdate(fiber, update); + } + + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + var alternate = fiber.alternate; + if (alternate !== null && alternate.expirationTime < renderExpirationTime) { + alternate.expirationTime = renderExpirationTime; + } + + scheduleWorkOnParentPath(fiber.return, renderExpirationTime); + + // Mark the expiration time on the list, too. + if (list.expirationTime < renderExpirationTime) { + list.expirationTime = renderExpirationTime; + } + + // Since we already found a match, we can stop traversing the + // dependency list. + break; + } + dependency = dependency.next; + } + } else if (fiber.tag === ContextProvider) { + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedSuspenseComponent) { + // If a dehydrated suspense component is in this subtree, we don't know + // if it will have any context consumers in it. The best we can do is + // mark it as having updates on its children. + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + var _alternate = fiber.alternate; + if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) { + _alternate.expirationTime = renderExpirationTime; + } + // This is intentionally passing this fiber as the parent + // because we want to schedule this fiber as having work + // on its children. We'll use the childExpirationTime on + // this fiber to indicate that a context has changed. + scheduleWorkOnParentPath(fiber, renderExpirationTime); + nextFiber = fiber.sibling; + } else { + // Traverse down. + nextFiber = fiber.child; + } + + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber.return = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + var sibling = nextFiber.sibling; + if (sibling !== null) { + // Set the return pointer of the sibling to the work-in-progress fiber. + sibling.return = nextFiber.return; + nextFiber = sibling; + break; + } + // No more siblings. Traverse up. + nextFiber = nextFiber.return; + } + } + fiber = nextFiber; + } +} + +function prepareToReadContext(workInProgress, renderExpirationTime) { + currentlyRenderingFiber = workInProgress; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + + var currentDependencies = workInProgress.contextDependencies; + if (currentDependencies !== null && currentDependencies.expirationTime >= renderExpirationTime) { + // Context list has a pending update. Mark that this fiber performed work. + markWorkInProgressReceivedUpdate(); + } + + // Reset the work-in-progress list + workInProgress.contextDependencies = null; +} + +function readContext(context, observedBits) { + { + // This warning would fire if you read context inside a Hook like useMemo. + // Unlike the class check below, it's not enforced in production for perf. + !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0; + } + + if (lastContextWithAllBitsObserved === context) { + // Nothing to do. We already observe everything in this context. + } else if (observedBits === false || observedBits === 0) { + // Do not observe any updates. + } else { + var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types. + if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) { + // Observe all updates. + lastContextWithAllBitsObserved = context; + resolvedObservedBits = maxSigned31BitInt; + } else { + resolvedObservedBits = observedBits; + } + + var contextItem = { + context: context, + observedBits: resolvedObservedBits, + next: null + }; + + if (lastContextDependency === null) { + !(currentlyRenderingFiber !== null) ? invariant(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; + + // This is the first dependency for this component. Create a new list. + lastContextDependency = contextItem; + currentlyRenderingFiber.contextDependencies = { + first: contextItem, + expirationTime: NoWork + }; + } else { + // Append a new context item. + lastContextDependency = lastContextDependency.next = contextItem; + } + } + return isPrimaryRenderer ? context._currentValue : context._currentValue2; +} + +// UpdateQueue is a linked list of prioritized updates. +// +// Like fibers, update queues come in pairs: a current queue, which represents +// the visible state of the screen, and a work-in-progress queue, which can be +// mutated and processed asynchronously before it is committed — a form of +// double buffering. If a work-in-progress render is discarded before finishing, +// we create a new work-in-progress by cloning the current queue. +// +// Both queues share a persistent, singly-linked list structure. To schedule an +// update, we append it to the end of both queues. Each queue maintains a +// pointer to first update in the persistent list that hasn't been processed. +// The work-in-progress pointer always has a position equal to or greater than +// the current queue, since we always work on that one. The current queue's +// pointer is only updated during the commit phase, when we swap in the +// work-in-progress. +// +// For example: +// +// Current pointer: A - B - C - D - E - F +// Work-in-progress pointer: D - E - F +// ^ +// The work-in-progress queue has +// processed more updates than current. +// +// The reason we append to both queues is because otherwise we might drop +// updates without ever processing them. For example, if we only add updates to +// the work-in-progress queue, some updates could be lost whenever a work-in +// -progress render restarts by cloning from current. Similarly, if we only add +// updates to the current queue, the updates will be lost whenever an already +// in-progress queue commits and swaps with the current queue. However, by +// adding to both queues, we guarantee that the update will be part of the next +// work-in-progress. (And because the work-in-progress queue becomes the +// current queue once it commits, there's no danger of applying the same +// update twice.) +// +// Prioritization +// -------------- +// +// Updates are not sorted by priority, but by insertion; new updates are always +// appended to the end of the list. +// +// The priority is still important, though. When processing the update queue +// during the render phase, only the updates with sufficient priority are +// included in the result. If we skip an update because it has insufficient +// priority, it remains in the queue to be processed later, during a lower +// priority render. Crucially, all updates subsequent to a skipped update also +// remain in the queue *regardless of their priority*. That means high priority +// updates are sometimes processed twice, at two separate priorities. We also +// keep track of a base state, that represents the state before the first +// update in the queue is applied. +// +// For example: +// +// Given a base state of '', and the following queue of updates +// +// A1 - B2 - C1 - D2 +// +// where the number indicates the priority, and the update is applied to the +// previous state by appending a letter, React will process these updates as +// two separate renders, one per distinct priority level: +// +// First render, at priority 1: +// Base state: '' +// Updates: [A1, C1] +// Result state: 'AC' +// +// Second render, at priority 2: +// Base state: 'A' <- The base state does not include C1, +// because B2 was skipped. +// Updates: [B2, C1, D2] <- C1 was rebased on top of B2 +// Result state: 'ABCD' +// +// Because we process updates in insertion order, and rebase high priority +// updates when preceding updates are skipped, the final result is deterministic +// regardless of priority. Intermediate state may vary according to system +// resources, but the final state is always the same. + +var UpdateState = 0; +var ReplaceState = 1; +var ForceUpdate = 2; +var CaptureUpdate = 3; + +// Global state that is reset at the beginning of calling `processUpdateQueue`. +// It should only be read right after calling `processUpdateQueue`, via +// `checkHasForceUpdateAfterProcessing`. +var hasForceUpdate = false; + +var didWarnUpdateInsideUpdate = void 0; +var currentlyProcessingQueue = void 0; +var resetCurrentlyProcessingQueue = void 0; +{ + didWarnUpdateInsideUpdate = false; + currentlyProcessingQueue = null; + resetCurrentlyProcessingQueue = function () { + currentlyProcessingQueue = null; + }; +} + +function createUpdateQueue(baseState) { + var queue = { + baseState: baseState, + firstUpdate: null, + lastUpdate: null, + firstCapturedUpdate: null, + lastCapturedUpdate: null, + firstEffect: null, + lastEffect: null, + firstCapturedEffect: null, + lastCapturedEffect: null + }; + return queue; +} + +function cloneUpdateQueue(currentQueue) { + var queue = { + baseState: currentQueue.baseState, + firstUpdate: currentQueue.firstUpdate, + lastUpdate: currentQueue.lastUpdate, + + // TODO: With resuming, if we bail out and resuse the child tree, we should + // keep these effects. + firstCapturedUpdate: null, + lastCapturedUpdate: null, + + firstEffect: null, + lastEffect: null, - // Even though we're creating a new fiber, there are no new children, - // because we're reusing an already mounted tree. So we don't need to - // schedule a placement. - // primaryChildFragment.effectTag |= Placement; + firstCapturedEffect: null, + lastCapturedEffect: null + }; + return queue; +} - if ((workInProgress.mode & ConcurrentMode) === NoContext) { - // Outside of concurrent mode, we commit the effects from the - var _progressedState2 = workInProgress.memoizedState; - var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child; - _primaryChildFragment2.child = _progressedPrimaryChild2; - } +function createUpdate(expirationTime) { + return { + expirationTime: expirationTime, - // Because primaryChildFragment is a new fiber that we're inserting as the - // parent of a new tree, we need to set its treeBaseDuration. - if (enableProfilerTimer && workInProgress.mode & ProfileMode) { - // treeBaseDuration is the sum of all the child tree base durations. - var _treeBaseDuration = 0; - var _hiddenChild = _primaryChildFragment2.child; - while (_hiddenChild !== null) { - _treeBaseDuration += _hiddenChild.treeBaseDuration; - _hiddenChild = _hiddenChild.sibling; - } - _primaryChildFragment2.treeBaseDuration = _treeBaseDuration; - } + tag: UpdateState, + payload: null, + callback: null, - // Create a fragment from the fallback children, too. - var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null); - _fallbackChildFragment2.effectTag |= Placement; - child = _primaryChildFragment2; - _primaryChildFragment2.childExpirationTime = NoWork; - // Skip the primary children, and continue working on the - // fallback children. - next = _fallbackChildFragment2; - child.return = next.return = workInProgress; + next: null, + nextEffect: null + }; +} + +function appendUpdateToQueue(queue, update) { + // Append the update to the end of the list. + if (queue.lastUpdate === null) { + // Queue is empty + queue.firstUpdate = queue.lastUpdate = update; + } else { + queue.lastUpdate.next = update; + queue.lastUpdate = update; + } +} + +function enqueueUpdate(fiber, update) { + // Update queues are created lazily. + var alternate = fiber.alternate; + var queue1 = void 0; + var queue2 = void 0; + if (alternate === null) { + // There's only one fiber. + queue1 = fiber.updateQueue; + queue2 = null; + if (queue1 === null) { + queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); + } + } else { + // There are two owners. + queue1 = fiber.updateQueue; + queue2 = alternate.updateQueue; + if (queue1 === null) { + if (queue2 === null) { + // Neither fiber has an update queue. Create new ones. + queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); + queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState); } else { - // Still haven't timed out. Continue rendering the children, like we - // normally do. - var _nextPrimaryChildren2 = nextProps.children; - next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime); + // Only one fiber has an update queue. Clone to create a new one. + queue1 = fiber.updateQueue = cloneUpdateQueue(queue2); + } + } else { + if (queue2 === null) { + // Only one fiber has an update queue. Clone to create a new one. + queue2 = alternate.updateQueue = cloneUpdateQueue(queue1); + } else { + // Both owners have an update queue. } } } + if (queue2 === null || queue1 === queue2) { + // There's only a single queue. + appendUpdateToQueue(queue1, update); + } else { + // There are two queues. We need to append the update to both queues, + // while accounting for the persistent structure of the list — we don't + // want the same update to be added multiple times. + if (queue1.lastUpdate === null || queue2.lastUpdate === null) { + // One of the queues is not empty. We must add the update to both queues. + appendUpdateToQueue(queue1, update); + appendUpdateToQueue(queue2, update); + } else { + // Both queues are non-empty. The last update is the same in both lists, + // because of structural sharing. So, only append to one of the lists. + appendUpdateToQueue(queue1, update); + // But we still need to update the `lastUpdate` pointer of queue2. + queue2.lastUpdate = update; + } + } - workInProgress.memoizedState = nextState; - workInProgress.child = child; - return next; + { + if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) { + warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); + didWarnUpdateInsideUpdate = true; + } + } } -function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) { - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - var nextChildren = workInProgress.pendingProps; - if (current$$1 === null) { - // Portals are special because we don't append the children during mount - // but at commit. Therefore we need to track insertions which the normal - // flow doesn't do during mount. This doesn't happen at the root because - // the root always starts with a "current" with a null child. - // TODO: Consider unifying this with how the root works. - workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); +function enqueueCapturedUpdate(workInProgress, update) { + // Captured updates go into a separate list, and only on the work-in- + // progress queue. + var workInProgressQueue = workInProgress.updateQueue; + if (workInProgressQueue === null) { + workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState); } else { - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + // TODO: I put this here rather than createWorkInProgress so that we don't + // clone the queue unnecessarily. There's probably a better way to + // structure this. + workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue); + } + + // Append the update to the end of the list. + if (workInProgressQueue.lastCapturedUpdate === null) { + // This is the first render phase update + workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update; + } else { + workInProgressQueue.lastCapturedUpdate.next = update; + workInProgressQueue.lastCapturedUpdate = update; } - return workInProgress.child; } -function updateContextProvider(current$$1, workInProgress, renderExpirationTime) { - var providerType = workInProgress.type; - var context = providerType._context; +function ensureWorkInProgressQueueIsAClone(workInProgress, queue) { + var current = workInProgress.alternate; + if (current !== null) { + // If the work-in-progress queue is equal to the current queue, + // we need to clone it first. + if (queue === current.updateQueue) { + queue = workInProgress.updateQueue = cloneUpdateQueue(queue); + } + } + return queue; +} - var newProps = workInProgress.pendingProps; - var oldProps = workInProgress.memoizedProps; +function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { + switch (update.tag) { + case ReplaceState: + { + var _payload = update.payload; + if (typeof _payload === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + _payload.call(instance, prevState, nextProps); + } + } + var nextState = _payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + return nextState; + } + // State object + return _payload; + } + case CaptureUpdate: + { + workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture; + } + // Intentional fallthrough + case UpdateState: + { + var _payload2 = update.payload; + var partialState = void 0; + if (typeof _payload2 === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + _payload2.call(instance, prevState, nextProps); + } + } + partialState = _payload2.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + } else { + // Partial state object + partialState = _payload2; + } + if (partialState === null || partialState === undefined) { + // Null and undefined are treated as no-ops. + return prevState; + } + // Merge the partial state and the previous state. + return _assign({}, prevState, partialState); + } + case ForceUpdate: + { + hasForceUpdate = true; + return prevState; + } + } + return prevState; +} - var newValue = newProps.value; +function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) { + hasForceUpdate = false; - { - var providerPropTypes = workInProgress.type.propTypes; + queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue); - if (providerPropTypes) { - checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); - } + { + currentlyProcessingQueue = queue; } - pushProvider(workInProgress, newValue); + // These values may change as we process the queue. + var newBaseState = queue.baseState; + var newFirstUpdate = null; + var newExpirationTime = NoWork; - if (oldProps !== null) { - var oldValue = oldProps.value; - var changedBits = calculateChangedBits(context, newValue, oldValue); - if (changedBits === 0) { - // No change. Bailout early if children are the same. - if (oldProps.children === newProps.children && !hasContextChanged()) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + // Iterate through the list of updates to compute the result. + var update = queue.firstUpdate; + var resultState = newBaseState; + while (update !== null) { + var updateExpirationTime = update.expirationTime; + if (updateExpirationTime < renderExpirationTime) { + // This update does not have sufficient priority. Skip it. + if (newFirstUpdate === null) { + // This is the first skipped update. It will be the first update in + // the new list. + newFirstUpdate = update; + // Since this is the first update that was skipped, the current result + // is the new base state. + newBaseState = resultState; + } + // Since this update will remain in the list, update the remaining + // expiration time. + if (newExpirationTime < updateExpirationTime) { + newExpirationTime = updateExpirationTime; } } else { - // The context value changed. Search for matching consumers and schedule - // them to update. - propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + // This update does have sufficient priority. Process it and compute + // a new result. + resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); + var _callback = update.callback; + if (_callback !== null) { + workInProgress.effectTag |= Callback; + // Set this to null, in case it was mutated during an aborted render. + update.nextEffect = null; + if (queue.lastEffect === null) { + queue.firstEffect = queue.lastEffect = update; + } else { + queue.lastEffect.nextEffect = update; + queue.lastEffect = update; + } + } } + // Continue to the next update. + update = update.next; } - var newChildren = newProps.children; - reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); - return workInProgress.child; -} - -var hasWarnedAboutUsingContextAsConsumer = false; - -function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) { - var context = workInProgress.type; - // The logic below for Context differs depending on PROD or DEV mode. In - // DEV mode, we create a separate object for Context.Consumer that acts - // like a proxy to Context. This proxy object adds unnecessary code in PROD - // so we use the old behaviour (Context.Consumer references Context) to - // reduce size and overhead. The separate object references context via - // a property called "_context", which also gives us the ability to check - // in DEV mode if this property exists or not and warn if it does not. - { - if (context._context === undefined) { - // This may be because it's a Context (rather than a Consumer). - // Or it may be because it's older React where they're the same thing. - // We only want to warn if we're sure it's a new React. - if (context !== context.Consumer) { - if (!hasWarnedAboutUsingContextAsConsumer) { - hasWarnedAboutUsingContextAsConsumer = true; - warning$1(false, 'Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + // Separately, iterate though the list of captured updates. + var newFirstCapturedUpdate = null; + update = queue.firstCapturedUpdate; + while (update !== null) { + var _updateExpirationTime = update.expirationTime; + if (_updateExpirationTime < renderExpirationTime) { + // This update does not have sufficient priority. Skip it. + if (newFirstCapturedUpdate === null) { + // This is the first skipped captured update. It will be the first + // update in the new list. + newFirstCapturedUpdate = update; + // If this is the first update that was skipped, the current result is + // the new base state. + if (newFirstUpdate === null) { + newBaseState = resultState; } } + // Since this update will remain in the list, update the remaining + // expiration time. + if (newExpirationTime < _updateExpirationTime) { + newExpirationTime = _updateExpirationTime; + } } else { - context = context._context; + // This update does have sufficient priority. Process it and compute + // a new result. + resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); + var _callback2 = update.callback; + if (_callback2 !== null) { + workInProgress.effectTag |= Callback; + // Set this to null, in case it was mutated during an aborted render. + update.nextEffect = null; + if (queue.lastCapturedEffect === null) { + queue.firstCapturedEffect = queue.lastCapturedEffect = update; + } else { + queue.lastCapturedEffect.nextEffect = update; + queue.lastCapturedEffect = update; + } + } } + update = update.next; } - var newProps = workInProgress.pendingProps; - var render = newProps.children; - { - !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0; + if (newFirstUpdate === null) { + queue.lastUpdate = null; } - - prepareToReadContext(workInProgress, renderExpirationTime); - var newValue = readContext(context, newProps.unstable_observedBits); - var newChildren = void 0; - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - newChildren = render(newValue); - setCurrentPhase(null); + if (newFirstCapturedUpdate === null) { + queue.lastCapturedUpdate = null; + } else { + workInProgress.effectTag |= Callback; + } + if (newFirstUpdate === null && newFirstCapturedUpdate === null) { + // We processed every update, without skipping. That means the new base + // state is the same as the result state. + newBaseState = resultState; } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); - return workInProgress.child; -} + queue.baseState = newBaseState; + queue.firstUpdate = newFirstUpdate; + queue.firstCapturedUpdate = newFirstCapturedUpdate; -function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) { - cancelWorkTimer(workInProgress); + // Set the remaining expiration time to be whatever is remaining in the queue. + // This should be fine because the only two other things that contribute to + // expiration time are props and context. We're already in the middle of the + // begin phase by the time we start processing the queue, so we've already + // dealt with the props. Context in components that specify + // shouldComponentUpdate is tricky; but we'll have to account for + // that regardless. + workInProgress.expirationTime = newExpirationTime; + workInProgress.memoizedState = resultState; - if (current$$1 !== null) { - // Reuse previous context list - workInProgress.firstContextDependency = current$$1.firstContextDependency; + { + currentlyProcessingQueue = null; } +} - if (enableProfilerTimer) { - // Don't update "base" render times for bailouts. - stopProfilerTimerIfRunning(workInProgress); - } +function callCallback(callback, context) { + !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0; + callback.call(context); +} - // Check if the children have any pending work. - var childExpirationTime = workInProgress.childExpirationTime; - if (childExpirationTime < renderExpirationTime) { - // The children don't have any work either. We can skip them. - // TODO: Once we add back resuming, we should check if the children are - // a work-in-progress set. If so, we need to transfer their effects. - return null; - } else { - // This fiber doesn't have work, but its subtree does. Clone the child - // fibers and continue. - cloneChildFibers(current$$1, workInProgress); - return workInProgress.child; - } +function resetHasForceUpdateBeforeProcessing() { + hasForceUpdate = false; } -function beginWork(current$$1, workInProgress, renderExpirationTime) { - var updateExpirationTime = workInProgress.expirationTime; +function checkHasForceUpdateAfterProcessing() { + return hasForceUpdate; +} - if (current$$1 !== null) { - var oldProps = current$$1.memoizedProps; - var newProps = workInProgress.pendingProps; - if (oldProps === newProps && !hasContextChanged() && updateExpirationTime < renderExpirationTime) { - // This fiber does not have any pending work. Bailout without entering - // the begin phase. There's still some bookkeeping we that needs to be done - // in this optimized path, mostly pushing stuff onto the stack. - switch (workInProgress.tag) { - case HostRoot: - pushHostRootContext(workInProgress); - resetHydrationState(); - break; - case HostComponent: - pushHostContext(workInProgress); - break; - case ClassComponent: - { - var Component = workInProgress.type; - if (isContextProvider(Component)) { - pushContextProvider(workInProgress); - } - break; - } - case HostPortal: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case ContextProvider: - { - var newValue = workInProgress.memoizedProps.value; - pushProvider(workInProgress, newValue); - break; - } - case Profiler: - if (enableProfilerTimer) { - workInProgress.effectTag |= Update; - } - break; - case SuspenseComponent: - { - var state = workInProgress.memoizedState; - var didTimeout = state !== null; - if (didTimeout) { - // If this boundary is currently timed out, we need to decide - // whether to retry the primary children, or to skip over it and - // go straight to the fallback. Check the priority of the primary - var primaryChildFragment = workInProgress.child; - var primaryChildExpirationTime = primaryChildFragment.childExpirationTime; - if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) { - // The primary children have pending work. Use the normal path - // to attempt to render the primary children again. - return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); - } else { - // The primary children do not have pending work with sufficient - // priority. Bailout. - var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - if (child !== null) { - // The fallback children have pending work. Skip over the - // primary children and work on the fallback. - return child.sibling; - } else { - return null; - } - } - } - break; - } - } - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); +function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) { + // If the finished render included captured updates, and there are still + // lower priority updates left over, we need to keep the captured updates + // in the queue so that they are rebased and not dropped once we process the + // queue again at the lower priority. + if (finishedQueue.firstCapturedUpdate !== null) { + // Join the captured update list to the end of the normal list. + if (finishedQueue.lastUpdate !== null) { + finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate; + finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate; } + // Clear the list of captured updates. + finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null; } - // Before entering the begin phase, clear the expiration time. - workInProgress.expirationTime = NoWork; + // Commit the effects + commitUpdateEffects(finishedQueue.firstEffect, instance); + finishedQueue.firstEffect = finishedQueue.lastEffect = null; - switch (workInProgress.tag) { - case IndeterminateComponent: - { - var elementType = workInProgress.elementType; - return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime); - } - case LazyComponent: - { - var _elementType = workInProgress.elementType; - return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime); - } - case FunctionComponent: - { - var _Component = workInProgress.type; - var unresolvedProps = workInProgress.pendingProps; - var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps); - return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime); - } - case ClassComponent: - { - var _Component2 = workInProgress.type; - var _unresolvedProps = workInProgress.pendingProps; - var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps); - return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime); - } - case HostRoot: - return updateHostRoot(current$$1, workInProgress, renderExpirationTime); - case HostComponent: - return updateHostComponent(current$$1, workInProgress, renderExpirationTime); - case HostText: - return updateHostText(current$$1, workInProgress); - case SuspenseComponent: - return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); - case HostPortal: - return updatePortalComponent(current$$1, workInProgress, renderExpirationTime); - case ForwardRef: - { - var type = workInProgress.type; - var _unresolvedProps2 = workInProgress.pendingProps; - var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); - return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime); - } - case Fragment: - return updateFragment(current$$1, workInProgress, renderExpirationTime); - case Mode: - return updateMode(current$$1, workInProgress, renderExpirationTime); - case Profiler: - return updateProfiler(current$$1, workInProgress, renderExpirationTime); - case ContextProvider: - return updateContextProvider(current$$1, workInProgress, renderExpirationTime); - case ContextConsumer: - return updateContextConsumer(current$$1, workInProgress, renderExpirationTime); - case MemoComponent: - { - var _type = workInProgress.type; - var _unresolvedProps3 = workInProgress.pendingProps; - var _resolvedProps3 = resolveDefaultProps(_type.type, _unresolvedProps3); - return updateMemoComponent(current$$1, workInProgress, _type, _resolvedProps3, updateExpirationTime, renderExpirationTime); - } - case SimpleMemoComponent: - { - return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime); - } - case IncompleteClassComponent: - { - var _Component3 = workInProgress.type; - var _unresolvedProps4 = workInProgress.pendingProps; - var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4); - return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime); - } - default: - invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); + commitUpdateEffects(finishedQueue.firstCapturedEffect, instance); + finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null; +} + +function commitUpdateEffects(effect, instance) { + while (effect !== null) { + var _callback3 = effect.callback; + if (_callback3 !== null) { + effect.callback = null; + callCallback(_callback3, instance); + } + effect = effect.nextEffect; } } +function createCapturedValue(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; +} + function markUpdate(workInProgress) { // Tag the fiber with an update effect. This turns a Placement into // a PlacementAndUpdate. @@ -15623,16 +16977,10 @@ function completeWork(current, workInProgress, renderExpirationTime) { } } - // The children either timed out after previously being visible, or - // were restored after previously being hidden. Schedule an effect - // to update their visiblity. - if ( - // - nextDidTimeout !== prevDidTimeout || - // Outside concurrent mode, the primary children commit in an - // inconsistent state, even if they are hidden. So if they are hidden, - // we need to schedule an effect to re-hide them, just in case. - (workInProgress.effectTag & ConcurrentMode) === NoContext && nextDidTimeout) { + if (nextDidTimeout || prevDidTimeout) { + // If the children are hidden, or if they were previous hidden, schedule + // an effect to toggle their visibility. This is also used to attach a + // retry listener to the promise. workInProgress.effectTag |= Update; } break; @@ -15665,6 +17013,26 @@ function completeWork(current, workInProgress, renderExpirationTime) { } break; } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + if (current === null) { + var _wasHydrated2 = popHydrationState(workInProgress); + !_wasHydrated2 ? invariant(false, 'A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.') : void 0; + skipPastDehydratedSuspenseInstance(workInProgress); + } else if ((workInProgress.effectTag & DidCapture) === NoEffect) { + // This boundary did not suspend so it's now hydrated. + // To handle any future suspense cases, we're going to now upgrade it + // to a Suspense component. We detach it from the existing current fiber. + current.alternate = null; + workInProgress.alternate = null; + workInProgress.tag = SuspenseComponent; + workInProgress.memoizedState = null; + workInProgress.stateNode = null; + } + } + break; + } default: invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); } @@ -15672,7 +17040,7 @@ function completeWork(current, workInProgress, renderExpirationTime) { return null; } -function shouldCaptureSuspense(current, workInProgress) { +function shouldCaptureSuspense(workInProgress) { // In order to capture, the Suspense component must have a fallback prop. if (workInProgress.memoizedProps.fallback === undefined) { return false; @@ -15755,6 +17123,8 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); } +var PossiblyWeakSet$1 = typeof WeakSet === 'function' ? WeakSet : Set; + function logError(boundary, errorInfo) { var source = errorInfo.source; var stack = errorInfo.stack; @@ -15859,9 +17229,9 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) { // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); @@ -15893,9 +17263,6 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) { } function commitHookEffectList(unmountTag, mountTag, finishedWork) { - if (!enableHooks) { - return; - } var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { @@ -15905,24 +17272,30 @@ function commitHookEffectList(unmountTag, mountTag, finishedWork) { if ((effect.tag & unmountTag) !== NoEffect$1) { // Unmount var destroy = effect.destroy; - effect.destroy = null; - if (destroy !== null) { + effect.destroy = undefined; + if (destroy !== undefined) { destroy(); } } if ((effect.tag & mountTag) !== NoEffect$1) { // Mount var create = effect.create; - var _destroy = create(); - if (typeof _destroy !== 'function') { - { - if (_destroy !== null && _destroy !== undefined) { - warningWithoutStack$1(false, 'useEffect function must return a cleanup function or ' + 'nothing.%s%s', typeof _destroy.then === 'function' ? ' Promises and useEffect(async () => ...) are not ' + 'supported, but you can call an async function inside an ' + 'effect.' : '', getStackByFiberInDevAndProd(finishedWork)); + effect.destroy = create(); + + { + var _destroy = effect.destroy; + if (_destroy !== undefined && typeof _destroy !== 'function') { + var addendum = void 0; + if (_destroy === null) { + addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).'; + } else if (typeof _destroy.then === 'function') { + addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + '}, [someId]); // Or [] if effect doesn\'t need props or state\n\n' + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching'; + } else { + addendum = ' You returned: ' + _destroy; } + warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork)); } - _destroy = null; } - effect.destroy = _destroy; } effect = effect.next; } while (effect !== firstEffect); @@ -15953,9 +17326,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } instance.componentDidMount(); @@ -15968,9 +17341,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); @@ -15980,9 +17353,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir var updateQueue = finishedWork.updateQueue; if (updateQueue !== null) { { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } // We could update instance props and state here, @@ -16063,7 +17436,7 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir function hideOrUnhideAllChildren(finishedWork, isHidden) { if (supportsMutation) { - // We only have the top Fiber that was inserted but we need recurse down its + // We only have the top Fiber that was inserted but we need to recurse down its var node = finishedWork; while (true) { if (node.tag === HostComponent) { @@ -16163,7 +17536,7 @@ function commitUnmount(current$$1) { var effect = firstEffect; do { var destroy = effect.destroy; - if (destroy !== null) { + if (destroy !== undefined) { safelyCallDestroy(current$$1, destroy); } effect = effect.next; @@ -16241,9 +17614,14 @@ function detachFiber(current$$1) { // itself will be GC:ed when the parent updates the next time. current$$1.return = null; current$$1.child = null; - if (current$$1.alternate) { - current$$1.alternate.child = null; - current$$1.alternate.return = null; + current$$1.memoizedState = null; + current$$1.updateQueue = null; + var alternate = current$$1.alternate; + if (alternate !== null) { + alternate.return = null; + alternate.child = null; + alternate.memoizedState = null; + alternate.updateQueue = null; } } @@ -16326,7 +17704,7 @@ function getHostSibling(fiber) { } node.sibling.return = node.return; node = node.sibling; - while (node.tag !== HostComponent && node.tag !== HostText) { + while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedSuspenseComponent) { // If it is not host node and, we might have a host node inside it. // Try to search down until we find one. if (node.effectTag & Placement) { @@ -16386,7 +17764,7 @@ function commitPlacement(finishedWork) { } var before = getHostSibling(finishedWork); - // We only have the top Fiber that was inserted but we need recurse down its + // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. var node = finishedWork; while (true) { @@ -16428,7 +17806,7 @@ function commitPlacement(finishedWork) { } function unmountHostComponents(current$$1) { - // We only have the top Fiber that was deleted but we need recurse down its + // We only have the top Fiber that was deleted but we need to recurse down its var node = current$$1; // Each iteration, currentParent is populated with node's host parent if not @@ -16473,13 +17851,20 @@ function unmountHostComponents(current$$1) { removeChild(currentParent, node.stateNode); } // Don't visit children because we already visited them. + } else if (enableSuspenseServerRenderer && node.tag === DehydratedSuspenseComponent) { + // Delete the dehydrated suspense boundary and all of its content. + if (currentParentIsContainer) { + clearSuspenseBoundaryFromContainer(currentParent, node.stateNode); + } else { + clearSuspenseBoundary(currentParent, node.stateNode); + } } else if (node.tag === HostPortal) { - // When we go into a portal, it becomes the parent to remove from. - // We will reassign it back when we pop the portal on the way up. - currentParent = node.stateNode.containerInfo; - currentParentIsContainer = true; - // Visit children because portals might contain host components. if (node.child !== null) { + // When we go into a portal, it becomes the parent to remove from. + // We will reassign it back when we pop the portal on the way up. + currentParent = node.stateNode.containerInfo; + currentParentIsContainer = true; + // Visit children because portals might contain host components. node.child.return = node; node = node.child; continue; @@ -16532,6 +17917,8 @@ function commitWork(current$$1, finishedWork) { case MemoComponent: case SimpleMemoComponent: { + // Note: We currently never use MountMutation, but useLayout uses + // UnmountMutation. commitHookEffectList(UnmountMutation, MountMutation, finishedWork); return; } @@ -16547,6 +17934,8 @@ function commitWork(current$$1, finishedWork) { case MemoComponent: case SimpleMemoComponent: { + // Note: We currently never use MountMutation, but useLayout uses + // UnmountMutation. commitHookEffectList(UnmountMutation, MountMutation, finishedWork); return; } @@ -16616,6 +18005,30 @@ function commitWork(current$$1, finishedWork) { if (primaryChildParent !== null) { hideOrUnhideAllChildren(primaryChildParent, newDidTimeout); } + + // If this boundary just timed out, then it will have a set of thenables. + // For each thenable, attach a listener so that when it resolves, React + // attempts to re-render the boundary in the primary (pre-timeout) state. + var thenables = finishedWork.updateQueue; + if (thenables !== null) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + if (retryCache === null) { + retryCache = finishedWork.stateNode = new PossiblyWeakSet$1(); + } + thenables.forEach(function (thenable) { + // Memoize using the boundary fiber to prevent redundant listeners. + var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable); + if (enableSchedulerTracing) { + retry = tracing.unstable_wrap(retry); + } + if (!retryCache.has(thenable)) { + retryCache.add(thenable); + thenable.then(retry, retry); + } + }); + } + return; } case IncompleteClassComponent: @@ -16636,6 +18049,9 @@ function commitResetTextContent(current$$1) { resetTextContent(current$$1.stateNode); } +var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set; +var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + function createRootErrorUpdate(fiber, errorInfo, expirationTime) { var update = createUpdate(expirationTime); // Unmount the root by rendering null. @@ -16692,6 +18108,34 @@ function createClassErrorUpdate(fiber, errorInfo, expirationTime) { return update; } +function attachPingListener(root, renderExpirationTime, thenable) { + // Attach a listener to the promise to "ping" the root and retry. But + // only if one does not already exist for the current render expiration + // time (which acts like a "thread ID" here). + var pingCache = root.pingCache; + var threadIDs = void 0; + if (pingCache === null) { + pingCache = root.pingCache = new PossiblyWeakMap(); + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } else { + threadIDs = pingCache.get(thenable); + if (threadIDs === undefined) { + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } + } + if (!threadIDs.has(renderExpirationTime)) { + // Memoize using the thread ID to prevent redundant listeners. + threadIDs.add(renderExpirationTime); + var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime); + if (enableSchedulerTracing) { + ping = tracing.unstable_wrap(ping); + } + thenable.then(ping, ping); + } +} + function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) { // The source fiber did not complete. sourceFiber.effectTag |= Incomplete; @@ -16733,25 +18177,27 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT } } } + // If there is a DehydratedSuspenseComponent we don't have to do anything because + // if something suspends inside it, we will simply leave that as dehydrated. It + // will never timeout. _workInProgress = _workInProgress.return; } while (_workInProgress !== null); // Schedule the nearest Suspense to re-render the timed out view. _workInProgress = returnFiber; do { - if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress.alternate, _workInProgress)) { + if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) { // Found the nearest boundary. - // If the boundary is not in concurrent mode, we should not suspend, and - // likewise, when the promise resolves, we should ping synchronously. - var pingTime = (_workInProgress.mode & ConcurrentMode) === NoEffect ? Sync : renderExpirationTime; - - // Attach a listener to the promise to "ping" the root and retry. - var onResolveOrReject = retrySuspendedRoot.bind(null, root, _workInProgress, sourceFiber, pingTime); - if (enableSchedulerTracing) { - onResolveOrReject = tracing.unstable_wrap(onResolveOrReject); + // Stash the promise on the boundary fiber. If the boundary times out, we'll + var thenables = _workInProgress.updateQueue; + if (thenables === null) { + var updateQueue = new Set(); + updateQueue.add(thenable); + _workInProgress.updateQueue = updateQueue; + } else { + thenables.add(thenable); } - thenable.then(onResolveOrReject, onResolveOrReject); // If the boundary is outside of concurrent mode, we should *not* // suspend the commit. Pretend as if the suspended component rendered @@ -16770,18 +18216,25 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete); if (sourceFiber.tag === ClassComponent) { - var _current = sourceFiber.alternate; - if (_current === null) { + var currentSourceFiber = sourceFiber.alternate; + if (currentSourceFiber === null) { // This is a new mount. Change the tag so it's not mistaken for a // completed class component. For example, we should not call // componentWillUnmount if it is deleted. sourceFiber.tag = IncompleteClassComponent; + } else { + // When we try rendering again, we should not reuse the current fiber, + // since it's known to be in an inconsistent state. Use a force updte to + // prevent a bail out. + var update = createUpdate(Sync); + update.tag = ForceUpdate; + enqueueUpdate(sourceFiber, update); } } - // The source fiber did not complete. Mark it with the current - // render priority to indicate that it still has pending work. - sourceFiber.expirationTime = renderExpirationTime; + // The source fiber did not complete. Mark it with Sync priority to + // indicate that it still has pending work. + sourceFiber.expirationTime = Sync; // Exit without suspending. return; @@ -16790,9 +18243,11 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT // Confirmed that the boundary is in a concurrent mode tree. Continue // with the normal suspend path. + attachPingListener(root, renderExpirationTime, thenable); + var absoluteTimeoutMs = void 0; if (earliestTimeoutMs === -1) { - // If no explicit threshold is given, default to an abitrarily large + // If no explicit threshold is given, default to an arbitrarily large // value. The actual size doesn't matter because the threshold for the // whole tree will be clamped to the expiration time. absoluteTimeoutMs = maxSigned31BitInt; @@ -16820,6 +18275,29 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT // whole tree. renderDidSuspend(root, absoluteTimeoutMs, renderExpirationTime); + _workInProgress.effectTag |= ShouldCapture; + _workInProgress.expirationTime = renderExpirationTime; + return; + } else if (enableSuspenseServerRenderer && _workInProgress.tag === DehydratedSuspenseComponent) { + attachPingListener(root, renderExpirationTime, thenable); + + // Since we already have a current fiber, we can eagerly add a retry listener. + var retryCache = _workInProgress.memoizedState; + if (retryCache === null) { + retryCache = _workInProgress.memoizedState = new PossiblyWeakSet(); + var _current = _workInProgress.alternate; + !_current ? invariant(false, 'A dehydrated suspense boundary must commit before trying to render. This is probably a bug in React.') : void 0; + _current.memoizedState = retryCache; + } + // Memoize using the boundary fiber to prevent redundant listeners. + if (!retryCache.has(thenable)) { + retryCache.add(thenable); + var retry = retryTimedOutBoundary.bind(null, _workInProgress, thenable); + if (enableSchedulerTracing) { + retry = tracing.unstable_wrap(retry); + } + thenable.then(retry, retry); + } _workInProgress.effectTag |= ShouldCapture; _workInProgress.expirationTime = renderExpirationTime; return; @@ -16846,8 +18324,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT var _errorInfo = value; workInProgress.effectTag |= ShouldCapture; workInProgress.expirationTime = renderExpirationTime; - var update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime); - enqueueCapturedUpdate(workInProgress, update); + var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime); + enqueueCapturedUpdate(workInProgress, _update); return; } case ClassComponent: @@ -16859,8 +18337,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT workInProgress.effectTag |= ShouldCapture; workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime); - enqueueCapturedUpdate(workInProgress, _update); + var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime); + enqueueCapturedUpdate(workInProgress, _update2); return; } break; @@ -16897,6 +18375,7 @@ function unwindWork(workInProgress, renderExpirationTime) { } case HostComponent: { + // TODO: popHydrationState popHostContext(workInProgress); return null; } @@ -16910,6 +18389,19 @@ function unwindWork(workInProgress, renderExpirationTime) { } return null; } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + // TODO: popHydrationState + var _effectTag3 = workInProgress.effectTag; + if (_effectTag3 & ShouldCapture) { + workInProgress.effectTag = _effectTag3 & ~ShouldCapture | DidCapture; + // Captured a suspense effect. Re-render the boundary. + return workInProgress; + } + } + return null; + } case HostPortal: popHostContainer(workInProgress); return null; @@ -16953,23 +18445,7 @@ function unwindInterruptedWork(interruptedWork) { } } -var Dispatcher = { - readContext: readContext, - useCallback: useCallback, - useContext: useContext, - useEffect: useEffect, - useImperativeMethods: useImperativeMethods, - useLayoutEffect: useLayoutEffect, - useMemo: useMemo, - useMutationEffect: useMutationEffect, - useReducer: useReducer, - useRef: useRef, - useState: useState -}; -var DispatcherWithoutHooks = { - readContext: readContext -}; - +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; @@ -17023,11 +18499,6 @@ if (enableSchedulerTracing) { // Used to ensure computeUniqueAsyncExpiration is monotonically decreasing. var lastUniqueAsyncExpiration = Sync - 1; -// Represents the expiration time that incoming updates should use. (If this -// is NoWork, use the default strategy: async updates in async mode, sync -// updates in sync mode.) -var expirationContext = NoWork; - var isWorking = false; // The next work in progress fiber that we're currently working on. @@ -17254,6 +18725,9 @@ function commitAllLifeCycles(finishedRoot, committedExpirationTime) { } } while (nextEffect !== null) { + { + setCurrentFiber(nextEffect); + } var effectTag = nextEffect.effectTag; if (effectTag & (Update | Callback)) { @@ -17267,12 +18741,15 @@ function commitAllLifeCycles(finishedRoot, committedExpirationTime) { commitAttachRef(nextEffect); } - if (enableHooks && effectTag & Passive) { + if (effectTag & Passive) { rootWithPendingPassiveEffects = finishedRoot; } nextEffect = nextEffect.nextEffect; } + { + resetCurrentFiber(); + } } function commitPassiveEffects(root, firstEffect) { @@ -17286,6 +18763,10 @@ function commitPassiveEffects(root, firstEffect) { var effect = firstEffect; do { + { + setCurrentFiber(effect); + } + if (effect.effectTag & Passive) { var didError = false; var error = void 0; @@ -17302,6 +18783,9 @@ function commitPassiveEffects(root, firstEffect) { } effect = effect.nextEffect; } while (effect !== null); + { + resetCurrentFiber(); + } isRendering = previousIsRendering; @@ -17310,6 +18794,10 @@ function commitPassiveEffects(root, firstEffect) { if (rootExpirationTime !== NoWork) { requestWork(root, rootExpirationTime); } + // Flush any sync work that was scheduled by effects + if (!isBatchingUpdates && !isRendering) { + performSyncWork(); + } } function isAlreadyFailedLegacyErrorBoundary(instance) { @@ -17325,8 +18813,10 @@ function markLegacyErrorBoundaryAsFailed(instance) { } function flushPassiveEffects() { + if (passiveEffectCallbackHandle !== null) { + cancelPassiveEffects(passiveEffectCallbackHandle); + } if (passiveEffectCallback !== null) { - scheduler.unstable_cancelCallback(passiveEffectCallbackHandle); // We call the scheduled callback instead of commitPassiveEffects directly // to ensure tracing works correctly. passiveEffectCallback(); @@ -17470,7 +18960,7 @@ function commitRoot(root, finishedWork) { } } - if (enableHooks && firstEffect !== null && rootWithPendingPassiveEffects !== null) { + if (firstEffect !== null && rootWithPendingPassiveEffects !== null) { // This commit included a passive effect. These do not need to fire until // after the next paint. Schedule an callback to fire them in an async // event. To ensure serial execution, the callback will be flushed early if @@ -17482,7 +18972,9 @@ function commitRoot(root, finishedWork) { // here because that code is still in flux. callback = tracing.unstable_wrap(callback); } - passiveEffectCallbackHandle = scheduler.unstable_scheduleCallback(callback); + passiveEffectCallbackHandle = scheduler.unstable_runWithPriority(scheduler.unstable_NormalPriority, function () { + return schedulePassiveEffects(callback); + }); passiveEffectCallback = callback; } @@ -17873,11 +19365,8 @@ function renderRoot(root, isYieldy) { flushPassiveEffects(); isWorking = true; - if (enableHooks) { - ReactCurrentOwner$2.currentDispatcher = Dispatcher; - } else { - ReactCurrentOwner$2.currentDispatcher = DispatcherWithoutHooks; - } + var previousDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = ContextOnlyDispatcher; var expirationTime = root.nextExpirationTimeToWorkOn; @@ -17917,7 +19406,7 @@ function renderRoot(root, isYieldy) { subscriber.onWorkStarted(interactions, threadID); } catch (error) { // Work thrown by an interaction tracing subscriber should be rethrown, - // But only once it's safe (to avoid leaveing the scheduler in an invalid state). + // But only once it's safe (to avoid leaving the scheduler in an invalid state). // Store the error for now and we'll re-throw in finishRendering(). if (!hasUnhandledError) { hasUnhandledError = true; @@ -18013,7 +19502,7 @@ function renderRoot(root, isYieldy) { // We're done performing work. Time to clean up. isWorking = false; - ReactCurrentOwner$2.currentDispatcher = null; + ReactCurrentDispatcher.current = previousDispatcher; resetContextDependences(); resetHooks(); @@ -18074,7 +19563,7 @@ function renderRoot(root, isYieldy) { return; } else if ( // There's no lower priority work, but we're rendering asynchronously. - // Synchronsouly attempt to render the same level one more time. This is + // Synchronously attempt to render the same level one more time. This is // similar to a suspend, but without a timeout because we're not waiting // for a promise to resolve. !root.didError && isYieldy) { @@ -18179,49 +19668,50 @@ function computeUniqueAsyncExpiration() { } function computeExpirationForFiber(currentTime, fiber) { + var priorityLevel = scheduler.unstable_getCurrentPriorityLevel(); + var expirationTime = void 0; - if (expirationContext !== NoWork) { - // An explicit expiration context was set; - expirationTime = expirationContext; - } else if (isWorking) { - if (isCommitting$1) { - // Updates that occur during the commit phase should have sync priority - // by default. - expirationTime = Sync; - } else { - // Updates during the render phase should expire at the same time as - // the work that is being rendered. - expirationTime = nextRenderExpirationTime; - } + if ((fiber.mode & ConcurrentMode) === NoContext) { + // Outside of concurrent mode, updates are always synchronous. + expirationTime = Sync; + } else if (isWorking && !isCommitting$1) { + // During render phase, updates expire during as the current render. + expirationTime = nextRenderExpirationTime; } else { - // No explicit expiration context was set, and we're not currently - // performing work. Calculate a new expiration time. - if (fiber.mode & ConcurrentMode) { - if (isBatchingInteractiveUpdates) { - // This is an interactive update + switch (priorityLevel) { + case scheduler.unstable_ImmediatePriority: + expirationTime = Sync; + break; + case scheduler.unstable_UserBlockingPriority: expirationTime = computeInteractiveExpiration(currentTime); - } else { - // This is an async update + break; + case scheduler.unstable_NormalPriority: + // This is a normal, concurrent update expirationTime = computeAsyncExpiration(currentTime); - } - // If we're in the middle of rendering a tree, do not update at the same - // expiration time that is already rendering. - if (nextRoot !== null && expirationTime === nextRenderExpirationTime) { - expirationTime -= 1; - } - } else { - // This is a sync update - expirationTime = Sync; + break; + case scheduler.unstable_LowPriority: + case scheduler.unstable_IdlePriority: + expirationTime = Never; + break; + default: + invariant(false, 'Unknown priority level. This error is likely caused by a bug in React. Please file an issue.'); } - } - if (isBatchingInteractiveUpdates) { - // This is an interactive update. Keep track of the lowest pending - // interactive expiration time. This allows us to synchronously flush - // all interactive updates when needed. - if (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime) { - lowestPriorityPendingInteractiveExpirationTime = expirationTime; + + // If we're in the middle of rendering a tree, do not update at the same + // expiration time that is already rendering. + if (nextRoot !== null && expirationTime === nextRenderExpirationTime) { + expirationTime -= 1; } } + + // Keep track of the lowest pending interactive expiration time. This + // allows us to synchronously flush all interactive updates + // when needed. + // TODO: Move this to renderer? + if (priorityLevel === scheduler.unstable_UserBlockingPriority && (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime)) { + lowestPriorityPendingInteractiveExpirationTime = expirationTime; + } + return expirationTime; } @@ -18236,56 +19726,68 @@ function renderDidError() { nextRenderDidError = true; } -function retrySuspendedRoot(root, boundaryFiber, sourceFiber, suspendedTime) { - var retryTime = void 0; - - if (isPriorityLevelSuspended(root, suspendedTime)) { - // Ping at the original level - retryTime = suspendedTime; +function pingSuspendedRoot(root, thenable, pingTime) { + // A promise that previously suspended React from committing has resolved. + // If React is still suspended, try again at the previous level (pingTime). - markPingedPriorityLevel(root, retryTime); - } else { - // Suspense already timed out. Compute a new expiration time - var currentTime = requestCurrentTime(); - retryTime = computeExpirationForFiber(currentTime, boundaryFiber); - markPendingPriorityLevel(root, retryTime); + var pingCache = root.pingCache; + if (pingCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + pingCache.delete(thenable); } - // TODO: If the suspense fiber has already rendered the primary children - // without suspending (that is, all of the promises have already resolved), - // we should not trigger another update here. One case this happens is when - // we are in sync mode and a single promise is thrown both on initial render - // and on update; we attach two .then(retrySuspendedRoot) callbacks and each - // one performs Sync work, rerendering the Suspense. - - if ((boundaryFiber.mode & ConcurrentMode) !== NoContext) { - if (root === nextRoot && nextRenderExpirationTime === suspendedTime) { - // Received a ping at the same priority level at which we're currently - // rendering. Restart from the root. - nextRoot = null; + if (nextRoot !== null && nextRenderExpirationTime === pingTime) { + // Received a ping at the same priority level at which we're currently + // rendering. Restart from the root. + nextRoot = null; + } else { + // Confirm that the root is still suspended at this level. Otherwise exit. + if (isPriorityLevelSuspended(root, pingTime)) { + // Ping at the original level + markPingedPriorityLevel(root, pingTime); + var rootExpirationTime = root.expirationTime; + if (rootExpirationTime !== NoWork) { + requestWork(root, rootExpirationTime); + } } } +} - scheduleWorkToRoot(boundaryFiber, retryTime); - if ((boundaryFiber.mode & ConcurrentMode) === NoContext) { - // Outside of concurrent mode, we must schedule an update on the source - // fiber, too, since it already committed in an inconsistent state and - // therefore does not have any pending work. - scheduleWorkToRoot(sourceFiber, retryTime); - var sourceTag = sourceFiber.tag; - if (sourceTag === ClassComponent && sourceFiber.stateNode !== null) { - // When we try rendering again, we should not reuse the current fiber, - // since it's known to be in an inconsistent state. Use a force updte to - // prevent a bail out. - var update = createUpdate(retryTime); - update.tag = ForceUpdate; - enqueueUpdate(sourceFiber, update); +function retryTimedOutBoundary(boundaryFiber, thenable) { + // The boundary fiber (a Suspense component) previously timed out and was + // rendered in its fallback state. One of the promises that suspended it has + // resolved, which means at least part of the tree was likely unblocked. Try + var retryCache = void 0; + if (enableSuspenseServerRenderer) { + switch (boundaryFiber.tag) { + case SuspenseComponent: + retryCache = boundaryFiber.stateNode; + break; + case DehydratedSuspenseComponent: + retryCache = boundaryFiber.memoizedState; + break; + default: + invariant(false, 'Pinged unknown suspense boundary type. This is probably a bug in React.'); } + } else { + retryCache = boundaryFiber.stateNode; + } + if (retryCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + retryCache.delete(thenable); } - var rootExpirationTime = root.expirationTime; - if (rootExpirationTime !== NoWork) { - requestWork(root, rootExpirationTime); + var currentTime = requestCurrentTime(); + var retryTime = computeExpirationForFiber(currentTime, boundaryFiber); + var root = scheduleWorkToRoot(boundaryFiber, retryTime); + if (root !== null) { + markPendingPriorityLevel(root, retryTime); + var rootExpirationTime = root.expirationTime; + if (rootExpirationTime !== NoWork) { + requestWork(root, rootExpirationTime); + } } } @@ -18366,6 +19868,14 @@ function scheduleWorkToRoot(fiber, expirationTime) { return root; } +function warnIfNotCurrentlyBatchingInDev(fiber) { + { + if (isRendering === false && isBatchingUpdates === false) { + warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see in the browser." + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber)); + } + } +} + function scheduleWork(fiber, expirationTime) { var root = scheduleWorkToRoot(fiber, expirationTime); if (root === null) { @@ -18408,13 +19918,9 @@ function scheduleWork(fiber, expirationTime) { } function syncUpdates(fn, a, b, c, d) { - var previousExpirationContext = expirationContext; - expirationContext = Sync; - try { + return scheduler.unstable_runWithPriority(scheduler.unstable_ImmediatePriority, function () { return fn(a, b, c, d); - } finally { - expirationContext = previousExpirationContext; - } + }); } // TODO: Everything below this is written as if it has been lifted to the @@ -18435,7 +19941,6 @@ var unhandledError = null; var isBatchingUpdates = false; var isUnbatchingUpdates = false; -var isBatchingInteractiveUpdates = false; var completedBatches = null; @@ -18909,7 +20414,9 @@ function completeRoot(root, finishedWork, expirationTime) { lastCommittedRootDuringThisBatch = root; nestedUpdateCount = 0; } - commitRoot(root, finishedWork); + scheduler.unstable_runWithPriority(scheduler.unstable_ImmediatePriority, function () { + commitRoot(root, finishedWork); + }); } function onUncaughtError(error) { @@ -18967,9 +20474,6 @@ function flushSync(fn, a) { } function interactiveUpdates$1(fn, a, b) { - if (isBatchingInteractiveUpdates) { - return fn(a, b); - } // If there are any pending interactive updates, synchronously flush them. // This needs to happen before we read any handlers, because the effect of // the previous event may influence which handlers are called during @@ -18979,14 +20483,13 @@ function interactiveUpdates$1(fn, a, b) { performWork(lowestPriorityPendingInteractiveExpirationTime, false); lowestPriorityPendingInteractiveExpirationTime = NoWork; } - var previousIsBatchingInteractiveUpdates = isBatchingInteractiveUpdates; var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingInteractiveUpdates = true; isBatchingUpdates = true; try { - return fn(a, b); + return scheduler.unstable_runWithPriority(scheduler.unstable_UserBlockingPriority, function () { + return fn(a, b); + }); } finally { - isBatchingInteractiveUpdates = previousIsBatchingInteractiveUpdates; isBatchingUpdates = previousIsBatchingUpdates; if (!isBatchingUpdates && !isRendering) { performSyncWork(); @@ -19175,10 +20678,43 @@ function findHostInstanceWithNoPortals(fiber) { return hostFiber.stateNode; } +var overrideProps = null; + +{ + var copyWithSetImpl = function (obj, path, idx, value) { + if (idx >= path.length) { + return value; + } + var key = path[idx]; + var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); + // $FlowFixMe number or string is fine here + updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value); + return updated; + }; + + var copyWithSet = function (obj, path, value) { + return copyWithSetImpl(obj, path, 0, value); + }; + + // Support DevTools props for function components, forwardRef, memo, host components, etc. + overrideProps = function (fiber, path, value) { + flushPassiveEffects(); + fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + scheduleWork(fiber, Sync); + }; +} + function injectIntoDevTools(devToolsConfig) { var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + return injectInternals(_assign({}, devToolsConfig, { + overrideProps: overrideProps, + currentDispatcherRef: ReactCurrentDispatcher, findHostInstanceByFiber: function (fiber) { var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { @@ -19216,10 +20752,11 @@ implementation) { // TODO: this is special because it gets imported during build. -var ReactVersion = '16.6.3'; +var ReactVersion = '16.8.6'; // TODO: This type is shared between the reconciler and ReactDOM, but will // eventually be lifted out to the renderer. + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; var topLevelUpdateWarnings = void 0; @@ -19528,9 +21065,6 @@ function legacyCreateRootFromDOMContainer(container, forceHydrate) { } function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { - // TODO: Ensure all entry points contain this check - !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; - { topLevelUpdateWarnings(container); } @@ -19574,7 +21108,7 @@ function legacyRenderSubtreeIntoContainer(parentComponent, children, container, return getPublicRootInstance(root._internalRoot); } -function createPortal(children, container) { +function createPortal$$1(children, container) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; @@ -19583,7 +21117,7 @@ function createPortal(children, container) { } var ReactDOM = { - createPortal: createPortal, + createPortal: createPortal$$1, findDOMNode: function (componentOrElement) { { @@ -19606,19 +21140,32 @@ var ReactDOM = { return findHostInstance(componentOrElement); }, hydrate: function (element, container, callback) { + !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } // TODO: throw or warn if we couldn't hydrate? return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); }, render: function (element, container, callback) { + !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call root.render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); }, unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) { + !isValidContainer(containerNode) ? invariant(false, 'Target container is not a DOM element.') : void 0; !(parentComponent != null && has(parentComponent)) ? invariant(false, 'parentComponent must be a valid React Component') : void 0; return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); }, unmountComponentAtNode: function (container) { !isValidContainer(container) ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. Did you mean to call root.unmount()?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } + if (container._reactRootContainer) { { var rootEl = getReactRootElementInContainer(container); @@ -19658,7 +21205,7 @@ var ReactDOM = { didWarnAboutUnstableCreatePortal = true; lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.'); } - return createPortal.apply(undefined, arguments); + return createPortal$$1.apply(undefined, arguments); }, @@ -19668,6 +21215,7 @@ var ReactDOM = { flushSync: flushSync, + unstable_createRoot: createRoot, unstable_flushControlled: flushControlled, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { @@ -19680,14 +21228,17 @@ var ReactDOM = { function createRoot(container, options) { var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot'; !isValidContainer(container) ? invariant(false, '%s(...): Target container is not a DOM element.', functionName) : void 0; + { + !!container._reactRootContainer ? warningWithoutStack$1(false, 'You are calling ReactDOM.%s() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + container._reactHasBeenPassedToCreateRootDEV = true; + } var hydrate = options != null && options.hydrate === true; return new ReactRoot(container, true, hydrate); } if (enableStableConcurrentModeAPIs) { ReactDOM.createRoot = createRoot; -} else { - ReactDOM.unstable_createRoot = createRoot; + ReactDOM.unstable_createRoot = undefined; } var foundDevTools = injectIntoDevTools({ diff --git a/frontend/node_modules/react-dom/cjs/react-dom.production.min.js b/frontend/node_modules/react-dom/cjs/react-dom.production.min.js index af99b8d8..97a51323 100644 --- a/frontend/node_modules/react-dom/cjs/react-dom.production.min.js +++ b/frontend/node_modules/react-dom/cjs/react-dom.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -10,240 +10,260 @@ /* Modernizr 3.0.0pre (Custom Build) | MIT */ -'use strict';var aa=require("react"),n=require("object-assign"),ba=require("scheduler");function ca(a,b,c,d,e,f,g,h){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 k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} -function t(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;dthis.eventPool.length&&this.eventPool.push(a)} -function jb(a){a.eventPool=[];a.getPooled=kb;a.release=lb}var mb=A.extend({data:null}),nb=A.extend({data:null}),ob=[9,13,27,32],pb=Sa&&"CompositionEvent"in window,qb=null;Sa&&"documentMode"in document&&(qb=document.documentMode); -var rb=Sa&&"TextEvent"in window&&!qb,sb=Sa&&(!pb||qb&&8=qb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", -captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1; -function wb(a,b){switch(a){case "keyup":return-1!==ob.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function xb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var yb=!1;function zb(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}} -function Ab(a,b){if(yb)return"compositionend"===a||!pb&&wb(a,b)?(a=gb(),fb=eb=cb=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function E(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var F={}; -"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){F[a]=new E(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];F[b]=new E(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){F[a]=new E(a,2,!1,a.toLowerCase(),null)}); -["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){F[a]=new E(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){F[a]=new E(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){F[a]=new E(a,3,!0,a,null)}); -["capture","download"].forEach(function(a){F[a]=new E(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){F[a]=new E(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){F[a]=new E(a,5,!1,a.toLowerCase(),null)});var vc=/[\-:]([a-z])/g;function xc(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(vc, -xc);F[b]=new E(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(vc,xc);F[b]=new E(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(vc,xc);F[b]=new E(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});F.tabIndex=new E("tabIndex",1,!1,"tabindex",null); -function yc(a,b,c,d){var e=F.hasOwnProperty(b)?F[b]:null;var f=null!==e?0===e.type:d?!1:!(2this.eventPool.length&&this.eventPool.push(a)} +function hb(a){a.eventPool=[];a.getPooled=ib;a.release=jb}var kb=y.extend({data:null}),lb=y.extend({data:null}),mb=[9,13,27,32],nb=Ra&&"CompositionEvent"in window,ob=null;Ra&&"documentMode"in document&&(ob=document.documentMode); +var pb=Ra&&"TextEvent"in window&&!ob,qb=Ra&&(!nb||ob&&8=ob),rb=String.fromCharCode(32),sb={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", +captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},tb=!1; +function ub(a,b){switch(a){case "keyup":return-1!==mb.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function vb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var wb=!1;function xb(a,b){switch(a){case "compositionend":return vb(b);case "keypress":if(32!==b.which)return null;tb=!0;return rb;case "textInput":return a=b.data,a===rb&&tb?null:a;default:return null}} +function yb(a,b){if(wb)return"compositionend"===a||!nb&&ub(a,b)?(a=eb(),db=cb=bb=null,wb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function C(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var D={}; +"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){D[a]=new C(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];D[b]=new C(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){D[a]=new C(a,2,!1,a.toLowerCase(),null)}); +["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){D[a]=new C(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){D[a]=new C(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){D[a]=new C(a,3,!0,a,null)}); +["capture","download"].forEach(function(a){D[a]=new C(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){D[a]=new C(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){D[a]=new C(a,5,!1,a.toLowerCase(),null)});var rc=/[\-:]([a-z])/g;function sc(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(rc, +sc);D[b]=new C(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(rc,sc);D[b]=new C(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(rc,sc);D[b]=new C(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});["tabIndex","crossOrigin"].forEach(function(a){D[a]=new C(a,1,!1,a.toLowerCase(),null)}); +function tc(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2Fd.length&&Fd.push(a)}}}var Ld={},Md=0,Nd="_reactListenersID"+(""+Math.random()).slice(2); -function Od(a){Object.prototype.hasOwnProperty.call(a,Nd)||(a[Nd]=Md++,Ld[a[Nd]]={});return Ld[a[Nd]]}function Pd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Qd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} -function Rd(a,b){var c=Qd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Qd(c)}}function Sd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Sd(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} -function Td(){for(var a=window,b=Pd();b instanceof a.HTMLIFrameElement;){try{a=b.contentDocument.defaultView}catch(c){break}b=Pd(a.document)}return b}function Ud(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} -var Vd=Sa&&"documentMode"in document&&11>=document.documentMode,Wd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Xd=null,Yd=null,Zd=null,$d=!1; -function ae(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if($d||null==Xd||Xd!==Pd(c))return null;c=Xd;"selectionStart"in c&&Ud(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Zd&&jd(Zd,c)?null:(Zd=c,a=A.getPooled(Wd.select,Yd,a,b),a.type="select",a.target=Xd,Ra(a),a)} -var be={eventTypes:Wd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Od(e);f=ta.onSelect;for(var g=0;g=b.length?void 0:t("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:zc(c)}} -function ie(a,b){var c=zc(b.value),d=zc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function je(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var ke={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; -function le(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function me(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?le(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} -var ne=void 0,oe=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==ke.svg||"innerHTML"in a)a.innerHTML=b;else{ne=ne||document.createElement("div");ne.innerHTML=""+b+"";for(b=ne.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); -function pe(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} -var qe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0, -floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},re=["Webkit","ms","Moz","O"];Object.keys(qe).forEach(function(a){re.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qe[b]=qe[a]})});function se(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||qe.hasOwnProperty(a)&&qe[a]?(""+b).trim():b+"px"} -function te(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=se(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var ue=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); -function ve(a,b){b&&(ue[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?t("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?t("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:t("61")),null!=b.style&&"object"!==typeof b.style?t("62",""):void 0)} -function we(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}} -function xe(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Od(a);b=ta[b];for(var d=0;dIe||(a.current=He[Ie],He[Ie]=null,Ie--)}function I(a,b){Ie++;He[Ie]=a.current;a.current=b}var Je={},J={current:Je},K={current:!1},Ke=Je; -function Le(a,b){var c=a.type.contextTypes;if(!c)return Je;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function L(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Me(a){H(K,a);H(J,a)}function Ne(a){H(K,a);H(J,a)} -function Oe(a,b,c){J.current!==Je?t("168"):void 0;I(J,b,a);I(K,c,a)}function Pe(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:t("108",mc(b)||"Unknown",e);return n({},c,d)}function Qe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Je;Ke=J.current;I(J,b,a);I(K,K.current,a);return!0} -function Re(a,b,c){var d=a.stateNode;d?void 0:t("169");c?(b=Pe(a,b,Ke),d.__reactInternalMemoizedMergedChildContext=b,H(K,a),H(J,a),I(J,b,a)):H(K,a);I(K,c,a)}var Se=null,Te=null;function Ue(a){return function(b){try{return a(b)}catch(c){}}} -function Ve(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Se=Ue(function(a){return b.onCommitFiberRoot(c,a)});Te=Ue(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0} -function We(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function M(a,b,c,d){return new We(a,b,c,d)} -function Xe(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Ye(a){if("function"===typeof a)return Xe(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===gc)return 11;if(a===ic)return 14}return 2} -function Ze(a,b){var c=a.alternate;null===c?(c=M(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.firstContextDependency=a.firstContextDependency;c.sibling=a.sibling; +["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(a){wd(a,!0)});td.forEach(function(a){wd(a,!1)}); +var xd={eventTypes:ud,isInteractiveTopLevelEventType:function(a){a=vd[a];return void 0!==a&&!0===a.isInteractive},extractEvents:function(a,b,c,d){var e=vd[a];if(!e)return null;switch(a){case "keypress":if(0===ld(c))return null;case "keydown":case "keyup":a=od;break;case "blur":case "focus":a=kd;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=Yc;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a= +pd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=qd;break;case Xa:case Ya:case Za:a=id;break;case $a:a=rd;break;case "scroll":a=Qc;break;case "wheel":a=sd;break;case "copy":case "cut":case "paste":a=jd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=Zc;break;default:a=y}b=a.getPooled(e,b,c,d);Qa(b);return b}},yd=xd.isInteractiveTopLevelEventType, +zd=[];function Ad(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d;for(d=c;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo;if(!d)break;a.ancestors.push(c);c=Ha(d)}while(c);for(c=0;czd.length&&zd.push(a)}}}var Fd={},Gd=0,Hd="_reactListenersID"+(""+Math.random()).slice(2); +function Id(a){Object.prototype.hasOwnProperty.call(a,Hd)||(a[Hd]=Gd++,Fd[a[Hd]]={});return Fd[a[Hd]]}function Jd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Kd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} +function Ld(a,b){var c=Kd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Kd(c)}}function Md(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Md(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} +function Nd(){for(var a=window,b=Jd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Jd(a.document)}return b}function Od(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} +function Pd(){var a=Nd();if(Od(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(A){b=null;break a}var f=0,g=-1,h=-1,l=0,k=0,m=a,p=null;b:for(;;){for(var t;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length); +if(null===(t=m.firstChild))break;p=m;m=t}for(;;){if(m===a)break b;p===b&&++l===d&&(g=f);p===e&&++k===c&&(h=f);if(null!==(t=m.nextSibling))break;m=p;p=m.parentNode}m=t}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}} +function Qd(a){var b=Nd(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Md(c.ownerDocument.documentElement,c)){if(null!==d&&Od(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ld(c,f);var g=Ld(c, +d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Sd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Td=null,Ud=null,Vd=null,Wd=!1; +function Xd(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Wd||null==Td||Td!==Jd(c))return null;c=Td;"selectionStart"in c&&Od(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Vd&&dd(Vd,c)?null:(Vd=c,a=y.getPooled(Sd.select,Ud,a,b),a.type="select",a.target=Td,Qa(a),a)} +var Yd={eventTypes:Sd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Id(e);f=sa.onSelect;for(var g=0;g=b.length?void 0:x("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:uc(c)}} +function de(a,b){var c=uc(b.value),d=uc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function ee(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var fe={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; +function ge(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?ge(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} +var ie=void 0,je=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==fe.svg||"innerHTML"in a)a.innerHTML=b;else{ie=ie||document.createElement("div");ie.innerHTML=""+b+"";for(b=ie.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); +function ke(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} +var le={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0, +floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},me=["Webkit","ms","Moz","O"];Object.keys(le).forEach(function(a){me.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);le[b]=le[a]})});function ne(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||le.hasOwnProperty(a)&&le[a]?(""+b).trim():b+"px"} +function oe(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ne(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var pe=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); +function qe(a,b){b&&(pe[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?x("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?x("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:x("61")),null!=b.style&&"object"!==typeof b.style?x("62",""):void 0)} +function re(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}} +function se(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Id(a);b=sa[b];for(var d=0;dGe||(a.current=Fe[Ge],Fe[Ge]=null,Ge--)}function G(a,b){Ge++;Fe[Ge]=a.current;a.current=b}var He={},H={current:He},I={current:!1},Ie=He; +function Je(a,b){var c=a.type.contextTypes;if(!c)return He;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function J(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ke(a){F(I,a);F(H,a)}function Le(a){F(I,a);F(H,a)} +function Me(a,b,c){H.current!==He?x("168"):void 0;G(H,b,a);G(I,c,a)}function Ne(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x("108",ic(b)||"Unknown",e);return n({},c,d)}function Oe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||He;Ie=H.current;G(H,b,a);G(I,I.current,a);return!0} +function Pe(a,b,c){var d=a.stateNode;d?void 0:x("169");c?(b=Ne(a,b,Ie),d.__reactInternalMemoizedMergedChildContext=b,F(I,a),F(H,a),G(H,b,a)):F(I,a);G(I,c,a)}var Qe=null,Re=null;function Se(a){return function(b){try{return a(b)}catch(c){}}} +function Te(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Qe=Se(function(a){return b.onCommitFiberRoot(c,a)});Re=Se(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0} +function Ue(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function K(a,b,c,d){return new Ue(a,b,c,d)} +function Ve(a){a=a.prototype;return!(!a||!a.isReactComponent)}function We(a){if("function"===typeof a)return Ve(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===cc)return 11;if(a===ec)return 14}return 2} +function Xe(a,b){var c=a.alternate;null===c?(c=K(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.contextDependencies=a.contextDependencies;c.sibling=a.sibling; c.index=a.index;c.ref=a.ref;return c} -function $e(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Xe(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ac:return af(c.children,e,f,b);case fc:return bf(c,e|3,f,b);case bc:return bf(c,e|2,f,b);case cc:return a=M(12,c,b,e|4),a.elementType=cc,a.type=cc,a.expirationTime=f,a;case hc:return a=M(13,c,b,e),a.elementType=hc,a.type=hc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case dc:g=10;break a;case ec:g=9;break a;case gc:g=11;break a;case ic:g= -14;break a;case jc:g=16;d=null;break a}t("130",null==a?a:typeof a,"")}b=M(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function af(a,b,c,d){a=M(7,a,d,b);a.expirationTime=c;return a}function bf(a,b,c,d){a=M(8,a,d,b);b=0===(b&1)?bc:fc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function cf(a,b,c){a=M(6,a,null,b);a.expirationTime=c;return a} -function df(a,b,c){b=M(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function ef(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);ff(b,a)} -function gf(a,b){a.didError=!1;var c=a.latestPingedTime;0!==c&&c>=b&&(a.latestPingedTime=0);c=a.earliestPendingTime;var d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);ff(b,a)} -function hf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function ff(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}var jf=!1; -function kf(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function lf(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} -function mf(a){return{expirationTime:a,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function nf(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)} -function of(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=kf(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=kf(a.memoizedState),e=c.updateQueue=kf(c.memoizedState)):d=a.updateQueue=lf(e):null===e&&(e=c.updateQueue=lf(d));null===e||d===e?nf(d,b):null===d.lastUpdate||null===e.lastUpdate?(nf(d,b),nf(e,b)):(nf(d,b),e.lastUpdate=b)} -function pf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=kf(a.memoizedState):qf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function qf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=lf(b));return b} -function rf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case 2:jf=!0}return d} -function sf(a,b,c,d,e){jf=!1;b=qf(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;mu?(p=m,m=null):p=m.sibling;var v=x(e,m,h[u],k);if(null===v){null===m&&(m=p);break}a&& -m&&null===v.alternate&&b(e,m);g=f(v,g,u);null===r?l=v:r.sibling=v;r=v;m=p}if(u===h.length)return c(e,m),l;if(null===m){for(;uu?(p=r,r=null):p=r.sibling;var y=x(e,r,v.value,k);if(null===y){r||(r=p);break}a&&r&&null===y.alternate&&b(e,r);g=f(y,g,u);null===m?l=y:m.sibling=y;m=y;r=p}if(v.done)return c(e,r),l;if(null===r){for(;!v.done;u++,v=h.next())v=q(e,v.value,k),null!==v&&(g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);return l}for(r=d(e,r);!v.done;u++,v=h.next())v=z(r,e,u,v.value,k),null!==v&&(a&&null!==v.alternate&&r.delete(null===v.key?u: -v.key),g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);a&&r.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ac&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Zb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===ac:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ac?f.props.children:f.props,h);d.ref=$f(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k= -k.sibling}f.type===ac?(d=af(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=$e(f.type,f.key,f.props,null,a.mode,h),h.ref=$f(a,d,f),h.return=a,a=h)}return g(a);case $b:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=df(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f= -""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=cf(f,a.mode,h),d.return=a,a=d),g(a);if(Zf(f))return B(a,d,f,h);if(lc(f))return Q(a,d,f,h);l&&ag(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,t("152",h.displayName||h.name||"Component")}return c(a,d)}}var cg=bg(!0),dg=bg(!1),eg=null,fg=null,gg=!1; -function hg(a,b){var c=M(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function ig(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;default:return!1}} -function jg(a){if(gg){var b=fg;if(b){var c=b;if(!ig(a,b)){b=Fe(c);if(!b||!ig(a,b)){a.effectTag|=2;gg=!1;eg=a;return}hg(eg,c)}eg=a;fg=Ge(b)}else a.effectTag|=2,gg=!1,eg=a}}function kg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag;)a=a.return;eg=a}function lg(a){if(a!==eg)return!1;if(!gg)return kg(a),gg=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ce(b,a.memoizedProps))for(b=fg;b;)hg(a,b),b=Fe(b);kg(a);fg=eg?Fe(a.stateNode):null;return!0}function mg(){fg=eg=null;gg=!1}var ng=Xb.ReactCurrentOwner; -function P(a,b,c,d){b.child=null===a?dg(b,null,c,d):cg(b,a.child,c,d)}function og(a,b,c,d,e){c=c.render;var f=b.ref;Cf(b,e);d=c(d,f);b.effectTag|=1;P(a,b,d,e);return b.child} -function pg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Xe(g)&&void 0===g.defaultProps&&null===c.compare)return b.tag=15,b.type=g,qg(a,b,g,d,e,f);a=$e(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return xg(a,b,c);b=rg(a,b,c);return null!==b?b.sibling:null}}return rg(a,b,c)}b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!== -a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Le(b,J.current);Cf(b,c);e=d(a,e);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;if(L(d)){var f=!0;Qe(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Pf(b,d,g,a);e.updater=Uf;b.stateNode=e;e._reactInternalFiber=b;Yf(b,d,a,c);b=vg(null,b,d,!0,f,c)}else b.tag=0,P(null,b,e,c),b=b.child; -return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=Mf(e);b.type=a;e=b.tag=Ye(a);f=O(a,f);g=void 0;switch(e){case 0:g=sg(null,b,a,f,c);break;case 1:g=ug(null,b,a,f,c);break;case 11:g=og(null,b,a,f,c);break;case 14:g=pg(null,b,a,O(a.type,f),d,c);break;default:t("283",a)}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),sg(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),ug(a,b,d, -e,c);case 3:wg(b);d=b.updateQueue;null===d?t("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;sf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)mg(),b=rg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)fg=Ge(b.stateNode.containerInfo),eg=b,e=gg=!0;e?(b.effectTag|=2,b.child=dg(b,null,d,c)):(P(a,b,d,c),mg());b=b.child}return b;case 5:return Kf(b),null===a&&jg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ce(d,e)?g=null:null!== -f&&Ce(d,f)&&(b.effectTag|=16),tg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=1,b=null):(P(a,b,g,c),b=b.child),b;case 6:return null===a&&jg(b),null;case 13:return xg(a,b,c);case 4:return If(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=cg(b,null,d,c):P(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),og(a,b,d,e,c);case 7:return P(a,b,b.pendingProps,c),b.child;case 8:return P(a,b,b.pendingProps.children,c),b.child;case 12:return P(a,b,b.pendingProps.children, -c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Af(b,f);if(null!==g){var h=g.value;f=h===f&&(0!==h||1/h===1/f)||h!==h&&f!==f?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!K.current){b=rg(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){h=g.firstContextDependency;if(null!==h){do{if(h.context===d&&0!==(h.observedBits&f)){if(1===g.tag){var k=mf(c);k.tag=2;of(g,k)}g.expirationTime< -c&&(g.expirationTime=c);k=g.alternate;null!==k&&k.expirationTimeb&&(a.latestPendingTime=b);df(b,a)} +function ef(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{bb?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?cf(a,b):bc&&cf(a,b)}df(0,a)}function ff(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);df(b,a)} +function gf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function df(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function L(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b} +function hf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var jf=(new aa.Component).refs; +function kf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)} +var tf={isMounted:function(a){return(a=a._reactInternalFiber)?2===ed(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=lf();d=mf(d,a);var e=nf(d);e.tag=rf;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);of();pf(a,e);qf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=lf();c=mf(c,a);var d=nf(c);d.tag= +sf;void 0!==b&&null!==b&&(d.callback=b);of();pf(a,d);qf(a,c)}};function uf(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!dd(c,d)||!dd(e,f):!0} +function vf(a,b,c){var d=!1,e=He;var f=b.contextType;"object"===typeof f&&null!==f?f=M(f):(e=J(b)?Ie:H.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Je(a,e):He);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=tf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} +function wf(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&tf.enqueueReplaceState(b,b.state,null)} +function xf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=jf;var f=b.contextType;"object"===typeof f&&null!==f?e.context=M(f):(f=J(b)?Ie:H.current,e.context=Je(a,f));f=a.updateQueue;null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(kf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!== +typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&tf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(yf(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var zf=Array.isArray; +function Af(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x("309"):void 0,d=c.stateNode);d?void 0:x("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===jf&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?x("284"):void 0;c._owner?void 0:x("290",a)}return a} +function Bf(a,b){"textarea"!==a.type&&x("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")} +function Cf(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=Xe(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,du?(B=q,q=null):B=q.sibling;var w=t(e,q,h[u],k);if(null===w){null===q&&(q=B);break}a&& +q&&null===w.alternate&&b(e,q);g=f(w,g,u);null===m?l=w:m.sibling=w;m=w;q=B}if(u===h.length)return c(e,q),l;if(null===q){for(;uu?(B=q,q=null):B=q.sibling;var v=t(e,q,w.value,k);if(null===v){q||(q=B);break}a&&q&&null===v.alternate&&b(e,q);g=f(v,g,u);null===m?l=v:m.sibling=v;m=v;q=B}if(w.done)return c(e,q),l;if(null===q){for(;!w.done;u++,w=h.next())w=p(e,w.value,k),null!==w&&(g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);return l}for(q=d(e,q);!w.done;u++,w=h.next())w=A(q,e,u,w.value,k),null!==w&&(a&&null!==w.alternate&&q.delete(null===w.key?u: +w.key),g=f(w,g,u),null===m?l=w:m.sibling=w,m=w);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===Xb&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Vb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===Xb:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Xb?f.props.children:f.props,h);d.ref=Af(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k= +k.sibling}f.type===Xb?(d=Ze(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ye(f.type,f.key,f.props,null,a.mode,h),h.ref=Af(a,d,f),h.return=a,a=h)}return g(a);case Wb:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=bf(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f= +""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=af(f,a.mode,h),d.return=a,a=d),g(a);if(zf(f))return v(a,d,f,h);if(hc(f))return R(a,d,f,h);l&&Bf(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x("152",h.displayName||h.name||"Component")}return c(a,d)}}var Df=Cf(!0),Ef=Cf(!1),Ff={},N={current:Ff},Gf={current:Ff},Hf={current:Ff};function If(a){a===Ff?x("174"):void 0;return a} +function Jf(a,b){G(Hf,b,a);G(Gf,a,a);G(N,Ff,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:he(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=he(b,c)}F(N,a);G(N,b,a)}function Kf(a){F(N,a);F(Gf,a);F(Hf,a)}function Lf(a){If(Hf.current);var b=If(N.current);var c=he(b,a.type);b!==c&&(G(Gf,a,a),G(N,c,a))}function Mf(a){Gf.current===a&&(F(N,a),F(Gf,a))} +var Nf=0,Of=2,Pf=4,Qf=8,Rf=16,Sf=32,Tf=64,Uf=128,Vf=Tb.ReactCurrentDispatcher,Wf=0,Xf=null,O=null,P=null,Yf=null,Q=null,Zf=null,$f=0,ag=null,bg=0,cg=!1,dg=null,eg=0;function fg(){x("321")}function gg(a,b){if(null===b)return!1;for(var c=0;c$f&&($f=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next}while(null!==l&&l!==d);k||(h=g,e=f);bd(f,b.memoizedState)||(qg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]} +function rg(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===ag?(ag={lastEffect:null},ag.lastEffect=a.next=a):(b=ag.lastEffect,null===b?ag.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,ag.lastEffect=a));return a}function sg(a,b,c,d){var e=mg();bg|=a;e.memoizedState=rg(b,c,void 0,void 0===d?null:d)} +function tg(a,b,c,d){var e=ng();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&gg(d,g.deps)){rg(Nf,c,f,d);return}}bg|=a;e.memoizedState=rg(b,c,f,d)}function ug(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function vg(){} +function wg(a,b,c){25>eg?void 0:x("301");var d=a.alternate;if(a===Xf||null!==d&&d===Xf)if(cg=!0,a={expirationTime:Wf,action:c,eagerReducer:null,eagerState:null,next:null},null===dg&&(dg=new Map),c=dg.get(b),void 0===c)dg.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{of();var e=lf();e=mf(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null=== +d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var l=b.lastRenderedState,k=d(l,c);f.eagerReducer=d;f.eagerState=k;if(bd(k,l))return}catch(m){}finally{}qf(a,e)}} +var kg={readContext:M,useCallback:fg,useContext:fg,useEffect:fg,useImperativeHandle:fg,useLayoutEffect:fg,useMemo:fg,useReducer:fg,useRef:fg,useState:fg,useDebugValue:fg},ig={readContext:M,useCallback:function(a,b){mg().memoizedState=[a,void 0===b?null:b];return a},useContext:M,useEffect:function(a,b){return sg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return sg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a,b){return sg(4,Pf|Sf,a,b)}, +useMemo:function(a,b){var c=mg();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=mg();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=wg.bind(null,Xf,a);return[d.memoizedState,a]},useRef:function(a){var b=mg();a={current:a};return b.memoizedState=a},useState:function(a){var b=mg();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null, +lastRenderedReducer:og,lastRenderedState:a};a=a.dispatch=wg.bind(null,Xf,a);return[b.memoizedState,a]},useDebugValue:vg},jg={readContext:M,useCallback:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:M,useEffect:function(a,b){return tg(516,Uf|Tf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return tg(4,Pf|Sf,ug.bind(null,b,a),c)},useLayoutEffect:function(a, +b){return tg(4,Pf|Sf,a,b)},useMemo:function(a,b){var c=ng();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&gg(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:pg,useRef:function(){return ng().memoizedState},useState:function(a){return pg(og,a)},useDebugValue:vg},xg=null,yg=null,zg=!1; +function Ag(a,b){var c=K(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function Bg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}} +function Cg(a){if(zg){var b=yg;if(b){var c=b;if(!Bg(a,b)){b=De(c);if(!b||!Bg(a,b)){a.effectTag|=2;zg=!1;xg=a;return}Ag(xg,c)}xg=a;yg=Ee(b)}else a.effectTag|=2,zg=!1,xg=a}}function Dg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;xg=a}function Eg(a){if(a!==xg)return!1;if(!zg)return Dg(a),zg=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!xe(b,a.memoizedProps))for(b=yg;b;)Ag(a,b),b=De(b);Dg(a);yg=xg?De(a.stateNode):null;return!0}function Fg(){yg=xg=null;zg=!1} +var Gg=Tb.ReactCurrentOwner,qg=!1;function S(a,b,c,d){b.child=null===a?Ef(b,null,c,d):Df(b,a.child,c,d)}function Hg(a,b,c,d,e){c=c.render;var f=b.ref;Ig(b,e);d=hg(a,b,c,d,f,e);if(null!==a&&!qg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Jg(a,b,e);b.effectTag|=1;S(a,b,d,e);return b.child} +function Kg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Ve(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Lg(a,b,g,d,e,f);a=Ye(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Sg(a,b,c);b=Jg(a,b,c);return null!==b?b.sibling:null}}return Jg(a,b,c)}}else qg=!1;b.expirationTime=0;switch(b.tag){case 2:d= +b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Je(b,H.current);Ig(b,c);e=hg(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;lg();if(J(d)){var f=!0;Oe(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&kf(b,d,g,a);e.updater=tf;b.stateNode=e;e._reactInternalFiber=b;xf(b,d,a,c);b=Qg(null,b,d,!0,f, +c)}else b.tag=0,S(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=hf(e);b.type=a;e=b.tag=We(a);f=L(a,f);g=void 0;switch(e){case 0:g=Mg(null,b,a,f,c);break;case 1:g=Og(null,b,a,f,c);break;case 11:g=Hg(null,b,a,f,c);break;case 14:g=Kg(null,b,a,L(a.type,f),d,c);break;default:x("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Mg(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps, +e=b.elementType===d?e:L(d,e),Og(a,b,d,e,c);case 3:Rg(b);d=b.updateQueue;null===d?x("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;yf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Fg(),b=Jg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)yg=Ee(b.stateNode.containerInfo),xg=b,e=zg=!0;e?(b.effectTag|=2,b.child=Ef(b,null,d,c)):(S(a,b,d,c),Fg());b=b.child}return b;case 5:return Lf(b),null===a&&Cg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null, +g=e.children,xe(d,e)?g=null:null!==f&&xe(d,f)&&(b.effectTag|=16),Ng(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(S(a,b,g,c),b=b.child),b;case 6:return null===a&&Cg(b),null;case 13:return Sg(a,b,c);case 4:return Jf(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Df(b,null,d,c):S(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:L(d,e),Hg(a,b,d,e,c);case 7:return S(a,b,b.pendingProps,c),b.child;case 8:return S(a,b,b.pendingProps.children, +c),b.child;case 12:return S(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Ug(b,f);if(null!==g){var h=g.value;f=bd(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!I.current){b=Jg(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var l=h.contextDependencies;if(null!==l){g=h.child;for(var k=l.first;null!==k;){if(k.context===d&&0!== +(k.observedBits&f)){1===h.tag&&(k=nf(c),k.tag=sf,pf(h,k));h.expirationTime=b&&(qg=!0);a.contextDependencies=null} +function M(a,b){if(Yg!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Yg=a,b=1073741823;b={context:a,observedBits:b,next:null};null===Xg?(null===Wg?x("308"):void 0,Xg=b,Wg.contextDependencies={first:b,expirationTime:0}):Xg=Xg.next=b}return a._currentValue}var $g=0,rf=1,sf=2,ah=3,Pg=!1;function bh(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} +function ch(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function nf(a){return{expirationTime:a,tag:$g,payload:null,callback:null,next:null,nextEffect:null}}function dh(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)} +function pf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=bh(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=bh(a.memoizedState),e=c.updateQueue=bh(c.memoizedState)):d=a.updateQueue=ch(e):null===e&&(e=c.updateQueue=ch(d));null===e||d===e?dh(d,b):null===d.lastUpdate||null===e.lastUpdate?(dh(d,b),dh(e,b)):(dh(d,b),e.lastUpdate=b)} +function eh(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=bh(a.memoizedState):fh(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function fh(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=ch(b));return b} +function gh(a,b,c,d,e,f){switch(c.tag){case rf:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case ah:a.effectTag=a.effectTag&-2049|64;case $g:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case sf:Pg=!0}return d} +function yf(a,b,c,d,e){Pg=!1;b=fh(a,b);for(var f=b.baseState,g=null,h=0,l=b.firstUpdate,k=f;null!==l;){var m=l.expirationTime;m\x3c/script>",l=e.removeChild(e.firstChild)):"string"===typeof q.is?l=l.createElement(e,{is:q.is}):(l=l.createElement(e),"select"===e&&q.multiple&&(l.multiple=!0)):l=l.createElementNS(k,e);e=l;e[Ga]=m;e[Ha]=g;Ag(e,b,!1,!1);q=e;l=f;m=g;var x=h,z=we(l,m);switch(l){case "iframe":case "object":G("load", -q);h=m;break;case "video":case "audio":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==R)return R;null!==c&&0===(c.effectTag&1024)&&(null=== -c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1=z)q=0;else if(-1===q||z component higher in the tree to provide a loading indicator or placeholder to display."+nc(k))}$g=!0;l=vf(l,k);g=h;do{switch(g.tag){case 3:k= -l;g.effectTag|=2048;g.expirationTime=f;f=Pg(g,k,f);pf(g,f);break a;case 1:if(k=l,h=g.type,m=g.stateNode,0===(g.effectTag&64)&&("function"===typeof h.getDerivedStateFromError||null!==m&&"function"===typeof m.componentDidCatch&&(null===Sg||!Sg.has(m)))){g.effectTag|=2048;g.expirationTime=f;f=Rg(g,k,f);pf(g,f);break a}}g=g.return}while(null!==g)}R=eh(e);continue}}}break}while(1);Yg=!1;zf=yf=xf=Vg.currentDispatcher=null;if(d)S=null,a.finishedWork=null;else if(null!==R)a.finishedWork=null;else{d=a.current.alternate; -null===d?t("281"):void 0;S=null;if($g){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime=c,a.finishedWork=d)}} -function Jg(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Sg||!Sg.has(d))){a=vf(b,a);a=Rg(c,a,1073741823);of(c,a);Tf(c,1073741823);return}break;case 3:a=vf(b,a);a=Pg(c,a,1073741823);of(c,a);Tf(c,1073741823);return}c=c.return}3===a.tag&&(c=vf(b,a),c=Pg(a,c,1073741823),of(a,c),Tf(a,1073741823))} -function Rf(a,b){0!==Xg?a=Xg:Yg?a=ah?1073741823:T:b.mode&1?(a=kh?1073741822-10*(((1073741822-a+15)/10|0)+1):1073741822-25*(((1073741822-a+500)/25|0)+1),null!==S&&a===T&&--a):a=1073741823;kh&&(0===lh||a=f){f=e=d;a.didError=!1;var g=a.latestPingedTime;if(0===g||g>f)a.latestPingedTime=f;ff(f,a)}else e=Qf(),e=Rf(e,b),ef(a,e);0!==(b.mode&1)&&a===S&&T===d&&(S=null);mh(b,e);0===(b.mode&1)&&(mh(c,e),1===c.tag&&null!==c.stateNode&&(b=mf(e),b.tag=2,of(c,b)));c=a.expirationTime;0!==c&&nh(a,c)} -function mh(a,b){a.expirationTimeT&&dh(),ef(a,b),Yg&&!ah&&S===a||nh(a,a.expirationTime),oh>ph&&(oh=0,t("185")))}function qh(a,b,c,d,e){var f=Xg;Xg=1073741823;try{return a(b,c,d,e)}finally{Xg=f}}var rh=null,V=null,sh=0,th=void 0,W=!1,uh=null,X=0,lh=0,vh=!1,wh=null,Z=!1,xh=!1,kh=!1,yh=null,zh=ba.unstable_now(),Ah=1073741822-(zh/10|0),Bh=Ah,ph=50,oh=0,Ch=null;function Dh(){Ah=1073741822-((ba.unstable_now()-zh)/10|0)} -function Eh(a,b){if(0!==sh){if(ba.expirationTime&&(a.expirationTime=b);W||(Z?xh&&(uh=a,X=1073741823,Jh(a,1073741823,!1)):1073741823===b?Kh(1073741823,!1):Eh(a,b))} -function Ih(){var a=0,b=null;if(null!==V)for(var c=V,d=rh;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===V?t("244"):void 0;if(d===d.nextScheduledRoot){rh=V=d.nextScheduledRoot=null;break}else if(d===rh)rh=e=d.nextScheduledRoot,V.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===V){V=c;V.nextScheduledRoot=rh;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===V)break;if(1073741823=== -a)break;c=d;d=d.nextScheduledRoot}}uh=b;X=a}var Lh=!1;function hh(){return Lh?!0:ba.unstable_shouldYield()?Lh=!0:!1}function Fh(){try{if(!hh()&&null!==rh){Dh();var a=rh;do{var b=a.expirationTime;0!==b&&Ah<=b&&(a.nextExpirationTimeToWorkOn=Ah);a=a.nextScheduledRoot}while(a!==rh)}Kh(0,!0)}finally{Lh=!1}} -function Kh(a,b){Ih();if(b)for(Dh(),Bh=Ah;null!==uh&&0!==X&&a<=X&&!(Lh&&Ah>X);)Jh(uh,X,Ah>X),Ih(),Dh(),Bh=Ah;else for(;null!==uh&&0!==X&&a<=X;)Jh(uh,X,!1),Ih();b&&(sh=0,th=null);0!==X&&Eh(uh,X);oh=0;Ch=null;if(null!==yh)for(a=yh,yh=null,b=0;b=c&&(null===yh?yh=[d]:yh.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Ch?oh++:(Ch=a,oh=0);ah=Yg=!0;a.current===b?t("177"):void 0;c=a.pendingCommitExpirationTime;0===c?t("261"):void 0;a.pendingCommitExpirationTime=0;d=b.expirationTime;var e=b.childExpirationTime;d=e>d?e:d;a.didError=!1;0===d?(a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime= -0):(e=a.latestPendingTime,0!==e&&(e>d?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>d&&(a.earliestPendingTime=a.latestPendingTime)),e=a.earliestSuspendedTime,0===e?ef(a,d):de&&ef(a,d));ff(0,a);Vg.current=null;1u&&(y=u,u=r,r=y),y=Rd(w,r),Y=Rd(w,u),y&&Y&&(1!==p.rangeCount||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==Y.node||p.focusOffset!==Y.offset)&&(C=C.createRange(),C.setStart(y.node,y.offset),p.removeAllRanges(),r>u?(p.addRange(C),p.extend(Y.node,Y.offset)):(C.setEnd(Y.node,Y.offset), -p.addRange(C))))));C=[];for(p=w;p=p.parentNode;)1===p.nodeType&&C.push({element:p,left:p.scrollLeft,top:p.scrollTop});"function"===typeof w.focus&&w.focus();for(w=0;wFb?b:Fb;0===b&&(Sg=null);a.expirationTime=b;a.finishedWork=null} -function Qg(a){null===uh?t("246"):void 0;uh.expirationTime=0;vh||(vh=!0,wh=a)}function Nh(a,b){var c=Z;Z=!0;try{return a(b)}finally{(Z=c)||W||Kh(1073741823,!1)}}function Oh(a,b){if(Z&&!xh){xh=!0;try{return a(b)}finally{xh=!1}}return a(b)}function Ph(a,b,c){if(kh)return a(b,c);Z||W||0===lh||(Kh(lh,!1),lh=0);var d=kh,e=Z;Z=kh=!0;try{return a(b,c)}finally{kh=d,(Z=e)||W||Kh(1073741823,!1)}} -function Qh(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===kd(c)&&1===c.tag?void 0:t("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(L(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);t("171");g=void 0}if(1===c.tag){var h=c.type;if(L(h)){c=Pe(c,h,g);break a}}c=g}else c=Je;null===b.context?b.context=c:b.pendingContext=c;b=e;e=mf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b); -Sf();of(f,e);Tf(f,d);return d}function Rh(a,b,c,d){var e=b.current,f=Qf();e=Rf(f,e);return Qh(a,b,c,e,d)}function Sh(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Uh(a,b,c){var d=3=Wg&&(b=Wg-1);this._expirationTime=Wg=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Vh.prototype.render=function(a){this._defer?void 0:t("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Wh;Qh(a,b,null,c,d._onCommit);return d}; -Vh.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; -Vh.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:t("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?t("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Hh(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next= -null,this._defer=!1};Vh.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};function Yh(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Kb=Nh;Lb=Ph;Mb=function(){W||0===lh||(Kh(lh,!1),lh=0)}; -function Zh(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Xh(a,!1,b)} -function $h(a,b,c,d,e){Yh(c)?void 0:t("200");var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Sh(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Zh(c,d);if("function"===typeof e){var h=e;e=function(){var a=Sh(f._internalRoot);h.call(a)}}Oh(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Sh(f._internalRoot)} -function ai(a,b){var c=2d?e:d);Ih.current=null;d=void 0;1c?b:c;0===b&&(Fh=null);$h(a,b)} +function ai(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){T=a;a:{var e=b;b=a;var f=U;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:J(b.type)&&Ke(b);break;case 3:Kf(b);Le(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Eg(b),b.effectTag&=-3;mh(b);break;case 5:Mf(b);var h=If(Hf.current);f=b.type;if(null!==e&&null!=b.stateNode)nh(e,b,f,g,h),e.ref!==b.ref&&(b.effectTag|= +128);else if(g){var l=If(N.current);if(Eg(b)){g=b;e=g.stateNode;var k=g.type,m=g.memoizedProps,p=h;e[Fa]=g;e[Ga]=m;f=void 0;h=k;switch(h){case "iframe":case "object":E("load",e);break;case "video":case "audio":for(k=0;k\x3c/script>",k=e.removeChild(e.firstChild)):"string"===typeof e.is?k=k.createElement(p,{is:e.is}):(k=k.createElement(p),"select"===p&&(p=k,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):k=k.createElementNS(l,p);e=k;e[Fa]=m;e[Ga]=g;lh(e,b,!1,!1);p=e;k=f;m=g;var t=h,A=re(k,m);switch(k){case "iframe":case "object":E("load", +p);h=m;break;case "video":case "audio":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==T)return T;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&& +(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1=v)t=0;else if(-1===t||v component higher in the tree to provide a loading indicator or placeholder to display."+jc(k))}Nh=!0;m=jh(m,k);h=l;do{switch(h.tag){case 3:h.effectTag|=2048;h.expirationTime=g;g=Ch(h,m,g);eh(h,g);break a;case 1:if(t=m,A=h.type,k=h.stateNode,0===(h.effectTag&64)&&("function"===typeof A.getDerivedStateFromError||null!==k&&"function"===typeof k.componentDidCatch&&(null===Fh||!Fh.has(k)))){h.effectTag|=2048; +h.expirationTime=g;g=Eh(h,t,g);eh(h,g);break a}}h=h.return}while(null!==h)}T=ai(f);continue}}}break}while(1);Kh=!1;Hh.current=c;Yg=Xg=Wg=null;lg();if(e)Lh=null,a.finishedWork=null;else if(null!==T)a.finishedWork=null;else{c=a.current.alternate;null===c?x("281"):void 0;Lh=null;if(Nh){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime=d,a.finishedWork=c)}} +function sh(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Fh||!Fh.has(d))){a=jh(b,a);a=Eh(c,a,1073741823);pf(c,a);qf(c,1073741823);return}break;case 3:a=jh(b,a);a=Ch(c,a,1073741823);pf(c,a);qf(c,1073741823);return}c=c.return}3===a.tag&&(c=jh(b,a),c=Ch(a,c,1073741823),pf(a,c),qf(a,1073741823))} +function mf(a,b){var c=r.unstable_getCurrentPriorityLevel(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Kh&&!Oh)d=U;else{switch(c){case r.unstable_ImmediatePriority:d=1073741823;break;case r.unstable_UserBlockingPriority:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case r.unstable_NormalPriority:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case r.unstable_LowPriority:case r.unstable_IdlePriority:d=1;break;default:x("313")}null!==Lh&&d===U&&--d}c===r.unstable_UserBlockingPriority&& +(0===gi||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;df(c,a);c=a.expirationTime;0!==c&&Xh(a,c)}}function Ah(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=lf();b=mf(b,a);a=hi(a,b);null!==a&&(cf(a,b),b=a.expirationTime,0!==b&&Xh(a,b))} +function hi(a,b){a.expirationTimeU&&Sh(),cf(a,b),Kh&&!Oh&&Lh===a||Xh(a,a.expirationTime),ii>ji&&(ii=0,x("185")))}function ki(a,b,c,d,e){return r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){return a(b,c,d,e)})}var li=null,Y=null,mi=0,ni=void 0,W=!1,oi=null,Z=0,gi=0,pi=!1,qi=null,X=!1,ri=!1,si=null,ti=r.unstable_now(),ui=1073741822-(ti/10|0),vi=ui,ji=50,ii=0,wi=null;function xi(){ui=1073741822-((r.unstable_now()-ti)/10|0)} +function yi(a,b){if(0!==mi){if(ba.expirationTime&&(a.expirationTime=b);W||(X?ri&&(oi=a,Z=1073741823,Di(a,1073741823,!1)):1073741823===b?Yh(1073741823,!1):yi(a,b))} +function Ci(){var a=0,b=null;if(null!==Y)for(var c=Y,d=li;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===Y?x("244"):void 0;if(d===d.nextScheduledRoot){li=Y=d.nextScheduledRoot=null;break}else if(d===li)li=e=d.nextScheduledRoot,Y.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===Y){Y=c;Y.nextScheduledRoot=li;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===Y)break;if(1073741823=== +a)break;c=d;d=d.nextScheduledRoot}}oi=b;Z=a}var Ei=!1;function di(){return Ei?!0:r.unstable_shouldYield()?Ei=!0:!1}function zi(){try{if(!di()&&null!==li){xi();var a=li;do{var b=a.expirationTime;0!==b&&ui<=b&&(a.nextExpirationTimeToWorkOn=ui);a=a.nextScheduledRoot}while(a!==li)}Yh(0,!0)}finally{Ei=!1}} +function Yh(a,b){Ci();if(b)for(xi(),vi=ui;null!==oi&&0!==Z&&a<=Z&&!(Ei&&ui>Z);)Di(oi,Z,ui>Z),Ci(),xi(),vi=ui;else for(;null!==oi&&0!==Z&&a<=Z;)Di(oi,Z,!1),Ci();b&&(mi=0,ni=null);0!==Z&&yi(oi,Z);ii=0;wi=null;if(null!==si)for(a=si,si=null,b=0;b=c&&(null===si?si=[d]:si.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===wi?ii++:(wi=a,ii=0);r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){Zh(a,b)})}function Dh(a){null===oi?x("246"):void 0;oi.expirationTime=0;pi||(pi=!0,qi=a)}function Gi(a,b){var c=X;X=!0;try{return a(b)}finally{(X=c)||W||Yh(1073741823,!1)}} +function Hi(a,b){if(X&&!ri){ri=!0;try{return a(b)}finally{ri=!1}}return a(b)}function Ii(a,b,c){X||W||0===gi||(Yh(gi,!1),gi=0);var d=X;X=!0;try{return r.unstable_runWithPriority(r.unstable_UserBlockingPriority,function(){return a(b,c)})}finally{(X=d)||W||Yh(1073741823,!1)}} +function Ji(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===ed(c)&&1===c.tag?void 0:x("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(J(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);x("171");g=void 0}if(1===c.tag){var h=c.type;if(J(h)){c=Ne(c,h,g);break a}}c=g}else c=He;null===b.context?b.context=c:b.pendingContext=c;b=e;e=nf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b); +of();pf(f,e);qf(f,d);return d}function Ki(a,b,c,d){var e=b.current,f=lf();e=mf(f,e);return Ji(a,b,c,e,d)}function Li(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Mi(a,b,c){var d=3=Jh&&(b=Jh-1);this._expirationTime=Jh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Ni.prototype.render=function(a){this._defer?void 0:x("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Oi;Ji(a,b,null,c,d._onCommit);return d}; +Ni.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; +Ni.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:x("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?x("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Bi(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next= +null,this._defer=!1};Ni.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};function Qi(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Gb=Gi;Hb=Ii;Ib=function(){W||0===gi||(Yh(gi,!1),gi=0)}; +function Ri(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Pi(a,!1,b)} +function Si(a,b,c,d,e){var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Li(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Ri(c,d);if("function"===typeof e){var h=e;e=function(){var a=Li(f._internalRoot);h.call(a)}}Hi(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Li(f._internalRoot)} +function Ti(a,b){var c=2this.eventPool.length&&this.eventPool.push(a)} -function jb(a){a.eventPool=[];a.getPooled=kb;a.release=lb}var mb=z.extend({data:null}),nb=z.extend({data:null}),ob=[9,13,27,32],pb=Sa&&"CompositionEvent"in window,qb=null;Sa&&"documentMode"in document&&(qb=document.documentMode); +var Ba={injectEventPluginOrder:function(a){la?x("101"):void 0;la=Array.prototype.slice.call(a);na()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];ma.hasOwnProperty(c)&&ma[c]===d||(ma[c]?x("102",c):void 0,ma[c]=d,b=!0)}b&&na()}}; +function Ca(a,b){var c=a.stateNode;if(!c)return null;var d=ta(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;c&&"function"!==typeof c?x("231",b,typeof c):void 0; +return c}function Da(a){null!==a&&(za=xa(za,a));a=za;za=null;if(a&&(ya(a,Aa),za?x("95"):void 0,fa))throw a=ha,fa=!1,ha=null,a;}var Ea=Math.random().toString(36).slice(2),Fa="__reactInternalInstance$"+Ea,Ga="__reactEventHandlers$"+Ea;function Ha(a){if(a[Fa])return a[Fa];for(;!a[Fa];)if(a.parentNode)a=a.parentNode;else return null;a=a[Fa];return 5===a.tag||6===a.tag?a:null}function Ia(a){a=a[Fa];return!a||5!==a.tag&&6!==a.tag?null:a} +function Ja(a){if(5===a.tag||6===a.tag)return a.stateNode;x("33")}function Ka(a){return a[Ga]||null}function Ma(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function Na(a,b,c){if(b=Ca(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a)} +function Oa(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Ma(b);for(b=c.length;0this.eventPool.length&&this.eventPool.push(a)} +function jb(a){a.eventPool=[];a.getPooled=kb;a.release=lb}var mb=y.extend({data:null}),nb=y.extend({data:null}),ob=[9,13,27,32],pb=Sa&&"CompositionEvent"in window,qb=null;Sa&&"documentMode"in document&&(qb=document.documentMode); var rb=Sa&&"TextEvent"in window&&!qb,sb=Sa&&(!pb||qb&&8=qb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1; function wb(a,b){switch(a){case "keyup":return-1!==ob.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function xb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var yb=!1;function zb(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}} -function Ab(a,b){if(yb)return"compositionend"===a||!pb&&wb(a,b)?(a=gb(),fb=eb=db=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function B(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var C={}; +function Ib(a,b){return a(b)}function Jb(a,b,c){return a(b,c)}function Kb(){}var Lb=!1;function Mb(a,b){if(Lb)return a(b);Lb=!0;try{return Ib(a,b)}finally{if(Lb=!1,null!==Db||null!==Eb)Kb(),Hb()}}var Ob={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pb(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Ob[a.type]:"textarea"===b?!0:!1} +function Qb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function Rb(a){if(!Sa)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function Sb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)} +function Tb(a){var b=Sb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker= +null;delete a[b]}}}}function Ub(a){a._valueTracker||(a._valueTracker=Tb(a))}function Vb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Sb(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}var Wb=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Wb.hasOwnProperty("ReactCurrentDispatcher")||(Wb.ReactCurrentDispatcher={current:null}); +var Xb=/^(.*)[\\\/]/,A="function"===typeof Symbol&&Symbol.for,Yb=A?Symbol.for("react.element"):60103,Zb=A?Symbol.for("react.portal"):60106,$b=A?Symbol.for("react.fragment"):60107,ac=A?Symbol.for("react.strict_mode"):60108,bc=A?Symbol.for("react.profiler"):60114,cc=A?Symbol.for("react.provider"):60109,dc=A?Symbol.for("react.context"):60110,ec=A?Symbol.for("react.concurrent_mode"):60111,fc=A?Symbol.for("react.forward_ref"):60112,gc=A?Symbol.for("react.suspense"):60113,hc=A?Symbol.for("react.memo"): +60115,ic=A?Symbol.for("react.lazy"):60116,jc="function"===typeof Symbol&&Symbol.iterator;function kc(a){if(null===a||"object"!==typeof a)return null;a=jc&&a[jc]||a["@@iterator"];return"function"===typeof a?a:null} +function lc(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ec:return"ConcurrentMode";case $b:return"Fragment";case Zb:return"Portal";case bc:return"Profiler";case ac:return"StrictMode";case gc:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case dc:return"Context.Consumer";case cc:return"Context.Provider";case fc:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+ +")":"ForwardRef");case hc:return lc(a.type);case ic:if(a=1===a._status?a._result:null)return lc(a)}return null}function mc(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=lc(a.type);c=null;d&&(c=lc(d.type));d=f;f="";e?f=" (at "+e.fileName.replace(Xb,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")");c="\n in "+(d||"Unknown")+f}b+=c;a=a.return}while(a);return b} +var nc=/^[: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]*$/,oc=Object.prototype.hasOwnProperty,pc={},qc={}; +function rc(a){if(oc.call(qc,a))return!0;if(oc.call(pc,a))return!1;if(nc.test(a))return qc[a]=!0;pc[a]=!0;return!1}function sc(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}} +function tc(a,b,c,d){if(null===b||"undefined"===typeof b||sc(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function B(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var C={}; "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){C[a]=new B(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];C[b]=new B(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){C[a]=new B(a,2,!1,a.toLowerCase(),null)}); ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){C[a]=new B(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){C[a]=new B(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){C[a]=new B(a,3,!0,a,null)}); -["capture","download"].forEach(function(a){C[a]=new B(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){C[a]=new B(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){C[a]=new B(a,5,!1,a.toLowerCase(),null)});var tc=/[\-:]([a-z])/g;function uc(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(tc, -uc);C[b]=new B(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(tc,uc);C[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(tc,uc);C[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});C.tabIndex=new B("tabIndex",1,!1,"tabindex",null); -function vc(a,b,c,d){var e=C.hasOwnProperty(b)?C[b]:null;var f=null!==e?0===e.type:d?!1:!(2Bd.length&&Bd.push(a)}}}var Hd={},Id=0,Kd="_reactListenersID"+(""+Math.random()).slice(2); -function Ld(a){Object.prototype.hasOwnProperty.call(a,Kd)||(a[Kd]=Id++,Hd[a[Kd]]={});return Hd[a[Kd]]}function Md(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Nd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} +["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(a){zd(a,!0)});wd.forEach(function(a){zd(a,!1)}); +var Ad={eventTypes:xd,isInteractiveTopLevelEventType:function(a){a=yd[a];return void 0!==a&&!0===a.isInteractive},extractEvents:function(a,b,c,d){var e=yd[a];if(!e)return null;switch(a){case "keypress":if(0===od(c))return null;case "keydown":case "keyup":a=rd;break;case "blur":case "focus":a=nd;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=ad;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a= +sd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=td;break;case Ya:case Za:case $a:a=ld;break;case ab:a=ud;break;case "scroll":a=Tc;break;case "wheel":a=vd;break;case "copy":case "cut":case "paste":a=md;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=bd;break;default:a=y}b=a.getPooled(e,b,c,d);Ra(b);return b}},Bd=Ad.isInteractiveTopLevelEventType, +Cd=[];function Dd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d;for(d=c;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo;if(!d)break;a.ancestors.push(c);c=Ha(d)}while(c);for(c=0;cCd.length&&Cd.push(a)}}}var Id={},Jd=0,Kd="_reactListenersID"+(""+Math.random()).slice(2); +function Ld(a){Object.prototype.hasOwnProperty.call(a,Kd)||(a[Kd]=Jd++,Id[a[Kd]]={});return Id[a[Kd]]}function Md(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Nd(a){for(;a&&a.firstChild;)a=a.firstChild;return a} function Od(a,b){var c=Nd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Nd(c)}}function Pd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Pd(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1} -function Qd(){for(var a=window,b=Md();b instanceof a.HTMLIFrameElement;){try{a=b.contentDocument.defaultView}catch(c){break}b=Md(a.document)}return b}function Rd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} -function Sd(){var a=Qd();if(Rd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(L){b=null;break a}var f=0,g=-1,h=-1,k=0,l=0,m=a,p=null;b:for(;;){for(var v;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length); -if(null===(v=m.firstChild))break;p=m;m=v}for(;;){if(m===a)break b;p===b&&++k===d&&(g=f);p===e&&++l===c&&(h=f);if(null!==(v=m.nextSibling))break;m=p;p=m.parentNode}m=v}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}} +function Qd(){for(var a=window,b=Md();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Md(a.document)}return b}function Rd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)} +function Sd(){var a=Qd();if(Rd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(U){b=null;break a}var f=0,g=-1,h=-1,k=0,l=0,m=a,p=null;b:for(;;){for(var w;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length); +if(null===(w=m.firstChild))break;p=m;m=w}for(;;){if(m===a)break b;p===b&&++k===d&&(g=f);p===e&&++l===c&&(h=f);if(null!==(w=m.nextSibling))break;m=p;p=m.parentNode}m=w}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}} function Td(a){var b=Qd(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Pd(c.ownerDocument.documentElement,c)){if(null!==d&&Rd(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Od(c,f);var g=Od(c, d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Vd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Wd=null,Xd=null,Yd=null,Zd=!1; -function $d(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Zd||null==Wd||Wd!==Md(c))return null;c=Wd;"selectionStart"in c&&Rd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Yd&&fd(Yd,c)?null:(Yd=c,a=z.getPooled(Vd.select,Xd,a,b),a.type="select",a.target=Wd,Ra(a),a)} -var ae={eventTypes:Vd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Ld(e);f=sa.onSelect;for(var g=0;g=b.length?void 0:x("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:wc(c)}} -function ge(a,b){var c=wc(b.value),d=wc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function he(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var ie={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; +function $d(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(Zd||null==Wd||Wd!==Md(c))return null;c=Wd;"selectionStart"in c&&Rd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Yd&&gd(Yd,c)?null:(Yd=c,a=y.getPooled(Vd.select,Xd,a,b),a.type="select",a.target=Wd,Ra(a),a)} +var ae={eventTypes:Vd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Ld(e);f=sa.onSelect;for(var g=0;g=b.length?void 0:x("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:xc(c)}} +function ge(a,b){var c=xc(b.value),d=xc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function he(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var ie={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; function je(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ke(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?je(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} var le=void 0,me=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==ie.svg||"innerHTML"in a)a.innerHTML=b;else{le=le||document.createElement("div");le.innerHTML=""+b+"";for(b=le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}); function ne(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b} @@ -106,155 +106,173 @@ floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMite function re(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=qe(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var se=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); function te(a,b){b&&(se[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?x("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?x("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:x("61")),null!=b.style&&"object"!==typeof b.style?x("62",""):void 0)} function ue(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}} -function ve(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Ld(a);b=sa[b];for(var d=0;dGe||(a.current=Fe[Ge],Fe[Ge]=null,Ge--)}function F(a,b){Ge++;Fe[Ge]=a.current;a.current=b}var He={},G={current:He},H={current:!1},Ie=He; -function Je(a,b){var c=a.type.contextTypes;if(!c)return He;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function I(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ke(a){E(H,a);E(G,a)}function Le(a){E(H,a);E(G,a)} -function Me(a,b,c){G.current!==He?x("168"):void 0;F(G,b,a);F(H,c,a)}function Ne(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x("108",kc(b)||"Unknown",e);return n({},c,d)}function Oe(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||He;Ie=G.current;F(G,b,a);F(H,H.current,a);return!0} -function Pe(a,b,c){var d=a.stateNode;d?void 0:x("169");c?(b=Ne(a,b,Ie),d.__reactInternalMemoizedMergedChildContext=b,E(H,a),E(G,a),F(G,b,a)):E(H,a);F(H,c,a)}var Qe=null,Re=null;function Se(a){return function(b){try{return a(b)}catch(c){}}}var Te="undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function Ue(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Qe=Se(function(a){return b.onCommitFiberRoot(c,a)});Re=Se(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0} -function Ve(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null;this.actualDuration=0;this.actualStartTime=-1;this.treeBaseDuration=this.selfBaseDuration= -0}function J(a,b,c,d){return new Ve(a,b,c,d)}function We(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Xe(a){if("function"===typeof a)return We(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===ec)return 11;if(a===gc)return 14}return 2} -function Ye(a,b){var c=a.alternate;null===c?(c=J(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.firstContextDependency= -a.firstContextDependency;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;c.selfBaseDuration=a.selfBaseDuration;c.treeBaseDuration=a.treeBaseDuration;return c} -function Ze(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)We(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Zb:return $e(c.children,e,f,b);case dc:return af(c,e|3,f,b);case $b:return af(c,e|2,f,b);case ac:return a=J(12,c,b,e|4),a.elementType=ac,a.type=ac,a.expirationTime=f,a;case fc:return a=J(13,c,b,e),a.elementType=fc,a.type=fc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case bc:g=10;break a;case cc:g=9;break a;case ec:g=11;break a;case gc:g= -14;break a;case hc:g=16;d=null;break a}x("130",null==a?a:typeof a,"")}b=J(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function $e(a,b,c,d){a=J(7,a,d,b);a.expirationTime=c;return a}function af(a,b,c,d){a=J(8,a,d,b);b=0===(b&1)?$b:dc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function bf(a,b,c){a=J(6,a,null,b);a.expirationTime=c;return a} -function cf(a,b,c){b=J(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function df(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);ef(b,a)} -function ff(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{var c=a.latestPendingTime;0!==c&&(c>b?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?df(a,b):bc&&df(a,b)}ef(0,a)} -function gf(a,b){var c=a.latestPendingTime,d=a.latestSuspendedTime;a=a.latestPingedTime;return 0!==c&&c=b&&(a.latestPingedTime=0);c=a.earliestPendingTime;var d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);ef(b,a)} -function jf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function ef(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}var kf=!1; -function lf(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function mf(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} -function nf(a){return{expirationTime:a,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function of(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)} -function pf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=lf(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=lf(a.memoizedState),e=c.updateQueue=lf(c.memoizedState)):d=a.updateQueue=mf(e):null===e&&(e=c.updateQueue=mf(d));null===e||d===e?of(d,b):null===d.lastUpdate||null===e.lastUpdate?(of(d,b),of(e,b)):(of(d,b),e.lastUpdate=b)} -function qf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=lf(a.memoizedState):rf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function rf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=mf(b));return b} -function sf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case 2:kf=!0}return d} -function tf(a,b,c,d,e){kf=!1;b=rf(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;mJe||(a.current=Ie[Je],Ie[Je]=null,Je--)}function F(a,b){Je++;Ie[Je]=a.current;a.current=b}var Ke={},G={current:Ke},H={current:!1},Le=Ke; +function Me(a,b){var c=a.type.contextTypes;if(!c)return Ke;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function I(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ne(a){E(H,a);E(G,a)}function Oe(a){E(H,a);E(G,a)} +function Pe(a,b,c){G.current!==Ke?x("168"):void 0;F(G,b,a);F(H,c,a)}function Qe(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:x("108",lc(b)||"Unknown",e);return n({},c,d)}function Re(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Ke;Le=G.current;F(G,b,a);F(H,H.current,a);return!0} +function Se(a,b,c){var d=a.stateNode;d?void 0:x("169");c?(b=Qe(a,b,Le),d.__reactInternalMemoizedMergedChildContext=b,E(H,a),E(G,a),F(G,b,a)):E(H,a);F(H,c,a)}var Te=null,Ue=null;function Ve(a){return function(b){try{return a(b)}catch(c){}}}var We="undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; +function Xe(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Te=Ve(function(a){return b.onCommitFiberRoot(c,a)});Ue=Ve(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0} +function Ye(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null;this.treeBaseDuration=this.selfBaseDuration=this.actualStartTime=this.actualDuration=Number.NaN; +this.actualDuration=0;this.actualStartTime=-1;this.treeBaseDuration=this.selfBaseDuration=0}function J(a,b,c,d){return new Ye(a,b,c,d)}function Ze(a){a=a.prototype;return!(!a||!a.isReactComponent)}function $e(a){if("function"===typeof a)return Ze(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===fc)return 11;if(a===hc)return 14}return 2} +function af(a,b){var c=a.alternate;null===c?(c=J(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.contextDependencies= +a.contextDependencies;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;c.selfBaseDuration=a.selfBaseDuration;c.treeBaseDuration=a.treeBaseDuration;return c} +function bf(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Ze(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case $b:return cf(c.children,e,f,b);case ec:return df(c,e|3,f,b);case ac:return df(c,e|2,f,b);case bc:return a=J(12,c,b,e|4),a.elementType=bc,a.type=bc,a.expirationTime=f,a;case gc:return a=J(13,c,b,e),a.elementType=gc,a.type=gc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case cc:g=10;break a;case dc:g=9;break a;case fc:g=11;break a;case hc:g= +14;break a;case ic:g=16;d=null;break a}x("130",null==a?a:typeof a,"")}b=J(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function cf(a,b,c,d){a=J(7,a,d,b);a.expirationTime=c;return a}function df(a,b,c,d){a=J(8,a,d,b);b=0===(b&1)?ac:ec;a.elementType=b;a.type=b;a.expirationTime=c;return a}function ef(a,b,c){a=J(6,a,null,b);a.expirationTime=c;return a} +function ff(a,b,c){b=J(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function gf(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);hf(b,a)} +function jf(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{bb?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?gf(a,b):bc&&gf(a,b)}hf(0,a)}function kf(a,b){var c=a.latestPendingTime,d=a.latestSuspendedTime;a=a.latestPingedTime;return 0!==c&&c=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);hf(b,a)}function mf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b} +function hf(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function K(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b} +function nf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}var of=(new aa.Component).refs; +function pf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)} +var yf={isMounted:function(a){return(a=a._reactInternalFiber)?2===hd(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=qf();d=rf(d,a);var e=sf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);tf();uf(a,e);vf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=qf();d=rf(d,a);var e=sf(d);e.tag=wf;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);tf();uf(a,e);vf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=qf();c=rf(c,a);var d=sf(c);d.tag= +xf;void 0!==b&&null!==b&&(d.callback=b);tf();uf(a,d);vf(a,c)}};function zf(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!gd(c,d)||!gd(e,f):!0} +function Af(a,b,c){var d=!1,e=Ke;var f=b.contextType;"object"===typeof f&&null!==f?f=L(f):(e=I(b)?Le:G.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Me(a,e):Ke);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=yf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} +function Bf(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&yf.enqueueReplaceState(b,b.state,null)} +function Cf(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=of;var f=b.contextType;"object"===typeof f&&null!==f?e.context=L(f):(f=I(b)?Le:G.current,e.context=Me(a,f));f=a.updateQueue;null!==f&&(Df(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(pf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!== +typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&yf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Df(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var Ef=Array.isArray; +function Ff(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x("309"):void 0,d=c.stateNode);d?void 0:x("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===of&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?x("284"):void 0;c._owner?void 0:x("290",a)}return a} +function Gf(a,b){"textarea"!==a.type&&x("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")} +function Hf(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=af(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,du?(z=q,q=null):z=q.sibling;var t=w(e,q,h[u],k);if(null===t){null===q&&(q=z);break}a&& +q&&null===t.alternate&&b(e,q);g=f(t,g,u);null===m?l=t:m.sibling=t;m=t;q=z}if(u===h.length)return c(e,q),l;if(null===q){for(;uu?(z=q,q=null):z=q.sibling;var gb=w(e,q,t.value,k);if(null===gb){q||(q=z);break}a&&q&&null===gb.alternate&&b(e,q);g=f(gb,g,u);null===m?l=gb:m.sibling=gb;m=gb;q=z}if(t.done)return c(e,q),l;if(null===q){for(;!t.done;u++,t=h.next())t=p(e,t.value,k),null!==t&&(g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);return l}for(q=d(e,q);!t.done;u++,t=h.next())t=U(q,e,u,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null=== +t.key?u:t.key),g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===$b&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Yb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===$b:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===$b?f.props.children:f.props,h);d.ref=Ff(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a, +k);k=k.sibling}f.type===$b?(d=cf(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=bf(f.type,f.key,f.props,null,a.mode,h),h.ref=Ff(a,d,f),h.return=a,a=h)}return g(a);case Zb:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ff(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"=== +typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=ef(f,a.mode,h),d.return=a,a=d),g(a);if(Ef(f))return Nb(a,d,f,h);if(kc(f))return La(a,d,f,h);l&&Gf(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x("152",h.displayName||h.name||"Component")}return c(a,d)}}var If=Hf(!0),Jf=Hf(!1),Kf={},M={current:Kf},Lf={current:Kf},Mf={current:Kf};function Nf(a){a===Kf?x("174"):void 0;return a} +function Of(a,b){F(Mf,b,a);F(Lf,a,a);F(M,Kf,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:ke(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=ke(b,c)}E(M,a);F(M,b,a)}function Pf(a){E(M,a);E(Lf,a);E(Mf,a)}function Qf(a){Nf(Mf.current);var b=Nf(M.current);var c=ke(b,a.type);b!==c&&(F(Lf,a,a),F(M,c,a))}function Rf(a){Lf.current===a&&(E(M,a),E(Lf,a))} +var Sf=0,Tf=2,Uf=4,Vf=8,Wf=16,Xf=32,Yf=64,Zf=128,$f=Wb.ReactCurrentDispatcher,ag=0,bg=null,N=null,O=null,cg=null,P=null,dg=null,eg=0,fg=null,gg=0,hg=!1,ig=null,jg=0;function kg(){x("321")}function lg(a,b){if(null===b)return!1;for(var c=0;ceg&&(eg=m)):f=k.eagerReducer===a?k.eagerState:a(f,k.action);g=k;k=k.next}while(null!==k&&k!==d);l||(h=g,e=f);ed(f,b.memoizedState)||(vg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]} +function wg(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===fg?(fg={lastEffect:null},fg.lastEffect=a.next=a):(b=fg.lastEffect,null===b?fg.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,fg.lastEffect=a));return a}function xg(a,b,c,d){var e=rg();gg|=a;e.memoizedState=wg(b,c,void 0,void 0===d?null:d)} +function yg(a,b,c,d){var e=sg();d=void 0===d?null:d;var f=void 0;if(null!==N){var g=N.memoizedState;f=g.destroy;if(null!==d&&lg(d,g.deps)){wg(Sf,c,f,d);return}}gg|=a;e.memoizedState=wg(b,c,f,d)}function zg(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function Ag(){} +function Bg(a,b,c){25>jg?void 0:x("301");var d=a.alternate;if(a===bg||null!==d&&d===bg)if(hg=!0,a={expirationTime:ag,action:c,eagerReducer:null,eagerState:null,next:null},null===ig&&(ig=new Map),c=ig.get(b),void 0===c)ig.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{tf();var e=qf();e=rf(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null=== +d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(ed(l,k))return}catch(m){}finally{}vf(a,e)}} +var pg={readContext:L,useCallback:kg,useContext:kg,useEffect:kg,useImperativeHandle:kg,useLayoutEffect:kg,useMemo:kg,useReducer:kg,useRef:kg,useState:kg,useDebugValue:kg},ng={readContext:L,useCallback:function(a,b){rg().memoizedState=[a,void 0===b?null:b];return a},useContext:L,useEffect:function(a,b){return xg(516,Zf|Yf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return xg(4,Uf|Xf,zg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return xg(4,Uf|Xf,a,b)}, +useMemo:function(a,b){var c=rg();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=rg();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Bg.bind(null,bg,a);return[d.memoizedState,a]},useRef:function(a){var b=rg();a={current:a};return b.memoizedState=a},useState:function(a){var b=rg();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null, +lastRenderedReducer:tg,lastRenderedState:a};a=a.dispatch=Bg.bind(null,bg,a);return[b.memoizedState,a]},useDebugValue:Ag},og={readContext:L,useCallback:function(a,b){var c=sg();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lg(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:L,useEffect:function(a,b){return yg(516,Zf|Yf,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return yg(4,Uf|Xf,zg.bind(null,b,a),c)},useLayoutEffect:function(a, +b){return yg(4,Uf|Xf,a,b)},useMemo:function(a,b){var c=sg();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&lg(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:ug,useRef:function(){return sg().memoizedState},useState:function(a){return ug(tg,a)},useDebugValue:Ag},Cg=0,Dg=-1;function Eg(a){Dg=r.unstable_now();0>a.actualStartTime&&(a.actualStartTime=r.unstable_now())} +function Fg(a,b){if(0<=Dg){var c=r.unstable_now()-Dg;a.actualDuration+=c;b&&(a.selfBaseDuration=c);Dg=-1}}var Gg=null,Hg=null,Ig=!1;function Jg(a,b){var c=J(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c} +function Kg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}function Lg(a){if(Ig){var b=Hg;if(b){var c=b;if(!Kg(a,b)){b=Ge(c);if(!b||!Kg(a,b)){a.effectTag|=2;Ig=!1;Gg=a;return}Jg(Gg,c)}Gg=a;Hg=He(b)}else a.effectTag|=2,Ig=!1,Gg=a}} +function Mg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;Gg=a}function Ng(a){if(a!==Gg)return!1;if(!Ig)return Mg(a),Ig=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ae(b,a.memoizedProps))for(b=Hg;b;)Jg(a,b),b=Ge(b);Mg(a);Hg=Gg?Ge(a.stateNode):null;return!0}function Og(){Hg=Gg=null;Ig=!1}var Pg=Wb.ReactCurrentOwner,vg=!1;function Q(a,b,c,d){b.child=null===a?Jf(b,null,c,d):If(b,a.child,c,d)} +function Qg(a,b,c,d,e){c=c.render;var f=b.ref;Rg(b,e);d=mg(a,b,c,d,f,e);if(null!==a&&!vg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),Sg(a,b,e);b.effectTag|=1;Q(a,b,d,e);return b.child} +function Tg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Ze(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,Ug(a,b,g,d,e,f);a=bf(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return ah(a,b,c);b=Sg(a,b,c);return null!==b?b.sibling:null}}return Sg(a,b,c)}}else vg=!1;b.expirationTime= +0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Me(b,G.current);Rg(b,c);e=mg(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;qg();if(I(d)){var f=!0;Re(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&pf(b,d,g,a);e.updater=yf;b.stateNode=e;e._reactInternalFiber=b;Cf(b, +d,a,c);b=Zg(null,b,d,!0,f,c)}else b.tag=0,Q(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=nf(e);b.type=a;e=b.tag=$e(a);f=K(a,f);g=void 0;switch(e){case 0:g=Vg(null,b,a,f,c);break;case 1:g=Xg(null,b,a,f,c);break;case 11:g=Qg(null,b,a,f,c);break;case 14:g=Tg(null,b,a,K(a.type,f),d,c);break;default:x("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Vg(a,b,d,e,c);case 1:return d= +b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Xg(a,b,d,e,c);case 3:$g(b);d=b.updateQueue;null===d?x("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;Df(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Og(),b=Sg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)Hg=He(b.stateNode.containerInfo),Gg=b,e=Ig=!0;e?(b.effectTag|=2,b.child=Jf(b,null,d,c)):(Q(a,b,d,c),Og());b=b.child}return b;case 5:return Qf(b),null===a&&Lg(b),d=b.type,e=b.pendingProps,f=null!== +a?a.memoizedProps:null,g=e.children,Ae(d,e)?g=null:null!==f&&Ae(d,f)&&(b.effectTag|=16),Wg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(Q(a,b,g,c),b=b.child),b;case 6:return null===a&&Lg(b),null;case 13:return ah(a,b,c);case 4:return Of(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=If(b,null,d,c):Q(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:K(d,e),Qg(a,b,d,e,c);case 7:return Q(a,b,b.pendingProps,c),b.child; +case 8:return Q(a,b,b.pendingProps.children,c),b.child;case 12:return b.effectTag|=4,Q(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;ch(b,f);if(null!==g){var h=g.value;f=ed(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!H.current){b=Sg(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.contextDependencies;if(null!==k){g= +h.child;for(var l=k.first;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=sf(c),l.tag=xf,uf(h,l));h.expirationTime=b&&(vg=!0);a.contextDependencies=null}function L(a,b){if(gh!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)gh=a,b=1073741823;b={context:a,observedBits:b,next:null};null===fh?(null===eh?x("308"):void 0,fh=b,eh.contextDependencies={first:b,expirationTime:0}):fh=fh.next=b}return a._currentValue}var ih=0,wf=1,xf=2,jh=3,Yg=!1; +function kh(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function lh(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}} +function sf(a){return{expirationTime:a,tag:ih,payload:null,callback:null,next:null,nextEffect:null}}function mh(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)} +function uf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=kh(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=kh(a.memoizedState),e=c.updateQueue=kh(c.memoizedState)):d=a.updateQueue=lh(e):null===e&&(e=c.updateQueue=lh(d));null===e||d===e?mh(d,b):null===d.lastUpdate||null===e.lastUpdate?(mh(d,b),mh(e,b)):(mh(d,b),e.lastUpdate=b)} +function nh(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=kh(a.memoizedState):oh(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function oh(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=lh(b));return b} +function ph(a,b,c,d,e,f){switch(c.tag){case wf:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case jh:a.effectTag=a.effectTag&-2049|64;case ih:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case xf:Yg=!0}return d} +function Df(a,b,c,d,e){Yg=!1;b=oh(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;ma.actualStartTime&&(a.actualStartTime=r.unstable_now())}function Qf(a,b){if(0<=Of){var c=r.unstable_now()-Of;a.actualDuration+=c;b&&(a.selfBaseDuration=c);Of=-1}}function M(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b} -function Rf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:throw a._status=0,b=a._ctor,b=b(),b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)}),a._result=b,b;}}var Sf=Vb.ReactCurrentOwner,Tf=(new aa.Component).refs; -function Uf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)} -var Zf={isMounted:function(a){return(a=a._reactInternalFiber)?2===gd(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=Vf();d=Wf(d,a);var e=nf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Xf();pf(a,e);Yf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Vf();d=Wf(d,a);var e=nf(d);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Xf();pf(a,e);Yf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Vf();c=Wf(c,a);var d=nf(c);d.tag= -2;void 0!==b&&null!==b&&(d.callback=b);Xf();pf(a,d);Yf(a,c)}};function $f(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!fd(c,d)||!fd(e,f):!0} -function ag(a,b,c){var d=!1,e=He;var f=b.contextType;"object"===typeof f&&null!==f?f=Sf.currentDispatcher.readContext(f):(e=I(b)?Ie:G.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Je(a,e):He);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Zf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b} -function bg(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Zf.enqueueReplaceState(b,b.state,null)} -function cg(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Tf;var f=b.contextType;"object"===typeof f&&null!==f?e.context=Sf.currentDispatcher.readContext(f):(f=I(b)?Ie:G.current,e.context=Je(a,f));f=a.updateQueue;null!==f&&(tf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(Uf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&& -"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Zf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(tf(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var dg=Array.isArray; -function eg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?x("289"):void 0,d=c.stateNode);d?void 0:x("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Tf&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?x("284"):void 0;c._owner?void 0:x("290",a)}return a} -function fg(a,b){"textarea"!==a.type&&x("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")} -function gg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=Ye(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,du?(y=q,q=null):y=q.sibling;var t=v(e,q,h[u],k);if(null===t){null===q&&(q=y);break}a&& -q&&null===t.alternate&&b(e,q);g=f(t,g,u);null===m?l=t:m.sibling=t;m=t;q=y}if(u===h.length)return c(e,q),l;if(null===q){for(;uu?(y=q,q=null):y=q.sibling;var Wa=v(e,q,t.value,k);if(null===Wa){q||(q=y);break}a&&q&&null===Wa.alternate&&b(e,q);g=f(Wa,g,u);null===m?l=Wa:m.sibling=Wa;m=Wa;q=y}if(t.done)return c(e,q),l;if(null===q){for(;!t.done;u++,t=h.next())t=p(e,t.value,k),null!==t&&(g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);return l}for(q=d(e,q);!t.done;u++,t=h.next())t=L(q,e,u,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null=== -t.key?u:t.key),g=f(t,g,u),null===m?l=t:m.sibling=t,m=t);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===Zb&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Xb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===Zb:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Zb?f.props.children:f.props,h);d.ref=eg(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a, -k);k=k.sibling}f.type===Zb?(d=$e(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ze(f.type,f.key,f.props,null,a.mode,h),h.ref=eg(a,d,f),h.return=a,a=h)}return g(a);case Yb:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=cf(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"=== -typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=bf(f,a.mode,h),d.return=a,a=d),g(a);if(dg(f))return Jd(a,d,f,h);if(jc(f))return Ba(a,d,f,h);l&&fg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,x("152",h.displayName||h.name||"Component")}return c(a,d)}}var hg=gg(!0),ig=gg(!1),jg=null,kg=null,lg=!1; -function mg(a,b){var c=J(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function ng(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;default:return!1}} -function og(a){if(lg){var b=kg;if(b){var c=b;if(!ng(a,b)){b=De(c);if(!b||!ng(a,b)){a.effectTag|=2;lg=!1;jg=a;return}mg(jg,c)}jg=a;kg=Ee(b)}else a.effectTag|=2,lg=!1,jg=a}}function pg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag;)a=a.return;jg=a}function qg(a){if(a!==jg)return!1;if(!lg)return pg(a),lg=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ae(b,a.memoizedProps))for(b=kg;b;)mg(a,b),b=De(b);pg(a);kg=jg?De(a.stateNode):null;return!0}function rg(){kg=jg=null;lg=!1}var sg=Vb.ReactCurrentOwner; -function N(a,b,c,d){b.child=null===a?ig(b,null,c,d):hg(b,a.child,c,d)}function tg(a,b,c,d,e){c=c.render;var f=b.ref;Df(b,e);d=c(d,f);b.effectTag|=1;N(a,b,d,e);return b.child} -function ug(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!We(g)&&void 0===g.defaultProps&&null===c.compare)return b.tag=15,b.type=g,vg(a,b,g,d,e,f);a=Ze(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Cg(a,b,c);b=wg(a,b,c);return null!==b?b.sibling:null}}return wg(a,b,c)}b.expirationTime=0;switch(b.tag){case 2:d= -b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Je(b,G.current);Df(b,c);e=d(a,e);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;if(I(d)){var f=!0;Oe(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Uf(b,d,g,a);e.updater=Zf;b.stateNode=e;e._reactInternalFiber=b;cg(b,d,a,c);b=Ag(null,b,d,!0,f,c)}else b.tag=0, -N(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=Rf(e);b.type=a;e=b.tag=Xe(a);f=M(a,f);g=void 0;switch(e){case 0:g=xg(null,b,a,f,c);break;case 1:g=zg(null,b,a,f,c);break;case 11:g=tg(null,b,a,f,c);break;case 14:g=ug(null,b,a,M(a.type,f),d,c);break;default:x("283",a)}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:M(d,e),xg(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType=== -d?e:M(d,e),zg(a,b,d,e,c);case 3:Bg(b);d=b.updateQueue;null===d?x("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;tf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)rg(),b=wg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)kg=Ee(b.stateNode.containerInfo),jg=b,e=lg=!0;e?(b.effectTag|=2,b.child=ig(b,null,d,c)):(N(a,b,d,c),rg());b=b.child}return b;case 5:return Lf(b),null===a&&og(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ae(d, -e)?g=null:null!==f&&Ae(d,f)&&(b.effectTag|=16),yg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=1,b=null):(N(a,b,g,c),b=b.child),b;case 6:return null===a&&og(b),null;case 13:return Cg(a,b,c);case 4:return Jf(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=hg(b,null,d,c):N(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:M(d,e),tg(a,b,d,e,c);case 7:return N(a,b,b.pendingProps,c),b.child;case 8:return N(a,b,b.pendingProps.children,c),b.child;case 12:return b.effectTag|= -4,N(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Bf(b,f);if(null!==g){var h=g.value;f=h===f&&(0!==h||1/h===1/f)||h!==h&&f!==f?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!H.current){b=wg(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){h=g.firstContextDependency;if(null!==h){do{if(h.context===d&&0!==(h.observedBits&f)){if(1===g.tag){var k= -nf(c);k.tag=2;pf(g,k)}g.expirationTime=k)g=0;else if(-1===g||k component higher in the tree to provide a loading indicator or placeholder to display."+ -lc(c))}Yg=!0;d=wf(d,c);a=b;do{switch(a.tag){case 3:c=d;a.effectTag|=2048;a.expirationTime=e;e=Rg(a,c,e);qf(a,e);return;case 1:if(c=d,b=a.type,f=a.stateNode,0===(a.effectTag&64)&&("function"===typeof b.getDerivedStateFromError||null!==f&&"function"===typeof f.componentDidCatch&&(null===Ug||!Ug.has(f)))){a.effectTag|=2048;a.expirationTime=e;e=Tg(a,c,e);qf(a,e);return}}a=a.return}while(null!==a)} -function Zg(a){switch(a.tag){case 1:I(a.type)&&Ke(a);var b=a.effectTag;return b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return Kf(a),Le(a),b=a.effectTag,0!==(b&64)?x("285"):void 0,a.effectTag=b&-2049|64,a;case 5:return Mf(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 4:return Kf(a),null;case 10:return Cf(a),null;default:return null}}var $g={readContext:Ef},ah=Vb.ReactCurrentOwner;null==w.__interactionsRef||null==w.__interactionsRef.current?x("302"):void 0; -var bh=1073741822,ch=0,dh=!1,O=null,P=null,Q=0,Xg=-1,Yg=!1,R=null,eh=!1,fh=null,gh=null,Ug=null;function hh(){if(null!==O)for(var a=O.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&Ke(b);break;case 3:Kf(b);Le(b);break;case 5:Mf(b);break;case 4:Kf(b);break;case 10:Cf(b)}a=a.return}P=null;Q=0;Xg=-1;Yg=!1;O=null} -function ih(){for(;null!==R;){var a=R.effectTag;a&16&&ne(R.stateNode,"");if(a&128){var b=R.alternate;null!==b&&(b=b.ref,null!==b&&("function"===typeof b?b(null):b.current=null))}switch(a&14){case 2:Pg(R);R.effectTag&=-3;break;case 6:Pg(R);R.effectTag&=-3;Qg(R.alternate,R);break;case 4:Qg(R.alternate,R);break;case 8:a=R,Ng(a),a.return=null,a.child=null,a.alternate&&(a.alternate.child=null,a.alternate.return=null)}R=R.nextEffect}} -function jh(){for(;null!==R;){if(R.effectTag&256)a:{var a=R.alternate,b=R;switch(b.tag){case 0:case 11:case 15:break a;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:M(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}break a;case 3:case 5:case 6:case 4:case 17:break a;default:x("163")}}R=R.nextEffect}} -function kh(a,b){for(;null!==R;){var c=R.effectTag;if(c&36){var d=a,e=R.alternate,f=R,g=b;switch(f.tag){case 0:case 11:case 15:break;case 1:d=f.stateNode;if(f.effectTag&4)if(null===e)d.componentDidMount();else{var h=f.elementType===f.type?e.memoizedProps:M(f.type,e.memoizedProps);d.componentDidUpdate(h,e.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}e=f.updateQueue;null!==e&&uf(f,e,d,g);break;case 3:e=f.updateQueue;if(null!==e){d=null;if(null!==f.child)switch(f.child.tag){case 5:d=f.child.stateNode; -break;case 1:d=f.child.stateNode}uf(f,e,d,g)}break;case 5:g=f.stateNode;null===e&&f.effectTag&4&&ze(f.type,f.memoizedProps)&&g.focus();break;case 6:break;case 4:break;case 12:g=f.memoizedProps.onRender;g(f.memoizedProps.id,null===e?"mount":"update",f.actualDuration,f.treeBaseDuration,f.actualStartTime,Nf,d.memoizedInteractions);break;case 13:break;case 17:break;default:x("163")}}c&128&&(c=R.ref,null!==c&&(f=R.stateNode,"function"===typeof c?c(f):c.current=f));R=R.nextEffect}} -function Xf(){null!==gh&&(r.unstable_cancelCallback(fh),gh())} -function lh(a,b){eh=dh=!0;a.current===b?x("177"):void 0;var c=a.pendingCommitExpirationTime;0===c?x("261"):void 0;a.pendingCommitExpirationTime=0;var d=b.expirationTime,e=b.childExpirationTime;ff(a,e>d?e:d);d=null;d=w.__interactionsRef.current;w.__interactionsRef.current=a.memoizedInteractions;ah.current=null;e=void 0;1e?b:e;0===h&&(Ug=null); -mh(a,h);w.__interactionsRef.current=d;var k=void 0;try{if(k=w.__subscriberRef.current,null!==k&&0h&&(l.delete(b),a.forEach(function(a){a.__count--;if(null!==k&&0===a.__count)try{k.onInteractionScheduledWorkCompleted(a)}catch(L){S||(S=!0,nh=L)}}))})}} -function oh(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){O=a;a.mode&4&&Pf(a);a:{var e=b;b=a;var f=Q;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:I(b.type)&&Ke(b);break;case 3:Kf(b);Le(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)qg(b),b.effectTag&=-3;Gg(b);break;case 5:Mf(b);var h=If(Hf.current);f=b.type;if(null!==e&&null!=b.stateNode)Hg(e,b,f,g,h),e.ref!== -b.ref&&(b.effectTag|=128);else if(g){var k=If(K.current);if(qg(b)){g=b;e=g.stateNode;var l=g.type,m=g.memoizedProps,p=h;e[Ga]=g;e[Ha]=m;f=void 0;h=l;switch(h){case "iframe":case "object":D("load",e);break;case "video":case "audio":for(l=0;l\x3c/script>",l=e.removeChild(e.firstChild)):"string"===typeof p.is?l=l.createElement(e,{is:p.is}):(l=l.createElement(e),"select"===e&&p.multiple&&(l.multiple=!0)):l=l.createElementNS(k,e);e=l;e[Ga]=m;e[Ha]=g;Fg(e,b,!1,!1);p=e;l=f;m=g;var v=h,L=ue(l,m);switch(l){case "iframe":case "object":D("load", -p);h=m;break;case "video":case "audio":for(h=0;hg&&(g=p),l>g&&(g=l),h&&(f+=m.actualDuration),e+=m.treeBaseDuration,m=m.sibling;b.actualDuration=f;b.treeBaseDuration=e}else for(f=b.child;null!==f;)e=f.expirationTime,h=f.childExpirationTime,e>g&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==O)return O;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1=c&&a.forEach(function(a){return d.add(a)})});a.memoizedInteractions=d;if(0b?0:b)):th(a,e,c)}} -function Lg(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Ug||!Ug.has(d))){a=wf(b,a);a=Tg(c,a,1073741823);pf(c,a);Yf(c,1073741823);return}break;case 3:a=wf(b,a);a=Rg(c,a,1073741823);pf(c,a);Yf(c,1073741823);return}c=c.return}3===a.tag&&(c=wf(b,a),c=Rg(a,c,1073741823),pf(a,c),Yf(a,1073741823))} -function Wf(a,b){0!==ch?a=ch:dh?a=eh?1073741823:Q:b.mode&1?(a=uh?1073741822-10*(((1073741822-a+15)/10|0)+1):1073741822-25*(((1073741822-a+500)/25|0)+1),null!==P&&a===Q&&--a):a=1073741823;uh&&(0===vh||a=f){f=e=d;a.didError=!1;var g=a.latestPingedTime;if(0===g||g>f)a.latestPingedTime=f;ef(f,a)}else e=Vf(),e=Wf(e,b),df(a,e);0!==(b.mode&1)&&a===P&&Q===d&&(P=null);wh(b,e);0===(b.mode&1)&&(wh(c,e),1===c.tag&&null!==c.stateNode&&(b=nf(e),b.tag=2,pf(c,b)));c=a.expirationTime;0!==c&&xh(a,c)} -function wh(a,b){a.expirationTimeQ&&hh(),df(a,b),dh&&!eh&&P===a||xh(a,a.expirationTime),yh>zh&&(yh=0,x("185")))}function Ah(a,b,c,d,e){var f=ch;ch=1073741823;try{return a(b,c,d,e)}finally{ch=f}} -var T=null,U=null,Bh=0,Ch=void 0,V=!1,W=null,X=0,vh=0,S=!1,nh=null,Y=!1,Dh=!1,uh=!1,Eh=null,Fh=r.unstable_now(),Z=1073741822-(Fh/10|0),Gh=Z,zh=50,yh=0,Hh=null;function Ih(){Z=1073741822-((r.unstable_now()-Fh)/10|0)}function Jh(a,b){if(0!==Bh){if(ba.expirationTime&&(a.expirationTime=b);V||(Y?Dh&&(W=a,X=1073741823,Oh(a,1073741823,!1)):1073741823===b?Ph(1073741823,!1):Jh(a,b))} -function Nh(){var a=0,b=null;if(null!==U)for(var c=U,d=T;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===U?x("244"):void 0;if(d===d.nextScheduledRoot){T=U=d.nextScheduledRoot=null;break}else if(d===T)T=e=d.nextScheduledRoot,U.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===U){U=c;U.nextScheduledRoot=T;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===U)break;if(1073741823===a)break; -c=d;d=d.nextScheduledRoot}}W=b;X=a}var Qh=!1;function rh(){return Qh?!0:r.unstable_shouldYield()?Qh=!0:!1}function Kh(){try{if(!rh()&&null!==T){Ih();var a=T;do{var b=a.expirationTime;0!==b&&Z<=b&&(a.nextExpirationTimeToWorkOn=Z);a=a.nextScheduledRoot}while(a!==T)}Ph(0,!0)}finally{Qh=!1}} -function Ph(a,b){Nh();if(b)for(Ih(),Gh=Z;null!==W&&0!==X&&a<=X&&!(Qh&&Z>X);)Oh(W,X,Z>X),Nh(),Ih(),Gh=Z;else for(;null!==W&&0!==X&&a<=X;)Oh(W,X,!1),Nh();b&&(Bh=0,Ch=null);0!==X&&Jh(W,X);yh=0;Hh=null;if(null!==Eh)for(a=Eh,Eh=null,b=0;b=c&&(null===Eh?Eh=[d]:Eh.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Hh?yh++:(Hh=a,yh=0);lh(a,b)}function Sg(a){null===W?x("246"):void 0;W.expirationTime=0;S||(S=!0,nh=a)}function Sh(a,b){var c=Y;Y=!0;try{return a(b)}finally{(Y=c)||V||Ph(1073741823,!1)}}function Th(a,b){if(Y&&!Dh){Dh=!0;try{return a(b)}finally{Dh=!1}}return a(b)} -function Uh(a,b,c){if(uh)return a(b,c);Y||V||0===vh||(Ph(vh,!1),vh=0);var d=uh,e=Y;Y=uh=!0;try{return a(b,c)}finally{uh=d,(Y=e)||V||Ph(1073741823,!1)}} -function Vh(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===gd(c)&&1===c.tag?void 0:x("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(I(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);x("171");g=void 0}if(1===c.tag){var h=c.type;if(I(h)){c=Ne(c,h,g);break a}}c=g}else c=He;null===b.context?b.context=c:b.pendingContext=c;b=e;e=nf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b); -Xf();pf(f,e);Yf(f,d);return d}function Wh(a,b,c,d){var e=b.current,f=Vf();e=Wf(f,e);return Vh(a,b,c,e,d)}function Xh(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Yh(a,b,c){var d=3=bh&&(b=bh-1);this._expirationTime=bh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Zh.prototype.render=function(a){this._defer?void 0:x("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new $h;Vh(a,b,null,c,d._onCommit);return d}; -Zh.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; -Zh.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:x("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?x("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Mh(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next= -null,this._defer=!1};Zh.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};function bi(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Ib=Sh;Jb=Uh;Kb=function(){V||0===vh||(Ph(vh,!1),vh=0)}; -function ci(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new ai(a,!1,b)} -function di(a,b,c,d,e){bi(c)?void 0:x("200");var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Xh(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=ci(c,d);if("function"===typeof e){var h=e;e=function(){var a=Xh(f._internalRoot);h.call(a)}}Th(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Xh(f._internalRoot)} -function ei(a,b){var c=2=k)g=0;else if(-1===g||k component higher in the tree to provide a loading indicator or placeholder to display."+mc(c))}Sh=!0;d=sh(d,c);a=b;do{switch(a.tag){case 3:a.effectTag|=2048;a.expirationTime=e;e=Lh(a,d,e);nh(a,e);return;case 1:if(g=d,h=a.type,c=a.stateNode,0===(a.effectTag&64)&&("function"===typeof h.getDerivedStateFromError|| +null!==c&&"function"===typeof c.componentDidCatch&&(null===Oh||!Oh.has(c)))){a.effectTag|=2048;a.expirationTime=e;e=Nh(a,g,e);nh(a,e);return}}a=a.return}while(null!==a)} +function Th(a){switch(a.tag){case 1:I(a.type)&&Ne(a);var b=a.effectTag;return b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return Pf(a),Oe(a),b=a.effectTag,0!==(b&64)?x("285"):void 0,a.effectTag=b&-2049|64,a;case 5:return Rf(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 18:return null;case 4:return Pf(a),null;case 10:return hh(a),null;default:return null}}var Uh=Wb.ReactCurrentDispatcher,Vh=Wb.ReactCurrentOwner; +null==v.__interactionsRef||null==v.__interactionsRef.current?x("302"):void 0;var Wh=1073741822,Xh=!1,R=null,Yh=null,S=0,Rh=-1,Sh=!1,T=null,Zh=!1,$h=null,ai=null,bi=null,Oh=null;function ci(){if(null!==R)for(var a=R.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&Ne(b);break;case 3:Pf(b);Oe(b);break;case 5:Rf(b);break;case 4:Pf(b);break;case 10:hh(b)}a=a.return}Yh=null;S=0;Rh=-1;Sh=!1;R=null} +function di(){for(;null!==T;){var a=T.effectTag;a&16&&ne(T.stateNode,"");if(a&128){var b=T.alternate;null!==b&&(b=b.ref,null!==b&&("function"===typeof b?b(null):b.current=null))}switch(a&14){case 2:Hh(T);T.effectTag&=-3;break;case 6:Hh(T);T.effectTag&=-3;Ih(T.alternate,T);break;case 4:Ih(T.alternate,T);break;case 8:a=T,Fh(a),a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null,a=a.alternate,null!==a&&(a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null)}T=T.nextEffect}} +function ei(){for(;null!==T;){if(T.effectTag&256)a:{var a=T.alternate,b=T;switch(b.tag){case 0:case 11:case 15:Ch(Tf,Sf,b);break a;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:K(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}break a;case 3:case 5:case 6:case 4:case 17:break a;default:x("163")}}T=T.nextEffect}} +function fi(a,b){for(;null!==T;){var c=T.effectTag;if(c&36){var d=a,e=T.alternate,f=T,g=b;switch(f.tag){case 0:case 11:case 15:Ch(Wf,Xf,f);break;case 1:d=f.stateNode;if(f.effectTag&4)if(null===e)d.componentDidMount();else{var h=f.elementType===f.type?e.memoizedProps:K(f.type,e.memoizedProps);d.componentDidUpdate(h,e.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}e=f.updateQueue;null!==e&&qh(f,e,d,g);break;case 3:e=f.updateQueue;if(null!==e){d=null;if(null!==f.child)switch(f.child.tag){case 5:d= +f.child.stateNode;break;case 1:d=f.child.stateNode}qh(f,e,d,g)}break;case 5:g=f.stateNode;null===e&&f.effectTag&4&&ze(f.type,f.memoizedProps)&&g.focus();break;case 6:break;case 4:break;case 12:g=f.memoizedProps.onRender;g(f.memoizedProps.id,null===e?"mount":"update",f.actualDuration,f.treeBaseDuration,f.actualStartTime,Cg,d.memoizedInteractions);break;case 13:break;case 17:break;default:x("163")}}c&128&&(f=T.ref,null!==f&&(g=T.stateNode,"function"===typeof f?f(g):f.current=g));c&512&&($h=a);T=T.nextEffect}} +function gi(a,b){bi=ai=$h=null;var c=V;V=!0;do{if(b.effectTag&512){var d=!1,e=void 0;try{var f=b;Ch(Zf,Sf,f);Ch(Sf,Yf,f)}catch(g){d=!0,e=g}d&&Bh(b,e)}b=b.nextEffect}while(null!==b);V=c;c=a.expirationTime;0!==c&&hi(a,c);W||V||ii(1073741823,!1)}function tf(){null!==ai&&Ee(ai);null!==bi&&bi()} +function ji(a,b){Zh=Xh=!0;a.current===b?x("177"):void 0;var c=a.pendingCommitExpirationTime;0===c?x("261"):void 0;a.pendingCommitExpirationTime=0;var d=b.expirationTime,e=b.childExpirationTime;jf(a,e>d?e:d);d=null;d=v.__interactionsRef.current;v.__interactionsRef.current=a.memoizedInteractions;Vh.current=null;e=void 0;1e?b:e;0===k&&(Oh=null);ki(a,k);v.__interactionsRef.current=d;var l=void 0;try{if(l=v.__subscriberRef.current,null!==l&&0k&&(m.delete(b),a.forEach(function(a){a.__count--;if(null!==l&&0=== +a.__count)try{l.onInteractionScheduledWorkCompleted(a)}catch(Nb){X||(X=!0,li=Nb)}}))})}} +function mi(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){R=a;a.mode&4&&Eg(a);a:{var e=b;b=a;var f=S;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:I(b.type)&&Ne(b);break;case 3:Pf(b);Oe(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Ng(b),b.effectTag&=-3;vh(b);break;case 5:Rf(b);var h=Nf(Mf.current);f=b.type;if(null!==e&&null!=b.stateNode)wh(e,b,f,g,h),e.ref!== +b.ref&&(b.effectTag|=128);else if(g){var k=Nf(M.current);if(Ng(b)){g=b;e=g.stateNode;var l=g.type,m=g.memoizedProps,p=h;e[Fa]=g;e[Ga]=m;f=void 0;h=l;switch(h){case "iframe":case "object":D("load",e);break;case "video":case "audio":for(l=0;l\x3c/script>",l=e.removeChild(e.firstChild)):"string"===typeof e.is?l=l.createElement(p,{is:e.is}):(l=l.createElement(p),"select"===p&&(p=l,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):l=l.createElementNS(k,p);e=l;e[Fa]=m;e[Ga]=g;uh(e,b,!1,!1);p=e; +l=f;m=g;var w=h,U=ue(l,m);switch(l){case "iframe":case "object":D("load",p);h=m;break;case "video":case "audio":for(h=0;hg&&(g=p),l>g&&(g=l),h&&(f+=m.actualDuration),e+=m.treeBaseDuration,m=m.sibling;b.actualDuration=f;b.treeBaseDuration=e}else for(f=b.child;null!==f;)e=f.expirationTime,h=f.childExpirationTime,e>g&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==R)return R;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect= +a.firstEffect),c.lastEffect=a.lastEffect),1=d&&a.forEach(function(a){return e.add(a)})});a.memoizedInteractions=e;if(0b?0:b)):ri(a,c,d)}} +function Bh(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Oh||!Oh.has(d))){a=sh(b,a);a=Nh(c,a,1073741823);uf(c,a);vf(c,1073741823);return}break;case 3:a=sh(b,a);a=Lh(c,a,1073741823);uf(c,a);vf(c,1073741823);return}c=c.return}3===a.tag&&(c=sh(b,a),c=Lh(a,c,1073741823),uf(a,c),vf(a,1073741823))} +function rf(a,b){var c=r.unstable_getCurrentPriorityLevel(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Xh&&!Zh)d=S;else{switch(c){case r.unstable_ImmediatePriority:d=1073741823;break;case r.unstable_UserBlockingPriority:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case r.unstable_NormalPriority:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case r.unstable_LowPriority:case r.unstable_IdlePriority:d=1;break;default:x("313")}null!==Yh&&d===S&&--d}c===r.unstable_UserBlockingPriority&& +(0===si||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;hf(c,a);c=a.expirationTime;0!==c&&hi(a,c)}}function Jh(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=qf();b=rf(b,a);a=ti(a,b);null!==a&&(gf(a,b),b=a.expirationTime,0!==b&&hi(a,b))} +function ti(a,b){a.expirationTimeS&&ci(),gf(a,b),Xh&&!Zh&&Yh===a||hi(a,a.expirationTime),ui>vi&&(ui=0,x("185")))}function wi(a,b,c,d,e){return r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){return a(b,c,d,e)})} +var xi=null,Y=null,yi=0,zi=void 0,V=!1,Ai=null,Z=0,si=0,X=!1,li=null,W=!1,Bi=!1,Ci=null,Di=r.unstable_now(),Ei=1073741822-(Di/10|0),Fi=Ei,vi=50,ui=0,Gi=null;function Hi(){Ei=1073741822-((r.unstable_now()-Di)/10|0)}function Ii(a,b){if(0!==yi){if(ba.expirationTime&&(a.expirationTime=b);V||(W?Bi&&(Ai=a,Z=1073741823,Ni(a,1073741823,!1)):1073741823===b?ii(1073741823,!1):Ii(a,b))} +function Mi(){var a=0,b=null;if(null!==Y)for(var c=Y,d=xi;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===Y?x("244"):void 0;if(d===d.nextScheduledRoot){xi=Y=d.nextScheduledRoot=null;break}else if(d===xi)xi=e=d.nextScheduledRoot,Y.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===Y){Y=c;Y.nextScheduledRoot=xi;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===Y)break;if(1073741823=== +a)break;c=d;d=d.nextScheduledRoot}}Ai=b;Z=a}var Oi=!1;function pi(){return Oi?!0:r.unstable_shouldYield()?Oi=!0:!1}function Ji(){try{if(!pi()&&null!==xi){Hi();var a=xi;do{var b=a.expirationTime;0!==b&&Ei<=b&&(a.nextExpirationTimeToWorkOn=Ei);a=a.nextScheduledRoot}while(a!==xi)}ii(0,!0)}finally{Oi=!1}} +function ii(a,b){Mi();if(b)for(Hi(),Fi=Ei;null!==Ai&&0!==Z&&a<=Z&&!(Oi&&Ei>Z);)Ni(Ai,Z,Ei>Z),Mi(),Hi(),Fi=Ei;else for(;null!==Ai&&0!==Z&&a<=Z;)Ni(Ai,Z,!1),Mi();b&&(yi=0,zi=null);0!==Z&&Ii(Ai,Z);ui=0;Gi=null;if(null!==Ci)for(a=Ci,Ci=null,b=0;b=c&&(null===Ci?Ci=[d]:Ci.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Gi?ui++:(Gi=a,ui=0);r.unstable_runWithPriority(r.unstable_ImmediatePriority,function(){ji(a,b)})}function Mh(a){null===Ai?x("246"):void 0;Ai.expirationTime=0;X||(X=!0,li=a)}function Qi(a,b){var c=W;W=!0;try{return a(b)}finally{(W=c)||V||ii(1073741823,!1)}} +function Ri(a,b){if(W&&!Bi){Bi=!0;try{return a(b)}finally{Bi=!1}}return a(b)}function Si(a,b,c){W||V||0===si||(ii(si,!1),si=0);var d=W;W=!0;try{return r.unstable_runWithPriority(r.unstable_UserBlockingPriority,function(){return a(b,c)})}finally{(W=d)||V||ii(1073741823,!1)}} +function Ti(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===hd(c)&&1===c.tag?void 0:x("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(I(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);x("171");g=void 0}if(1===c.tag){var h=c.type;if(I(h)){c=Qe(c,h,g);break a}}c=g}else c=Ke;null===b.context?b.context=c:b.pendingContext=c;b=e;e=sf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b); +tf();uf(f,e);vf(f,d);return d}function Ui(a,b,c,d){var e=b.current,f=qf();e=rf(f,e);return Ti(a,b,c,e,d)}function Vi(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Wi(a,b,c){var d=3=Wh&&(b=Wh-1);this._expirationTime=Wh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}Xi.prototype.render=function(a){this._defer?void 0:x("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new Yi;Ti(a,b,null,c,d._onCommit);return d}; +Xi.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}}; +Xi.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:x("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?x("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Li(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next= +null,this._defer=!1};Xi.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a}; +function $i(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Ib=Qi;Jb=Si;Kb=function(){V||0===si||(ii(si,!1),si=0)};function aj(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new Zi(a,!1,b)} +function bj(a,b,c,d,e){var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Vi(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=aj(c,d);if("function"===typeof e){var h=e;e=function(){var a=Vi(f._internalRoot);h.call(a)}}Ri(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Vi(f._internalRoot)} +function cj(a,b){var c=2 + + 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 { @@ -834,12 +863,15 @@ var capitalize = function (token) { 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 /** @@ -994,24 +1026,13 @@ function createMarkupForCustomAttribute(name, value) { return name + '=' + quoteAttributeValueForBrowser(value); } -function areHookInputsEqual(arr1, arr2) { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - { - !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0; - } - for (var i = 0; i < arr1.length; i++) { - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - var val1 = arr1[i]; - var val2 = arr2[i]; - if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2 // eslint-disable-line no-self-compare - ) { - continue; - } - return false; - } - return true; +/** + * 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; @@ -1027,12 +1048,47 @@ var renderPhaseUpdates = null; 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, 'Hooks can only be called inside the body of a function component.') : void 0; + !(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, @@ -1067,6 +1123,9 @@ function createWorkInProgressHook() { function prepareToUseHooks(componentIdentity) { currentlyRenderingComponent = componentIdentity; + { + isInHookUserCodeInDev = false; + } // The following should have already been reset // didScheduleRenderPhaseUpdate = false; @@ -1098,6 +1157,9 @@ function finishHooks(Component, props, children, refOrContext) { numberOfReRenders = 0; renderPhaseUpdates = null; workInProgressHook = null; + { + isInHookUserCodeInDev = false; + } // These were reset above // currentlyRenderingComponent = null; @@ -1113,10 +1175,16 @@ function finishHooks(Component, props, children, refOrContext) { 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); @@ -1128,12 +1196,20 @@ function basicStateReducer(state, action) { } function useState(initialState) { + { + currentHookNameInDev = 'useState'; + } return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers initialState); } -function useReducer(reducer, initialState, initialAction) { +function useReducer(reducer, initialArg, init) { + { + if (reducer !== basicStateReducer) { + currentHookNameInDev = 'useReducer'; + } + } currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); if (isReRender) { @@ -1152,7 +1228,13 @@ function useReducer(reducer, initialState, initialAction) { // 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); @@ -1163,13 +1245,18 @@ function useReducer(reducer, initialState, initialAction) { } return [workInProgressHook.memoizedState, _dispatch]; } else { + { + isInHookUserCodeInDev = true; + } + var initialState = void 0; if (reducer === basicStateReducer) { // Special case for `useState`. - if (typeof initialState === 'function') { - initialState = initialState(); - } - } else if (initialAction !== undefined && initialAction !== null) { - initialState = reducer(initialState, initialAction); + initialState = typeof initialArg === 'function' ? initialArg() : initialArg; + } else { + initialState = init !== undefined ? init(initialArg) : initialArg; + } + { + isInHookUserCodeInDev = false; } workInProgressHook.memoizedState = initialState; var _queue2 = workInProgressHook.queue = { @@ -1181,22 +1268,32 @@ function useReducer(reducer, initialState, initialAction) { } } -function useMemo(nextCreate, inputs) { +function useMemo(nextCreate, deps) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate]; + var nextDeps = deps === undefined ? null : deps; - if (workInProgressHook !== null && workInProgressHook.memoizedState !== null) { + if (workInProgressHook !== null) { var prevState = workInProgressHook.memoizedState; - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } } } + { + isInHookUserCodeInDev = true; + } var nextValue = nextCreate(); - workInProgressHook.memoizedState = [nextValue, nextInputs]; + { + isInHookUserCodeInDev = false; + } + workInProgressHook.memoizedState = [nextValue, nextDeps]; return nextValue; } @@ -1216,12 +1313,11 @@ function useRef(initialValue) { } } -function useMutationEffect(create, inputs) { - warning$1(false, 'useMutationEffect 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, useMutationEffect should only be used in ' + 'components that render exclusively on the client.'); -} - function useLayoutEffect(create, inputs) { - 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.'); + { + currentHookNameInDev = 'useLayoutEffect'; + } + warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.'); } function dispatchAction(componentIdentity, queue, action) { @@ -1257,6 +1353,11 @@ function dispatchAction(componentIdentity, queue, action) { } } +function useCallback(callback, deps) { + // Callbacks are passed as they are in the server environment. + return callback; +} + function noop() {} var currentThreadID = 0; @@ -1272,17 +1373,14 @@ var Dispatcher = { useReducer: useReducer, useRef: useRef, useState: useState, - useMutationEffect: useMutationEffect, useLayoutEffect: useLayoutEffect, - // useImperativeMethods is not run in the server environment - useImperativeMethods: noop, - // Callbacks are not run in the server environment. - useCallback: noop, + useCallback: useCallback, + // useImperativeHandle is not run in the server environment + useImperativeHandle: noop, // Effects are not run in the server environment. - useEffect: noop -}; -var DispatcherWithoutHooks = { - readContext: readContext + useEffect: noop, + // Debugging effect + useDebugValue: noop }; var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; @@ -2525,7 +2623,7 @@ var toArray = React.Children.toArray; // Each stack is an array of frames which may contain nested stacks of elements. var currentDebugStacks = []; -var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var ReactDebugCurrentFrame = void 0; var prevGetCurrentStackImpl = null; var getCurrentServerStackImpl = function () { @@ -3034,6 +3132,7 @@ var ReactDOMServerRenderer = function () { ReactDOMServerRenderer.prototype.destroy = function destroy() { if (!this.exhausted) { this.exhausted = true; + this.clearProviders(); freeThreadID(this.threadID); } }; @@ -3092,6 +3191,15 @@ var ReactDOMServerRenderer = function () { context[this.threadID] = previousValue; }; + ReactDOMServerRenderer.prototype.clearProviders = function clearProviders() { + // Restore any remaining providers on the stack to previous values + for (var index = this.contextIndex; index >= 0; index--) { + var _context = this.contextStack[index]; + var previousValue = this.contextValueStack[index]; + _context[this.threadID] = previousValue; + } + }; + ReactDOMServerRenderer.prototype.read = function read(bytes) { if (this.exhausted) { return null; @@ -3099,12 +3207,8 @@ var ReactDOMServerRenderer = function () { var prevThreadID = currentThreadID; setCurrentThreadID(this.threadID); - var prevDispatcher = ReactCurrentOwner.currentDispatcher; - if (enableHooks) { - ReactCurrentOwner.currentDispatcher = Dispatcher; - } else { - ReactCurrentOwner.currentDispatcher = DispatcherWithoutHooks; - } + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = Dispatcher; try { // Markup generated within ends up buffered until we know // nothing in that boundary suspended @@ -3177,7 +3281,7 @@ var ReactDOMServerRenderer = function () { } return out[0]; } finally { - ReactCurrentOwner.currentDispatcher = prevDispatcher; + ReactCurrentDispatcher.current = prevDispatcher; setCurrentThreadID(prevThreadID); } }; @@ -3261,7 +3365,25 @@ var ReactDOMServerRenderer = function () { case REACT_SUSPENSE_TYPE: { if (enableSuspenseServerRenderer) { - var fallbackChildren = toArray(nextChild.props.fallback); + var fallback = nextChild.props.fallback; + if (fallback === undefined) { + // If there is no fallback, then this just behaves as a fragment. + var _nextChildren3 = toArray(nextChild.props.children); + var _frame3 = { + type: null, + domNamespace: parentNamespace, + children: _nextChildren3, + childIndex: 0, + context: context, + footer: '' + }; + { + _frame3.debugElementStack = []; + } + this.stack.push(_frame3); + return ''; + } + var fallbackChildren = toArray(fallback); var _nextChildren2 = toArray(nextChild.props.children); var _fallbackFrame2 = { type: null, @@ -3279,7 +3401,7 @@ var ReactDOMServerRenderer = function () { children: _nextChildren2, childIndex: 0, context: context, - footer: '' + footer: '' }; { _frame2.debugElementStack = []; @@ -3287,7 +3409,7 @@ var ReactDOMServerRenderer = function () { } this.stack.push(_frame2); this.suspenseDepth++; - return ''; + return ''; } else { invariant(false, 'ReactDOMServer does not yet support Suspense.'); } @@ -3301,64 +3423,64 @@ var ReactDOMServerRenderer = function () { case REACT_FORWARD_REF_TYPE: { var element = nextChild; - var _nextChildren3 = void 0; + var _nextChildren4 = void 0; var componentIdentity = {}; prepareToUseHooks(componentIdentity); - _nextChildren3 = elementType.render(element.props, element.ref); - _nextChildren3 = finishHooks(elementType.render, element.props, _nextChildren3, element.ref); - _nextChildren3 = toArray(_nextChildren3); - var _frame3 = { + _nextChildren4 = elementType.render(element.props, element.ref); + _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref); + _nextChildren4 = toArray(_nextChildren4); + var _frame4 = { type: null, domNamespace: parentNamespace, - children: _nextChildren3, + children: _nextChildren4, childIndex: 0, context: context, footer: '' }; { - _frame3.debugElementStack = []; + _frame4.debugElementStack = []; } - this.stack.push(_frame3); + this.stack.push(_frame4); return ''; } case REACT_MEMO_TYPE: { var _element = nextChild; - var _nextChildren4 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; - var _frame4 = { + var _nextChildren5 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))]; + var _frame5 = { type: null, domNamespace: parentNamespace, - children: _nextChildren4, + children: _nextChildren5, childIndex: 0, context: context, footer: '' }; { - _frame4.debugElementStack = []; + _frame5.debugElementStack = []; } - this.stack.push(_frame4); + this.stack.push(_frame5); return ''; } case REACT_PROVIDER_TYPE: { var provider = nextChild; var nextProps = provider.props; - var _nextChildren5 = toArray(nextProps.children); - var _frame5 = { + var _nextChildren6 = toArray(nextProps.children); + var _frame6 = { type: provider, domNamespace: parentNamespace, - children: _nextChildren5, + children: _nextChildren6, childIndex: 0, context: context, footer: '' }; { - _frame5.debugElementStack = []; + _frame6.debugElementStack = []; } this.pushProvider(provider); - this.stack.push(_frame5); + this.stack.push(_frame6); return ''; } case REACT_CONTEXT_TYPE: @@ -3391,19 +3513,19 @@ var ReactDOMServerRenderer = function () { validateContextBounds(reactContext, threadID); var nextValue = reactContext[threadID]; - var _nextChildren6 = toArray(_nextProps.children(nextValue)); - var _frame6 = { + var _nextChildren7 = toArray(_nextProps.children(nextValue)); + var _frame7 = { type: nextChild, domNamespace: parentNamespace, - children: _nextChildren6, + children: _nextChildren7, childIndex: 0, context: context, footer: '' }; { - _frame6.debugElementStack = []; + _frame7.debugElementStack = []; } - this.stack.push(_frame6); + this.stack.push(_frame7); return ''; } case REACT_LAZY_TYPE: diff --git a/frontend/node_modules/react-dom/umd/react-dom-server.browser.production.min.js b/frontend/node_modules/react-dom/umd/react-dom-server.browser.production.min.js index 7229bd17..0d679128 100644 --- a/frontend/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +++ b/frontend/node_modules/react-dom/umd/react-dom-server.browser.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-server.browser.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -6,35 +6,39 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict';(function(u,C){"object"===typeof exports&&"undefined"!==typeof module?module.exports=C(require("react")):"function"===typeof define&&define.amd?define(["react"],C):u.ReactDOMServer=C(u.React)})(this,function(u){function C(a,b,f,c,g,d,h,e){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 k=[f,c,g,d,h,e],ja=0;a=Error(b.replace(/%s/g,function(){return k[ja++]})); -a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function v(a){for(var b=arguments.length-1,f="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cb}return!1}function t(a,b,f,c,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=g;this.mustUseProperty=f;this.propertyName=a;this.type=b}function B(a){if("boolean"===typeof a||"number"===typeof a)return""+ -a;a=""+a;var b=oa.exec(a);if(b){var f="",c,g=0;for(c=b.index;cz;z++)q[z]=z+1;q[15]=0;var la=/^[: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]*$/, -Y=Object.prototype.hasOwnProperty,aa={},Z={},r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){r[a]=new t(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];r[b]=new t(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){r[a]=new t(a,2,!1, -a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){r[a]=new t(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){r[a]=new t(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){r[a]=new t(a,3,!0,a,null)});["capture", -"download"].forEach(function(a){r[a]=new t(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){r[a]=new t(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){r[a]=new t(a,5,!1,a.toLowerCase(),null)});var K=/[\-:]([a-z])/g,L=function(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);r[b]=new t(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);r[b]=new t(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);r[b]=new t(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});r.tabIndex=new t("tabIndex",1,!1,"tabindex",null);var oa=/["'&<>]/,ca=!1,G=0,sa={readContext:function(a,b){b=G;F(a,b);return a[b]}}, -fa={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ta=y({menuitem:!0},fa),D={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0, -gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ua=["Webkit","ms","Moz","O"];Object.keys(D).forEach(function(a){ua.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);D[b]=D[a]})});var va=/([A-Z])/g,wa=/^ms-/,A=u.Children.toArray,M=k.ReactCurrentOwner,xa={listing:!0,pre:!0, -textarea:!0},ya=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ha={},N={},za=Object.prototype.hasOwnProperty,Aa={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null},ia=function(){function a(b,f){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");u.isValidElement(b)?b.type!==H?b=[b]:(b=b.props.children,b=u.isValidElement(b)?[b]:A(b)):b=A(b);b={type:null,domNamespace:"http://www.w3.org/1999/xhtml",children:b,childIndex:0,context:W, -footer:""};var c=q[0];if(0===c){var g=q;c=g.length;var d=2*c;65536>=d?void 0:v("304");var h=new Uint16Array(d);h.set(g);q=h;q[0]=c+1;for(g=c;g=e.children.length){var k=e.footer;""!==k&&(this.previousWasTextNode=!1);this.stack.pop();if("select"===e.type)this.currentSelectValue=null;else if(null!=e.type&&null!=e.type.type&&e.type.type.$$typeof===J)this.popProvider(e.type);else if(e.type===I){this.suspenseDepth--;var r=g.pop();if(d){d= -!1;var p=e.fallbackFrame;p?void 0:v("303");this.stack.push(p);continue}else g[this.suspenseDepth]+=r}g[this.suspenseDepth]+=k}else{var m=e.children[e.childIndex++],l="";try{l+=this.render(m,e.context,e.domNamespace)}catch(ra){throw ra;}finally{}g.length<=this.suspenseDepth&&g.push("");g[this.suspenseDepth]+=l}}return g[0]}finally{M.currentDispatcher=c,G=b}};a.prototype.render=function(a,f,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return B(c); -if(this.previousWasTextNode)return"\x3c!-- --\x3e"+B(c);this.previousWasTextNode=!0;return B(c)}f=qa(a,f,this.threadID);a=f.child;f=f.context;if(null===a||!1===a)return"";if(!u.isValidElement(a)){if(null!=a&&null!=a.$$typeof){var b=a.$$typeof;b===P?v("257"):void 0;v("258",b.toString())}a=A(a);this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""});return""}b=a.type;if("string"===typeof b)return this.renderDOM(a,f,c);switch(b){case R:case O:case Q:case H:return a=A(a.props.children), -this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""}),"";case I:v("294")}if("object"===typeof b&&null!==b)switch(b.$$typeof){case T:var d=b.render(a.props,a.ref);d=ba(b.render,a.props,d,a.ref);d=A(d);this.stack.push({type:null,domNamespace:c,children:d,childIndex:0,context:f,footer:""});return"";case U:return a=[u.createElement(b.type,y({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:f,footer:""}),"";case J:return b= -A(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:f,footer:""},this.pushProvider(a),this.stack.push(c),"";case S:b=a.type;d=a.props;var h=this.threadID;F(b,h);b=A(d.children(b[h]));this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:f,footer:""});return"";case V:v("295")}v("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,f,c){var b=a.type.toLowerCase();"http://www.w3.org/1999/xhtml"===c&&da(b);ha.hasOwnProperty(b)||(ya.test(b)?void 0:v("65", -b),ha[b]=!0);var d=a.props;if("input"===b)d=y({type:void 0},d,{defaultChecked:void 0,defaultValue:void 0,value:null!=d.value?d.value:d.defaultValue,checked:null!=d.checked?d.checked:d.defaultChecked});else if("textarea"===b){var h=d.value;if(null==h){h=d.defaultValue;var e=d.children;null!=e&&(null!=h?v("92"):void 0,Array.isArray(e)&&(1>=e.length?void 0:v("93"),e=e[0]),h=""+e);null==h&&(h="")}d=y({},d,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=d.value?d.value: -d.defaultValue,d=y({},d,{value:void 0});else if("option"===b){e=this.currentSelectValue;var k=pa(d.children);if(null!=e){var q=null!=d.value?d.value+"":k;h=!1;if(Array.isArray(e))for(var p=0;p":(x+=">",h="");a:{e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html){e=e.__html;break a}}else if(e=d.children,"string"===typeof e||"number"===typeof e){e= -B(e);break a}e=null}null!=e?(d=[],xa[b]&&"\n"===e.charAt(0)&&(x+="\n"),x+=e):d=A(d.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?da(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:d,childIndex:0,context:f,footer:h});this.previousWasTextNode=!1;return x};return a}();k={renderToString:function(a){a=new ia(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a= -new ia(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){v("207")},renderToStaticNodeStream:function(){v("208")},version:"16.6.3"};k=(z={default:k},k)||z;return k.default||k}); +'use strict';(function(v,E){"object"===typeof exports&&"undefined"!==typeof module?module.exports=E(require("react")):"function"===typeof define&&define.amd?define(["react"],E):v.ReactDOMServer=E(v.React)})(this,function(v){function E(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 k=[d,c,f,e,h,g],u=0;a=Error(b.replace(/%s/g,function(){return k[u++]}));a.name= +"Invariant Violation"}a.framesToPop=1;throw a;}}function u(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cb}return!1}function t(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}function C(a){if("boolean"===typeof a||"number"=== +typeof a)return""+a;a=""+a;var b=ya.exec(a);if(b){var d="",c,f=0;for(c=b.index;cL?void 0:u("301");if(a===x)if(R=!0,a={action:d,next:null},null===A&&(A=new Map),d=A.get(b),void 0===d)A.set(b,a);else{for(b=d;null!==b.next;)b=b.next;b.next=a}}function S(){}function pa(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Aa(a){if(void 0===a||null===a)return a; +var b="";v.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function qa(a,b){void 0===a&&u("152",J(b)||"Component")}function Ba(a,b,d){function c(c,f){var e=ua(f,b,d),g=[],h=!1,m={isMounted:function(a){return!1},enqueueForceUpdate:function(a){if(null===g)return null},enqueueReplaceState:function(a,b){h=!0;g=[b]},enqueueSetState:function(a,b){if(null===g)return null;g.push(b)}},l=void 0;if(f.prototype&&f.prototype.isReactComponent){if(l=new f(c.props,e,m),"function"===typeof f.getDerivedStateFromProps){var k= +f.getDerivedStateFromProps.call(null,c.props,l.state);null!=k&&(l.state=z({},l.state,k))}}else if(x={},l=f(c.props,e,m),l=ma(f,c.props,l,e),null==l||null==l.render){a=l;qa(a,f);return}l.props=c.props;l.context=e;l.updater=m;m=l.state;void 0===m&&(l.state=m=null);if("function"===typeof l.UNSAFE_componentWillMount||"function"===typeof l.componentWillMount)if("function"===typeof l.componentWillMount&&"function"!==typeof f.getDerivedStateFromProps&&l.componentWillMount(),"function"===typeof l.UNSAFE_componentWillMount&& +"function"!==typeof f.getDerivedStateFromProps&&l.UNSAFE_componentWillMount(),g.length){m=g;var n=h;g=null;h=!1;if(n&&1===m.length)l.state=m[0];else{k=n?m[0]:l.state;var p=!0;for(n=n?1:0;nD;D++)q[D]=D+1;q[15]=0;var va=/^[: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]*$/, +ia=Object.prototype.hasOwnProperty,ka={},ja={},w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new t(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];w[b]=new t(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new t(a,2,!1, +a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new t(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){w[a]=new t(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){w[a]=new t(a,3,!0,a,null)});["capture", +"download"].forEach(function(a){w[a]=new t(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){w[a]=new t(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){w[a]=new t(a,5,!1,a.toLowerCase(),null)});var T=/[\-:]([a-z])/g,U=function(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(T,U);w[b]=new t(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(T,U);w[b]=new t(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(T,U);w[b]=new t(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});["tabIndex","crossOrigin"].forEach(function(a){w[a]=new t(a,1,!1,a.toLowerCase(),null)});var ya=/["'&<>]/,x=null,M=null,k=null, +G=!1,R=!1,A=null,L=0,H=0,Da={readContext:function(a,b){b=H;F(a,b);return a[b]},useContext:function(a,b){K();b=H;F(a,b);return a[b]},useMemo:function(a,b){x=K();k=Q();b=void 0===b?null:b;if(null!==k){var d=k.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:u("304");var h=new Uint16Array(e);h.set(f);q=h;q[0]=c+1;for(f=c;f=g.children.length){var k=g.footer;""!==k&&(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===P)this.popProvider(g.type);else if(g.type===O){this.suspenseDepth--;var p=f.pop();if(e){e=!1;var r=g.fallbackFrame;r?void 0:u("303");this.stack.push(r);continue}else f[this.suspenseDepth]+=p}f[this.suspenseDepth]+=k}else{var m=g.children[g.childIndex++],l="";try{l+=this.render(m, +g.context,g.domNamespace)}catch(Ca){throw Ca;}finally{}f.length<=this.suspenseDepth&&f.push("");f[this.suspenseDepth]+=l}}return f[0]}finally{V.current=c,H=b}};a.prototype.render=function(a,d,c){if("string"===typeof a||"number"===typeof a){c=""+a;if(""===c)return"";if(this.makeStaticMarkup)return C(c);if(this.previousWasTextNode)return"\x3c!-- --\x3e"+C(c);this.previousWasTextNode=!0;return C(c)}d=Ba(a,d,this.threadID);a=d.child;d=d.context;if(null===a||!1===a)return"";if(!v.isValidElement(a)){if(null!= +a&&null!=a.$$typeof){var b=a.$$typeof;b===Y?u("257"):void 0;u("258",b.toString())}a=B(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 aa:case X:case Z:case N:return a=B(a.props.children),this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case O:u("294")}if("object"===typeof b&&null!==b)switch(b.$$typeof){case ca:x={};var e=b.render(a.props, +a.ref);e=ma(b.render,a.props,e,a.ref);e=B(e);this.stack.push({type:null,domNamespace:c,children:e,childIndex:0,context:d,footer:""});return"";case da:return a=[v.createElement(b.type,z({ref:a.ref},a.props))],this.stack.push({type:null,domNamespace:c,children:a,childIndex:0,context:d,footer:""}),"";case P:return b=B(a.props.children),c={type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""},this.pushProvider(a),this.stack.push(c),"";case ba:b=a.type;e=a.props;var h=this.threadID;F(b,h); +b=B(e.children(b[h]));this.stack.push({type:a,domNamespace:c,children:b,childIndex:0,context:d,footer:""});return"";case ea:u("295")}u("130",null==b?b:typeof b,"")};a.prototype.renderDOM=function(a,d,c){var b=a.type.toLowerCase();"http://www.w3.org/1999/xhtml"===c&&pa(b);sa.hasOwnProperty(b)||(Ja.test(b)?void 0:u("65",b),sa[b]=!0);var e=a.props;if("input"===b)e=z({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?u("92"):void 0,Array.isArray(g)&&(1>=g.length?void 0:u("93"),g=g[0]),h=""+g);null==h&&(h="")}e=z({},e,{value:void 0,children:""+h})}else if("select"===b)this.currentSelectValue=null!=e.value?e.value:e.defaultValue,e=z({},e,{value:void 0});else if("option"===b){g=this.currentSelectValue;var k=Aa(e.children);if(null!=g){var p=null!=e.value?e.value+"":k;h=!1;if(Array.isArray(g))for(var r= +0;r":(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=C(g);break a}g=null}null!=g?(e=[],Ia[b]&&"\n"===g.charAt(0)&&(y+="\n"),y+=g):e=B(e.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?pa(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}();p={renderToString:function(a){a=new ta(a,!1);try{return a.read(Infinity)}finally{a.destroy()}},renderToStaticMarkup:function(a){a=new ta(a,!0);try{return a.read(Infinity)}finally{a.destroy()}},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.8.6"}; +p=(D={default:p},p)||D;return p.default||p}); diff --git a/frontend/node_modules/react-dom/umd/react-dom-test-utils.development.js b/frontend/node_modules/react-dom/umd/react-dom-test-utils.development.js index 98df2d21..8f54a165 100644 --- a/frontend/node_modules/react-dom/umd/react-dom-test-utils.development.js +++ b/frontend/node_modules/react-dom/umd/react-dom-test-utils.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-test-utils.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -137,6 +137,15 @@ function get(key) { 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 + }; +} + // 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. @@ -831,6 +840,7 @@ var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // Note that events in this list will *not* be listened to at the top level // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`. +// for .act's return value var findDOMNode = ReactDOM.findDOMNode; // Keep in sync with ReactDOMUnstableNativeDependencies.js // and ReactDOM.js: @@ -939,6 +949,9 @@ function validateClassInstance(inst, methodName) { invariant(false, '%s(...): the first argument must be a React class instance. Instead received: %s.', methodName, received); } +// a stub element, lazily initialized, used by act() when flushing effects +var actContainerElement = null; + /** * Utilities for making it easy to test React components. * @@ -1133,7 +1146,43 @@ var ReactTestUtils = { }, Simulate: null, - SimulateNative: {} + SimulateNative: {}, + + act: function (callback) { + if (actContainerElement === null) { + // warn if we can't actually create the stub element + { + !(typeof document !== 'undefined' && document !== null && typeof document.createElement === 'function') ? warningWithoutStack$1(false, 'It looks like you called TestUtils.act(...) in a non-browser environment. ' + "If you're using TestRenderer for your tests, you should call " + 'TestRenderer.act(...) instead of TestUtils.act(...).') : void 0; + } + // then make it + actContainerElement = document.createElement('div'); + } + + var result = ReactDOM.unstable_batchedUpdates(callback); + // note: keep these warning messages in sync with + // createReactNoop.js and ReactTestRenderer.js + { + if (result !== undefined) { + var addendum = void 0; + if (result !== null && typeof result.then === 'function') { + addendum = '\n\nIt looks like you wrote ReactTestUtils.act(async () => ...), ' + 'or returned a Promise from the callback passed to it. ' + 'Putting asynchronous logic inside ReactTestUtils.act(...) is not supported.\n'; + } else { + addendum = ' You returned: ' + result; + } + warningWithoutStack$1(false, 'The callback passed to ReactTestUtils.act(...) function must not return anything.%s', addendum); + } + } + ReactDOM.render(React.createElement('div', null), actContainerElement); + // we want the user to not expect a return, + // but we want to warn if they use it like they can await on it. + return { + then: function () { + { + warningWithoutStack$1(false, 'Do not await the result of calling ReactTestUtils.act(...), it is not a Promise.'); + } + } + }; + } }; /** @@ -1173,7 +1222,7 @@ function makeSimulator(eventType) { ReactDOM.unstable_batchedUpdates(function () { // Normally extractEvent enqueues a state restore, but we'll just always - // do that since we we're by-passing it here. + // do that since we're by-passing it here. enqueueStateRestore(domNode); runEventsInBatch(event); }); diff --git a/frontend/node_modules/react-dom/umd/react-dom-test-utils.production.min.js b/frontend/node_modules/react-dom/umd/react-dom-test-utils.production.min.js index 911ca96d..dc1f1374 100644 --- a/frontend/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +++ b/frontend/node_modules/react-dom/umd/react-dom-test-utils.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-test-utils.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -6,23 +6,24 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict';(function(l,n){"object"===typeof exports&&"undefined"!==typeof module?module.exports=n(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],n):l.ReactTestUtils=n(l.React,l.ReactDOM)})(this,function(l,n){function H(a,b,c,e,d,f,g,h){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 I=[c,e,d,f,g,h],k=0;a=Error(b.replace(/%s/g, -function(){return I[k++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function k(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;ethis.eventPool.length&&this.eventPool.push(a)}function C(a){a.eventPool=[];a.getPooled=K;a.release=L}function x(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+ -b;return c}function y(a){if(z[a])return z[a];if(!r[a])return a;var b=r[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in D)return z[a]=b[c];return a}function E(a){}function M(a,b){if(!a)return[];a=J(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}}function q(a,b){if(a&& -!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;k("286",b,a)}}function N(a){return function(b,c){l.isValidElement(b)?k("228"):void 0;f.isCompositeComponent(b)?k("229"):void 0;var e=F[a],d=new E;d.target=b;d.type=a.toLowerCase();var m=O(b),g=new t(e,m,d,b);g.persist();u(g,c);e.phasedRegistrationNames?P(g):Q(g);n.unstable_batchedUpdates(function(){R(b);S(g)});T()}}function U(a, -b){return function(c,e){var d=new E(a);u(d,e);f.isDOMComponent(c)?(c=V(c),d.target=c,G(b,d)):c.tagName&&(d.target=c,G(b,d))}}var u=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=v)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!== -typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=v)},persist:function(){this.isPersistent=v},isPersistent:w,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=w;this._dispatchInstances=this._dispatchListeners=null}});t.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp|| -Date.now()},defaultPrevented:null,isTrusted:null};t.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,e=function(){};e.prototype=c.prototype;e=new e;u(e,b.prototype);b.prototype=e;b.prototype.constructor=b;b.Interface=u({},c.Interface,a);b.extend=c.extend;C(b);return b};C(t);var m=!("undefined"===typeof window||!window.document||!window.document.createElement),r={animationend:x("Animation","AnimationEnd"),animationiteration:x("Animation","AnimationIteration"),animationstart:x("Animation", -"AnimationStart"),transitionend:x("Transition","TransitionEnd")},z={},D={};m&&(D=document.createElement("div").style,"AnimationEvent"in window||(delete r.animationend.animation,delete r.animationiteration.animation,delete r.animationstart.animation),"TransitionEvent"in window||delete r.transitionend.transition);m=y("animationend");var W=y("animationiteration"),X=y("animationstart"),Y=y("transitionend"),V=n.findDOMNode,p=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,O=p[0],F=p[4],P=p[5], -Q=p[6],R=p[7],T=p[8],G=p[9],S=p[10],f={renderIntoDocument:function(a){var b=document.createElement("div");return n.render(a,b)},isElement:function(a){return l.isValidElement(a)},isElementOfType:function(a,b){return l.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&&l.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return f.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"=== -typeof a.setState},isCompositeComponentWithType:function(a,b){return f.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){q(a,"findAllInRenderedTree");return a?M(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){q(a,"scryRenderedDOMComponentsWithClass");return f.findAllInRenderedTree(a,function(a){if(f.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)|| -(void 0===b?k("11"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){q(a,"findRenderedDOMComponentWithClass");a=f.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,b){q(a,"scryRenderedDOMComponentsWithTag");return f.findAllInRenderedTree(a,function(a){return f.isDOMComponent(a)&& -a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){q(a,"findRenderedDOMComponentWithTag");a=f.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){q(a,"scryRenderedComponentsWithType");return f.findAllInRenderedTree(a,function(a){return f.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){q(a, -"findRenderedComponentWithType");a=f.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return l.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{}};(function(){f.Simulate={};var a=void 0;for(a in F)f.Simulate[a]= -N(a)})();[["abort","abort"],[m,"animationEnd"],[W,"animationIteration"],[X,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit", -"dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove", -"mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"], -["touchstart","touchStart"],[Y,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];f.SimulateNative[b]=U(b,a[0])});m=(m={default:f},f)||m;return m.default||m}); +'use strict';(function(g,m){"object"===typeof exports&&"undefined"!==typeof module?module.exports=m(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],m):g.ReactTestUtils=m(g.React,g.ReactDOM)})(this,function(g,m){function H(a,b,c,e,d,f,h,J){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 g=[c,e,d,f,h,J],I=0;a=Error(b.replace(/%s/g, +function(){return g[I++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function l(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;ethis.eventPool.length&&this.eventPool.push(a)}function C(a){a.eventPool=[];a.getPooled=L;a.release=M}function w(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+ +b;return c}function x(a){if(y[a])return y[a];if(!q[a])return a;var b=q[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in D)return y[a]=b[c];return a}function E(a){}function N(a,b){if(!a)return[];a=K(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||1===c.tag||0===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=c.return;c=c.sibling}}}function p(a,b){if(a&& +!a._reactInternalFiber){var c=""+a;a=Array.isArray(a)?"an array":a&&1===a.nodeType&&a.tagName?"a DOM node":"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c;l("286",b,a)}}function O(a){return function(b,c){g.isValidElement(b)?l("228"):void 0;f.isCompositeComponent(b)?l("229"):void 0;var e=F[a],d=new E;d.target=b;d.type=a.toLowerCase();var k=P(b),h=new r(e,k,d,b);h.persist();t(h,c);e.phasedRegistrationNames?Q(h):R(h);m.unstable_batchedUpdates(function(){S(b);T(h)});U()}}function V(a, +b){return function(c,e){var d=new E(a);t(d,e);f.isDOMComponent(c)?(c=W(c),d.target=c,G(b,d)):c.tagName&&(d.target=c,G(b,d))}}var t=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,k=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;k.hasOwnProperty("ReactCurrentDispatcher")||(k.ReactCurrentDispatcher={current:null});t(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue= +!1),this.isDefaultPrevented=u)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=u)},persist:function(){this.isPersistent=u},isPersistent:v,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=v;this._dispatchInstances=this._dispatchListeners= +null}});r.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};r.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,e=function(){};e.prototype=c.prototype;e=new e;t(e,b.prototype);b.prototype=e;b.prototype.constructor=b;b.Interface=t({},c.Interface,a);b.extend=c.extend;C(b);return b};C(r);k=!("undefined"===typeof window|| +!window.document||!window.document.createElement);var q={animationend:w("Animation","AnimationEnd"),animationiteration:w("Animation","AnimationIteration"),animationstart:w("Animation","AnimationStart"),transitionend:w("Transition","TransitionEnd")},y={},D={};k&&(D=document.createElement("div").style,"AnimationEvent"in window||(delete q.animationend.animation,delete q.animationiteration.animation,delete q.animationstart.animation),"TransitionEvent"in window||delete q.transitionend.transition);k=x("animationend"); +var X=x("animationiteration"),Y=x("animationstart"),Z=x("transitionend"),W=m.findDOMNode,n=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events,P=n[0],F=n[4],Q=n[5],R=n[6],S=n[7],U=n[8],G=n[9],T=n[10],z=null,f={renderIntoDocument:function(a){var b=document.createElement("div");return m.render(a,b)},isElement:function(a){return g.isValidElement(a)},isElementOfType:function(a,b){return g.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||!a.tagName)},isDOMComponentElement:function(a){return!!(a&& +g.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return f.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a,b){return f.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){p(a,"findAllInRenderedTree");return a?N(a._reactInternalFiber,b):[]},scryRenderedDOMComponentsWithClass:function(a,b){p(a,"scryRenderedDOMComponentsWithClass");return f.findAllInRenderedTree(a, +function(a){if(f.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?l("11"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){p(a,"findRenderedDOMComponentWithClass");a=f.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a, +b){p(a,"scryRenderedDOMComponentsWithTag");return f.findAllInRenderedTree(a,function(a){return f.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){p(a,"findRenderedDOMComponentWithTag");a=f.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){p(a,"scryRenderedComponentsWithType");return f.findAllInRenderedTree(a, +function(a){return f.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){p(a,"findRenderedComponentWithType");a=f.scryRenderedComponentsWithType(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return g.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a, +pageY:b}]}},Simulate:null,SimulateNative:{},act:function(a){null===z&&(z=document.createElement("div"));m.unstable_batchedUpdates(a);m.render(g.createElement("div",null),z);return{then:function(){}}}};(function(){f.Simulate={};var a=void 0;for(a in F)f.Simulate[a]=O(a)})();[["abort","abort"],[k,"animationEnd"],[X,"animationIteration"],[Y,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"], +["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"], +["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"], +["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart","touchStart"],[Z,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];f.SimulateNative[b]=V(b,a[0])});k=(k={default:f},f)||k;return k.default|| +k}); diff --git a/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.development.js b/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.development.js index 27cdf409..75de2a5d 100644 --- a/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.development.js +++ b/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-unstable-native-dependencies.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -68,7 +68,7 @@ function invariant(condition, format, a, b, c, d, e, f) { // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is - // untintuitive, though, because even though React has caught the error, from + // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a diff --git a/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.production.min.js b/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.production.min.js index 942ccdba..63f71b36 100644 --- a/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.production.min.js +++ b/frontend/node_modules/react-dom/umd/react-dom-unstable-native-dependencies.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom-unstable-native-dependencies.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. diff --git a/frontend/node_modules/react-dom/umd/react-dom.development.js b/frontend/node_modules/react-dom/umd/react-dom.development.js index de4f58be..d9ce05d0 100644 --- a/frontend/node_modules/react-dom/umd/react-dom.development.js +++ b/frontend/node_modules/react-dom/umd/react-dom.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -79,7 +79,7 @@ var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is - // untintuitive, though, because even though React has caught the error, from + // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a @@ -836,6 +836,7 @@ var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; +var DehydratedSuspenseComponent = 18; var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = '__reactInternalInstance$' + randomKey; @@ -2382,6 +2383,15 @@ function updateValueIfChanged(node) { 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 + }; +} + var BEFORE_SLASH_RE = /^(.*)[\\\/]/; var describeComponentFrame = function (name, source, ownerName) { @@ -2512,13 +2522,14 @@ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; function describeFiber(fiber) { switch (fiber.tag) { - case IndeterminateComponent: - case LazyComponent: - case FunctionComponent: - case ClassComponent: - case HostComponent: - case Mode: - case SuspenseComponent: + case HostRoot: + case HostPortal: + case HostText: + case Fragment: + case ContextProvider: + case ContextConsumer: + return ''; + default: var owner = fiber._debugOwner; var source = fiber._debugSource; var name = getComponentName(fiber.type); @@ -2527,8 +2538,6 @@ function describeFiber(fiber) { ownerName = getComponentName(owner.type); } return describeComponentFrame(name, source, ownerName); - default: - return ''; } } @@ -2893,12 +2902,15 @@ var capitalize = function (token) { 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 +); /** * Get the value for a property on a node. Only used in DEV for SSR validation. @@ -3219,7 +3231,6 @@ var ReactControlledValuePropTypes = { var enableUserTimingAPI = true; -var enableHooks = false; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: var debugRenderPhaseSideEffects = false; @@ -3242,6 +3253,9 @@ var enableProfilerTimer = true; // Trace which interactions trigger each commit. var enableSchedulerTracing = true; +// Only used in www builds. +var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false. + // Only used in www builds. @@ -3256,6 +3270,8 @@ var disableInputAttributeSyncing = false; // Control this behavior with a flag to support 16.6 minor releases in the meanwhile. var enableStableConcurrentModeAPIs = false; +var warnAboutShorthandPropertyCollision = false; + // TODO: direct imports like some-package/src/* are bad. Fix me. var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; @@ -4049,27 +4065,17 @@ var EnterLeaveEventPlugin = { } }; -/*eslint-disable no-self-compare */ - -var hasOwnProperty$1 = Object.prototype.hasOwnProperty; - /** * 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) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } + return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare + ; } +var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. @@ -5429,15 +5435,29 @@ function isInDocument(node) { return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); } +function isSameOriginFrame(iframe) { + try { + // Accessing the contentDocument of a HTMLIframeElement can cause the browser + // to throw, e.g. if it has a cross-origin src attribute. + // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: + // iframe.contentDocument.defaultView; + // A safety way is to access one of the cross origin properties: Window or Location + // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. + // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl + + return typeof iframe.contentWindow.location.href === 'string'; + } catch (err) { + return false; + } +} + function getActiveElementDeep() { var win = window; var element = getActiveElement(); while (element instanceof win.HTMLIFrameElement) { - // Accessing the contentDocument of a HTMLIframeElement can cause the browser - // to throw, e.g. if it has a cross-origin src attribute - try { - win = element.contentDocument.defaultView; - } catch (e) { + if (isSameOriginFrame(element)) { + win = element.contentWindow; + } else { return element; } element = getActiveElement(win.document); @@ -6193,6 +6213,58 @@ var setTextContent = function (node, text) { node.textContent = text; }; +// List derived from Gecko source code: +// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js +var shorthandToLonghand = { + animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'], + background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'], + backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], + border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'], + borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'], + borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], + borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'], + borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'], + borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'], + borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'], + borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], + borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'], + borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], + borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'], + borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'], + columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], + columns: ['columnCount', 'columnWidth'], + flex: ['flexBasis', 'flexGrow', 'flexShrink'], + flexFlow: ['flexDirection', 'flexWrap'], + font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'], + fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'], + gap: ['columnGap', 'rowGap'], + grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], + gridColumn: ['gridColumnEnd', 'gridColumnStart'], + gridColumnGap: ['columnGap'], + gridGap: ['columnGap', 'rowGap'], + gridRow: ['gridRowEnd', 'gridRowStart'], + gridRowGap: ['rowGap'], + gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], + margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], + marker: ['markerEnd', 'markerMid', 'markerStart'], + mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'], + maskPosition: ['maskPositionX', 'maskPositionY'], + outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], + overflow: ['overflowX', 'overflowY'], + padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], + placeContent: ['alignContent', 'justifyContent'], + placeItems: ['alignItems', 'justifyItems'], + placeSelf: ['alignSelf', 'justifySelf'], + textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'], + textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], + transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'], + wordWrap: ['overflowWrap'] +}; + /** * CSS properties which accept numbers but are not in units of "px". */ @@ -6473,6 +6545,69 @@ function setValueForStyles(node, styles) { } } +function isValueEmpty(value) { + return value == null || typeof value === 'boolean' || value === ''; +} + +/** + * Given {color: 'red', overflow: 'hidden'} returns { + * color: 'color', + * overflowX: 'overflow', + * overflowY: 'overflow', + * }. This can be read as "the overflowY property was set by the overflow + * shorthand". That is, the values are the property that each was derived from. + */ +function expandShorthandMap(styles) { + var expanded = {}; + for (var key in styles) { + var longhands = shorthandToLonghand[key] || [key]; + for (var i = 0; i < longhands.length; i++) { + expanded[longhands[i]] = key; + } + } + return expanded; +} + +/** + * When mixing shorthand and longhand property names, we warn during updates if + * we expect an incorrect result to occur. In particular, we warn for: + * + * Updating a shorthand property (longhand gets overwritten): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} + * becomes .style.font = 'baz' + * Removing a shorthand property (longhand gets lost too): + * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} + * becomes .style.font = '' + * Removing a longhand property (should revert to shorthand; doesn't): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} + * becomes .style.fontVariant = '' + */ +function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { + if (!warnAboutShorthandPropertyCollision) { + return; + } + + if (!nextStyles) { + return; + } + + var expandedUpdates = expandShorthandMap(styleUpdates); + var expandedStyles = expandShorthandMap(nextStyles); + var warnedAbout = {}; + for (var key in expandedUpdates) { + var originalKey = expandedUpdates[key]; + var correctOriginalKey = expandedStyles[key]; + if (correctOriginalKey && originalKey !== correctOriginalKey) { + var warningKey = originalKey + ',' + correctOriginalKey; + if (warnedAbout[warningKey]) { + continue; + } + warnedAbout[warningKey] = true; + warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey); + } + } +} + // For HTML, certain tags should omit their close tag. We keep a whitelist for // those special-case tags. @@ -7612,14 +7747,25 @@ function createElement(type, props, rootContainerElement, parentNamespace) { // See discussion in https://github.com/facebook/react/pull/6896 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 domElement = ownerDocument.createElement(type); - // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` - // attribute on `select`s needs to be added before `option`s are inserted. This prevents - // a bug where the `select` does not scroll to the correct option because singular - // `select` elements automatically pick the first item. + // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size` + // attributes on `select`s needs to be added before `option`s are inserted. + // This prevents: + // - a bug where the `select` does not scroll to the correct option because singular + // `select` elements automatically pick the first item #13222 + // - a bug where the `select` set the first item as selected despite the `size` attribute #14239 // See https://github.com/facebook/react/issues/13222 - if (type === 'select' && props.multiple) { + // and https://github.com/facebook/react/issues/14239 + if (type === 'select') { var node = domElement; - node.multiple = true; + if (props.multiple) { + node.multiple = true; + } else if (props.size) { + // Setting a size greater than 1 causes a select to behave like `multiple=true`, where + // it is possible that no option is selected. + // + // This is only necessary when a select in "single selection mode". + node.size = props.size; + } } } } else { @@ -7912,6 +8058,9 @@ function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContain } } if (styleUpdates) { + { + validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]); + } (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates); } return updatePayload; @@ -8589,6 +8738,17 @@ var unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback; var unstable_now = _ReactInternals$Sched.unstable_now; var unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback; var unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield; +var unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode; +var unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority; +var unstable_next = _ReactInternals$Sched.unstable_next; +var unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution; +var unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution; +var unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel; +var unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority; +var unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority; +var unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority; +var unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority; +var unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority; // Renderers that don't support persistence // can re-export everything from this module. @@ -8613,6 +8773,9 @@ var SUPPRESS_HYDRATION_WARNING = void 0; SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; } +var SUSPENSE_START_DATA = '$'; +var SUSPENSE_END_DATA = '/$'; + var STYLE = 'style'; var eventsEnabled = null; @@ -8752,6 +8915,8 @@ var isPrimaryRenderer = true; var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; var noTimeout = -1; +var schedulePassiveEffects = unstable_scheduleCallback; +var cancelPassiveEffects = unstable_cancelCallback; // ------------------- // Mutation @@ -8839,6 +9004,43 @@ function removeChildFromContainer(container, child) { } } +function clearSuspenseBoundary(parentInstance, suspenseInstance) { + var node = suspenseInstance; + // Delete all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + var depth = 0; + do { + var nextNode = node.nextSibling; + parentInstance.removeChild(node); + if (nextNode && nextNode.nodeType === COMMENT_NODE) { + var data = nextNode.data; + if (data === SUSPENSE_END_DATA) { + if (depth === 0) { + parentInstance.removeChild(nextNode); + return; + } else { + depth--; + } + } else if (data === SUSPENSE_START_DATA) { + depth++; + } + } + node = nextNode; + } while (node); + // TODO: Warn, we didn't find the end comment boundary. +} + +function clearSuspenseBoundaryFromContainer(container, suspenseInstance) { + if (container.nodeType === COMMENT_NODE) { + clearSuspenseBoundary(container.parentNode, suspenseInstance); + } else if (container.nodeType === ELEMENT_NODE) { + clearSuspenseBoundary(container, suspenseInstance); + } else { + // Document nodes should never contain suspense boundaries. + } +} + function hideInstance(instance) { // TODO: Does this work for all element types? What about MathML? Should we // pass host context to this method? @@ -8884,10 +9086,19 @@ function canHydrateTextInstance(instance, text) { return instance; } +function canHydrateSuspenseInstance(instance) { + if (instance.nodeType !== COMMENT_NODE) { + // Empty strings are not parsed by HTML so there won't be a correct match here. + return null; + } + // This has now been refined to a suspense node. + return instance; +} + function getNextHydratableSibling(instance) { var node = instance.nextSibling; // Skip non-hydratable nodes. - while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE) { + while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || node.nodeType !== COMMENT_NODE || node.data !== SUSPENSE_START_DATA)) { node = node.nextSibling; } return node; @@ -8896,7 +9107,7 @@ function getNextHydratableSibling(instance) { function getFirstHydratableChild(parentInstance) { var next = parentInstance.firstChild; // Skip non-hydratable nodes. - while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE) { + while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || next.nodeType !== COMMENT_NODE || next.data !== SUSPENSE_START_DATA)) { next = next.nextSibling; } return next; @@ -8920,6 +9131,31 @@ function hydrateTextInstance(textInstance, text, internalInstanceHandle) { return diffHydratedText(textInstance, text); } +function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { + var node = suspenseInstance.nextSibling; + // Skip past all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + var depth = 0; + while (node) { + if (node.nodeType === COMMENT_NODE) { + var data = node.data; + if (data === SUSPENSE_END_DATA) { + if (depth === 0) { + return getNextHydratableSibling(node); + } else { + depth--; + } + } else if (data === SUSPENSE_START_DATA) { + depth++; + } + } + node = node.nextSibling; + } + // TODO: Warn, we didn't find the end comment boundary. + return null; +} + function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) { { warnForUnmatchedText(textInstance, text); @@ -8936,6 +9172,8 @@ function didNotHydrateContainerInstance(parentContainer, instance) { { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentContainer, instance); + } else if (instance.nodeType === COMMENT_NODE) { + // TODO: warnForDeletedHydratableSuspenseBoundary } else { warnForDeletedHydratableText(parentContainer, instance); } @@ -8946,6 +9184,8 @@ function didNotHydrateInstance(parentType, parentProps, parentInstance, instance if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentInstance, instance); + } else if (instance.nodeType === COMMENT_NODE) { + // TODO: warnForDeletedHydratableSuspenseBoundary } else { warnForDeletedHydratableText(parentInstance, instance); } @@ -8964,6 +9204,8 @@ function didNotFindHydratableContainerTextInstance(parentContainer, text) { } } + + function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) { if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { warnForInsertedHydratedElement(parentInstance, type, props); @@ -8976,6 +9218,12 @@ function didNotFindHydratableTextInstance(parentType, parentProps, parentInstanc } } +function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) { + if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) { + // TODO: warnForInsertedHydratedSuspense(parentInstance); + } +} + // Prefix measurements so that it's possible to filter them. // Longer prefixes are hard to read in DevTools. var reactEmoji = '\u269B'; @@ -9231,7 +9479,7 @@ function stopFailedWorkTimer(fiber) { return; } fiber._debugIsCurrentlyTiming = false; - var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary'; + var warning = fiber.tag === SuspenseComponent || fiber.tag === DehydratedSuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary'; endFiberMark(fiber, null, warning); } } @@ -9852,7 +10100,7 @@ function FiberNode(tag, pendingProps, key, mode) { this.memoizedProps = null; this.updateQueue = null; this.memoizedState = null; - this.firstContextDependency = null; + this.contextDependencies = null; this.mode = mode; @@ -9869,6 +10117,26 @@ function FiberNode(tag, pendingProps, key, mode) { this.alternate = null; if (enableProfilerTimer) { + // Note: The following is done to avoid a v8 performance cliff. + // + // Initializing the fields below to smis and later updating them with + // double values will cause Fibers to end up having separate shapes. + // This behavior/bug has something to do with Object.preventExtension(). + // Fortunately this only impacts DEV builds. + // Unfortunately it makes React unusably slow for some applications. + // To work around this, initialize the fields below with doubles. + // + // Learn more about this here: + // https://github.com/facebook/react/issues/14365 + // https://bugs.chromium.org/p/v8/issues/detail?id=8538 + this.actualDuration = Number.NaN; + this.actualStartTime = Number.NaN; + this.selfBaseDuration = Number.NaN; + this.treeBaseDuration = Number.NaN; + + // It's okay to replace the initial doubles with smis after initialization. + // This won't trigger the performance cliff mentioned above, + // and it simplifies other profiler code (including DevTools). this.actualDuration = 0; this.actualStartTime = -1; this.selfBaseDuration = 0; @@ -9880,6 +10148,7 @@ function FiberNode(tag, pendingProps, key, mode) { this._debugSource = null; this._debugOwner = null; this._debugIsCurrentlyTiming = false; + this._debugHookTypes = null; if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { Object.preventExtensions(this); } @@ -9947,6 +10216,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) { workInProgress._debugID = current._debugID; workInProgress._debugSource = current._debugSource; workInProgress._debugOwner = current._debugOwner; + workInProgress._debugHookTypes = current._debugHookTypes; } workInProgress.alternate = current; @@ -9980,7 +10250,7 @@ function createWorkInProgress(current, pendingProps, expirationTime) { workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; - workInProgress.firstContextDependency = current.firstContextDependency; + workInProgress.contextDependencies = current.contextDependencies; // These will be overridden during the parent's reconciliation workInProgress.sibling = current.sibling; @@ -10195,7 +10465,7 @@ function assignFiberPropertiesInDEV(target, source) { target.memoizedProps = source.memoizedProps; target.updateQueue = source.updateQueue; target.memoizedState = source.memoizedState; - target.firstContextDependency = source.firstContextDependency; + target.contextDependencies = source.contextDependencies; target.mode = source.mode; target.effectTag = source.effectTag; target.nextEffect = source.nextEffect; @@ -10214,6 +10484,7 @@ function assignFiberPropertiesInDEV(target, source) { target._debugSource = source._debugSource; target._debugOwner = source._debugOwner; target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming; + target._debugHookTypes = source._debugHookTypes; return target; } @@ -10264,6 +10535,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) { latestSuspendedTime: NoWork, latestPingedTime: NoWork, + pingCache: null, + didError: false, pendingCommitExpirationTime: NoWork, @@ -10287,6 +10560,8 @@ function createFiberRoot(containerInfo, isConcurrent, hydrate) { containerInfo: containerInfo, pendingChildren: null, + pingCache: null, + earliestPendingTime: NoWork, latestPendingTime: NoWork, earliestSuspendedTime: NoWork, @@ -10416,7 +10691,7 @@ var ReactStrictModeWarnings = { ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { pendingUnsafeLifecycleWarnings.forEach(function (lifecycleWarningsMap, strictRoot) { - var lifecyclesWarningMesages = []; + var lifecyclesWarningMessages = []; Object.keys(lifecycleWarningsMap).forEach(function (lifecycle) { var lifecycleWarnings = lifecycleWarningsMap[lifecycle]; @@ -10431,14 +10706,14 @@ var ReactStrictModeWarnings = { var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle]; var sortedComponentNames = setToSortedString(componentNames); - lifecyclesWarningMesages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames)); + lifecyclesWarningMessages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames)); } }); - if (lifecyclesWarningMesages.length > 0) { + if (lifecyclesWarningMessages.length > 0) { var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot); - warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMesages.join('\n\n')); + warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMessages.join('\n\n')); } }); @@ -10661,6 +10936,10 @@ function markCommittedPriorityLevels(root, earliestRemainingTime) { return; } + if (earliestRemainingTime < root.latestPingedTime) { + root.latestPingedTime = NoWork; + } + // Let's see if the previous latest known pending level was just flushed. var latestPendingTime = root.latestPendingTime; if (latestPendingTime !== NoWork) { @@ -10786,10 +11065,8 @@ function markPingedPriorityLevel(root, pingedTime) { } function clearPing(root, completedTime) { - // TODO: Track whether the root was pinged during the render phase. If so, - // we need to make sure we don't lose track of it. var latestPingedTime = root.latestPingedTime; - if (latestPingedTime !== NoWork && latestPingedTime >= completedTime) { + if (latestPingedTime >= completedTime) { root.latestPingedTime = NoWork; } } @@ -10845,3511 +11122,3677 @@ function findNextExpirationTimeToWorkOn(completedExpirationTime, root) { root.expirationTime = expirationTime; } -// UpdateQueue is a linked list of prioritized updates. -// -// Like fibers, update queues come in pairs: a current queue, which represents -// the visible state of the screen, and a work-in-progress queue, which is -// can be mutated and processed asynchronously before it is committed — a form -// of double buffering. If a work-in-progress render is discarded before -// finishing, we create a new work-in-progress by cloning the current queue. -// -// Both queues share a persistent, singly-linked list structure. To schedule an -// update, we append it to the end of both queues. Each queue maintains a -// pointer to first update in the persistent list that hasn't been processed. -// The work-in-progress pointer always has a position equal to or greater than -// the current queue, since we always work on that one. The current queue's -// pointer is only updated during the commit phase, when we swap in the -// work-in-progress. -// -// For example: -// -// Current pointer: A - B - C - D - E - F -// Work-in-progress pointer: D - E - F -// ^ -// The work-in-progress queue has -// processed more updates than current. -// -// The reason we append to both queues is because otherwise we might drop -// updates without ever processing them. For example, if we only add updates to -// the work-in-progress queue, some updates could be lost whenever a work-in -// -progress render restarts by cloning from current. Similarly, if we only add -// updates to the current queue, the updates will be lost whenever an already -// in-progress queue commits and swaps with the current queue. However, by -// adding to both queues, we guarantee that the update will be part of the next -// work-in-progress. (And because the work-in-progress queue becomes the -// current queue once it commits, there's no danger of applying the same -// update twice.) -// -// Prioritization -// -------------- -// -// Updates are not sorted by priority, but by insertion; new updates are always -// appended to the end of the list. -// -// The priority is still important, though. When processing the update queue -// during the render phase, only the updates with sufficient priority are -// included in the result. If we skip an update because it has insufficient -// priority, it remains in the queue to be processed later, during a lower -// priority render. Crucially, all updates subsequent to a skipped update also -// remain in the queue *regardless of their priority*. That means high priority -// updates are sometimes processed twice, at two separate priorities. We also -// keep track of a base state, that represents the state before the first -// update in the queue is applied. -// -// For example: -// -// Given a base state of '', and the following queue of updates -// -// A1 - B2 - C1 - D2 -// -// where the number indicates the priority, and the update is applied to the -// previous state by appending a letter, React will process these updates as -// two separate renders, one per distinct priority level: -// -// First render, at priority 1: -// Base state: '' -// Updates: [A1, C1] -// Result state: 'AC' -// -// Second render, at priority 2: -// Base state: 'A' <- The base state does not include C1, -// because B2 was skipped. -// Updates: [B2, C1, D2] <- C1 was rebased on top of B2 -// Result state: 'ABCD' -// -// Because we process updates in insertion order, and rebase high priority -// updates when preceding updates are skipped, the final result is deterministic -// regardless of priority. Intermediate state may vary according to system -// resources, but the final state is always the same. - -var UpdateState = 0; -var ReplaceState = 1; -var ForceUpdate = 2; -var CaptureUpdate = 3; - -// Global state that is reset at the beginning of calling `processUpdateQueue`. -// It should only be read right after calling `processUpdateQueue`, via -// `checkHasForceUpdateAfterProcessing`. -var hasForceUpdate = false; - -var didWarnUpdateInsideUpdate = void 0; -var currentlyProcessingQueue = void 0; -var resetCurrentlyProcessingQueue = void 0; -{ - didWarnUpdateInsideUpdate = false; - currentlyProcessingQueue = null; - resetCurrentlyProcessingQueue = function () { - currentlyProcessingQueue = null; - }; -} - -function createUpdateQueue(baseState) { - var queue = { - baseState: baseState, - firstUpdate: null, - lastUpdate: null, - firstCapturedUpdate: null, - lastCapturedUpdate: null, - firstEffect: null, - lastEffect: null, - firstCapturedEffect: null, - lastCapturedEffect: null - }; - return queue; -} - -function cloneUpdateQueue(currentQueue) { - var queue = { - baseState: currentQueue.baseState, - firstUpdate: currentQueue.firstUpdate, - lastUpdate: currentQueue.lastUpdate, - - // TODO: With resuming, if we bail out and resuse the child tree, we should - // keep these effects. - firstCapturedUpdate: null, - lastCapturedUpdate: null, - - firstEffect: null, - lastEffect: null, - - firstCapturedEffect: null, - lastCapturedEffect: null - }; - return queue; +function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + // Resolve default props. Taken from ReactElement + var props = _assign({}, baseProps); + var defaultProps = Component.defaultProps; + for (var propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + return props; + } + return baseProps; } -function createUpdate(expirationTime) { - return { - expirationTime: expirationTime, +function readLazyComponentType(lazyComponent) { + var status = lazyComponent._status; + var result = lazyComponent._result; + switch (status) { + case Resolved: + { + var Component = result; + return Component; + } + case Rejected: + { + var error = result; + throw error; + } + case Pending: + { + var thenable = result; + throw thenable; + } + default: + { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var _thenable = ctor(); + _thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + { + if (defaultExport === undefined) { + warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + // Handle synchronous thenables. + switch (lazyComponent._status) { + case Resolved: + return lazyComponent._result; + case Rejected: + throw lazyComponent._result; + } + lazyComponent._result = _thenable; + throw _thenable; + } + } +} - tag: UpdateState, - payload: null, - callback: null, +var fakeInternalInstance = {}; +var isArray$1 = Array.isArray; - next: null, - nextEffect: null - }; -} +// React.Component uses a shared frozen object by default. +// We'll use it to determine whether we need to initialize legacy refs. +var emptyRefsObject = new React.Component().refs; -function appendUpdateToQueue(queue, update) { - // Append the update to the end of the list. - if (queue.lastUpdate === null) { - // Queue is empty - queue.firstUpdate = queue.lastUpdate = update; - } else { - queue.lastUpdate.next = update; - queue.lastUpdate = update; - } -} +var didWarnAboutStateAssignmentForComponent = void 0; +var didWarnAboutUninitializedState = void 0; +var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0; +var didWarnAboutLegacyLifecyclesAndDerivedState = void 0; +var didWarnAboutUndefinedDerivedState = void 0; +var warnOnUndefinedDerivedState = void 0; +var warnOnInvalidCallback$1 = void 0; +var didWarnAboutDirectlyAssigningPropsToState = void 0; +var didWarnAboutContextTypeAndContextTypes = void 0; +var didWarnAboutInvalidateContextType = void 0; -function enqueueUpdate(fiber, update) { - // Update queues are created lazily. - var alternate = fiber.alternate; - var queue1 = void 0; - var queue2 = void 0; - if (alternate === null) { - // There's only one fiber. - queue1 = fiber.updateQueue; - queue2 = null; - if (queue1 === null) { - queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); +{ + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + didWarnAboutDirectlyAssigningPropsToState = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutContextTypeAndContextTypes = new Set(); + didWarnAboutInvalidateContextType = new Set(); + + var didWarnOnInvalidCallback = new Set(); + + warnOnInvalidCallback$1 = function (callback, callerName) { + if (callback === null || typeof callback === 'function') { + return; } - } else { - // There are two owners. - queue1 = fiber.updateQueue; - queue2 = alternate.updateQueue; - if (queue1 === null) { - if (queue2 === null) { - // Neither fiber has an update queue. Create new ones. - queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); - queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState); - } else { - // Only one fiber has an update queue. Clone to create a new one. - queue1 = fiber.updateQueue = cloneUpdateQueue(queue2); - } - } else { - if (queue2 === null) { - // Only one fiber has an update queue. Clone to create a new one. - queue2 = alternate.updateQueue = cloneUpdateQueue(queue1); - } else { - // Both owners have an update queue. + var key = callerName + '_' + callback; + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + } + }; + + warnOnUndefinedDerivedState = function (type, partialState) { + if (partialState === undefined) { + var componentName = getComponentName(type) || 'Component'; + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); } } - } - if (queue2 === null || queue1 === queue2) { - // There's only a single queue. - appendUpdateToQueue(queue1, update); - } else { - // There are two queues. We need to append the update to both queues, - // while accounting for the persistent structure of the list — we don't - // want the same update to be added multiple times. - if (queue1.lastUpdate === null || queue2.lastUpdate === null) { - // One of the queues is not empty. We must add the update to both queues. - appendUpdateToQueue(queue1, update); - appendUpdateToQueue(queue2, update); - } else { - // Both queues are non-empty. The last update is the same in both lists, - // because of structural sharing. So, only append to one of the lists. - appendUpdateToQueue(queue1, update); - // But we still need to update the `lastUpdate` pointer of queue2. - queue2.lastUpdate = update; + }; + + // This is so gross but it's at least non-critical and can be removed if + // it causes problems. This is meant to give a nicer error message for + // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, + // ...)) which otherwise throws a "_processChildContext is not a function" + // exception. + Object.defineProperty(fakeInternalInstance, '_processChildContext', { + enumerable: false, + value: function () { + invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'); } - } + }); + Object.freeze(fakeInternalInstance); +} + +function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + var prevState = workInProgress.memoizedState; { - if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) { - warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); - didWarnUpdateInsideUpdate = true; + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Invoke the function an extra time to help detect side-effects. + getDerivedStateFromProps(nextProps, prevState); } } -} -function enqueueCapturedUpdate(workInProgress, update) { - // Captured updates go into a separate list, and only on the work-in- - // progress queue. - var workInProgressQueue = workInProgress.updateQueue; - if (workInProgressQueue === null) { - workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState); - } else { - // TODO: I put this here rather than createWorkInProgress so that we don't - // clone the queue unnecessarily. There's probably a better way to - // structure this. - workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue); - } + var partialState = getDerivedStateFromProps(nextProps, prevState); - // Append the update to the end of the list. - if (workInProgressQueue.lastCapturedUpdate === null) { - // This is the first render phase update - workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update; - } else { - workInProgressQueue.lastCapturedUpdate.next = update; - workInProgressQueue.lastCapturedUpdate = update; + { + warnOnUndefinedDerivedState(ctor, partialState); } -} + // Merge the partial state and the previous state. + var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState); + workInProgress.memoizedState = memoizedState; -function ensureWorkInProgressQueueIsAClone(workInProgress, queue) { - var current = workInProgress.alternate; - if (current !== null) { - // If the work-in-progress queue is equal to the current queue, - // we need to clone it first. - if (queue === current.updateQueue) { - queue = workInProgress.updateQueue = cloneUpdateQueue(queue); - } + // Once the update queue is empty, persist the derived state onto the + // base state. + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && workInProgress.expirationTime === NoWork) { + updateQueue.baseState = memoizedState; } - return queue; } -function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { - switch (update.tag) { - case ReplaceState: - { - var _payload = update.payload; - if (typeof _payload === 'function') { - // Updater function - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - _payload.call(instance, prevState, nextProps); - } - } - return _payload.call(instance, prevState, nextProps); - } - // State object - return _payload; - } - case CaptureUpdate: +var classComponentUpdater = { + isMounted: isMounted, + enqueueSetState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); + + var update = createUpdate(expirationTime); + update.payload = payload; + if (callback !== undefined && callback !== null) { { - workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture; + warnOnInvalidCallback$1(callback, 'setState'); } - // Intentional fallthrough - case UpdateState: - { - var _payload2 = update.payload; - var partialState = void 0; - if (typeof _payload2 === 'function') { - // Updater function - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - _payload2.call(instance, prevState, nextProps); - } - } - partialState = _payload2.call(instance, prevState, nextProps); - } else { - // Partial state object - partialState = _payload2; - } - if (partialState === null || partialState === undefined) { - // Null and undefined are treated as no-ops. - return prevState; - } - // Merge the partial state and the previous state. - return _assign({}, prevState, partialState); - } - case ForceUpdate: - { - hasForceUpdate = true; - return prevState; - } - } - return prevState; -} - -function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) { - hasForceUpdate = false; - - queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue); + update.callback = callback; + } - { - currentlyProcessingQueue = queue; - } + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueReplaceState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); - // These values may change as we process the queue. - var newBaseState = queue.baseState; - var newFirstUpdate = null; - var newExpirationTime = NoWork; + var update = createUpdate(expirationTime); + update.tag = ReplaceState; + update.payload = payload; - // Iterate through the list of updates to compute the result. - var update = queue.firstUpdate; - var resultState = newBaseState; - while (update !== null) { - var updateExpirationTime = update.expirationTime; - if (updateExpirationTime < renderExpirationTime) { - // This update does not have sufficient priority. Skip it. - if (newFirstUpdate === null) { - // This is the first skipped update. It will be the first update in - // the new list. - newFirstUpdate = update; - // Since this is the first update that was skipped, the current result - // is the new base state. - newBaseState = resultState; - } - // Since this update will remain in the list, update the remaining - // expiration time. - if (newExpirationTime < updateExpirationTime) { - newExpirationTime = updateExpirationTime; - } - } else { - // This update does have sufficient priority. Process it and compute - // a new result. - resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); - var _callback = update.callback; - if (_callback !== null) { - workInProgress.effectTag |= Callback; - // Set this to null, in case it was mutated during an aborted render. - update.nextEffect = null; - if (queue.lastEffect === null) { - queue.firstEffect = queue.lastEffect = update; - } else { - queue.lastEffect.nextEffect = update; - queue.lastEffect = update; - } + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback$1(callback, 'replaceState'); } + update.callback = callback; } - // Continue to the next update. - update = update.next; - } - // Separately, iterate though the list of captured updates. - var newFirstCapturedUpdate = null; - update = queue.firstCapturedUpdate; - while (update !== null) { - var _updateExpirationTime = update.expirationTime; - if (_updateExpirationTime < renderExpirationTime) { - // This update does not have sufficient priority. Skip it. - if (newFirstCapturedUpdate === null) { - // This is the first skipped captured update. It will be the first - // update in the new list. - newFirstCapturedUpdate = update; - // If this is the first update that was skipped, the current result is - // the new base state. - if (newFirstUpdate === null) { - newBaseState = resultState; - } - } - // Since this update will remain in the list, update the remaining - // expiration time. - if (newExpirationTime < _updateExpirationTime) { - newExpirationTime = _updateExpirationTime; - } - } else { - // This update does have sufficient priority. Process it and compute - // a new result. - resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); - var _callback2 = update.callback; - if (_callback2 !== null) { - workInProgress.effectTag |= Callback; - // Set this to null, in case it was mutated during an aborted render. - update.nextEffect = null; - if (queue.lastCapturedEffect === null) { - queue.firstCapturedEffect = queue.lastCapturedEffect = update; - } else { - queue.lastCapturedEffect.nextEffect = update; - queue.lastCapturedEffect = update; - } + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueForceUpdate: function (inst, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTime(); + var expirationTime = computeExpirationForFiber(currentTime, fiber); + + var update = createUpdate(expirationTime); + update.tag = ForceUpdate; + + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback$1(callback, 'forceUpdate'); } + update.callback = callback; } - update = update.next; - } - if (newFirstUpdate === null) { - queue.lastUpdate = null; - } - if (newFirstCapturedUpdate === null) { - queue.lastCapturedUpdate = null; - } else { - workInProgress.effectTag |= Callback; - } - if (newFirstUpdate === null && newFirstCapturedUpdate === null) { - // We processed every update, without skipping. That means the new base - // state is the same as the result state. - newBaseState = resultState; + flushPassiveEffects(); + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); } +}; - queue.baseState = newBaseState; - queue.firstUpdate = newFirstUpdate; - queue.firstCapturedUpdate = newFirstCapturedUpdate; +function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + var instance = workInProgress.stateNode; + if (typeof instance.shouldComponentUpdate === 'function') { + startPhaseTimer(workInProgress, 'shouldComponentUpdate'); + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); + stopPhaseTimer(); - // Set the remaining expiration time to be whatever is remaining in the queue. - // This should be fine because the only two other things that contribute to - // expiration time are props and context. We're already in the middle of the - // begin phase by the time we start processing the queue, so we've already - // dealt with the props. Context in components that specify - // shouldComponentUpdate is tricky; but we'll have to account for - // that regardless. - workInProgress.expirationTime = newExpirationTime; - workInProgress.memoizedState = resultState; + { + !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0; + } - { - currentlyProcessingQueue = null; + return shouldUpdate; } -} -function callCallback(callback, context) { - !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0; - callback.call(context); -} + if (ctor.prototype && ctor.prototype.isPureReactComponent) { + return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + } -function resetHasForceUpdateBeforeProcessing() { - hasForceUpdate = false; + return true; } -function checkHasForceUpdateAfterProcessing() { - return hasForceUpdate; -} +function checkClassInstance(workInProgress, ctor, newProps) { + var instance = workInProgress.stateNode; + { + var name = getComponentName(ctor) || 'Component'; + var renderPresent = instance.render; -function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) { - // If the finished render included captured updates, and there are still - // lower priority updates left over, we need to keep the captured updates - // in the queue so that they are rebased and not dropped once we process the - // queue again at the lower priority. - if (finishedQueue.firstCapturedUpdate !== null) { - // Join the captured update list to the end of the normal list. - if (finishedQueue.lastUpdate !== null) { - finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate; - finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate; + if (!renderPresent) { + if (ctor.prototype && typeof ctor.prototype.render === 'function') { + warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); + } else { + warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); + } } - // Clear the list of captured updates. - finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null; - } - - // Commit the effects - commitUpdateEffects(finishedQueue.firstEffect, instance); - finishedQueue.firstEffect = finishedQueue.lastEffect = null; - commitUpdateEffects(finishedQueue.firstCapturedEffect, instance); - finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null; -} + var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; + !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0; + var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; + !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0; + var noInstancePropTypes = !instance.propTypes; + !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0; + var noInstanceContextType = !instance.contextType; + !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0; + var noInstanceContextTypes = !instance.contextTypes; + !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0; -function commitUpdateEffects(effect, instance) { - while (effect !== null) { - var _callback3 = effect.callback; - if (_callback3 !== null) { - effect.callback = null; - callCallback(_callback3, instance); + if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { + didWarnAboutContextTypeAndContextTypes.add(ctor); + warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); } - effect = effect.nextEffect; - } -} -function createCapturedValue(value, source) { - // If the value is an error, call this function immediately after it is thrown - // so the stack is accurate. - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; -} + var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function'; + !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0; + if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { + warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component'); + } + var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function'; + !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0; + var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function'; + !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0; + var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; + !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0; + var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function'; + !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0; + var hasMutatedProps = instance.props !== newProps; + !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0; + var noInstanceDefaultProps = !instance.defaultProps; + !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0; -var valueCursor = createCursor(null); + if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); + warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor)); + } -var rendererSigil = void 0; -{ - // Use this to detect multiple renderers using the same context - rendererSigil = {}; + var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function'; + !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; + var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function'; + !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; + var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function'; + !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0; + var _state = instance.state; + if (_state && (typeof _state !== 'object' || isArray$1(_state))) { + warningWithoutStack$1(false, '%s.state: must be set to an object or null', name); + } + if (typeof instance.getChildContext === 'function') { + !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0; + } + } } -var currentlyRenderingFiber = null; -var lastContextDependency = null; -var lastContextWithAllBitsObserved = null; - -function resetContextDependences() { - // This is called right before React yields execution, to ensure `readContext` - // cannot be called outside the render phase. - currentlyRenderingFiber = null; - lastContextDependency = null; - lastContextWithAllBitsObserved = null; +function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; + // The instance needs access to the fiber so that it can schedule updates + set(instance, workInProgress); + { + instance._reactInternalInstance = fakeInternalInstance; + } } -function pushProvider(providerFiber, nextValue) { - var context = providerFiber.type._context; +function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) { + var isLegacyContextConsumer = false; + var unmaskedContext = emptyContextObject; + var context = null; + var contextType = ctor.contextType; - if (isPrimaryRenderer) { - push(valueCursor, context._currentValue, providerFiber); + { + if ('contextType' in ctor) { + var isValid = + // Allow null for conditional declaration + contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a - context._currentValue = nextValue; - { - !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; - context._currentRenderer = rendererSigil; - } - } else { - push(valueCursor, context._currentValue2, providerFiber); + if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { + didWarnAboutInvalidateContextType.add(ctor); - context._currentValue2 = nextValue; - { - !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; - context._currentRenderer2 = rendererSigil; + 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(ctor) || 'Component', addendum); + } } } -} - -function popProvider(providerFiber) { - var currentValue = valueCursor.current; - - pop(valueCursor, providerFiber); - var context = providerFiber.type._context; - if (isPrimaryRenderer) { - context._currentValue = currentValue; + if (typeof contextType === 'object' && contextType !== null) { + context = readContext(contextType); } else { - context._currentValue2 = currentValue; + unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + var contextTypes = ctor.contextTypes; + isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; + context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; } -} - -function calculateChangedBits(context, newValue, oldValue) { - // Use Object.is to compare the new context value to the old value. Inlined - // Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - if (oldValue === newValue && (oldValue !== 0 || 1 / oldValue === 1 / newValue) || oldValue !== oldValue && newValue !== newValue // eslint-disable-line no-self-compare - ) { - // No change - return 0; - } else { - var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt; - { - !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0; + // Instantiate twice to help detect side-effects. + { + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + new ctor(props, context); // eslint-disable-line no-new } - return changedBits | 0; - } -} - -function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { - var fiber = workInProgress.child; - if (fiber !== null) { - // Set the return pointer of the child to the work-in-progress fiber. - fiber.return = workInProgress; } - while (fiber !== null) { - var nextFiber = void 0; - - // Visit this fiber. - var dependency = fiber.firstContextDependency; - if (dependency !== null) { - do { - // Check if the context matches. - if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) { - // Match! Schedule an update on this fiber. - if (fiber.tag === ClassComponent) { - // Schedule a force update on the work-in-progress. - var update = createUpdate(renderExpirationTime); - update.tag = ForceUpdate; - // TODO: Because we don't have a work-in-progress, this will add the - // update to the current fiber, too, which means it will persist even if - // this render is thrown away. Since it's a race condition, not sure it's - // worth fixing. - enqueueUpdate(fiber, update); - } + var instance = new ctor(props, context); + var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; + adoptClassInstance(workInProgress, instance); - if (fiber.expirationTime < renderExpirationTime) { - fiber.expirationTime = renderExpirationTime; - } - var alternate = fiber.alternate; - if (alternate !== null && alternate.expirationTime < renderExpirationTime) { - alternate.expirationTime = renderExpirationTime; - } - // Update the child expiration time of all the ancestors, including - // the alternates. - var node = fiber.return; - while (node !== null) { - alternate = node.alternate; - if (node.childExpirationTime < renderExpirationTime) { - node.childExpirationTime = renderExpirationTime; - if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { - alternate.childExpirationTime = renderExpirationTime; - } - } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { - alternate.childExpirationTime = renderExpirationTime; - } else { - // Neither alternate was updated, which means the rest of the - // ancestor path already has sufficient priority. - break; - } - node = node.return; - } - } - nextFiber = fiber.child; - dependency = dependency.next; - } while (dependency !== null); - } else if (fiber.tag === ContextProvider) { - // Don't scan deeper if this is a matching provider - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - } else { - // Traverse down. - nextFiber = fiber.child; + { + if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { + var componentName = getComponentName(ctor) || 'Component'; + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); + } } - if (nextFiber !== null) { - // Set the return pointer of the child to the work-in-progress fiber. - nextFiber.return = fiber; - } else { - // No child. Traverse to next sibling. - nextFiber = fiber; - while (nextFiber !== null) { - if (nextFiber === workInProgress) { - // We're back to the root of this subtree. Exit. - nextFiber = null; - break; - } - var sibling = nextFiber.sibling; - if (sibling !== null) { - // Set the return pointer of the sibling to the work-in-progress fiber. - sibling.return = nextFiber.return; - nextFiber = sibling; - break; + // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { + foundWillMountName = 'componentWillMount'; + } else if (typeof instance.UNSAFE_componentWillMount === 'function') { + foundWillMountName = 'UNSAFE_componentWillMount'; + } + if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + foundWillReceivePropsName = 'componentWillReceiveProps'; + } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; + } + if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + foundWillUpdateName = 'componentWillUpdate'; + } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + foundWillUpdateName = 'UNSAFE_componentWillUpdate'; + } + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var _componentName = getComponentName(ctor) || 'Component'; + var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : ''); } - // No more siblings. Traverse up. - nextFiber = nextFiber.return; } } - fiber = nextFiber; } -} -function prepareToReadContext(workInProgress, renderExpirationTime) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - lastContextWithAllBitsObserved = null; + // Cache unmasked context so we can avoid recreating masked context unless necessary. + // ReactFiberContext usually updates this cache but can't for newly-created instances. + if (isLegacyContextConsumer) { + cacheContext(workInProgress, unmaskedContext, context); + } - // Reset the work-in-progress list - workInProgress.firstContextDependency = null; + return instance; } -function readContext(context, observedBits) { - if (lastContextWithAllBitsObserved === context) { - // Nothing to do. We already observe everything in this context. - } else if (observedBits === false || observedBits === 0) { - // Do not observe any updates. - } else { - var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types. - if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) { - // Observe all updates. - lastContextWithAllBitsObserved = context; - resolvedObservedBits = maxSigned31BitInt; - } else { - resolvedObservedBits = observedBits; - } +function callComponentWillMount(workInProgress, instance) { + startPhaseTimer(workInProgress, 'componentWillMount'); + var oldState = instance.state; - var contextItem = { - context: context, - observedBits: resolvedObservedBits, - next: null - }; + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } - if (lastContextDependency === null) { - !(currentlyRenderingFiber !== null) ? invariant(false, 'Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps.') : void 0; - // This is the first dependency in the list - currentlyRenderingFiber.firstContextDependency = lastContextDependency = contextItem; - } else { - // Append a new context item. - lastContextDependency = lastContextDependency.next = contextItem; + stopPhaseTimer(); + + if (oldState !== instance.state) { + { + warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component'); } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } - return isPrimaryRenderer ? context._currentValue : context._currentValue2; } -var NoEffect$1 = /* */0; -var UnmountSnapshot = /* */2; -var UnmountMutation = /* */4; -var MountMutation = /* */8; -var UnmountLayout = /* */16; -var MountLayout = /* */32; -var MountPassive = /* */64; -var UnmountPassive = /* */128; +function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + var oldState = instance.state; + startPhaseTimer(workInProgress, 'componentWillReceiveProps'); + if (typeof instance.componentWillReceiveProps === 'function') { + instance.componentWillReceiveProps(newProps, nextContext); + } + if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + } + stopPhaseTimer(); -function areHookInputsEqual(arr1, arr2) { - // Don't bother comparing lengths in prod because these arrays should be - // passed inline. - { - !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0; - } - for (var i = 0; i < arr1.length; i++) { - // Inlined Object.is polyfill. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - var val1 = arr1[i]; - var val2 = arr2[i]; - if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2 // eslint-disable-line no-self-compare - ) { - continue; + if (instance.state !== oldState) { + { + var componentName = getComponentName(workInProgress.type) || 'Component'; + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); + warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); } - return false; + } + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } - return true; } -// These are set right before calling the component. -var renderExpirationTime = NoWork; -// The work-in-progress fiber. I've named it differently to distinguish it from -// the work-in-progress hook. -var currentlyRenderingFiber$1 = null; +// Invokes the mount life-cycles on a previously never rendered instance. +function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + { + checkClassInstance(workInProgress, ctor, newProps); + } -// Hooks are stored as a linked list on the fiber's memoizedState field. The -// current hook list is the list that belongs to the current fiber. The -// work-in-progress hook list is a new list that will be added to the -// work-in-progress fiber. -var firstCurrentHook = null; -var currentHook = null; -var firstWorkInProgressHook = null; -var workInProgressHook = null; + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; -var remainingExpirationTime = NoWork; -var componentUpdateQueue = null; + var contextType = ctor.contextType; + if (typeof contextType === 'object' && contextType !== null) { + instance.context = readContext(contextType); + } else { + var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + instance.context = getMaskedContext(workInProgress, unmaskedContext); + } -// Updates scheduled during render will trigger an immediate re-render at the -// end of the current pass. We can't store these updates on the normal queue, -// because if the work is aborted, they should be discarded. Because this is -// a relatively rare case, we also don't want to add an additional field to -// either the hook or queue object types. So we store them in a lazily create -// map of queue -> render-phase updates, which are discarded once the component -// completes without re-rendering. + { + if (instance.state === newProps) { + var componentName = getComponentName(ctor) || 'Component'; + if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { + didWarnAboutDirectlyAssigningPropsToState.add(componentName); + warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); + } + } -// 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; + if (workInProgress.mode & StrictMode) { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); -function resolveCurrentlyRenderingFiber() { - !(currentlyRenderingFiber$1 !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0; - return currentlyRenderingFiber$1; -} + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); + } -function prepareToUseHooks(current, workInProgress, nextRenderExpirationTime) { - if (!enableHooks) { - return; + if (warnAboutDeprecatedLifecycles) { + ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); + } } - renderExpirationTime = nextRenderExpirationTime; - currentlyRenderingFiber$1 = workInProgress; - firstCurrentHook = current !== null ? current.memoizedState : null; - // The following should have already been reset - // currentHook = null; - // workInProgressHook = null; - - // remainingExpirationTime = NoWork; - // componentUpdateQueue = null; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + } - // isReRender = false; - // didScheduleRenderPhaseUpdate = false; - // renderPhaseUpdates = null; - // numberOfReRenders = 0; -} + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + instance.state = workInProgress.memoizedState; + } -function finishHooks(Component, props, children, refOrContext) { - if (!enableHooks) { - return children; + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + callComponentWillMount(workInProgress, instance); + // If we had additional state updates during this life-cycle, let's + // process them now. + updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + } } - // This must be called after every function component to prevent hooks from - // being used in classes. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } +} - 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; +function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; - // Start over from the beginning of the list - currentHook = null; - workInProgressHook = null; - componentUpdateQueue = null; + var oldProps = workInProgress.memoizedProps; + instance.props = oldProps; - children = Component(props, refOrContext); + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = void 0; + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); } - renderPhaseUpdates = null; - numberOfReRenders = 0; - var renderedWork = currentlyRenderingFiber$1; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; - renderedWork.memoizedState = firstWorkInProgressHook; - renderedWork.expirationTime = remainingExpirationTime; - renderedWork.updateQueue = componentUpdateQueue; + // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. - var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } - renderExpirationTime = NoWork; - currentlyRenderingFiber$1 = null; + resetHasForceUpdateBeforeProcessing(); - firstCurrentHook = null; - currentHook = null; - firstWorkInProgressHook = null; - workInProgressHook = null; + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + } + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + return false; + } - remainingExpirationTime = NoWork; - componentUpdateQueue = null; + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } - // Always set during createWorkInProgress - // isReRender = false; + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); - // These were reset above - // didScheduleRenderPhaseUpdate = false; - // renderPhaseUpdates = null; - // numberOfReRenders = 0; + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + startPhaseTimer(workInProgress, 'componentWillMount'); + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } + stopPhaseTimer(); + } + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } - !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0; + // If shouldComponentUpdate returned false, we should still update the + // memoized state to indicate that this work can be reused. + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } - return children; + // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + + return shouldUpdate; } -function resetHooks() { - if (!enableHooks) { - return; - } +// Invokes the update life-cycles and returns false if it shouldn't rerender. +function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; - // This is called instead of `finishHooks` if the component throws. It's also - // called inside mountIndeterminateComponent if we determine the component - // is a module-style component. - renderExpirationTime = NoWork; - currentlyRenderingFiber$1 = null; + var oldProps = workInProgress.memoizedProps; + instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); - firstCurrentHook = null; - currentHook = null; - firstWorkInProgressHook = null; - workInProgressHook = null; - - remainingExpirationTime = NoWork; - componentUpdateQueue = null; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = void 0; + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); + } - // Always set during createWorkInProgress - // isReRender = false; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; - didScheduleRenderPhaseUpdate = false; - renderPhaseUpdates = null; - numberOfReRenders = 0; -} + // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. -function createHook() { - return { - memoizedState: null, + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } - baseState: null, - queue: null, - baseUpdate: null, + resetHasForceUpdateBeforeProcessing(); - next: null - }; -} + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null) { + processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + } -function cloneHook(hook) { - return { - memoizedState: hook.memoizedState, + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } + return false; + } - baseState: hook.memoizedState, - queue: hook.queue, - baseUpdate: hook.baseUpdate, + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } - next: null - }; -} + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); -function createWorkInProgressHook() { - if (workInProgressHook === null) { - // This is the first hook in the list - if (firstWorkInProgressHook === null) { - isReRender = false; - currentHook = firstCurrentHook; - if (currentHook === null) { - // This is a newly mounted hook - workInProgressHook = createHook(); - } else { - // Clone the current hook. - workInProgressHook = cloneHook(currentHook); + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { + startPhaseTimer(workInProgress, 'componentWillUpdate'); + if (typeof instance.componentWillUpdate === 'function') { + instance.componentWillUpdate(newProps, newState, nextContext); } - firstWorkInProgressHook = workInProgressHook; - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - currentHook = firstCurrentHook; - workInProgressHook = firstWorkInProgressHook; + if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); + } + stopPhaseTimer(); + } + if (typeof instance.componentDidUpdate === 'function') { + workInProgress.effectTag |= Update; + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + workInProgress.effectTag |= Snapshot; } } else { - if (workInProgressHook.next === null) { - isReRender = false; - var hook = void 0; - if (currentHook === null) { - // This is a newly mounted hook - hook = createHook(); - } else { - currentHook = currentHook.next; - if (currentHook === null) { - // This is a newly mounted hook - hook = createHook(); - } else { - // Clone the current hook. - hook = cloneHook(currentHook); - } + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; } - // Append to the end of the list - workInProgressHook = workInProgressHook.next = hook; - } else { - // There's already a work-in-progress. Reuse it. - isReRender = true; - workInProgressHook = workInProgressHook.next; - currentHook = currentHook !== null ? currentHook.next : null; } + + // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; } - return workInProgressHook; -} -function createFunctionComponentUpdateQueue() { - return { - lastEffect: null - }; -} + // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; -function basicStateReducer(state, action) { - return typeof action === 'function' ? action(state) : action; + return shouldUpdate; } -function useContext(context, observedBits) { - // Ensure we're in a function component (class components support only the - // .unstable_read() form) - resolveCurrentlyRenderingFiber(); - return readContext(context, observedBits); -} - -function useState(initialState) { - return useReducer(basicStateReducer, - // useReducer has a special case to support lazy useState initializers - initialState); -} - -function useReducer(reducer, initialState, initialAction) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var queue = workInProgressHook.queue; - if (queue !== null) { - // Already have a queue, so this is an update. - if (isReRender) { - // This is a re-render. Apply the new render phase updates to the previous - var _dispatch2 = 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; - newState = reducer(newState, _action); - update = update.next; - } while (update !== null); - - workInProgressHook.memoizedState = newState; - - // Don't persist the state accumlated from the render phase updates to - // the base state unless the queue is empty. - // TODO: Not sure if this is the desired semantics, but it's what we - // do for gDSFP. I can't remember why. - if (workInProgressHook.baseUpdate === queue.last) { - workInProgressHook.baseState = newState; - } - - return [newState, _dispatch2]; - } - } - return [workInProgressHook.memoizedState, _dispatch2]; - } +var didWarnAboutMaps = void 0; +var didWarnAboutGenerators = void 0; +var didWarnAboutStringRefInStrictMode = void 0; +var ownerHasKeyUseWarning = void 0; +var ownerHasFunctionTypeWarning = void 0; +var warnForMissingKey = function (child) {}; - // The last update in the entire queue - var _last = queue.last; - // The last update that is part of the base state. - var _baseUpdate = workInProgressHook.baseUpdate; - - // Find the first unprocessed update. - var first = void 0; - if (_baseUpdate !== null) { - if (_last !== null) { - // For the first update, the queue is a circular linked list where - // `queue.last.next = queue.first`. Once the first update commits, and - // the `baseUpdate` is no longer empty, we can unravel the list. - _last.next = null; - } - first = _baseUpdate.next; - } else { - first = _last !== null ? _last.next : null; - } - if (first !== null) { - var _newState = workInProgressHook.baseState; - var newBaseState = null; - var newBaseUpdate = null; - var prevUpdate = _baseUpdate; - var _update = first; - var didSkip = false; - do { - var updateExpirationTime = _update.expirationTime; - if (updateExpirationTime < renderExpirationTime) { - // Priority is insufficient. Skip this update. If this is the first - // skipped update, the previous update/state is the new base - // update/state. - if (!didSkip) { - didSkip = true; - newBaseUpdate = prevUpdate; - newBaseState = _newState; - } - // Update the remaining priority in the queue. - if (updateExpirationTime > remainingExpirationTime) { - remainingExpirationTime = updateExpirationTime; - } - } else { - // Process this update. - var _action2 = _update.action; - _newState = reducer(_newState, _action2); - } - prevUpdate = _update; - _update = _update.next; - } while (_update !== null && _update !== first); +{ + didWarnAboutMaps = false; + didWarnAboutGenerators = false; + didWarnAboutStringRefInStrictMode = {}; - if (!didSkip) { - newBaseUpdate = prevUpdate; - newBaseState = _newState; - } + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; - workInProgressHook.memoizedState = _newState; - workInProgressHook.baseUpdate = newBaseUpdate; - workInProgressHook.baseState = newBaseState; + warnForMissingKey = function (child) { + if (child === null || typeof child !== 'object') { + return; } + if (!child._store || child._store.validated || child.key != null) { + return; + } + !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; + child._store.validated = true; - var _dispatch = queue.dispatch; - return [workInProgressHook.memoizedState, _dispatch]; - } - - // There's no existing queue, so this is the initial render. - if (reducer === basicStateReducer) { - // Special case for `useState`. - if (typeof initialState === 'function') { - initialState = initialState(); + var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev(); + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; } - } else if (initialAction !== undefined && initialAction !== null) { - initialState = reducer(initialState, initialAction); - } - workInProgressHook.memoizedState = workInProgressHook.baseState = initialState; - queue = workInProgressHook.queue = { - last: null, - dispatch: null + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + + warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.'); }; - var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue); - return [workInProgressHook.memoizedState, dispatch]; } -function pushEffect(tag, create, destroy, inputs) { - var effect = { - tag: tag, - create: create, - destroy: destroy, - inputs: inputs, - // Circular - next: null - }; - if (componentUpdateQueue === null) { - componentUpdateQueue = createFunctionComponentUpdateQueue(); - componentUpdateQueue.lastEffect = effect.next = effect; - } else { - var _lastEffect = componentUpdateQueue.lastEffect; - if (_lastEffect === null) { - componentUpdateQueue.lastEffect = effect.next = effect; +var isArray = Array.isArray; + +function coerceRef(returnFiber, current$$1, element) { + var mixedRef = element.ref; + if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { + { + if (returnFiber.mode & StrictMode) { + var componentName = getComponentName(returnFiber.type) || 'Component'; + if (!didWarnAboutStringRefInStrictMode[componentName]) { + warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber)); + didWarnAboutStringRefInStrictMode[componentName] = true; + } + } + } + + if (element._owner) { + var owner = element._owner; + var inst = void 0; + if (owner) { + var ownerFiber = owner; + !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs. Did you mean to use React.forwardRef()?') : void 0; + inst = ownerFiber.stateNode; + } + !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0; + var stringRef = '' + mixedRef; + // Check if previous string ref matches new string ref + if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) { + return current$$1.ref; + } + var ref = function (value) { + var refs = inst.refs; + if (refs === emptyRefsObject) { + // This is a lazy pooled frozen object, so we need to initialize. + refs = inst.refs = {}; + } + if (value === null) { + delete refs[stringRef]; + } else { + refs[stringRef] = value; + } + }; + ref._stringRef = stringRef; + return ref; } else { - var firstEffect = _lastEffect.next; - _lastEffect.next = effect; - effect.next = firstEffect; - componentUpdateQueue.lastEffect = effect; + !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0; + !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0; } } - return effect; + return mixedRef; } -function useRef(initialValue) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var ref = void 0; - - if (workInProgressHook.memoizedState === null) { - ref = { current: initialValue }; +function throwOnInvalidObjectType(returnFiber, newChild) { + if (returnFiber.type !== 'textarea') { + var addendum = ''; { - Object.seal(ref); + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev(); } - workInProgressHook.memoizedState = ref; - } else { - ref = workInProgressHook.memoizedState; + invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum); } - return ref; } -function useMutationEffect(create, inputs) { - useEffectImpl(Snapshot | Update, UnmountSnapshot | MountMutation, create, inputs); -} +function warnOnFunctionType() { + var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev(); -function useLayoutEffect(create, inputs) { - useEffectImpl(Update, UnmountMutation | MountLayout, create, inputs); -} + if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { + return; + } + ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; -function useEffect(create, inputs) { - useEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, inputs); + warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.'); } -function useEffectImpl(fiberEffectTag, hookEffectTag, create, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [create]; - var destroy = null; - if (currentHook !== null) { - var prevEffect = currentHook.memoizedState; - destroy = prevEffect.destroy; - if (areHookInputsEqual(nextInputs, prevEffect.inputs)) { - pushEffect(NoEffect$1, create, destroy, nextInputs); +// This wrapper function exists because I expect to clone the code in each path +// to be able to optimize each path individually by branching early. This needs +// a compiler or we can do it manually. Helpers that don't need this branching +// live outside of this function. +function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (!shouldTrackSideEffects) { + // Noop. return; } + // Deletions are added in reversed order so we add it to the front. + // At this point, the return fiber's effect list is empty except for + // deletions, so we can just append the deletion to the list. The remaining + // effects aren't added until the complete phase. Once we implement + // resuming, this may not be true. + var last = returnFiber.lastEffect; + if (last !== null) { + last.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } + childToDelete.nextEffect = null; + childToDelete.effectTag = Deletion; } - currentlyRenderingFiber$1.effectTag |= fiberEffectTag; - workInProgressHook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextInputs); -} - -function useImperativeMethods(ref, create, inputs) { - // TODO: If inputs are provided, should we skip comparing the ref itself? - var nextInputs = inputs !== null && inputs !== undefined ? inputs.concat([ref]) : [ref, create]; - - // TODO: I've implemented this on top of useEffect because it's almost the - // same thing, and it would require an equal amount of code. It doesn't seem - // like a common enough use case to justify the additional size. - useEffectImpl(Update, UnmountMutation | MountLayout, function () { - if (typeof ref === 'function') { - var refCallback = ref; - var _inst = create(); - refCallback(_inst); - return function () { - return refCallback(null); - }; - } else if (ref !== null && ref !== undefined) { - var refObject = ref; - var _inst2 = create(); - refObject.current = _inst2; - return function () { - refObject.current = null; - }; + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) { + // Noop. + return null; } - }, nextInputs); -} -function useCallback(callback, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); + // TODO: For the shouldClone case, this could be micro-optimized a bit by + // assuming that after the first child we've already added everything. + var childToDelete = currentFirstChild; + while (childToDelete !== null) { + deleteChild(returnFiber, childToDelete); + childToDelete = childToDelete.sibling; + } + return null; + } - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [callback]; + function mapRemainingChildren(returnFiber, currentFirstChild) { + // Add the remaining children to a temporary map so that we can find them by + // keys quickly. Implicit (null) keys get added to this set with their index + var existingChildren = new Map(); - var prevState = workInProgressHook.memoizedState; - if (prevState !== null) { - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + var existingChild = currentFirstChild; + while (existingChild !== null) { + if (existingChild.key !== null) { + existingChildren.set(existingChild.key, existingChild); + } else { + existingChildren.set(existingChild.index, existingChild); + } + existingChild = existingChild.sibling; } + return existingChildren; } - workInProgressHook.memoizedState = [callback, nextInputs]; - return callback; -} - -function useMemo(nextCreate, inputs) { - currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber(); - workInProgressHook = createWorkInProgressHook(); - var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate]; + function useFiber(fiber, pendingProps, expirationTime) { + // We currently set sibling to null and index to 0 here because it is easy + // to forget to do before returning it. E.g. for the single child case. + var clone = createWorkInProgress(fiber, pendingProps, expirationTime); + clone.index = 0; + clone.sibling = null; + return clone; + } - var prevState = workInProgressHook.memoizedState; - if (prevState !== null) { - var prevInputs = prevState[1]; - if (areHookInputsEqual(nextInputs, prevInputs)) { - return prevState[0]; + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) { + // Noop. + return lastPlacedIndex; + } + var current$$1 = newFiber.alternate; + if (current$$1 !== null) { + var oldIndex = current$$1.index; + if (oldIndex < lastPlacedIndex) { + // This is a move. + newFiber.effectTag = Placement; + return lastPlacedIndex; + } else { + // This item can stay in place. + return oldIndex; + } + } else { + // This is an insertion. + newFiber.effectTag = Placement; + return lastPlacedIndex; } } - var nextValue = nextCreate(); - workInProgressHook.memoizedState = [nextValue, nextInputs]; - return nextValue; -} + function placeSingleChild(newFiber) { + // This is simpler for the single child case. We only need to do a + // placement for inserting new children. + if (shouldTrackSideEffects && newFiber.alternate === null) { + newFiber.effectTag = Placement; + } + return newFiber; + } -function dispatchAction(fiber, 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; + function updateTextNode(returnFiber, current$$1, textContent, expirationTime) { + if (current$$1 === null || current$$1.tag !== HostText) { + // Insert + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current$$1, textContent, expirationTime); + existing.return = returnFiber; + return existing; + } + } - var alternate = fiber.alternate; - if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) { - // 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 = { - expirationTime: renderExpirationTime, - action: action, - next: null - }; - if (renderPhaseUpdates === null) { - renderPhaseUpdates = new Map(); + function updateElement(returnFiber, current$$1, element, expirationTime) { + if (current$$1 !== null && current$$1.elementType === element.type) { + // Move based on index + var existing = useFiber(current$$1, element.props, expirationTime); + existing.ref = coerceRef(returnFiber, current$$1, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } else { + // Insert + var created = createFiberFromElement(element, returnFiber.mode, expirationTime); + created.ref = coerceRef(returnFiber, current$$1, element); + created.return = returnFiber; + return created; } - var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); - if (firstRenderPhaseUpdate === undefined) { - renderPhaseUpdates.set(queue, update); + } + + function updatePortal(returnFiber, current$$1, portal, expirationTime) { + if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) { + // Insert + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } else { - // Append the update to the end of the list. - var lastRenderPhaseUpdate = firstRenderPhaseUpdate; - while (lastRenderPhaseUpdate.next !== null) { - lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; - } - lastRenderPhaseUpdate.next = update; + // Update + var existing = useFiber(current$$1, portal.children || [], expirationTime); + existing.return = returnFiber; + return existing; } - } else { - var currentTime = requestCurrentTime(); - var _expirationTime = computeExpirationForFiber(currentTime, fiber); - var _update2 = { - expirationTime: _expirationTime, - action: action, - next: null - }; - flushPassiveEffects(); - // Append the update to the end of the list. - var _last2 = queue.last; - if (_last2 === null) { - // This is the first update. Create a circular list. - _update2.next = _update2; + } + + function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) { + if (current$$1 === null || current$$1.tag !== Fragment) { + // Insert + var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); + created.return = returnFiber; + return created; } else { - var first = _last2.next; - if (first !== null) { - // Still circular. - _update2.next = first; - } - _last2.next = _update2; + // Update + var existing = useFiber(current$$1, fragment, expirationTime); + existing.return = returnFiber; + return existing; } - queue.last = _update2; - scheduleWork(fiber, _expirationTime); } -} -var NO_CONTEXT = {}; + function createChild(returnFiber, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } -var contextStackCursor$1 = createCursor(NO_CONTEXT); -var contextFiberStackCursor = createCursor(NO_CONTEXT); -var rootInstanceStackCursor = createCursor(NO_CONTEXT); + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); + _created.ref = coerceRef(returnFiber, null, newChild); + _created.return = returnFiber; + return _created; + } + case REACT_PORTAL_TYPE: + { + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); + _created2.return = returnFiber; + return _created2; + } + } -function requiredContext(c) { - !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0; - return c; -} + if (isArray(newChild) || getIteratorFn(newChild)) { + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); + _created3.return = returnFiber; + return _created3; + } -function getRootHostContainer() { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - return rootInstance; -} + throwOnInvalidObjectType(returnFiber, newChild); + } -function pushHostContainer(fiber, nextRootInstance) { - // Push current root instance onto the stack; - // This allows us to reset root when portals are popped. - push(rootInstanceStackCursor, nextRootInstance, fiber); - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } - // Finally, we need to push the host context to the stack. - // However, we can't just call getRootHostContext() and push it because - // we'd have a different number of entries on the stack depending on - // whether getRootHostContext() throws somewhere in renderer code or not. - // So we push an empty value first. This lets us safely unwind on errors. - push(contextStackCursor$1, NO_CONTEXT, fiber); - var nextRootContext = getRootHostContext(nextRootInstance); - // Now that we know this function doesn't throw, replace it. - pop(contextStackCursor$1, fiber); - push(contextStackCursor$1, nextRootContext, fiber); -} - -function popHostContainer(fiber) { - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); -} - -function getHostContext() { - var context = requiredContext(contextStackCursor$1.current); - return context; -} - -function pushHostContext(fiber) { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - var context = requiredContext(contextStackCursor$1.current); - var nextContext = getChildHostContext(context, fiber.type, rootInstance); - - // Don't push this Fiber's context unless it's unique. - if (context === nextContext) { - return; + return null; } - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor$1, nextContext, fiber); -} + function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { + // Update the fiber if the keys match, otherwise return null. -function popHostContext(fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - if (contextFiberStackCursor.current !== fiber) { - return; - } + var key = oldFiber !== null ? oldFiber.key : null; - pop(contextStackCursor$1, fiber); - pop(contextFiberStackCursor, fiber); -} + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + if (key !== null) { + return null; + } + return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); + } -var commitTime = 0; -var profilerStartTime = -1; + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + if (newChild.key === key) { + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); + } + return updateElement(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + case REACT_PORTAL_TYPE: + { + if (newChild.key === key) { + return updatePortal(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + } -function getCommitTime() { - return commitTime; -} + if (isArray(newChild) || getIteratorFn(newChild)) { + if (key !== null) { + return null; + } -function recordCommitTime() { - if (!enableProfilerTimer) { - return; - } - commitTime = unstable_now(); -} + return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); + } -function startProfilerTimer(fiber) { - if (!enableProfilerTimer) { - return; - } + throwOnInvalidObjectType(returnFiber, newChild); + } - profilerStartTime = unstable_now(); + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } - if (fiber.actualStartTime < 0) { - fiber.actualStartTime = unstable_now(); + return null; } -} -function stopProfilerTimerIfRunning(fiber) { - if (!enableProfilerTimer) { - return; - } - profilerStartTime = -1; -} + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys, so we neither have to check the old nor + // new node for the key. If both are text nodes, they match. + var matchedFiber = existingChildren.get(newIdx) || null; + return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); + } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (!enableProfilerTimer) { - return; - } + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); + } + return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); + } + case REACT_PORTAL_TYPE: + { + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); + } + } - if (profilerStartTime >= 0) { - var elapsedTime = unstable_now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - if (overrideBaseTime) { - fiber.selfBaseDuration = elapsedTime; + if (isArray(newChild) || getIteratorFn(newChild)) { + var _matchedFiber3 = existingChildren.get(newIdx) || null; + return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); + } + + throwOnInvalidObjectType(returnFiber, newChild); } - profilerStartTime = -1; - } -} -function resolveDefaultProps(Component, baseProps) { - if (Component && Component.defaultProps) { - // Resolve default props. Taken from ReactElement - var props = _assign({}, baseProps); - var defaultProps = Component.defaultProps; - for (var propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; + { + if (typeof newChild === 'function') { + warnOnFunctionType(); } } - return props; + + return null; } - return baseProps; -} -function readLazyComponentType(lazyComponent) { - var status = lazyComponent._status; - var result = lazyComponent._result; - switch (status) { - case Resolved: - { - var Component = result; - return Component; - } - case Rejected: - { - var error = result; - throw error; - } - case Pending: - { - var thenable = result; - throw thenable; + /** + * Warns if there is a duplicate or missing key + */ + function warnOnInvalidKey(child, knownKeys) { + { + if (typeof child !== 'object' || child === null) { + return knownKeys; } - default: - { - lazyComponent._status = Pending; - var ctor = lazyComponent._ctor; - var _thenable = ctor(); - _thenable.then(function (moduleObject) { - if (lazyComponent._status === Pending) { - var defaultExport = moduleObject.default; - { - if (defaultExport === undefined) { - warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); - } - } - lazyComponent._status = Resolved; - lazyComponent._result = defaultExport; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(child); + var key = child.key; + if (typeof key !== 'string') { + break; } - }, function (error) { - if (lazyComponent._status === Pending) { - lazyComponent._status = Rejected; - lazyComponent._result = error; + if (knownKeys === null) { + knownKeys = new Set(); + knownKeys.add(key); + break; } - }); - lazyComponent._result = _thenable; - throw _thenable; + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); + break; + default: + break; } + } + return knownKeys; } -} -var ReactCurrentOwner$4 = ReactSharedInternals.ReactCurrentOwner; + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { + // This algorithm can't optimize by searching from both ends since we + // don't have backpointers on fibers. I'm trying to see how far we can get + // with that model. If it ends up not being worth the tradeoffs, we can + // add it later. -function readContext$1(contextType) { - var dispatcher = ReactCurrentOwner$4.currentDispatcher; - return dispatcher.readContext(contextType); -} + // Even with a two ended optimization, we'd want to optimize for the case + // where there are few changes and brute force the comparison instead of + // going for the Map. It'd like to explore hitting that path first in + // forward-only mode and only go for the Map once we notice that we need + // lots of look ahead. This doesn't handle reversal as well as two ended + // search but that's unusual. Besides, for the two ended optimization to + // work on Iterables, we'd need to copy the whole set. -var fakeInternalInstance = {}; -var isArray$1 = Array.isArray; - -// React.Component uses a shared frozen object by default. -// We'll use it to determine whether we need to initialize legacy refs. -var emptyRefsObject = new React.Component().refs; + // In this first iteration, we'll just live with hitting the bad case + // (adding everything to a Map) in for every insert/move. -var didWarnAboutStateAssignmentForComponent = void 0; -var didWarnAboutUninitializedState = void 0; -var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0; -var didWarnAboutLegacyLifecyclesAndDerivedState = void 0; -var didWarnAboutUndefinedDerivedState = void 0; -var warnOnUndefinedDerivedState = void 0; -var warnOnInvalidCallback$1 = void 0; -var didWarnAboutDirectlyAssigningPropsToState = void 0; -var didWarnAboutContextTypeAndContextTypes = void 0; -var didWarnAboutInvalidateContextType = void 0; + // If you change this code, also update reconcileChildrenIterator() which + // uses the same algorithm. -{ - didWarnAboutStateAssignmentForComponent = new Set(); - didWarnAboutUninitializedState = new Set(); - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - didWarnAboutDirectlyAssigningPropsToState = new Set(); - didWarnAboutUndefinedDerivedState = new Set(); - didWarnAboutContextTypeAndContextTypes = new Set(); - didWarnAboutInvalidateContextType = new Set(); + { + // First, validate keys. + var knownKeys = null; + for (var i = 0; i < newChildren.length; i++) { + var child = newChildren[i]; + knownKeys = warnOnInvalidKey(child, knownKeys); + } + } - var didWarnOnInvalidCallback = new Set(); + var resultingFirstChild = null; + var previousNewFiber = null; - warnOnInvalidCallback$1 = function (callback, callerName) { - if (callback === null || typeof callback === 'function') { - return; - } - var key = callerName + '_' + callback; - if (!didWarnOnInvalidCallback.has(key)) { - didWarnOnInvalidCallback.add(key); - warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - }; - warnOnUndefinedDerivedState = function (type, partialState) { - if (partialState === undefined) { - var componentName = getComponentName(type) || 'Component'; - if (!didWarnAboutUndefinedDerivedState.has(componentName)) { - didWarnAboutUndefinedDerivedState.add(componentName); - warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); - } + if (newIdx === newChildren.length) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; } - }; - // This is so gross but it's at least non-critical and can be removed if - // it causes problems. This is meant to give a nicer error message for - // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, - // ...)) which otherwise throws a "_processChildContext is not a function" - // exception. - Object.defineProperty(fakeInternalInstance, '_processChildContext', { - enumerable: false, - value: function () { - invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).'); + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); + if (!_newFiber) { + continue; + } + lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber; + } else { + previousNewFiber.sibling = _newFiber; + } + previousNewFiber = _newFiber; + } + return resultingFirstChild; } - }); - Object.freeze(fakeInternalInstance); -} -function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { - var prevState = workInProgress.memoizedState; + // Add all children to a key map for quick lookups. + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - // Invoke the function an extra time to help detect side-effects. - getDerivedStateFromProps(nextProps, prevState); + // Keep scanning and use the map to restore deleted items as moves. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); + if (_newFiber2) { + if (shouldTrackSideEffects) { + if (_newFiber2.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); + } + } + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber2; + } else { + previousNewFiber.sibling = _newFiber2; + } + previousNewFiber = _newFiber2; + } } - } - var partialState = getDerivedStateFromProps(nextProps, prevState); + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } - { - warnOnUndefinedDerivedState(ctor, partialState); + return resultingFirstChild; } - // Merge the partial state and the previous state. - var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState); - workInProgress.memoizedState = memoizedState; - // Once the update queue is empty, persist the derived state onto the - // base state. - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null && workInProgress.expirationTime === NoWork) { - updateQueue.baseState = memoizedState; - } -} + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { + // This is the same implementation as reconcileChildrenArray(), + // but using the iterator instead. -var classComponentUpdater = { - isMounted: isMounted, - enqueueSetState: function (inst, payload, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); + var iteratorFn = getIteratorFn(newChildrenIterable); + !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var update = createUpdate(expirationTime); - update.payload = payload; - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'setState'); + { + // We don't support rendering Generators because it's a mutation. + // See https://github.com/facebook/react/issues/12995 + if (typeof Symbol === 'function' && + // $FlowFixMe Flow doesn't know about toStringTag + newChildrenIterable[Symbol.toStringTag] === 'Generator') { + !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0; + didWarnAboutGenerators = true; } - update.callback = callback; - } - - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueReplaceState: function (inst, payload, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); - var update = createUpdate(expirationTime); - update.tag = ReplaceState; - update.payload = payload; + // Warn about using Maps as children + if (newChildrenIterable.entries === iteratorFn) { + !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; + } - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'replaceState'); + // First, validate keys. + // We'll get a different iterator later for the main pass. + var _newChildren = iteratorFn.call(newChildrenIterable); + if (_newChildren) { + var knownKeys = null; + var _step = _newChildren.next(); + for (; !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys); + } } - update.callback = callback; } - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - }, - enqueueForceUpdate: function (inst, callback) { - var fiber = get(inst); - var currentTime = requestCurrentTime(); - var expirationTime = computeExpirationForFiber(currentTime, fiber); + var newChildren = iteratorFn.call(newChildrenIterable); + !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0; - var update = createUpdate(expirationTime); - update.tag = ForceUpdate; + var resultingFirstChild = null; + var previousNewFiber = null; - if (callback !== undefined && callback !== null) { - { - warnOnInvalidCallback$1(callback, 'forceUpdate'); + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + + var step = newChildren.next(); + for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; } - update.callback = callback; + var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (!oldFiber) { + oldFiber = nextOldFiber; + } + break; + } + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - flushPassiveEffects(); - enqueueUpdate(fiber, update); - scheduleWork(fiber, expirationTime); - } -}; - -function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { - var instance = workInProgress.stateNode; - if (typeof instance.shouldComponentUpdate === 'function') { - startPhaseTimer(workInProgress, 'shouldComponentUpdate'); - var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); - stopPhaseTimer(); - - { - !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0; + if (step.done) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; } - return shouldUpdate; - } - - if (ctor.prototype && ctor.prototype.isPureReactComponent) { - return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); - } - - return true; -} - -function checkClassInstance(workInProgress, ctor, newProps) { - var instance = workInProgress.stateNode; - { - var name = getComponentName(ctor) || 'Component'; - var renderPresent = instance.render; - - if (!renderPresent) { - if (ctor.prototype && typeof ctor.prototype.render === 'function') { - warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); - } else { - warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, expirationTime); + if (_newFiber3 === null) { + continue; + } + lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber3; + } else { + previousNewFiber.sibling = _newFiber3; + } + previousNewFiber = _newFiber3; } + return resultingFirstChild; } - var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; - !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0; - var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; - !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0; - var noInstancePropTypes = !instance.propTypes; - !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0; - var noInstanceContextType = !instance.contextType; - !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0; - var noInstanceContextTypes = !instance.contextTypes; - !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0; - - if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { - didWarnAboutContextTypeAndContextTypes.add(ctor); - warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); - } + // Add all children to a key map for quick lookups. + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function'; - !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0; - if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { - warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component'); + // Keep scanning and use the map to restore deleted items as moves. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); + if (_newFiber4 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber4.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); + } + } + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); + if (previousNewFiber === null) { + resultingFirstChild = _newFiber4; + } else { + previousNewFiber.sibling = _newFiber4; + } + previousNewFiber = _newFiber4; + } } - var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function'; - !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0; - var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function'; - !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0; - var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; - !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0; - var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function'; - !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0; - var hasMutatedProps = instance.props !== newProps; - !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0; - var noInstanceDefaultProps = !instance.defaultProps; - !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0; - if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); - warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor)); + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); } - var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function'; - !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; - var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function'; - !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0; - var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function'; - !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0; - var _state = instance.state; - if (_state && (typeof _state !== 'object' || isArray$1(_state))) { - warningWithoutStack$1(false, '%s.state: must be set to an object or null', name); - } - if (typeof instance.getChildContext === 'function') { - !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0; - } + return resultingFirstChild; } -} -function adoptClassInstance(workInProgress, instance) { - instance.updater = classComponentUpdater; - workInProgress.stateNode = instance; - // The instance needs access to the fiber so that it can schedule updates - set(instance, workInProgress); - { - instance._reactInternalInstance = fakeInternalInstance; + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { + // There's no need to check for keys on text nodes since we don't have a + // way to define them. + if (currentFirstChild !== null && currentFirstChild.tag === HostText) { + // We already have an existing node so let's just update it and delete + // the rest. + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, textContent, expirationTime); + existing.return = returnFiber; + return existing; + } + // The existing first child is not a text node so we need to create one + // and delete the existing ones. + deleteRemainingChildren(returnFiber, currentFirstChild); + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } -} -function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) { - var isLegacyContextConsumer = false; - var unmaskedContext = emptyContextObject; - var context = null; - var contextType = ctor.contextType; - if (typeof contextType === 'object' && contextType !== null) { - { - if (contextType.$$typeof !== REACT_CONTEXT_TYPE && !didWarnAboutInvalidateContextType.has(ctor)) { - didWarnAboutInvalidateContextType.add(ctor); - warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', getComponentName(ctor) || 'Component'); + function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { + var key = element.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); + existing.ref = coerceRef(returnFiber, child, element); + existing.return = returnFiber; + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); } + child = child.sibling; } - context = readContext$1(contextType); - } else { - unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - var contextTypes = ctor.contextTypes; - isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; - context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; + if (element.type === REACT_FRAGMENT_TYPE) { + var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); + created.return = returnFiber; + return created; + } else { + var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4.return = returnFiber; + return _created4; + } } - // Instantiate twice to help detect side-effects. - { - if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { - new ctor(props, context); // eslint-disable-line no-new + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { + var key = portal.key; + var child = currentFirstChild; + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, portal.children || [], expirationTime); + existing.return = returnFiber; + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); + } + child = child.sibling; } + + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; } - var instance = new ctor(props, context); - var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; - adoptClassInstance(workInProgress, instance); + // This API will tag the children with the side-effect of the reconciliation + // itself. They will be added to the side-effect list as we pass through the + // children and the parent. + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { + // This function is not recursive. + // If the top level item is an array, we treat it as a set of children, + // not as a fragment. Nested arrays on the other hand will be treated as + // fragment nodes. Recursion happens at the normal flow. - { - if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { - var componentName = getComponentName(ctor) || 'Component'; - if (!didWarnAboutUninitializedState.has(componentName)) { - didWarnAboutUninitializedState.add(componentName); - warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); - } + // Handle top level unkeyed fragments as if they were arrays. + // This leads to an ambiguity between <>{[...]} and <>.... + // We treat the ambiguous cases above the same. + var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; + if (isUnkeyedTopLevelFragment) { + newChild = newChild.props.children; } - // If new component APIs are defined, "unsafe" lifecycles won't be called. - // Warn about these lifecycles if they are present. - // Don't warn about react-lifecycles-compat polyfilled methods though. - if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { - var foundWillMountName = null; - var foundWillReceivePropsName = null; - var foundWillUpdateName = null; - if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { - foundWillMountName = 'componentWillMount'; - } else if (typeof instance.UNSAFE_componentWillMount === 'function') { - foundWillMountName = 'UNSAFE_componentWillMount'; - } - if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { - foundWillReceivePropsName = 'componentWillReceiveProps'; - } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { - foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; - } - if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { - foundWillUpdateName = 'componentWillUpdate'; - } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { - foundWillUpdateName = 'UNSAFE_componentWillUpdate'; - } - if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { - var _componentName = getComponentName(ctor) || 'Component'; - var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; - if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { - didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); - warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : ''); - } + // Handle object types + var isObject = typeof newChild === 'object' && newChild !== null; + + if (isObject) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); + case REACT_PORTAL_TYPE: + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); } } - } - - // Cache unmasked context so we can avoid recreating masked context unless necessary. - // ReactFiberContext usually updates this cache but can't for newly-created instances. - if (isLegacyContextConsumer) { - cacheContext(workInProgress, unmaskedContext, context); - } - - return instance; -} -function callComponentWillMount(workInProgress, instance) { - startPhaseTimer(workInProgress, 'componentWillMount'); - var oldState = instance.state; - - if (typeof instance.componentWillMount === 'function') { - instance.componentWillMount(); - } - if (typeof instance.UNSAFE_componentWillMount === 'function') { - instance.UNSAFE_componentWillMount(); - } + if (typeof newChild === 'string' || typeof newChild === 'number') { + return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); + } - stopPhaseTimer(); + if (isArray(newChild)) { + return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); + } - if (oldState !== instance.state) { - { - warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component'); + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); } - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); - } -} -function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { - var oldState = instance.state; - startPhaseTimer(workInProgress, 'componentWillReceiveProps'); - if (typeof instance.componentWillReceiveProps === 'function') { - instance.componentWillReceiveProps(newProps, nextContext); - } - if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - } - stopPhaseTimer(); + if (isObject) { + throwOnInvalidObjectType(returnFiber, newChild); + } - if (instance.state !== oldState) { { - var componentName = getComponentName(workInProgress.type) || 'Component'; - if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { - didWarnAboutStateAssignmentForComponent.add(componentName); - warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); + if (typeof newChild === 'function') { + warnOnFunctionType(); } } - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); - } -} - -// Invokes the mount life-cycles on a previously never rendered instance. -function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { - { - checkClassInstance(workInProgress, ctor, newProps); - } - - var instance = workInProgress.stateNode; - instance.props = newProps; - instance.state = workInProgress.memoizedState; - instance.refs = emptyRefsObject; - - var contextType = ctor.contextType; - if (typeof contextType === 'object' && contextType !== null) { - instance.context = readContext$1(contextType); - } else { - var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - instance.context = getMaskedContext(workInProgress, unmaskedContext); - } - - { - if (instance.state === newProps) { - var componentName = getComponentName(ctor) || 'Component'; - if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { - didWarnAboutDirectlyAssigningPropsToState.add(componentName); - warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); + if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) { + // If the new child is undefined, and the return fiber is a composite + // component, throw an error. If Fiber return types are disabled, + // we already threw above. + switch (returnFiber.tag) { + case ClassComponent: + { + { + var instance = returnFiber.stateNode; + if (instance.render._isMockFunction) { + // We allow auto-mocks to proceed as if they're returning null. + break; + } + } + } + // Intentionally fall through to the next case, which handles both + // functions and classes + // eslint-disable-next-lined no-fallthrough + case FunctionComponent: + { + var Component = returnFiber.type; + invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component'); + } } } - if (workInProgress.mode & StrictMode) { - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + // Remaining cases are all treated as empty. + return deleteRemainingChildren(returnFiber, currentFirstChild); + } - ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); - } + return reconcileChildFibers; +} - if (warnAboutDeprecatedLifecycles) { - ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); - } - } +var reconcileChildFibers = ChildReconciler(true); +var mountChildFibers = ChildReconciler(false); - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - instance.state = workInProgress.memoizedState; - } +function cloneChildFibers(current$$1, workInProgress) { + !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - instance.state = workInProgress.memoizedState; + if (workInProgress.child === null) { + return; } - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { - callComponentWillMount(workInProgress, instance); - // If we had additional state updates during this life-cycle, let's - // process them now. - updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - instance.state = workInProgress.memoizedState; - } - } + var currentChild = workInProgress.child; + var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); + workInProgress.child = newChild; - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; + newChild.return = workInProgress; + while (currentChild.sibling !== null) { + currentChild = currentChild.sibling; + newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); + newChild.return = workInProgress; } + newChild.sibling = null; } -function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { - var instance = workInProgress.stateNode; +var NO_CONTEXT = {}; - var oldProps = workInProgress.memoizedProps; - instance.props = oldProps; +var contextStackCursor$1 = createCursor(NO_CONTEXT); +var contextFiberStackCursor = createCursor(NO_CONTEXT); +var rootInstanceStackCursor = createCursor(NO_CONTEXT); - var oldContext = instance.context; - var contextType = ctor.contextType; - var nextContext = void 0; - if (typeof contextType === 'object' && contextType !== null) { - nextContext = readContext$1(contextType); - } else { - var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); - } +function requiredContext(c) { + !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0; + return c; +} - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; +function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; +} - // Note: During these life-cycles, instance.props/instance.state are what - // ever the previously attempted to render - not the "current". However, - // during componentDidUpdate we pass the "current" props. +function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { - if (oldProps !== newProps || oldContext !== nextContext) { - callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); - } - } + // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + push(contextStackCursor$1, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); + // Now that we know this function doesn't throw, replace it. + pop(contextStackCursor$1, fiber); + push(contextStackCursor$1, nextRootContext, fiber); +} - resetHasForceUpdateBeforeProcessing(); +function popHostContainer(fiber) { + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); +} - var oldState = workInProgress.memoizedState; - var newState = instance.state = oldState; - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - newState = workInProgress.memoizedState; +function getHostContext() { + var context = requiredContext(contextStackCursor$1.current); + return context; +} + +function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var nextContext = getChildHostContext(context, fiber.type, rootInstance); + + // Don't push this Fiber's context unless it's unique. + if (context === nextContext) { + return; } - if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; - } - return false; + + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); +} + +function popHostContext(fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + if (contextFiberStackCursor.current !== fiber) { + return; } - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - newState = workInProgress.memoizedState; + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); +} + +var NoEffect$1 = /* */0; +var UnmountSnapshot = /* */2; +var UnmountMutation = /* */4; +var MountMutation = /* */8; +var UnmountLayout = /* */16; +var MountLayout = /* */32; +var MountPassive = /* */64; +var UnmountPassive = /* */128; + +var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; + + +var didWarnAboutMismatchedHooksForComponent = void 0; +{ + didWarnAboutMismatchedHooksForComponent = new Set(); +} + +// These are set right before calling the component. +var renderExpirationTime = NoWork; +// The work-in-progress fiber. I've named it differently to distinguish it from +// the work-in-progress hook. +var currentlyRenderingFiber$1 = null; + +// Hooks are stored as a linked list on the fiber's memoizedState field. The +// current hook list is the list that belongs to the current fiber. The +// work-in-progress hook list is a new list that will be added to the +// work-in-progress fiber. +var currentHook = null; +var nextCurrentHook = null; +var firstWorkInProgressHook = null; +var workInProgressHook = null; +var nextWorkInProgressHook = null; + +var remainingExpirationTime = NoWork; +var componentUpdateQueue = null; +var sideEffectTag = 0; + +// Updates scheduled during render will trigger an immediate re-render at the +// end of the current pass. We can't store these updates on the normal queue, +// because if the work is aborted, they should be discarded. Because this is +// a relatively rare case, we also don't want to add an additional field to +// either the hook or queue object types. So we store them in a lazily create +// map of queue -> render-phase updates, which are discarded once the component +// completes without re-rendering. + +// 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; + +// In DEV, this is the name of the currently executing primitive hook +var currentHookNameInDev = null; + +// In DEV, this list ensures that hooks are called in the same order between renders. +// The list stores the order of hooks used during the initial render (mount). +// Subsequent renders (updates) reference this list. +var hookTypesDev = null; +var hookTypesUpdateIndexDev = -1; + +function mountHookTypesDev() { + { + var hookName = currentHookNameInDev; + + if (hookTypesDev === null) { + hookTypesDev = [hookName]; + } else { + hookTypesDev.push(hookName); + } } +} - var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); +function updateHookTypesDev() { + { + var hookName = currentHookNameInDev; - if (shouldUpdate) { - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { - startPhaseTimer(workInProgress, 'componentWillMount'); - if (typeof instance.componentWillMount === 'function') { - instance.componentWillMount(); - } - if (typeof instance.UNSAFE_componentWillMount === 'function') { - instance.UNSAFE_componentWillMount(); + if (hookTypesDev !== null) { + hookTypesUpdateIndexDev++; + if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { + warnOnHookMismatchInDev(hookName); } - stopPhaseTimer(); - } - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; - } - } else { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidMount === 'function') { - workInProgress.effectTag |= Update; } - - // If shouldComponentUpdate returned false, we should still update the - // memoized state to indicate that this work can be reused. - workInProgress.memoizedProps = newProps; - workInProgress.memoizedState = newState; } +} - // Update the existing instance's state, props, and context pointers even - // if shouldComponentUpdate returns false. - instance.props = newProps; - instance.state = newState; - instance.context = nextContext; +function warnOnHookMismatchInDev(currentHookName) { + { + var componentName = getComponentName(currentlyRenderingFiber$1.type); + if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { + didWarnAboutMismatchedHooksForComponent.add(componentName); - return shouldUpdate; -} + if (hookTypesDev !== null) { + var table = ''; -// Invokes the update life-cycles and returns false if it shouldn't rerender. -function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) { - var instance = workInProgress.stateNode; + var secondColumnStart = 30; - var oldProps = workInProgress.memoizedProps; - instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); + for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i]; + var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; - var oldContext = instance.context; - var contextType = ctor.contextType; - var nextContext = void 0; - if (typeof contextType === 'object' && contextType !== null) { - nextContext = readContext$1(contextType); - } else { - var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); - nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); - } + var row = i + 1 + '. ' + oldHookName; - var getDerivedStateFromProps = ctor.getDerivedStateFromProps; - var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; + // Extra space so second column lines up + // lol @ IE not supporting String#repeat + while (row.length < secondColumnStart) { + row += ' '; + } - // Note: During these life-cycles, instance.props/instance.state are what - // ever the previously attempted to render - not the "current". However, - // during componentDidUpdate we pass the "current" props. + row += newHookName + '\n'; - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { - if (oldProps !== newProps || oldContext !== nextContext) { - callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + table += row; + } + + warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table); + } } } +} - resetHasForceUpdateBeforeProcessing(); +function throwInvalidHookError() { + 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.'); +} - var oldState = workInProgress.memoizedState; - var newState = instance.state = oldState; - var updateQueue = workInProgress.updateQueue; - if (updateQueue !== null) { - processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime); - newState = workInProgress.memoizedState; +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; } - if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } + { + // 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(', ') + ']'); } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Snapshot; - } + } + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (is(nextDeps[i], prevDeps[i])) { + continue; } return false; } + return true; +} - if (typeof getDerivedStateFromProps === 'function') { - applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); - newState = workInProgress.memoizedState; +function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) { + renderExpirationTime = nextRenderExpirationTime; + currentlyRenderingFiber$1 = workInProgress; + nextCurrentHook = current !== null ? current.memoizedState : null; + + { + hookTypesDev = current !== null ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; } - var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + // The following should have already been reset + // currentHook = null; + // workInProgressHook = null; - if (shouldUpdate) { - // In order to support react-lifecycles-compat polyfilled components, - // Unsafe lifecycles should not be invoked for components using the new APIs. - if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { - startPhaseTimer(workInProgress, 'componentWillUpdate'); - if (typeof instance.componentWillUpdate === 'function') { - instance.componentWillUpdate(newProps, newState, nextContext); - } - if (typeof instance.UNSAFE_componentWillUpdate === 'function') { - instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); - } - stopPhaseTimer(); - } - if (typeof instance.componentDidUpdate === 'function') { - workInProgress.effectTag |= Update; - } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - workInProgress.effectTag |= Snapshot; - } - } else { - // If an update was already in progress, we should schedule an Update - // effect even though we're bailing out, so that cWU/cDU are called. - if (typeof instance.componentDidUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Update; - } + // remainingExpirationTime = NoWork; + // componentUpdateQueue = null; + + // didScheduleRenderPhaseUpdate = false; + // renderPhaseUpdates = null; + // numberOfReRenders = 0; + // sideEffectTag = 0; + + // TODO Warn if no hooks are used at all during mount, then some are used during update. + // Currently we will identify the update render as a mount because nextCurrentHook === null. + // This is tricky because it's valid for certain types of components (e.g. React.lazy) + + // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used. + // Non-stateful hooks (e.g. context) don't get added to memoizedState, + // so nextCurrentHook would be null during updates and mounts. + { + if (nextCurrentHook !== null) { + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + } else if (hookTypesDev !== null) { + // This dispatcher handles an edge case where a component is updating, + // but no stateful hooks have been used. + // We want to match the production code behavior (which will use HooksDispatcherOnMount), + // but with the extra DEV validation to ensure hooks ordering hasn't changed. + // This dispatcher does that. + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; + } else { + ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; } - if (typeof instance.getSnapshotBeforeUpdate === 'function') { - if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { - workInProgress.effectTag |= Snapshot; + } + + var children = Component(props, refOrContext); + + if (didScheduleRenderPhaseUpdate) { + do { + didScheduleRenderPhaseUpdate = false; + numberOfReRenders += 1; + + // Start over from the beginning of the list + nextCurrentHook = current !== null ? current.memoizedState : null; + nextWorkInProgressHook = firstWorkInProgressHook; + + currentHook = null; + workInProgressHook = null; + componentUpdateQueue = null; + + { + // Also validate hook order for cascading updates. + hookTypesUpdateIndexDev = -1; } - } - // If shouldComponentUpdate returned false, we should still update the - // memoized props/state to indicate that this work can be reused. - workInProgress.memoizedProps = newProps; - workInProgress.memoizedState = newState; + ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; + + children = Component(props, refOrContext); + } while (didScheduleRenderPhaseUpdate); + + renderPhaseUpdates = null; + numberOfReRenders = 0; } - // Update the existing instance's state, props, and context pointers even - // if shouldComponentUpdate returns false. - instance.props = newProps; - instance.state = newState; - instance.context = nextContext; + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - return shouldUpdate; + var renderedWork = currentlyRenderingFiber$1; + + renderedWork.memoizedState = firstWorkInProgressHook; + renderedWork.expirationTime = remainingExpirationTime; + renderedWork.updateQueue = componentUpdateQueue; + renderedWork.effectTag |= sideEffectTag; + + { + renderedWork._debugHookTypes = hookTypesDev; + } + + // This check uses currentHook so that it works the same in DEV and prod bundles. + // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. + var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; + + currentHook = null; + nextCurrentHook = null; + firstWorkInProgressHook = null; + workInProgressHook = null; + nextWorkInProgressHook = null; + + { + currentHookNameInDev = null; + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + } + + remainingExpirationTime = NoWork; + componentUpdateQueue = null; + sideEffectTag = 0; + + // These were reset above + // didScheduleRenderPhaseUpdate = false; + // renderPhaseUpdates = null; + // numberOfReRenders = 0; + + !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0; + + return children; } -var didWarnAboutMaps = void 0; -var didWarnAboutGenerators = void 0; -var didWarnAboutStringRefInStrictMode = void 0; -var ownerHasKeyUseWarning = void 0; -var ownerHasFunctionTypeWarning = void 0; -var warnForMissingKey = function (child) {}; +function bailoutHooks(current, workInProgress, expirationTime) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.effectTag &= ~(Passive | Update); + if (current.expirationTime <= expirationTime) { + current.expirationTime = NoWork; + } +} -{ - didWarnAboutMaps = false; - didWarnAboutGenerators = false; - didWarnAboutStringRefInStrictMode = {}; +function resetHooks() { + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; - /** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ - ownerHasKeyUseWarning = {}; - ownerHasFunctionTypeWarning = {}; + // This is used to reset the state of this module when a component throws. + // It's also called inside mountIndeterminateComponent if we determine the + // component is a module-style component. + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; - warnForMissingKey = function (child) { - if (child === null || typeof child !== 'object') { - return; - } - if (!child._store || child._store.validated || child.key != null) { - return; - } - !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; - child._store.validated = true; + currentHook = null; + nextCurrentHook = null; + firstWorkInProgressHook = null; + workInProgressHook = null; + nextWorkInProgressHook = null; - var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev(); - if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { - return; + { + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + + currentHookNameInDev = null; + } + + remainingExpirationTime = NoWork; + componentUpdateQueue = null; + sideEffectTag = 0; + + didScheduleRenderPhaseUpdate = false; + renderPhaseUpdates = null; + numberOfReRenders = 0; +} + +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + + baseState: null, + queue: null, + baseUpdate: null, + + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list + firstWorkInProgressHook = workInProgressHook = hook; + } else { + // Append to the end of the list + workInProgressHook = workInProgressHook.next = hook; + } + return workInProgressHook; +} + +function updateWorkInProgressHook() { + // This function is used both for updates and for re-renders triggered by a + // render phase update. It assumes there is either a current hook we can + // clone, or a work-in-progress hook from a previous render pass that we can + // use as a base. When we reach the end of the base list, we must switch to + // the dispatcher used for mounts. + if (nextWorkInProgressHook !== null) { + // There's already a work-in-progress. Reuse it. + workInProgressHook = nextWorkInProgressHook; + nextWorkInProgressHook = workInProgressHook.next; + + currentHook = nextCurrentHook; + nextCurrentHook = currentHook !== null ? currentHook.next : null; + } else { + // Clone from the current hook. + !(nextCurrentHook !== null) ? invariant(false, 'Rendered more hooks than during the previous render.') : void 0; + currentHook = nextCurrentHook; + + var newHook = { + memoizedState: currentHook.memoizedState, + + baseState: currentHook.baseState, + queue: currentHook.queue, + baseUpdate: currentHook.baseUpdate, + + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list. + workInProgressHook = firstWorkInProgressHook = newHook; + } else { + // Append to the end of the list. + workInProgressHook = workInProgressHook.next = newHook; } - ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + nextCurrentHook = currentHook.next; + } + return workInProgressHook; +} - warning$1(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.'); +function createFunctionComponentUpdateQueue() { + return { + lastEffect: null }; } -var isArray = Array.isArray; +function basicStateReducer(state, action) { + return typeof action === 'function' ? action(state) : action; +} -function coerceRef(returnFiber, current$$1, element) { - var mixedRef = element.ref; - if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { - { - if (returnFiber.mode & StrictMode) { - var componentName = getComponentName(returnFiber.type) || 'Component'; - if (!didWarnAboutStringRefInStrictMode[componentName]) { - warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber)); - didWarnAboutStringRefInStrictMode[componentName] = true; +function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + var initialState = void 0; + if (init !== undefined) { + initialState = init(initialArg); + } else { + initialState = initialArg; + } + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + last: null, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, + // Flow doesn't know this is non-null, but we do. + currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} + +function updateReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + !(queue !== null) ? invariant(false, 'Should have a queue. This is likely a bug in React. Please file an issue.') : void 0; + + queue.lastRenderedReducer = reducer; + + if (numberOfReRenders > 0) { + // This is a re-render. Apply the new render phase updates to the previous + 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 = hook.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; + newState = reducer(newState, _action); + update = update.next; + } while (update !== null); + + // Mark that the fiber performed work, but only if the new state is + // different from the current state. + if (!is(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); } + + hook.memoizedState = newState; + // Don't persist the state accumlated from the render phase updates to + // the base state unless the queue is empty. + // TODO: Not sure if this is the desired semantics, but it's what we + // do for gDSFP. I can't remember why. + if (hook.baseUpdate === queue.last) { + hook.baseState = newState; + } + + queue.lastRenderedState = newState; + + return [newState, _dispatch]; } } + return [hook.memoizedState, _dispatch]; + } - if (element._owner) { - var owner = element._owner; - var inst = void 0; - if (owner) { - var ownerFiber = owner; - !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs.') : void 0; - inst = ownerFiber.stateNode; - } - !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0; - var stringRef = '' + mixedRef; - // Check if previous string ref matches new string ref - if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) { - return current$$1.ref; - } - var ref = function (value) { - var refs = inst.refs; - if (refs === emptyRefsObject) { - // This is a lazy pooled frozen object, so we need to initialize. - refs = inst.refs = {}; + // The last update in the entire queue + var last = queue.last; + // The last update that is part of the base state. + var baseUpdate = hook.baseUpdate; + var baseState = hook.baseState; + + // Find the first unprocessed update. + var first = void 0; + if (baseUpdate !== null) { + if (last !== null) { + // For the first update, the queue is a circular linked list where + // `queue.last.next = queue.first`. Once the first update commits, and + // the `baseUpdate` is no longer empty, we can unravel the list. + last.next = null; + } + first = baseUpdate.next; + } else { + first = last !== null ? last.next : null; + } + if (first !== null) { + var _newState = baseState; + var newBaseState = null; + var newBaseUpdate = null; + var prevUpdate = baseUpdate; + var _update = first; + var didSkip = false; + do { + var updateExpirationTime = _update.expirationTime; + if (updateExpirationTime < renderExpirationTime) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + if (!didSkip) { + didSkip = true; + newBaseUpdate = prevUpdate; + newBaseState = _newState; } - if (value === null) { - delete refs[stringRef]; + // Update the remaining priority in the queue. + if (updateExpirationTime > remainingExpirationTime) { + remainingExpirationTime = updateExpirationTime; + } + } else { + // Process this update. + if (_update.eagerReducer === reducer) { + // If this update was processed eagerly, and its reducer matches the + // current reducer, we can use the eagerly computed state. + _newState = _update.eagerState; } else { - refs[stringRef] = value; + var _action2 = _update.action; + _newState = reducer(_newState, _action2); } - }; - ref._stringRef = stringRef; - return ref; - } else { - !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0; - !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0; + } + prevUpdate = _update; + _update = _update.next; + } while (_update !== null && _update !== first); + + if (!didSkip) { + newBaseUpdate = prevUpdate; + newBaseState = _newState; } - } - return mixedRef; -} -function throwOnInvalidObjectType(returnFiber, newChild) { - if (returnFiber.type !== 'textarea') { - var addendum = ''; - { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev(); + // Mark that the fiber performed work, but only if the new state is + // different from the current state. + if (!is(_newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); } - invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum); + + hook.memoizedState = _newState; + hook.baseUpdate = newBaseUpdate; + hook.baseState = newBaseState; + + queue.lastRenderedState = _newState; } -} -function warnOnFunctionType() { - var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev(); + var dispatch = queue.dispatch; + return [hook.memoizedState, dispatch]; +} - if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { - return; +function mountState(initialState) { + var hook = mountWorkInProgressHook(); + if (typeof initialState === 'function') { + initialState = initialState(); } - ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + last: null, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, + // Flow doesn't know this is non-null, but we do. + currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} - warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.'); +function updateState(initialState) { + return updateReducer(basicStateReducer, initialState); } -// This wrapper function exists because I expect to clone the code in each path -// to be able to optimize each path individually by branching early. This needs -// a compiler or we can do it manually. Helpers that don't need this branching -// live outside of this function. -function ChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (!shouldTrackSideEffects) { - // Noop. - return; - } - // Deletions are added in reversed order so we add it to the front. - // At this point, the return fiber's effect list is empty except for - // deletions, so we can just append the deletion to the list. The remaining - // effects aren't added until the complete phase. Once we implement - // resuming, this may not be true. - var last = returnFiber.lastEffect; - if (last !== null) { - last.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; +function pushEffect(tag, create, destroy, deps) { + var effect = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + // Circular + next: null + }; + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var _lastEffect = componentUpdateQueue.lastEffect; + if (_lastEffect === null) { + componentUpdateQueue.lastEffect = effect.next = effect; } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + var firstEffect = _lastEffect.next; + _lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; } - childToDelete.nextEffect = null; - childToDelete.effectTag = Deletion; } + return effect; +} - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) { - // Noop. - return null; - } - - // TODO: For the shouldClone case, this could be micro-optimized a bit by - // assuming that after the first child we've already added everything. - var childToDelete = currentFirstChild; - while (childToDelete !== null) { - deleteChild(returnFiber, childToDelete); - childToDelete = childToDelete.sibling; - } - return null; +function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + var ref = { current: initialValue }; + { + Object.seal(ref); } + hook.memoizedState = ref; + return ref; +} - function mapRemainingChildren(returnFiber, currentFirstChild) { - // Add the remaining children to a temporary map so that we can find them by - // keys quickly. Implicit (null) keys get added to this set with their index - var existingChildren = new Map(); +function updateRef(initialValue) { + var hook = updateWorkInProgressHook(); + return hook.memoizedState; +} - var existingChild = currentFirstChild; - while (existingChild !== null) { - if (existingChild.key !== null) { - existingChildren.set(existingChild.key, existingChild); - } else { - existingChildren.set(existingChild.index, existingChild); - } - existingChild = existingChild.sibling; - } - return existingChildren; - } +function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + sideEffectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps); +} - function useFiber(fiber, pendingProps, expirationTime) { - // We currently set sibling to null and index to 0 here because it is easy - // to forget to do before returning it. E.g. for the single child case. - var clone = createWorkInProgress(fiber, pendingProps, expirationTime); - clone.index = 0; - clone.sibling = null; - return clone; - } +function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var destroy = undefined; - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) { - // Noop. - return lastPlacedIndex; - } - var current$$1 = newFiber.alternate; - if (current$$1 !== null) { - var oldIndex = current$$1.index; - if (oldIndex < lastPlacedIndex) { - // This is a move. - newFiber.effectTag = Placement; - return lastPlacedIndex; - } else { - // This item can stay in place. - return oldIndex; + if (currentHook !== null) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + if (nextDeps !== null) { + var prevDeps = prevEffect.deps; + if (areHookInputsEqual(nextDeps, prevDeps)) { + pushEffect(NoEffect$1, create, destroy, nextDeps); + return; } - } else { - // This is an insertion. - newFiber.effectTag = Placement; - return lastPlacedIndex; } } - function placeSingleChild(newFiber) { - // This is simpler for the single child case. We only need to do a - // placement for inserting new children. - if (shouldTrackSideEffects && newFiber.alternate === null) { - newFiber.effectTag = Placement; - } - return newFiber; - } + sideEffectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps); +} - function updateTextNode(returnFiber, current$$1, textContent, expirationTime) { - if (current$$1 === null || current$$1.tag !== HostText) { - // Insert - var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, textContent, expirationTime); - existing.return = returnFiber; - return existing; - } - } +function mountEffect(create, deps) { + return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps); +} - function updateElement(returnFiber, current$$1, element, expirationTime) { - if (current$$1 !== null && current$$1.elementType === element.type) { - // Move based on index - var existing = useFiber(current$$1, element.props, expirationTime); - existing.ref = coerceRef(returnFiber, current$$1, element); - existing.return = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - // Insert - var created = createFiberFromElement(element, returnFiber.mode, expirationTime); - created.ref = coerceRef(returnFiber, current$$1, element); - created.return = returnFiber; - return created; +function updateEffect(create, deps) { + return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps); +} + +function mountLayoutEffect(create, deps) { + return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps); +} + +function updateLayoutEffect(create, deps) { + return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps); +} + +function imperativeHandleEffect(create, ref) { + if (typeof ref === 'function') { + var refCallback = ref; + var _inst = create(); + refCallback(_inst); + return function () { + refCallback(null); + }; + } else if (ref !== null && ref !== undefined) { + var refObject = ref; + { + !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0; } + var _inst2 = create(); + refObject.current = _inst2; + return function () { + refObject.current = null; + }; } +} - function updatePortal(returnFiber, current$$1, portal, expirationTime) { - if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) { - // Insert - var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, portal.children || [], expirationTime); - existing.return = returnFiber; - return existing; - } +function mountImperativeHandle(ref, create, deps) { + { + !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0; } - function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) { - if (current$$1 === null || current$$1.tag !== Fragment) { - // Insert - var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); - created.return = returnFiber; - return created; - } else { - // Update - var existing = useFiber(current$$1, fragment, expirationTime); - existing.return = returnFiber; - return existing; - } + // TODO: If deps are provided, should we skip comparing the ref itself? + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + + return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} + +function updateImperativeHandle(ref, create, deps) { + { + !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0; } - function createChild(returnFiber, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; - } + // TODO: If deps are provided, should we skip comparing the ref itself? + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); - _created.ref = coerceRef(returnFiber, null, newChild); - _created.return = returnFiber; - return _created; - } - case REACT_PORTAL_TYPE: - { - var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); - _created2.return = returnFiber; - return _created2; - } - } + return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} - if (isArray(newChild) || getIteratorFn(newChild)) { - var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); - _created3.return = returnFiber; - return _created3; - } +function mountDebugValue(value, formatterFn) { + // This hook is normally a no-op. + // The react-debug-hooks package injects its own implementation + // so that e.g. DevTools can display custom hook values. +} - throwOnInvalidObjectType(returnFiber, newChild); - } +var updateDebugValue = mountDebugValue; - { - if (typeof newChild === 'function') { - warnOnFunctionType(); +function mountCallback(callback, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + hook.memoizedState = [callback, nextDeps]; + return callback; +} + +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; } } - - return null; } + hook.memoizedState = [callback, nextDeps]; + return callback; +} - function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { - // Update the fiber if the keys match, otherwise return null. - - var key = oldFiber !== null ? oldFiber.key : null; +function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a text - // node. - if (key !== null) { - return null; +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + if (prevState !== null) { + // Assume these are defined. If they're not, areHookInputsEqual will warn. + if (nextDeps !== null) { + var prevDeps = prevState[1]; + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; } - return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); } + } + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - if (newChild.key === key) { - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); - } - return updateElement(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - case REACT_PORTAL_TYPE: - { - if (newChild.key === key) { - return updatePortal(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - } +// in a test-like environment, we want to warn if dispatchAction() +// is called outside of a batchedUpdates/TestUtils.act(...) call. +var shouldWarnForUnbatchedSetState = false; - if (isArray(newChild) || getIteratorFn(newChild)) { - if (key !== null) { - return null; - } +{ + // jest isn't a 'global', it's just exposed to tests via a wrapped function + // further, this isn't a test file, so flow doesn't recognize the symbol. So... + // $FlowExpectedError - because requirements don't give a damn about your type sigs. + if ('undefined' !== typeof jest) { + shouldWarnForUnbatchedSetState = true; + } +} - return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); - } +function dispatchAction(fiber, 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; - throwOnInvalidObjectType(returnFiber, newChild); - } + { + !(arguments.length <= 3) ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0; + } - { - if (typeof newChild === 'function') { - warnOnFunctionType(); + var alternate = fiber.alternate; + if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) { + // 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 = { + expirationTime: renderExpirationTime, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }; + if (renderPhaseUpdates === null) { + renderPhaseUpdates = new Map(); + } + var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); + if (firstRenderPhaseUpdate === undefined) { + renderPhaseUpdates.set(queue, update); + } else { + // Append the update to the end of the list. + var lastRenderPhaseUpdate = firstRenderPhaseUpdate; + while (lastRenderPhaseUpdate.next !== null) { + lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; } + lastRenderPhaseUpdate.next = update; } + } else { + flushPassiveEffects(); - return null; - } + var currentTime = requestCurrentTime(); + var _expirationTime = computeExpirationForFiber(currentTime, fiber); - function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { - if (typeof newChild === 'string' || typeof newChild === 'number') { - // Text nodes don't have keys, so we neither have to check the old nor - // new node for the key. If both are text nodes, they match. - var matchedFiber = existingChildren.get(newIdx) || null; - return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); + var _update2 = { + expirationTime: _expirationTime, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }; + + // Append the update to the end of the list. + var _last = queue.last; + if (_last === null) { + // This is the first update. Create a circular list. + _update2.next = _update2; + } else { + var first = _last.next; + if (first !== null) { + // Still circular. + _update2.next = first; + } + _last.next = _update2; } + queue.last = _update2; - if (typeof newChild === 'object' && newChild !== null) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - { - var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); - } - return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); + if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) { + // The queue is currently empty, which means we can eagerly compute the + // next state before entering the render phase. If the new state is the + // same as the current state, we may be able to bail out entirely. + var _lastRenderedReducer = queue.lastRenderedReducer; + if (_lastRenderedReducer !== null) { + var prevDispatcher = void 0; + { + prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + } + try { + var currentState = queue.lastRenderedState; + var _eagerState = _lastRenderedReducer(currentState, action); + // Stash the eagerly computed state, and the reducer used to compute + // it, on the update object. If the reducer hasn't changed by the + // time we enter the render phase, then the eager state can be used + // without calling the reducer again. + _update2.eagerReducer = _lastRenderedReducer; + _update2.eagerState = _eagerState; + if (is(_eagerState, currentState)) { + // Fast path. We can bail out without scheduling React to re-render. + // It's still possible that we'll need to rebase this update later, + // if the component re-renders for a different reason and by that + // time the reducer has changed. + return; } - case REACT_PORTAL_TYPE: + } catch (error) { + // Suppress the error. It will throw again in the render phase. + } finally { { - var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); + ReactCurrentDispatcher$1.current = prevDispatcher; } + } } - - if (isArray(newChild) || getIteratorFn(newChild)) { - var _matchedFiber3 = existingChildren.get(newIdx) || null; - return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); - } - - throwOnInvalidObjectType(returnFiber, newChild); } - { - if (typeof newChild === 'function') { - warnOnFunctionType(); + if (shouldWarnForUnbatchedSetState === true) { + warnIfNotCurrentlyBatchingInDev(fiber); } } - - return null; + scheduleWork(fiber, _expirationTime); } +} - /** - * Warns if there is a duplicate or missing key - */ - function warnOnInvalidKey(child, knownKeys) { - { - if (typeof child !== 'object' || child === null) { - return knownKeys; - } - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(child); - var key = child.key; - if (typeof key !== 'string') { - break; - } - if (knownKeys === null) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); - break; - default: - break; - } - } - return knownKeys; - } +var ContextOnlyDispatcher = { + readContext: readContext, - function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { - // This algorithm can't optimize by searching from boths ends since we - // don't have backpointers on fibers. I'm trying to see how far we can get - // with that model. If it ends up not being worth the tradeoffs, we can - // add it later. + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError +}; - // Even with a two ended optimization, we'd want to optimize for the case - // where there are few changes and brute force the comparison instead of - // going for the Map. It'd like to explore hitting that path first in - // forward-only mode and only go for the Map once we notice that we need - // lots of look ahead. This doesn't handle reversal as well as two ended - // search but that's unusual. Besides, for the two ended optimization to - // work on Iterables, we'd need to copy the whole set. +var HooksDispatcherOnMountInDEV = null; +var HooksDispatcherOnMountWithHookTypesInDEV = null; +var HooksDispatcherOnUpdateInDEV = null; +var InvalidNestedHooksDispatcherOnMountInDEV = null; +var InvalidNestedHooksDispatcherOnUpdateInDEV = null; - // In this first iteration, we'll just live with hitting the bad case - // (adding everything to a Map) in for every insert/move. +{ + var warnInvalidContextAccess = function () { + 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().'); + }; - // If you change this code, also update reconcileChildrenIterator() which - // uses the same algorithm. + var warnInvalidHookAccess = function () { + 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'); + }; - { - // First, validate keys. - var knownKeys = null; - for (var i = 0; i < newChildren.length; i++) { - var child = newChildren[i]; - knownKeys = warnOnInvalidKey(child, knownKeys); + HooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + mountHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - var resultingFirstChild = null; - var previousNewFiber = null; - - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; - for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (oldFiber === null) { - oldFiber = nextOldFiber; - } - break; + HooksDispatcherOnMountWithHookTypesInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - - if (newIdx === newChildren.length) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); - if (!_newFiber) { - continue; - } - lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber; - } else { - previousNewFiber.sibling = _newFiber; - } - previousNewFiber = _newFiber; + HooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } - return resultingFirstChild; + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return updateRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return updateDebugValue(value, formatterFn); } + }; - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; newIdx < newChildren.length; newIdx++) { - var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); - if (_newFiber2) { - if (shouldTrackSideEffects) { - if (_newFiber2.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); - } - } - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber2; - } else { - previousNewFiber.sibling = _newFiber2; - } - previousNewFiber = _newFiber2; + InvalidNestedHooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDebugValue(value, formatterFn); } + }; - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); + InvalidNestedHooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher$1.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(value, formatterFn); } + }; +} - return resultingFirstChild; +var commitTime = 0; +var profilerStartTime = -1; + +function getCommitTime() { + return commitTime; +} + +function recordCommitTime() { + if (!enableProfilerTimer) { + return; } + commitTime = unstable_now(); +} - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { - // This is the same implementation as reconcileChildrenArray(), - // but using the iterator instead. +function startProfilerTimer(fiber) { + if (!enableProfilerTimer) { + return; + } - var iteratorFn = getIteratorFn(newChildrenIterable); - !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0; + profilerStartTime = unstable_now(); - { - // We don't support rendering Generators because it's a mutation. - // See https://github.com/facebook/react/issues/12995 - if (typeof Symbol === 'function' && - // $FlowFixMe Flow doesn't know about toStringTag - newChildrenIterable[Symbol.toStringTag] === 'Generator') { - !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0; - didWarnAboutGenerators = true; - } + if (fiber.actualStartTime < 0) { + fiber.actualStartTime = unstable_now(); + } +} - // Warn about using Maps as children - if (newChildrenIterable.entries === iteratorFn) { - !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; - } +function stopProfilerTimerIfRunning(fiber) { + if (!enableProfilerTimer) { + return; + } + profilerStartTime = -1; +} - // First, validate keys. - // We'll get a different iterator later for the main pass. - var _newChildren = iteratorFn.call(newChildrenIterable); - if (_newChildren) { - var knownKeys = null; - var _step = _newChildren.next(); - for (; !_step.done; _step = _newChildren.next()) { - var child = _step.value; - knownKeys = warnOnInvalidKey(child, knownKeys); - } - } +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (!enableProfilerTimer) { + return; + } + + if (profilerStartTime >= 0) { + var elapsedTime = unstable_now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + if (overrideBaseTime) { + fiber.selfBaseDuration = elapsedTime; } + profilerStartTime = -1; + } +} - var newChildren = iteratorFn.call(newChildrenIterable); - !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0; +// The deepest Fiber on the stack involved in a hydration context. +// This may have been an insertion or a hydration. +var hydrationParentFiber = null; +var nextHydratableInstance = null; +var isHydrating = false; - var resultingFirstChild = null; - var previousNewFiber = null; +function enterHydrationState(fiber) { + if (!supportsHydration) { + return false; + } - var oldFiber = currentFirstChild; - var lastPlacedIndex = 0; - var newIdx = 0; - var nextOldFiber = null; + var parentInstance = fiber.stateNode.containerInfo; + nextHydratableInstance = getFirstHydratableChild(parentInstance); + hydrationParentFiber = fiber; + isHydrating = true; + return true; +} - var step = newChildren.next(); - for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { - if (oldFiber.index > newIdx) { - nextOldFiber = oldFiber; - oldFiber = null; - } else { - nextOldFiber = oldFiber.sibling; - } - var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); - if (newFiber === null) { - // TODO: This breaks on empty slots like null children. That's - // unfortunate because it triggers the slow path all the time. We need - // a better way to communicate whether this was a miss or null, - // boolean, undefined, etc. - if (!oldFiber) { - oldFiber = nextOldFiber; - } +function reenterHydrationStateFromDehydratedSuspenseInstance(fiber) { + if (!supportsHydration) { + return false; + } + + var suspenseInstance = fiber.stateNode; + nextHydratableInstance = getNextHydratableSibling(suspenseInstance); + popToNextHostParent(fiber); + isHydrating = true; + return true; +} + +function deleteHydratableInstance(returnFiber, instance) { + { + switch (returnFiber.tag) { + case HostRoot: + didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); + break; + case HostComponent: + didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); break; - } - if (shouldTrackSideEffects) { - if (oldFiber && newFiber.alternate === null) { - // We matched the slot, but we didn't reuse the existing fiber, so we - // need to delete the existing child. - deleteChild(returnFiber, oldFiber); - } - } - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = newFiber; - } else { - // TODO: Defer siblings if we're not at the right index for this slot. - // I.e. if we had null values before, then we want to defer this - // for each null value. However, we also don't want to call updateSlot - // with the previous one. - previousNewFiber.sibling = newFiber; - } - previousNewFiber = newFiber; - oldFiber = nextOldFiber; } + } - if (step.done) { - // We've reached the end of the new children. We can delete the rest. - deleteRemainingChildren(returnFiber, oldFiber); - return resultingFirstChild; - } + var childToDelete = createFiberFromHostInstanceForDeletion(); + childToDelete.stateNode = instance; + childToDelete.return = returnFiber; + childToDelete.effectTag = Deletion; - if (oldFiber === null) { - // If we don't have any more existing children we can choose a fast path - // since the rest will all be insertions. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber3 = createChild(returnFiber, step.value, expirationTime); - if (_newFiber3 === null) { - continue; + // This might seem like it belongs on progressedFirstDeletion. However, + // these children are not part of the reconciliation list of children. + // Even if we abort and rereconcile the children, that will try to hydrate + // again and the nodes are still in the host tree so these will be + // recreated. + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } +} + +function insertNonHydratedInstance(returnFiber, fiber) { + fiber.effectTag |= Placement; + { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + switch (fiber.tag) { + case HostComponent: + var type = fiber.type; + var props = fiber.pendingProps; + didNotFindHydratableContainerInstance(parentContainer, type, props); + break; + case HostText: + var text = fiber.pendingProps; + didNotFindHydratableContainerTextInstance(parentContainer, text); + break; + case SuspenseComponent: + + break; + } + break; } - lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - // TODO: Move out of the loop. This only happens for the first run. - resultingFirstChild = _newFiber3; - } else { - previousNewFiber.sibling = _newFiber3; + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + switch (fiber.tag) { + case HostComponent: + var _type = fiber.type; + var _props = fiber.pendingProps; + didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props); + break; + case HostText: + var _text = fiber.pendingProps; + didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); + break; + case SuspenseComponent: + didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance); + break; + } + break; } - previousNewFiber = _newFiber3; - } - return resultingFirstChild; + default: + return; } + } +} - // Add all children to a key map for quick lookups. - var existingChildren = mapRemainingChildren(returnFiber, oldFiber); - - // Keep scanning and use the map to restore deleted items as moves. - for (; !step.done; newIdx++, step = newChildren.next()) { - var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); - if (_newFiber4 !== null) { - if (shouldTrackSideEffects) { - if (_newFiber4.alternate !== null) { - // The new fiber is a work in progress, but if there exists a - // current, that means that we reused the fiber. We need to delete - // it from the child list so that we don't add it to the deletion - // list. - existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); - } +function tryHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent: + { + var type = fiber.type; + var props = fiber.pendingProps; + var instance = canHydrateInstance(nextInstance, type, props); + if (instance !== null) { + fiber.stateNode = instance; + return true; } - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); - if (previousNewFiber === null) { - resultingFirstChild = _newFiber4; - } else { - previousNewFiber.sibling = _newFiber4; + return false; + } + case HostText: + { + var text = fiber.pendingProps; + var textInstance = canHydrateTextInstance(nextInstance, text); + if (textInstance !== null) { + fiber.stateNode = textInstance; + return true; } - previousNewFiber = _newFiber4; + return false; } - } + case SuspenseComponent: + { + if (enableSuspenseServerRenderer) { + var suspenseInstance = canHydrateSuspenseInstance(nextInstance); + if (suspenseInstance !== null) { + // Downgrade the tag to a dehydrated component until we've hydrated it. + fiber.tag = DehydratedSuspenseComponent; + fiber.stateNode = suspenseInstance; + return true; + } + } + return false; + } + default: + return false; + } +} - if (shouldTrackSideEffects) { - // Any existing children that weren't consumed above were deleted. We need - // to add them to the deletion list. - existingChildren.forEach(function (child) { - return deleteChild(returnFiber, child); - }); +function tryToClaimNextHydratableInstance(fiber) { + if (!isHydrating) { + return; + } + var nextInstance = nextHydratableInstance; + if (!nextInstance) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; + } + var firstAttemptedInstance = nextInstance; + if (!tryHydrate(fiber, nextInstance)) { + // If we can't hydrate this instance let's try the next one. + // We use this as a heuristic. It's based on intuition and not data so it + // might be flawed or unnecessary. + nextInstance = getNextHydratableSibling(firstAttemptedInstance); + if (!nextInstance || !tryHydrate(fiber, nextInstance)) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; } + // We matched the next one, we'll now assume that the first one was + // superfluous and we'll delete it. Since we can't eagerly delete it + // we'll have to schedule a deletion. To do that, this node needs a dummy + // fiber associated with it. + deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance); + } + hydrationParentFiber = fiber; + nextHydratableInstance = getFirstHydratableChild(nextInstance); +} - return resultingFirstChild; +function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { + if (!supportsHydration) { + invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); } - function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { - // There's no need to check for keys on text nodes since we don't have a - // way to define them. - if (currentFirstChild !== null && currentFirstChild.tag === HostText) { - // We already have an existing node so let's just update it and delete - // the rest. - deleteRemainingChildren(returnFiber, currentFirstChild.sibling); - var existing = useFiber(currentFirstChild, textContent, expirationTime); - existing.return = returnFiber; - return existing; - } - // The existing first child is not a text node so we need to create one - // and delete the existing ones. - deleteRemainingChildren(returnFiber, currentFirstChild); - var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; + var instance = fiber.stateNode; + var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); + // TODO: Type this specific to this type of component. + fiber.updateQueue = updatePayload; + // If the update payload indicates that there is a change or if there + // is a new ref we mark this as an update. + if (updatePayload !== null) { + return true; } + return false; +} - function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { - var key = element.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); - existing.ref = coerceRef(returnFiber, child, element); - existing.return = returnFiber; - { - existing._debugSource = element._source; - existing._debugOwner = element._owner; - } - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; +function prepareToHydrateHostTextInstance(fiber) { + if (!supportsHydration) { + invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); + } + + var textInstance = fiber.stateNode; + var textContent = fiber.memoizedProps; + var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); + { + if (shouldUpdate) { + // We assume that prepareToHydrateHostTextInstance is called in a context where the + // hydration parent is the parent host component of this host text. + var returnFiber = hydrationParentFiber; + if (returnFiber !== null) { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); + break; + } + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); + break; + } } - } else { - deleteChild(returnFiber, child); } - child = child.sibling; } + } + return shouldUpdate; +} - if (element.type === REACT_FRAGMENT_TYPE) { - var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); - created.return = returnFiber; - return created; - } else { - var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); - _created4.ref = coerceRef(returnFiber, currentFirstChild, element); - _created4.return = returnFiber; - return _created4; - } +function skipPastDehydratedSuspenseInstance(fiber) { + if (!supportsHydration) { + invariant(false, 'Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); } + var suspenseInstance = fiber.stateNode; + !suspenseInstance ? invariant(false, 'Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.') : void 0; + nextHydratableInstance = getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); +} - function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { - var key = portal.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, portal.children || [], expirationTime); - existing.return = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); - created.return = returnFiber; - return created; +function popToNextHostParent(fiber) { + var parent = fiber.return; + while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== DehydratedSuspenseComponent) { + parent = parent.return; } + hydrationParentFiber = parent; +} - // This API will tag the children with the side-effect of the reconciliation - // itself. They will be added to the side-effect list as we pass through the - // children and the parent. - function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { - // This function is not recursive. - // If the top level item is an array, we treat it as a set of children, - // not as a fragment. Nested arrays on the other hand will be treated as - // fragment nodes. Recursion happens at the normal flow. - - // Handle top level unkeyed fragments as if they were arrays. - // This leads to an ambiguity between <>{[...]} and <>.... - // We treat the ambiguous cases above the same. - var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; - if (isUnkeyedTopLevelFragment) { - newChild = newChild.props.children; - } +function popHydrationState(fiber) { + if (!supportsHydration) { + return false; + } + if (fiber !== hydrationParentFiber) { + // We're deeper than the current hydration context, inside an inserted + // tree. + return false; + } + if (!isHydrating) { + // If we're not currently hydrating but we're in a hydration context, then + // we were an insertion and now need to pop up reenter hydration of our + // siblings. + popToNextHostParent(fiber); + isHydrating = true; + return false; + } - // Handle object types - var isObject = typeof newChild === 'object' && newChild !== null; + var type = fiber.type; - if (isObject) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); - case REACT_PORTAL_TYPE: - return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); - } + // If we have any remaining hydratable nodes, we need to delete them now. + // We only do this deeper than head and body since they tend to have random + // other nodes in them. We also ignore components with pure text content in + // side of them. + // TODO: Better heuristic. + if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { + var nextInstance = nextHydratableInstance; + while (nextInstance) { + deleteHydratableInstance(fiber, nextInstance); + nextInstance = getNextHydratableSibling(nextInstance); } + } - if (typeof newChild === 'string' || typeof newChild === 'number') { - return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); - } + popToNextHostParent(fiber); + nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; + return true; +} - if (isArray(newChild)) { - return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); - } +function resetHydrationState() { + if (!supportsHydration) { + return; + } - if (getIteratorFn(newChild)) { - return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); - } + hydrationParentFiber = null; + nextHydratableInstance = null; + isHydrating = false; +} - if (isObject) { - throwOnInvalidObjectType(returnFiber, newChild); - } +var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; - { - if (typeof newChild === 'function') { - warnOnFunctionType(); - } - } - if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) { - // If the new child is undefined, and the return fiber is a composite - // component, throw an error. If Fiber return types are disabled, - // we already threw above. - switch (returnFiber.tag) { - case ClassComponent: - { - { - var instance = returnFiber.stateNode; - if (instance.render._isMockFunction) { - // We allow auto-mocks to proceed as if they're returning null. - break; - } - } - } - // Intentionally fall through to the next case, which handles both - // functions and classes - // eslint-disable-next-lined no-fallthrough - case FunctionComponent: - { - var Component = returnFiber.type; - invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component'); - } - } - } +var didReceiveUpdate = false; - // Remaining cases are all treated as empty. - return deleteRemainingChildren(returnFiber, currentFirstChild); - } +var didWarnAboutBadClass = void 0; +var didWarnAboutContextTypeOnFunctionComponent = void 0; +var didWarnAboutGetDerivedStateOnFunctionComponent = void 0; +var didWarnAboutFunctionRefs = void 0; +var didWarnAboutReassigningProps = void 0; - return reconcileChildFibers; +{ + didWarnAboutBadClass = {}; + didWarnAboutContextTypeOnFunctionComponent = {}; + didWarnAboutGetDerivedStateOnFunctionComponent = {}; + didWarnAboutFunctionRefs = {}; + didWarnAboutReassigningProps = false; } -var reconcileChildFibers = ChildReconciler(true); -var mountChildFibers = ChildReconciler(false); - -function cloneChildFibers(current$$1, workInProgress) { - !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0; +function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) { + if (current$$1 === null) { + // If this is a fresh new component that hasn't been rendered yet, we + // won't update its child set by applying minimal side-effects. Instead, + // we will add them all to the child before it gets rendered. That means + // we can optimize this reconciliation pass by not tracking side-effects. + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + // If the current child is the same as the work in progress, it means that + // we haven't yet started any work on these children. Therefore, we use + // the clone algorithm to create a copy of all the current children. - if (workInProgress.child === null) { - return; + // If we had any progressed work already, that is invalid at this point so + // let's throw it out. + workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime); } +} - var currentChild = workInProgress.child; - var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - workInProgress.child = newChild; - - newChild.return = workInProgress; - while (currentChild.sibling !== null) { - currentChild = currentChild.sibling; - newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime); - newChild.return = workInProgress; - } - newChild.sibling = null; +function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) { + // This function is fork of reconcileChildren. It's used in cases where we + // want to reconcile without matching against the existing set. This has the + // effect of all current children being unmounted; even if the type and key + // are the same, the old child is unmounted and a new child is created. + // + // To do this, we're going to go through the reconcile algorithm twice. In + // the first pass, we schedule a deletion for all the current children by + // passing null. + workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); + // In the second pass, we mount the new children. The trick here is that we + // pass null in place of where we usually pass the current child set. This has + // the effect of remounting all children regardless of whether their their + // identity matches. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); } -// The deepest Fiber on the stack involved in a hydration context. -// This may have been an insertion or a hydration. -var hydrationParentFiber = null; -var nextHydratableInstance = null; -var isHydrating = false; +function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens after the first render suspends. + // We'll need to figure out if this is fine or can cause issues. -function enterHydrationState(fiber) { - if (!supportsHydration) { - return false; + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes_1(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var parentInstance = fiber.stateNode.containerInfo; - nextHydratableInstance = getFirstHydratableChild(parentInstance); - hydrationParentFiber = fiber; - isHydrating = true; - return true; -} + var render = Component.render; + var ref = workInProgress.ref; -function deleteHydratableInstance(returnFiber, instance) { + // The rest is a fork of updateFunctionComponent + var nextChildren = void 0; + prepareToReadContext(workInProgress, renderExpirationTime); { - switch (returnFiber.tag) { - case HostRoot: - didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); - break; - case HostComponent: - didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); - break; + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime); + } } + setCurrentPhase(null); } - var childToDelete = createFiberFromHostInstanceForDeletion(); - childToDelete.stateNode = instance; - childToDelete.return = returnFiber; - childToDelete.effectTag = Deletion; - - // This might seem like it belongs on progressedFirstDeletion. However, - // these children are not part of the reconciliation list of children. - // Even if we abort and rereconcile the children, that will try to hydrate - // again and the nodes are still in the host tree so these will be - // recreated. - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = childToDelete; - returnFiber.lastEffect = childToDelete; - } else { - returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + if (current$$1 !== null && !didReceiveUpdate) { + bailoutHooks(current$$1, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; } -function insertNonHydratedInstance(returnFiber, fiber) { - fiber.effectTag |= Placement; +function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + if (current$$1 === null) { + var type = Component.type; + if (isSimpleFunctionComponent(type) && Component.compare === null && + // SimpleMemoComponent codepath doesn't resolve outer props either. + Component.defaultProps === undefined) { + // If this is a plain function component without default props, + // and with only the default shallow comparison, we upgrade it + // to a SimpleMemoComponent to allow fast path updates. + workInProgress.tag = SimpleMemoComponent; + workInProgress.type = type; + { + validateFunctionComponentInDev(workInProgress, type); + } + return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime); + } + { + var innerPropTypes = type.propTypes; + if (innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes_1(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(type), getCurrentFiberStackInDev); + } + } + var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime); + child.ref = workInProgress.ref; + child.return = workInProgress; + workInProgress.child = child; + return child; + } { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - switch (fiber.tag) { - case HostComponent: - var type = fiber.type; - var props = fiber.pendingProps; - didNotFindHydratableContainerInstance(parentContainer, type, props); - break; - case HostText: - var text = fiber.pendingProps; - didNotFindHydratableContainerTextInstance(parentContainer, text); - break; - } - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - switch (fiber.tag) { - case HostComponent: - var _type = fiber.type; - var _props = fiber.pendingProps; - didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props); - break; - case HostText: - var _text = fiber.pendingProps; - didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); - break; - } - break; - } - default: - return; + var _type = Component.type; + var _innerPropTypes = _type.propTypes; + if (_innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes_1(_innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(_type), getCurrentFiberStackInDev); + } + } + var currentChild = current$$1.child; // This is always exactly one child + if (updateExpirationTime < renderExpirationTime) { + // This will be the props with resolved defaultProps, + // unlike current.memoizedProps which will be the unresolved ones. + var prevProps = currentChild.memoizedProps; + // Default to shallow comparison + var compare = Component.compare; + compare = compare !== null ? compare : shallowEqual; + if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } } + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime); + newChild.ref = workInProgress.ref; + newChild.return = workInProgress; + workInProgress.child = newChild; + return newChild; } -function tryHydrate(fiber, nextInstance) { - switch (fiber.tag) { - case HostComponent: - { - var type = fiber.type; - var props = fiber.pendingProps; - var instance = canHydrateInstance(nextInstance, type, props); - if (instance !== null) { - fiber.stateNode = instance; - return true; - } - return false; +function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens when the inner render suspends. + // We'll need to figure out if this is fine or can cause issues. + + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var outerMemoType = workInProgress.elementType; + if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { + // We warn when you define propTypes on lazy() + // so let's just skip over it to find memo() outer wrapper. + // Inner props for memo are validated later. + outerMemoType = refineResolvedLazyComponent(outerMemoType); } - case HostText: - { - var text = fiber.pendingProps; - var textInstance = canHydrateTextInstance(nextInstance, text); - if (textInstance !== null) { - fiber.stateNode = textInstance; - return true; - } - return false; + var outerPropTypes = outerMemoType && outerMemoType.propTypes; + if (outerPropTypes) { + checkPropTypes_1(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps) + 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev); } - default: - return false; - } -} - -function tryToClaimNextHydratableInstance(fiber) { - if (!isHydrating) { - return; - } - var nextInstance = nextHydratableInstance; - if (!nextInstance) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; + // Inner propTypes will be validated in the function component path. + } } - var firstAttemptedInstance = nextInstance; - if (!tryHydrate(fiber, nextInstance)) { - // If we can't hydrate this instance let's try the next one. - // We use this as a heuristic. It's based on intuition and not data so it - // might be flawed or unnecessary. - nextInstance = getNextHydratableSibling(firstAttemptedInstance); - if (!nextInstance || !tryHydrate(fiber, nextInstance)) { - // Nothing to hydrate. Make it an insertion. - insertNonHydratedInstance(hydrationParentFiber, fiber); - isHydrating = false; - hydrationParentFiber = fiber; - return; + if (current$$1 !== null) { + var prevProps = current$$1.memoizedProps; + if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { + didReceiveUpdate = false; + if (updateExpirationTime < renderExpirationTime) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } } - // We matched the next one, we'll now assume that the first one was - // superfluous and we'll delete it. Since we can't eagerly delete it - // we'll have to schedule a deletion. To do that, this node needs a dummy - // fiber associated with it. - deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance); } - hydrationParentFiber = fiber; - nextHydratableInstance = getFirstHydratableChild(nextInstance); + return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime); } -function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { - if (!supportsHydration) { - invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); +function updateFragment(current$$1, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateMode(current$$1, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps.children; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateProfiler(current$$1, workInProgress, renderExpirationTime) { + if (enableProfilerTimer) { + workInProgress.effectTag |= Update; } + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} - var instance = fiber.stateNode; - var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); - // TODO: Type this specific to this type of component. - fiber.updateQueue = updatePayload; - // If the update payload indicates that there is a change or if there - // is a new ref we mark this as an update. - if (updatePayload !== null) { - return true; +function markRef(current$$1, workInProgress) { + var ref = workInProgress.ref; + if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) { + // Schedule a Ref effect + workInProgress.effectTag |= Ref; } - return false; } -function prepareToHydrateHostTextInstance(fiber) { - if (!supportsHydration) { - invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.'); +function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes_1(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var textInstance = fiber.stateNode; - var textContent = fiber.memoizedProps; - var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); + var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); + var context = getMaskedContext(workInProgress, unmaskedContext); + + var nextChildren = void 0; + prepareToReadContext(workInProgress, renderExpirationTime); { - if (shouldUpdate) { - // We assume that prepareToHydrateHostTextInstance is called in a context where the - // hydration parent is the parent host component of this host text. - var returnFiber = hydrationParentFiber; - if (returnFiber !== null) { - switch (returnFiber.tag) { - case HostRoot: - { - var parentContainer = returnFiber.stateNode.containerInfo; - didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); - break; - } - case HostComponent: - { - var parentType = returnFiber.type; - var parentProps = returnFiber.memoizedProps; - var parentInstance = returnFiber.stateNode; - didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); - break; - } - } + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime); } } + setCurrentPhase(null); } - return shouldUpdate; -} -function popToNextHostParent(fiber) { - var parent = fiber.return; - while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) { - parent = parent.return; + if (current$$1 !== null && !didReceiveUpdate) { + bailoutHooks(current$$1, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); } - hydrationParentFiber = parent; + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; } -function popHydrationState(fiber) { - if (!supportsHydration) { - return false; - } - if (fiber !== hydrationParentFiber) { - // We're deeper than the current hydration context, inside an inserted - // tree. - return false; - } - if (!isHydrating) { - // If we're not currently hydrating but we're in a hydration context, then - // we were an insertion and now need to pop up reenter hydration of our - // siblings. - popToNextHostParent(fiber); - isHydrating = true; - return false; +function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + if (innerPropTypes) { + checkPropTypes_1(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } } - var type = fiber.type; - - // If we have any remaining hydratable nodes, we need to delete them now. - // We only do this deeper than head and body since they tend to have random - // other nodes in them. We also ignore components with pure text content in - // side of them. - // TODO: Better heuristic. - if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { - var nextInstance = nextHydratableInstance; - while (nextInstance) { - deleteHydratableInstance(fiber, nextInstance); - nextInstance = getNextHydratableSibling(nextInstance); - } - } - - popToNextHostParent(fiber); - nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; - return true; -} - -function resetHydrationState() { - if (!supportsHydration) { - return; - } - - hydrationParentFiber = null; - nextHydratableInstance = null; - isHydrating = false; -} - -var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; - -var didWarnAboutBadClass = void 0; -var didWarnAboutContextTypeOnFunctionComponent = void 0; -var didWarnAboutGetDerivedStateOnFunctionComponent = void 0; -var didWarnAboutFunctionRefs = void 0; - -{ - didWarnAboutBadClass = {}; - didWarnAboutContextTypeOnFunctionComponent = {}; - didWarnAboutGetDerivedStateOnFunctionComponent = {}; - didWarnAboutFunctionRefs = {}; -} - -function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) { - if (current$$1 === null) { - // If this is a fresh new component that hasn't been rendered yet, we - // won't update its child set by applying minimal side-effects. Instead, - // we will add them all to the child before it gets rendered. That means - // we can optimize this reconciliation pass by not tracking side-effects. - workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); - } else { - // If the current child is the same as the work in progress, it means that - // we haven't yet started any work on these children. Therefore, we use - // the clone algorithm to create a copy of all the current children. - - // If we had any progressed work already, that is invalid at this point so - // let's throw it out. - workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime); - } -} - -function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) { - // This function is fork of reconcileChildren. It's used in cases where we - // want to reconcile without matching against the existing set. This has the - // effect of all current children being unmounted; even if the type and key - // are the same, the old child is unmounted and a new child is created. - // - // To do this, we're going to go through the reconcile algorithm twice. In - // the first pass, we schedule a deletion for all the current children by - // passing null. - workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); - // In the second pass, we mount the new children. The trick here is that we - // pass null in place of where we usually pass the current child set. This has - // the effect of remounting all children regardless of whether their their - // identity matches. - workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); -} - -function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { - var render = Component.render; - var ref = workInProgress.ref; - - // The rest is a fork of updateFunctionComponent - var nextChildren = void 0; - prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(current$$1, workInProgress, renderExpirationTime); - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - nextChildren = render(nextProps, ref); - setCurrentPhase(null); - } - nextChildren = finishHooks(render, nextProps, nextChildren, ref); - - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { - if (current$$1 === null) { - var type = Component.type; - if (isSimpleFunctionComponent(type) && Component.compare === null) { - // If this is a plain function component without default props, - // and with only the default shallow comparison, we upgrade it - // to a SimpleMemoComponent to allow fast path updates. - workInProgress.tag = SimpleMemoComponent; - workInProgress.type = type; - return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime); - } - var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime); - child.ref = workInProgress.ref; - child.return = workInProgress; - workInProgress.child = child; - return child; - } - var currentChild = current$$1.child; // This is always exactly one child - if (updateExpirationTime < renderExpirationTime) { - // This will be the props with resolved defaultProps, - // unlike current.memoizedProps which will be the unresolved ones. - var prevProps = currentChild.memoizedProps; - // Default to shallow comparison - var compare = Component.compare; - compare = compare !== null ? compare : shallowEqual; - if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - } - } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime); - newChild.ref = workInProgress.ref; - newChild.return = workInProgress; - workInProgress.child = newChild; - return newChild; -} - -function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { - if (current$$1 !== null && updateExpirationTime < renderExpirationTime) { - var prevProps = current$$1.memoizedProps; - if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - } - } - return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime); -} - -function updateFragment(current$$1, workInProgress, renderExpirationTime) { - var nextChildren = workInProgress.pendingProps; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateMode(current$$1, workInProgress, renderExpirationTime) { - var nextChildren = workInProgress.pendingProps.children; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateProfiler(current$$1, workInProgress, renderExpirationTime) { - if (enableProfilerTimer) { - workInProgress.effectTag |= Update; - } - var nextProps = workInProgress.pendingProps; - var nextChildren = nextProps.children; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function markRef(current$$1, workInProgress) { - var ref = workInProgress.ref; - if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) { - // Schedule a Ref effect - workInProgress.effectTag |= Ref; - } -} - -function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { - var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); - var context = getMaskedContext(workInProgress, unmaskedContext); - - var nextChildren = void 0; - prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(current$$1, workInProgress, renderExpirationTime); - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - nextChildren = Component(nextProps, context); - setCurrentPhase(null); - } - nextChildren = finishHooks(Component, nextProps, nextChildren, context); - - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); - return workInProgress.child; -} - -function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) { // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. @@ -14385,7 +14828,15 @@ function updateClassComponent(current$$1, workInProgress, Component, nextProps, } else { shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime); } - return finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime); + var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime); + { + var inst = workInProgress.stateNode; + if (inst.props !== nextProps) { + !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0; + didWarnAboutReassigningProps = true; + } + } + return nextUnitOfWork; } function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) { @@ -14540,7 +14991,7 @@ function updateHostComponent(current$$1, workInProgress, renderExpirationTime) { // Check the host config to see if the children are offscreen/hidden. if (renderExpirationTime !== Never && workInProgress.mode & ConcurrentMode && shouldDeprioritizeSubtree(type, nextProps)) { // Schedule this fiber to re-render at offscreen priority. Then bailout. - workInProgress.expirationTime = Never; + workInProgress.expirationTime = workInProgress.childExpirationTime = Never; return null; } @@ -14583,6 +15034,9 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat switch (resolvedTag) { case FunctionComponent: { + { + validateFunctionComponentInDev(workInProgress, Component); + } child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime); break; } @@ -14598,16 +15052,31 @@ function mountLazyComponent(_current, workInProgress, elementType, updateExpirat } case MemoComponent: { + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = Component.propTypes; + if (outerPropTypes) { + checkPropTypes_1(outerPropTypes, resolvedProps, // Resolved for outer only + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too updateExpirationTime, renderExpirationTime); break; } default: { + var hint = ''; + { + if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) { + hint = ' Did you wrap a component in React.lazy() more than once?'; + } + } // This message intentionally doesn't mention ForwardRef or MemoComponent // because the fact that it's a separate type of work is an // implementation detail. - invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Promise elements must resolve to a class or function.', Component); + invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Lazy element type must resolve to a class or function.%s', Component, hint); } } return child; @@ -14665,7 +15134,6 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render var context = getMaskedContext(workInProgress, unmaskedContext); prepareToReadContext(workInProgress, renderExpirationTime); - prepareToUseHooks(null, workInProgress, renderExpirationTime); var value = void 0; @@ -14684,7 +15152,7 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render } ReactCurrentOwner$3.current = workInProgress; - value = Component(props, context); + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); } // React DevTools reads this flag. workInProgress.effectTag |= PerformedWork; @@ -14720,49 +15188,60 @@ function mountIndeterminateComponent(_current, workInProgress, Component, render } else { // Proceed under the assumption that this is a function component workInProgress.tag = FunctionComponent; - value = finishHooks(Component, props, value, context); { - if (Component) { - !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0; - } - if (workInProgress.ref !== null) { - var info = ''; - var ownerName = getCurrentFiberOwnerNameInDevOrNull(); - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - - var warningKey = ownerName || workInProgress._debugID || ''; - var debugSource = workInProgress._debugSource; - if (debugSource) { - warningKey = debugSource.fileName + ':' + debugSource.lineNumber; - } - if (!didWarnAboutFunctionRefs[warningKey]) { - didWarnAboutFunctionRefs[warningKey] = true; - warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s', info); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); } } + } + reconcileChildren(null, workInProgress, value, renderExpirationTime); + { + validateFunctionComponentInDev(workInProgress, Component); + } + return workInProgress.child; + } +} - if (typeof Component.getDerivedStateFromProps === 'function') { - var _componentName = getComponentName(Component) || 'Unknown'; +function validateFunctionComponentInDev(workInProgress, Component) { + if (Component) { + !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0; + } + if (workInProgress.ref !== null) { + var info = ''; + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + if (ownerName) { + info += '\n\nCheck the render method of `' + ownerName + '`.'; + } - if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName]) { - warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName); - didWarnAboutGetDerivedStateOnFunctionComponent[_componentName] = true; - } - } + var warningKey = ownerName || workInProgress._debugID || ''; + var debugSource = workInProgress._debugSource; + if (debugSource) { + warningKey = debugSource.fileName + ':' + debugSource.lineNumber; + } + if (!didWarnAboutFunctionRefs[warningKey]) { + didWarnAboutFunctionRefs[warningKey] = true; + warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); + } + } - if (typeof Component.contextType === 'object' && Component.contextType !== null) { - var _componentName2 = getComponentName(Component) || 'Unknown'; + if (typeof Component.getDerivedStateFromProps === 'function') { + var componentName = getComponentName(Component) || 'Unknown'; - if (!didWarnAboutContextTypeOnFunctionComponent[_componentName2]) { - warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName2); - didWarnAboutContextTypeOnFunctionComponent[_componentName2] = true; - } - } + if (!didWarnAboutGetDerivedStateOnFunctionComponent[componentName]) { + warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', componentName); + didWarnAboutGetDerivedStateOnFunctionComponent[componentName] = true; + } + } + + if (typeof Component.contextType === 'object' && Component.contextType !== null) { + var _componentName = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName]) { + warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName); + didWarnAboutContextTypeOnFunctionComponent[_componentName] = true; } - reconcileChildren(null, workInProgress, value, renderExpirationTime); - return workInProgress.child; } } @@ -14821,6 +15300,18 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim // children -- we skip over the primary children entirely. var next = void 0; if (current$$1 === null) { + if (enableSuspenseServerRenderer) { + // If we're currently hydrating, try to hydrate this boundary. + // But only if this has a fallback. + if (nextProps.fallback !== undefined) { + tryToClaimNextHydratableInstance(workInProgress); + // This could've changed the tag if this was a dehydrated suspense component. + if (workInProgress.tag === DehydratedSuspenseComponent) { + return updateDehydratedSuspenseComponent(null, workInProgress, renderExpirationTime); + } + } + } + // This is the initial mount. This branch is pretty simple because there's // no previous state that needs to be preserved. if (nextDidTimeout) { @@ -14906,355 +15397,1229 @@ function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTim // TODO: Would it be better to store the fallback fragment on // the stateNode? - // Continue rendering the children, like we normally do. - child = next = primaryChild; - } - } else { - // The current tree has not already timed out. That means the primary - // children are not wrapped in a fragment fiber. - var _currentPrimaryChild = current$$1.child; - if (nextDidTimeout) { - // Timed out. Wrap the children in a fragment fiber to keep them - // separate from the fallback children. - var _nextFallbackChildren2 = nextProps.fallback; - var _primaryChildFragment2 = createFiberFromFragment( - // It shouldn't matter what the pending props are because we aren't - // going to render this fragment. - null, mode, NoWork, null); - _primaryChildFragment2.child = _currentPrimaryChild; + // Continue rendering the children, like we normally do. + child = next = primaryChild; + } + } else { + // The current tree has not already timed out. That means the primary + // children are not wrapped in a fragment fiber. + var _currentPrimaryChild = current$$1.child; + if (nextDidTimeout) { + // Timed out. Wrap the children in a fragment fiber to keep them + // separate from the fallback children. + var _nextFallbackChildren2 = nextProps.fallback; + var _primaryChildFragment2 = createFiberFromFragment( + // It shouldn't matter what the pending props are because we aren't + // going to render this fragment. + null, mode, NoWork, null); + _primaryChildFragment2.child = _currentPrimaryChild; + + // Even though we're creating a new fiber, there are no new children, + // because we're reusing an already mounted tree. So we don't need to + // schedule a placement. + // primaryChildFragment.effectTag |= Placement; + + if ((workInProgress.mode & ConcurrentMode) === NoContext) { + // Outside of concurrent mode, we commit the effects from the + var _progressedState2 = workInProgress.memoizedState; + var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child; + _primaryChildFragment2.child = _progressedPrimaryChild2; + } + + // Because primaryChildFragment is a new fiber that we're inserting as the + // parent of a new tree, we need to set its treeBaseDuration. + if (enableProfilerTimer && workInProgress.mode & ProfileMode) { + // treeBaseDuration is the sum of all the child tree base durations. + var _treeBaseDuration = 0; + var _hiddenChild = _primaryChildFragment2.child; + while (_hiddenChild !== null) { + _treeBaseDuration += _hiddenChild.treeBaseDuration; + _hiddenChild = _hiddenChild.sibling; + } + _primaryChildFragment2.treeBaseDuration = _treeBaseDuration; + } + + // Create a fragment from the fallback children, too. + var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null); + _fallbackChildFragment2.effectTag |= Placement; + child = _primaryChildFragment2; + _primaryChildFragment2.childExpirationTime = NoWork; + // Skip the primary children, and continue working on the + // fallback children. + next = _fallbackChildFragment2; + child.return = next.return = workInProgress; + } else { + // Still haven't timed out. Continue rendering the children, like we + // normally do. + var _nextPrimaryChildren2 = nextProps.children; + next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime); + } + } + workInProgress.stateNode = current$$1.stateNode; + } + + workInProgress.memoizedState = nextState; + workInProgress.child = child; + return next; +} + +function updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime) { + if (current$$1 === null) { + // During the first pass, we'll bail out and not drill into the children. + // Instead, we'll leave the content in place and try to hydrate it later. + workInProgress.expirationTime = Never; + return null; + } + // We use childExpirationTime to indicate that a child might depend on context, so if + // any context has changed, we need to treat is as if the input might have changed. + var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime; + if (didReceiveUpdate || hasContextChanged$$1) { + // This boundary has changed since the first render. This means that we are now unable to + // hydrate it. We might still be able to hydrate it using an earlier expiration time but + // during this render we can't. Instead, we're going to delete the whole subtree and + // instead inject a new real Suspense boundary to take its place, which may render content + // or fallback. The real Suspense boundary will suspend for a while so we have some time + // to ensure it can produce real content, but all state and pending events will be lost. + + // Detach from the current dehydrated boundary. + current$$1.alternate = null; + workInProgress.alternate = null; + + // Insert a deletion in the effect list. + var returnFiber = workInProgress.return; + !(returnFiber !== null) ? invariant(false, 'Suspense boundaries are never on the root. This is probably a bug in React.') : void 0; + var last = returnFiber.lastEffect; + if (last !== null) { + last.nextEffect = current$$1; + returnFiber.lastEffect = current$$1; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = current$$1; + } + current$$1.nextEffect = null; + current$$1.effectTag = Deletion; + + // Upgrade this work in progress to a real Suspense component. + workInProgress.tag = SuspenseComponent; + workInProgress.stateNode = null; + workInProgress.memoizedState = null; + // This is now an insertion. + workInProgress.effectTag |= Placement; + // Retry as a real Suspense component. + return updateSuspenseComponent(null, workInProgress, renderExpirationTime); + } + if ((workInProgress.effectTag & DidCapture) === NoEffect) { + // This is the first attempt. + reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress); + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + return workInProgress.child; + } else { + // Something suspended. Leave the existing children in place. + // TODO: In non-concurrent mode, should we commit the nodes we have hydrated so far? + workInProgress.child = null; + return null; + } +} + +function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) { + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var nextChildren = workInProgress.pendingProps; + if (current$$1 === null) { + // Portals are special because we don't append the children during mount + // but at commit. Therefore we need to track insertions which the normal + // flow doesn't do during mount. This doesn't happen at the root because + // the root always starts with a "current" with a null child. + // TODO: Consider unifying this with how the root works. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + } + return workInProgress.child; +} + +function updateContextProvider(current$$1, workInProgress, renderExpirationTime) { + var providerType = workInProgress.type; + var context = providerType._context; + + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + + var newValue = newProps.value; + + { + var providerPropTypes = workInProgress.type.propTypes; + + if (providerPropTypes) { + checkPropTypes_1(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); + } + } + + pushProvider(workInProgress, newValue); + + if (oldProps !== null) { + var oldValue = oldProps.value; + var changedBits = calculateChangedBits(context, newValue, oldValue); + if (changedBits === 0) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children && !hasContextChanged()) { + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } + } else { + // The context value changed. Search for matching consumers and schedule + // them to update. + propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + } + } + + var newChildren = newProps.children; + reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +var hasWarnedAboutUsingContextAsConsumer = false; + +function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) { + var context = workInProgress.type; + // The logic below for Context differs depending on PROD or DEV mode. In + // DEV mode, we create a separate object for Context.Consumer that acts + // like a proxy to Context. This proxy object adds unnecessary code in PROD + // so we use the old behaviour (Context.Consumer references Context) to + // reduce size and overhead. The separate object references context via + // a property called "_context", which also gives us the ability to check + // in DEV mode if this property exists or not and warn if it does not. + { + if (context._context === undefined) { + // This may be because it's a Context (rather than a Consumer). + // Or it may be because it's older React where they're the same thing. + // We only want to warn if we're sure it's a new React. + if (context !== context.Consumer) { + if (!hasWarnedAboutUsingContextAsConsumer) { + hasWarnedAboutUsingContextAsConsumer = true; + warning$1(false, 'Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + } + } + } else { + context = context._context; + } + } + var newProps = workInProgress.pendingProps; + var render = newProps.children; + + { + !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0; + } + + prepareToReadContext(workInProgress, renderExpirationTime); + var newValue = readContext(context, newProps.unstable_observedBits); + var newChildren = void 0; + { + ReactCurrentOwner$3.current = workInProgress; + setCurrentPhase('render'); + newChildren = render(newValue); + setCurrentPhase(null); + } + + // React DevTools reads this flag. + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +function markWorkInProgressReceivedUpdate() { + didReceiveUpdate = true; +} + +function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) { + cancelWorkTimer(workInProgress); + + if (current$$1 !== null) { + // Reuse previous context list + workInProgress.contextDependencies = current$$1.contextDependencies; + } + + if (enableProfilerTimer) { + // Don't update "base" render times for bailouts. + stopProfilerTimerIfRunning(workInProgress); + } + + // Check if the children have any pending work. + var childExpirationTime = workInProgress.childExpirationTime; + if (childExpirationTime < renderExpirationTime) { + // The children don't have any work either. We can skip them. + // TODO: Once we add back resuming, we should check if the children are + // a work-in-progress set. If so, we need to transfer their effects. + return null; + } else { + // This fiber doesn't have work, but its subtree does. Clone the child + // fibers and continue. + cloneChildFibers(current$$1, workInProgress); + return workInProgress.child; + } +} + +function beginWork(current$$1, workInProgress, renderExpirationTime) { + var updateExpirationTime = workInProgress.expirationTime; + + if (current$$1 !== null) { + var oldProps = current$$1.memoizedProps; + var newProps = workInProgress.pendingProps; + + if (oldProps !== newProps || hasContextChanged()) { + // If props or context changed, mark the fiber as having performed work. + // This may be unset if the props are determined to be equal later (memo). + didReceiveUpdate = true; + } else if (updateExpirationTime < renderExpirationTime) { + didReceiveUpdate = false; + // This fiber does not have any pending work. Bailout without entering + // the begin phase. There's still some bookkeeping we that needs to be done + // in this optimized path, mostly pushing stuff onto the stack. + switch (workInProgress.tag) { + case HostRoot: + pushHostRootContext(workInProgress); + resetHydrationState(); + break; + case HostComponent: + pushHostContext(workInProgress); + break; + case ClassComponent: + { + var Component = workInProgress.type; + if (isContextProvider(Component)) { + pushContextProvider(workInProgress); + } + break; + } + case HostPortal: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case ContextProvider: + { + var newValue = workInProgress.memoizedProps.value; + pushProvider(workInProgress, newValue); + break; + } + case Profiler: + if (enableProfilerTimer) { + workInProgress.effectTag |= Update; + } + break; + case SuspenseComponent: + { + var state = workInProgress.memoizedState; + var didTimeout = state !== null; + if (didTimeout) { + // If this boundary is currently timed out, we need to decide + // whether to retry the primary children, or to skip over it and + // go straight to the fallback. Check the priority of the primary + var primaryChildFragment = workInProgress.child; + var primaryChildExpirationTime = primaryChildFragment.childExpirationTime; + if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) { + // The primary children have pending work. Use the normal path + // to attempt to render the primary children again. + return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + } else { + // The primary children do not have pending work with sufficient + // priority. Bailout. + var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + if (child !== null) { + // The fallback children have pending work. Skip over the + // primary children and work on the fallback. + return child.sibling; + } else { + return null; + } + } + } + break; + } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + // We know that this component will suspend again because if it has + // been unsuspended it has committed as a regular Suspense component. + // If it needs to be retried, it should have work scheduled on it. + workInProgress.effectTag |= DidCapture; + break; + } + } + } + return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + } + } else { + didReceiveUpdate = false; + } + + // Before entering the begin phase, clear the expiration time. + workInProgress.expirationTime = NoWork; + + switch (workInProgress.tag) { + case IndeterminateComponent: + { + var elementType = workInProgress.elementType; + return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime); + } + case LazyComponent: + { + var _elementType = workInProgress.elementType; + return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime); + } + case FunctionComponent: + { + var _Component = workInProgress.type; + var unresolvedProps = workInProgress.pendingProps; + var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps); + return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime); + } + case ClassComponent: + { + var _Component2 = workInProgress.type; + var _unresolvedProps = workInProgress.pendingProps; + var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps); + return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime); + } + case HostRoot: + return updateHostRoot(current$$1, workInProgress, renderExpirationTime); + case HostComponent: + return updateHostComponent(current$$1, workInProgress, renderExpirationTime); + case HostText: + return updateHostText(current$$1, workInProgress); + case SuspenseComponent: + return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + case HostPortal: + return updatePortalComponent(current$$1, workInProgress, renderExpirationTime); + case ForwardRef: + { + var type = workInProgress.type; + var _unresolvedProps2 = workInProgress.pendingProps; + var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); + return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime); + } + case Fragment: + return updateFragment(current$$1, workInProgress, renderExpirationTime); + case Mode: + return updateMode(current$$1, workInProgress, renderExpirationTime); + case Profiler: + return updateProfiler(current$$1, workInProgress, renderExpirationTime); + case ContextProvider: + return updateContextProvider(current$$1, workInProgress, renderExpirationTime); + case ContextConsumer: + return updateContextConsumer(current$$1, workInProgress, renderExpirationTime); + case MemoComponent: + { + var _type2 = workInProgress.type; + var _unresolvedProps3 = workInProgress.pendingProps; + // Resolve outer props first, then resolve inner props. + var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = _type2.propTypes; + if (outerPropTypes) { + checkPropTypes_1(outerPropTypes, _resolvedProps3, // Resolved for outer only + 'prop', getComponentName(_type2), getCurrentFiberStackInDev); + } + } + } + _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); + return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime); + } + case SimpleMemoComponent: + { + return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime); + } + case IncompleteClassComponent: + { + var _Component3 = workInProgress.type; + var _unresolvedProps4 = workInProgress.pendingProps; + var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4); + return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime); + } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + return updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime); + } + break; + } + } + invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); +} + +var valueCursor = createCursor(null); + +var rendererSigil = void 0; +{ + // Use this to detect multiple renderers using the same context + rendererSigil = {}; +} + +var currentlyRenderingFiber = null; +var lastContextDependency = null; +var lastContextWithAllBitsObserved = null; + +var isDisallowedContextReadInDEV = false; + +function resetContextDependences() { + // This is called right before React yields execution, to ensure `readContext` + // cannot be called outside the render phase. + currentlyRenderingFiber = null; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + { + isDisallowedContextReadInDEV = false; + } +} + +function enterDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = true; + } +} + +function exitDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = false; + } +} + +function pushProvider(providerFiber, nextValue) { + var context = providerFiber.type._context; + + if (isPrimaryRenderer) { + push(valueCursor, context._currentValue, providerFiber); + + context._currentValue = nextValue; + { + !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; + context._currentRenderer = rendererSigil; + } + } else { + push(valueCursor, context._currentValue2, providerFiber); + + context._currentValue2 = nextValue; + { + !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0; + context._currentRenderer2 = rendererSigil; + } + } +} + +function popProvider(providerFiber) { + var currentValue = valueCursor.current; + + pop(valueCursor, providerFiber); + + var context = providerFiber.type._context; + if (isPrimaryRenderer) { + context._currentValue = currentValue; + } else { + context._currentValue2 = currentValue; + } +} + +function calculateChangedBits(context, newValue, oldValue) { + if (is(oldValue, newValue)) { + // No change + return 0; + } else { + var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt; + + { + !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0; + } + return changedBits | 0; + } +} + +function scheduleWorkOnParentPath(parent, renderExpirationTime) { + // Update the child expiration time of all the ancestors, including + // the alternates. + var node = parent; + while (node !== null) { + var alternate = node.alternate; + if (node.childExpirationTime < renderExpirationTime) { + node.childExpirationTime = renderExpirationTime; + if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } + } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } else { + // Neither alternate was updated, which means the rest of the + // ancestor path already has sufficient priority. + break; + } + node = node.return; + } +} + +function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { + var fiber = workInProgress.child; + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber.return = workInProgress; + } + while (fiber !== null) { + var nextFiber = void 0; + + // Visit this fiber. + var list = fiber.contextDependencies; + if (list !== null) { + nextFiber = fiber.child; + + var dependency = list.first; + while (dependency !== null) { + // Check if the context matches. + if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) { + // Match! Schedule an update on this fiber. + + if (fiber.tag === ClassComponent) { + // Schedule a force update on the work-in-progress. + var update = createUpdate(renderExpirationTime); + update.tag = ForceUpdate; + // TODO: Because we don't have a work-in-progress, this will add the + // update to the current fiber, too, which means it will persist even if + // this render is thrown away. Since it's a race condition, not sure it's + // worth fixing. + enqueueUpdate(fiber, update); + } + + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + var alternate = fiber.alternate; + if (alternate !== null && alternate.expirationTime < renderExpirationTime) { + alternate.expirationTime = renderExpirationTime; + } + + scheduleWorkOnParentPath(fiber.return, renderExpirationTime); + + // Mark the expiration time on the list, too. + if (list.expirationTime < renderExpirationTime) { + list.expirationTime = renderExpirationTime; + } + + // Since we already found a match, we can stop traversing the + // dependency list. + break; + } + dependency = dependency.next; + } + } else if (fiber.tag === ContextProvider) { + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedSuspenseComponent) { + // If a dehydrated suspense component is in this subtree, we don't know + // if it will have any context consumers in it. The best we can do is + // mark it as having updates on its children. + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + var _alternate = fiber.alternate; + if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) { + _alternate.expirationTime = renderExpirationTime; + } + // This is intentionally passing this fiber as the parent + // because we want to schedule this fiber as having work + // on its children. We'll use the childExpirationTime on + // this fiber to indicate that a context has changed. + scheduleWorkOnParentPath(fiber, renderExpirationTime); + nextFiber = fiber.sibling; + } else { + // Traverse down. + nextFiber = fiber.child; + } + + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber.return = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + var sibling = nextFiber.sibling; + if (sibling !== null) { + // Set the return pointer of the sibling to the work-in-progress fiber. + sibling.return = nextFiber.return; + nextFiber = sibling; + break; + } + // No more siblings. Traverse up. + nextFiber = nextFiber.return; + } + } + fiber = nextFiber; + } +} + +function prepareToReadContext(workInProgress, renderExpirationTime) { + currentlyRenderingFiber = workInProgress; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + + var currentDependencies = workInProgress.contextDependencies; + if (currentDependencies !== null && currentDependencies.expirationTime >= renderExpirationTime) { + // Context list has a pending update. Mark that this fiber performed work. + markWorkInProgressReceivedUpdate(); + } + + // Reset the work-in-progress list + workInProgress.contextDependencies = null; +} + +function readContext(context, observedBits) { + { + // This warning would fire if you read context inside a Hook like useMemo. + // Unlike the class check below, it's not enforced in production for perf. + !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0; + } + + if (lastContextWithAllBitsObserved === context) { + // Nothing to do. We already observe everything in this context. + } else if (observedBits === false || observedBits === 0) { + // Do not observe any updates. + } else { + var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types. + if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) { + // Observe all updates. + lastContextWithAllBitsObserved = context; + resolvedObservedBits = maxSigned31BitInt; + } else { + resolvedObservedBits = observedBits; + } + + var contextItem = { + context: context, + observedBits: resolvedObservedBits, + next: null + }; + + if (lastContextDependency === null) { + !(currentlyRenderingFiber !== null) ? invariant(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; + + // This is the first dependency for this component. Create a new list. + lastContextDependency = contextItem; + currentlyRenderingFiber.contextDependencies = { + first: contextItem, + expirationTime: NoWork + }; + } else { + // Append a new context item. + lastContextDependency = lastContextDependency.next = contextItem; + } + } + return isPrimaryRenderer ? context._currentValue : context._currentValue2; +} + +// UpdateQueue is a linked list of prioritized updates. +// +// Like fibers, update queues come in pairs: a current queue, which represents +// the visible state of the screen, and a work-in-progress queue, which can be +// mutated and processed asynchronously before it is committed — a form of +// double buffering. If a work-in-progress render is discarded before finishing, +// we create a new work-in-progress by cloning the current queue. +// +// Both queues share a persistent, singly-linked list structure. To schedule an +// update, we append it to the end of both queues. Each queue maintains a +// pointer to first update in the persistent list that hasn't been processed. +// The work-in-progress pointer always has a position equal to or greater than +// the current queue, since we always work on that one. The current queue's +// pointer is only updated during the commit phase, when we swap in the +// work-in-progress. +// +// For example: +// +// Current pointer: A - B - C - D - E - F +// Work-in-progress pointer: D - E - F +// ^ +// The work-in-progress queue has +// processed more updates than current. +// +// The reason we append to both queues is because otherwise we might drop +// updates without ever processing them. For example, if we only add updates to +// the work-in-progress queue, some updates could be lost whenever a work-in +// -progress render restarts by cloning from current. Similarly, if we only add +// updates to the current queue, the updates will be lost whenever an already +// in-progress queue commits and swaps with the current queue. However, by +// adding to both queues, we guarantee that the update will be part of the next +// work-in-progress. (And because the work-in-progress queue becomes the +// current queue once it commits, there's no danger of applying the same +// update twice.) +// +// Prioritization +// -------------- +// +// Updates are not sorted by priority, but by insertion; new updates are always +// appended to the end of the list. +// +// The priority is still important, though. When processing the update queue +// during the render phase, only the updates with sufficient priority are +// included in the result. If we skip an update because it has insufficient +// priority, it remains in the queue to be processed later, during a lower +// priority render. Crucially, all updates subsequent to a skipped update also +// remain in the queue *regardless of their priority*. That means high priority +// updates are sometimes processed twice, at two separate priorities. We also +// keep track of a base state, that represents the state before the first +// update in the queue is applied. +// +// For example: +// +// Given a base state of '', and the following queue of updates +// +// A1 - B2 - C1 - D2 +// +// where the number indicates the priority, and the update is applied to the +// previous state by appending a letter, React will process these updates as +// two separate renders, one per distinct priority level: +// +// First render, at priority 1: +// Base state: '' +// Updates: [A1, C1] +// Result state: 'AC' +// +// Second render, at priority 2: +// Base state: 'A' <- The base state does not include C1, +// because B2 was skipped. +// Updates: [B2, C1, D2] <- C1 was rebased on top of B2 +// Result state: 'ABCD' +// +// Because we process updates in insertion order, and rebase high priority +// updates when preceding updates are skipped, the final result is deterministic +// regardless of priority. Intermediate state may vary according to system +// resources, but the final state is always the same. + +var UpdateState = 0; +var ReplaceState = 1; +var ForceUpdate = 2; +var CaptureUpdate = 3; + +// Global state that is reset at the beginning of calling `processUpdateQueue`. +// It should only be read right after calling `processUpdateQueue`, via +// `checkHasForceUpdateAfterProcessing`. +var hasForceUpdate = false; + +var didWarnUpdateInsideUpdate = void 0; +var currentlyProcessingQueue = void 0; +var resetCurrentlyProcessingQueue = void 0; +{ + didWarnUpdateInsideUpdate = false; + currentlyProcessingQueue = null; + resetCurrentlyProcessingQueue = function () { + currentlyProcessingQueue = null; + }; +} + +function createUpdateQueue(baseState) { + var queue = { + baseState: baseState, + firstUpdate: null, + lastUpdate: null, + firstCapturedUpdate: null, + lastCapturedUpdate: null, + firstEffect: null, + lastEffect: null, + firstCapturedEffect: null, + lastCapturedEffect: null + }; + return queue; +} + +function cloneUpdateQueue(currentQueue) { + var queue = { + baseState: currentQueue.baseState, + firstUpdate: currentQueue.firstUpdate, + lastUpdate: currentQueue.lastUpdate, + + // TODO: With resuming, if we bail out and resuse the child tree, we should + // keep these effects. + firstCapturedUpdate: null, + lastCapturedUpdate: null, + + firstEffect: null, + lastEffect: null, - // Even though we're creating a new fiber, there are no new children, - // because we're reusing an already mounted tree. So we don't need to - // schedule a placement. - // primaryChildFragment.effectTag |= Placement; + firstCapturedEffect: null, + lastCapturedEffect: null + }; + return queue; +} - if ((workInProgress.mode & ConcurrentMode) === NoContext) { - // Outside of concurrent mode, we commit the effects from the - var _progressedState2 = workInProgress.memoizedState; - var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child; - _primaryChildFragment2.child = _progressedPrimaryChild2; - } +function createUpdate(expirationTime) { + return { + expirationTime: expirationTime, - // Because primaryChildFragment is a new fiber that we're inserting as the - // parent of a new tree, we need to set its treeBaseDuration. - if (enableProfilerTimer && workInProgress.mode & ProfileMode) { - // treeBaseDuration is the sum of all the child tree base durations. - var _treeBaseDuration = 0; - var _hiddenChild = _primaryChildFragment2.child; - while (_hiddenChild !== null) { - _treeBaseDuration += _hiddenChild.treeBaseDuration; - _hiddenChild = _hiddenChild.sibling; - } - _primaryChildFragment2.treeBaseDuration = _treeBaseDuration; - } + tag: UpdateState, + payload: null, + callback: null, - // Create a fragment from the fallback children, too. - var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null); - _fallbackChildFragment2.effectTag |= Placement; - child = _primaryChildFragment2; - _primaryChildFragment2.childExpirationTime = NoWork; - // Skip the primary children, and continue working on the - // fallback children. - next = _fallbackChildFragment2; - child.return = next.return = workInProgress; + next: null, + nextEffect: null + }; +} + +function appendUpdateToQueue(queue, update) { + // Append the update to the end of the list. + if (queue.lastUpdate === null) { + // Queue is empty + queue.firstUpdate = queue.lastUpdate = update; + } else { + queue.lastUpdate.next = update; + queue.lastUpdate = update; + } +} + +function enqueueUpdate(fiber, update) { + // Update queues are created lazily. + var alternate = fiber.alternate; + var queue1 = void 0; + var queue2 = void 0; + if (alternate === null) { + // There's only one fiber. + queue1 = fiber.updateQueue; + queue2 = null; + if (queue1 === null) { + queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); + } + } else { + // There are two owners. + queue1 = fiber.updateQueue; + queue2 = alternate.updateQueue; + if (queue1 === null) { + if (queue2 === null) { + // Neither fiber has an update queue. Create new ones. + queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState); + queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState); } else { - // Still haven't timed out. Continue rendering the children, like we - // normally do. - var _nextPrimaryChildren2 = nextProps.children; - next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime); + // Only one fiber has an update queue. Clone to create a new one. + queue1 = fiber.updateQueue = cloneUpdateQueue(queue2); + } + } else { + if (queue2 === null) { + // Only one fiber has an update queue. Clone to create a new one. + queue2 = alternate.updateQueue = cloneUpdateQueue(queue1); + } else { + // Both owners have an update queue. } } } + if (queue2 === null || queue1 === queue2) { + // There's only a single queue. + appendUpdateToQueue(queue1, update); + } else { + // There are two queues. We need to append the update to both queues, + // while accounting for the persistent structure of the list — we don't + // want the same update to be added multiple times. + if (queue1.lastUpdate === null || queue2.lastUpdate === null) { + // One of the queues is not empty. We must add the update to both queues. + appendUpdateToQueue(queue1, update); + appendUpdateToQueue(queue2, update); + } else { + // Both queues are non-empty. The last update is the same in both lists, + // because of structural sharing. So, only append to one of the lists. + appendUpdateToQueue(queue1, update); + // But we still need to update the `lastUpdate` pointer of queue2. + queue2.lastUpdate = update; + } + } - workInProgress.memoizedState = nextState; - workInProgress.child = child; - return next; + { + if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) { + warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); + didWarnUpdateInsideUpdate = true; + } + } } -function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) { - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - var nextChildren = workInProgress.pendingProps; - if (current$$1 === null) { - // Portals are special because we don't append the children during mount - // but at commit. Therefore we need to track insertions which the normal - // flow doesn't do during mount. This doesn't happen at the root because - // the root always starts with a "current" with a null child. - // TODO: Consider unifying this with how the root works. - workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); +function enqueueCapturedUpdate(workInProgress, update) { + // Captured updates go into a separate list, and only on the work-in- + // progress queue. + var workInProgressQueue = workInProgress.updateQueue; + if (workInProgressQueue === null) { + workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState); } else { - reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime); + // TODO: I put this here rather than createWorkInProgress so that we don't + // clone the queue unnecessarily. There's probably a better way to + // structure this. + workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue); + } + + // Append the update to the end of the list. + if (workInProgressQueue.lastCapturedUpdate === null) { + // This is the first render phase update + workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update; + } else { + workInProgressQueue.lastCapturedUpdate.next = update; + workInProgressQueue.lastCapturedUpdate = update; } - return workInProgress.child; } -function updateContextProvider(current$$1, workInProgress, renderExpirationTime) { - var providerType = workInProgress.type; - var context = providerType._context; +function ensureWorkInProgressQueueIsAClone(workInProgress, queue) { + var current = workInProgress.alternate; + if (current !== null) { + // If the work-in-progress queue is equal to the current queue, + // we need to clone it first. + if (queue === current.updateQueue) { + queue = workInProgress.updateQueue = cloneUpdateQueue(queue); + } + } + return queue; +} - var newProps = workInProgress.pendingProps; - var oldProps = workInProgress.memoizedProps; +function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { + switch (update.tag) { + case ReplaceState: + { + var _payload = update.payload; + if (typeof _payload === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + _payload.call(instance, prevState, nextProps); + } + } + var nextState = _payload.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + return nextState; + } + // State object + return _payload; + } + case CaptureUpdate: + { + workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture; + } + // Intentional fallthrough + case UpdateState: + { + var _payload2 = update.payload; + var partialState = void 0; + if (typeof _payload2 === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + _payload2.call(instance, prevState, nextProps); + } + } + partialState = _payload2.call(instance, prevState, nextProps); + { + exitDisallowedContextReadInDEV(); + } + } else { + // Partial state object + partialState = _payload2; + } + if (partialState === null || partialState === undefined) { + // Null and undefined are treated as no-ops. + return prevState; + } + // Merge the partial state and the previous state. + return _assign({}, prevState, partialState); + } + case ForceUpdate: + { + hasForceUpdate = true; + return prevState; + } + } + return prevState; +} - var newValue = newProps.value; +function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) { + hasForceUpdate = false; - { - var providerPropTypes = workInProgress.type.propTypes; + queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue); - if (providerPropTypes) { - checkPropTypes_1(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); - } + { + currentlyProcessingQueue = queue; } - pushProvider(workInProgress, newValue); + // These values may change as we process the queue. + var newBaseState = queue.baseState; + var newFirstUpdate = null; + var newExpirationTime = NoWork; - if (oldProps !== null) { - var oldValue = oldProps.value; - var changedBits = calculateChangedBits(context, newValue, oldValue); - if (changedBits === 0) { - // No change. Bailout early if children are the same. - if (oldProps.children === newProps.children && !hasContextChanged()) { - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); + // Iterate through the list of updates to compute the result. + var update = queue.firstUpdate; + var resultState = newBaseState; + while (update !== null) { + var updateExpirationTime = update.expirationTime; + if (updateExpirationTime < renderExpirationTime) { + // This update does not have sufficient priority. Skip it. + if (newFirstUpdate === null) { + // This is the first skipped update. It will be the first update in + // the new list. + newFirstUpdate = update; + // Since this is the first update that was skipped, the current result + // is the new base state. + newBaseState = resultState; + } + // Since this update will remain in the list, update the remaining + // expiration time. + if (newExpirationTime < updateExpirationTime) { + newExpirationTime = updateExpirationTime; } } else { - // The context value changed. Search for matching consumers and schedule - // them to update. - propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + // This update does have sufficient priority. Process it and compute + // a new result. + resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); + var _callback = update.callback; + if (_callback !== null) { + workInProgress.effectTag |= Callback; + // Set this to null, in case it was mutated during an aborted render. + update.nextEffect = null; + if (queue.lastEffect === null) { + queue.firstEffect = queue.lastEffect = update; + } else { + queue.lastEffect.nextEffect = update; + queue.lastEffect = update; + } + } } + // Continue to the next update. + update = update.next; } - var newChildren = newProps.children; - reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); - return workInProgress.child; -} - -var hasWarnedAboutUsingContextAsConsumer = false; - -function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) { - var context = workInProgress.type; - // The logic below for Context differs depending on PROD or DEV mode. In - // DEV mode, we create a separate object for Context.Consumer that acts - // like a proxy to Context. This proxy object adds unnecessary code in PROD - // so we use the old behaviour (Context.Consumer references Context) to - // reduce size and overhead. The separate object references context via - // a property called "_context", which also gives us the ability to check - // in DEV mode if this property exists or not and warn if it does not. - { - if (context._context === undefined) { - // This may be because it's a Context (rather than a Consumer). - // Or it may be because it's older React where they're the same thing. - // We only want to warn if we're sure it's a new React. - if (context !== context.Consumer) { - if (!hasWarnedAboutUsingContextAsConsumer) { - hasWarnedAboutUsingContextAsConsumer = true; - warning$1(false, 'Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?'); + // Separately, iterate though the list of captured updates. + var newFirstCapturedUpdate = null; + update = queue.firstCapturedUpdate; + while (update !== null) { + var _updateExpirationTime = update.expirationTime; + if (_updateExpirationTime < renderExpirationTime) { + // This update does not have sufficient priority. Skip it. + if (newFirstCapturedUpdate === null) { + // This is the first skipped captured update. It will be the first + // update in the new list. + newFirstCapturedUpdate = update; + // If this is the first update that was skipped, the current result is + // the new base state. + if (newFirstUpdate === null) { + newBaseState = resultState; } } + // Since this update will remain in the list, update the remaining + // expiration time. + if (newExpirationTime < _updateExpirationTime) { + newExpirationTime = _updateExpirationTime; + } } else { - context = context._context; + // This update does have sufficient priority. Process it and compute + // a new result. + resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance); + var _callback2 = update.callback; + if (_callback2 !== null) { + workInProgress.effectTag |= Callback; + // Set this to null, in case it was mutated during an aborted render. + update.nextEffect = null; + if (queue.lastCapturedEffect === null) { + queue.firstCapturedEffect = queue.lastCapturedEffect = update; + } else { + queue.lastCapturedEffect.nextEffect = update; + queue.lastCapturedEffect = update; + } + } } + update = update.next; } - var newProps = workInProgress.pendingProps; - var render = newProps.children; - { - !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0; + if (newFirstUpdate === null) { + queue.lastUpdate = null; } - - prepareToReadContext(workInProgress, renderExpirationTime); - var newValue = readContext(context, newProps.unstable_observedBits); - var newChildren = void 0; - { - ReactCurrentOwner$3.current = workInProgress; - setCurrentPhase('render'); - newChildren = render(newValue); - setCurrentPhase(null); + if (newFirstCapturedUpdate === null) { + queue.lastCapturedUpdate = null; + } else { + workInProgress.effectTag |= Callback; + } + if (newFirstUpdate === null && newFirstCapturedUpdate === null) { + // We processed every update, without skipping. That means the new base + // state is the same as the result state. + newBaseState = resultState; } - // React DevTools reads this flag. - workInProgress.effectTag |= PerformedWork; - reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime); - return workInProgress.child; -} + queue.baseState = newBaseState; + queue.firstUpdate = newFirstUpdate; + queue.firstCapturedUpdate = newFirstCapturedUpdate; -function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) { - cancelWorkTimer(workInProgress); + // Set the remaining expiration time to be whatever is remaining in the queue. + // This should be fine because the only two other things that contribute to + // expiration time are props and context. We're already in the middle of the + // begin phase by the time we start processing the queue, so we've already + // dealt with the props. Context in components that specify + // shouldComponentUpdate is tricky; but we'll have to account for + // that regardless. + workInProgress.expirationTime = newExpirationTime; + workInProgress.memoizedState = resultState; - if (current$$1 !== null) { - // Reuse previous context list - workInProgress.firstContextDependency = current$$1.firstContextDependency; + { + currentlyProcessingQueue = null; } +} - if (enableProfilerTimer) { - // Don't update "base" render times for bailouts. - stopProfilerTimerIfRunning(workInProgress); - } +function callCallback(callback, context) { + !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0; + callback.call(context); +} - // Check if the children have any pending work. - var childExpirationTime = workInProgress.childExpirationTime; - if (childExpirationTime < renderExpirationTime) { - // The children don't have any work either. We can skip them. - // TODO: Once we add back resuming, we should check if the children are - // a work-in-progress set. If so, we need to transfer their effects. - return null; - } else { - // This fiber doesn't have work, but its subtree does. Clone the child - // fibers and continue. - cloneChildFibers(current$$1, workInProgress); - return workInProgress.child; - } +function resetHasForceUpdateBeforeProcessing() { + hasForceUpdate = false; } -function beginWork(current$$1, workInProgress, renderExpirationTime) { - var updateExpirationTime = workInProgress.expirationTime; +function checkHasForceUpdateAfterProcessing() { + return hasForceUpdate; +} - if (current$$1 !== null) { - var oldProps = current$$1.memoizedProps; - var newProps = workInProgress.pendingProps; - if (oldProps === newProps && !hasContextChanged() && updateExpirationTime < renderExpirationTime) { - // This fiber does not have any pending work. Bailout without entering - // the begin phase. There's still some bookkeeping we that needs to be done - // in this optimized path, mostly pushing stuff onto the stack. - switch (workInProgress.tag) { - case HostRoot: - pushHostRootContext(workInProgress); - resetHydrationState(); - break; - case HostComponent: - pushHostContext(workInProgress); - break; - case ClassComponent: - { - var Component = workInProgress.type; - if (isContextProvider(Component)) { - pushContextProvider(workInProgress); - } - break; - } - case HostPortal: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case ContextProvider: - { - var newValue = workInProgress.memoizedProps.value; - pushProvider(workInProgress, newValue); - break; - } - case Profiler: - if (enableProfilerTimer) { - workInProgress.effectTag |= Update; - } - break; - case SuspenseComponent: - { - var state = workInProgress.memoizedState; - var didTimeout = state !== null; - if (didTimeout) { - // If this boundary is currently timed out, we need to decide - // whether to retry the primary children, or to skip over it and - // go straight to the fallback. Check the priority of the primary - var primaryChildFragment = workInProgress.child; - var primaryChildExpirationTime = primaryChildFragment.childExpirationTime; - if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) { - // The primary children have pending work. Use the normal path - // to attempt to render the primary children again. - return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); - } else { - // The primary children do not have pending work with sufficient - // priority. Bailout. - var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); - if (child !== null) { - // The fallback children have pending work. Skip over the - // primary children and work on the fallback. - return child.sibling; - } else { - return null; - } - } - } - break; - } - } - return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime); +function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) { + // If the finished render included captured updates, and there are still + // lower priority updates left over, we need to keep the captured updates + // in the queue so that they are rebased and not dropped once we process the + // queue again at the lower priority. + if (finishedQueue.firstCapturedUpdate !== null) { + // Join the captured update list to the end of the normal list. + if (finishedQueue.lastUpdate !== null) { + finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate; + finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate; } + // Clear the list of captured updates. + finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null; } - // Before entering the begin phase, clear the expiration time. - workInProgress.expirationTime = NoWork; + // Commit the effects + commitUpdateEffects(finishedQueue.firstEffect, instance); + finishedQueue.firstEffect = finishedQueue.lastEffect = null; - switch (workInProgress.tag) { - case IndeterminateComponent: - { - var elementType = workInProgress.elementType; - return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime); - } - case LazyComponent: - { - var _elementType = workInProgress.elementType; - return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime); - } - case FunctionComponent: - { - var _Component = workInProgress.type; - var unresolvedProps = workInProgress.pendingProps; - var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps); - return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime); - } - case ClassComponent: - { - var _Component2 = workInProgress.type; - var _unresolvedProps = workInProgress.pendingProps; - var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps); - return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime); - } - case HostRoot: - return updateHostRoot(current$$1, workInProgress, renderExpirationTime); - case HostComponent: - return updateHostComponent(current$$1, workInProgress, renderExpirationTime); - case HostText: - return updateHostText(current$$1, workInProgress); - case SuspenseComponent: - return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime); - case HostPortal: - return updatePortalComponent(current$$1, workInProgress, renderExpirationTime); - case ForwardRef: - { - var type = workInProgress.type; - var _unresolvedProps2 = workInProgress.pendingProps; - var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); - return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime); - } - case Fragment: - return updateFragment(current$$1, workInProgress, renderExpirationTime); - case Mode: - return updateMode(current$$1, workInProgress, renderExpirationTime); - case Profiler: - return updateProfiler(current$$1, workInProgress, renderExpirationTime); - case ContextProvider: - return updateContextProvider(current$$1, workInProgress, renderExpirationTime); - case ContextConsumer: - return updateContextConsumer(current$$1, workInProgress, renderExpirationTime); - case MemoComponent: - { - var _type = workInProgress.type; - var _unresolvedProps3 = workInProgress.pendingProps; - var _resolvedProps3 = resolveDefaultProps(_type.type, _unresolvedProps3); - return updateMemoComponent(current$$1, workInProgress, _type, _resolvedProps3, updateExpirationTime, renderExpirationTime); - } - case SimpleMemoComponent: - { - return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime); - } - case IncompleteClassComponent: - { - var _Component3 = workInProgress.type; - var _unresolvedProps4 = workInProgress.pendingProps; - var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4); - return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime); - } - default: - invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); + commitUpdateEffects(finishedQueue.firstCapturedEffect, instance); + finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null; +} + +function commitUpdateEffects(effect, instance) { + while (effect !== null) { + var _callback3 = effect.callback; + if (_callback3 !== null) { + effect.callback = null; + callCallback(_callback3, instance); + } + effect = effect.nextEffect; } } +function createCapturedValue(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; +} + function markUpdate(workInProgress) { // Tag the fiber with an update effect. This turns a Placement into // a PlacementAndUpdate. @@ -15747,16 +17112,10 @@ function completeWork(current, workInProgress, renderExpirationTime) { } } - // The children either timed out after previously being visible, or - // were restored after previously being hidden. Schedule an effect - // to update their visiblity. - if ( - // - nextDidTimeout !== prevDidTimeout || - // Outside concurrent mode, the primary children commit in an - // inconsistent state, even if they are hidden. So if they are hidden, - // we need to schedule an effect to re-hide them, just in case. - (workInProgress.effectTag & ConcurrentMode) === NoContext && nextDidTimeout) { + if (nextDidTimeout || prevDidTimeout) { + // If the children are hidden, or if they were previous hidden, schedule + // an effect to toggle their visibility. This is also used to attach a + // retry listener to the promise. workInProgress.effectTag |= Update; } break; @@ -15789,6 +17148,26 @@ function completeWork(current, workInProgress, renderExpirationTime) { } break; } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + if (current === null) { + var _wasHydrated2 = popHydrationState(workInProgress); + !_wasHydrated2 ? invariant(false, 'A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.') : void 0; + skipPastDehydratedSuspenseInstance(workInProgress); + } else if ((workInProgress.effectTag & DidCapture) === NoEffect) { + // This boundary did not suspend so it's now hydrated. + // To handle any future suspense cases, we're going to now upgrade it + // to a Suspense component. We detach it from the existing current fiber. + current.alternate = null; + workInProgress.alternate = null; + workInProgress.tag = SuspenseComponent; + workInProgress.memoizedState = null; + workInProgress.stateNode = null; + } + } + break; + } default: invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); } @@ -15796,7 +17175,7 @@ function completeWork(current, workInProgress, renderExpirationTime) { return null; } -function shouldCaptureSuspense(current, workInProgress) { +function shouldCaptureSuspense(workInProgress) { // In order to capture, the Suspense component must have a fallback prop. if (workInProgress.memoizedProps.fallback === undefined) { return false; @@ -15879,6 +17258,8 @@ var didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); } +var PossiblyWeakSet$1 = typeof WeakSet === 'function' ? WeakSet : Set; + function logError(boundary, errorInfo) { var source = errorInfo.source; var stack = errorInfo.stack; @@ -15983,9 +17364,9 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) { // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'getSnapshotBeforeUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); @@ -16017,9 +17398,6 @@ function commitBeforeMutationLifeCycles(current$$1, finishedWork) { } function commitHookEffectList(unmountTag, mountTag, finishedWork) { - if (!enableHooks) { - return; - } var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { @@ -16029,24 +17407,30 @@ function commitHookEffectList(unmountTag, mountTag, finishedWork) { if ((effect.tag & unmountTag) !== NoEffect$1) { // Unmount var destroy = effect.destroy; - effect.destroy = null; - if (destroy !== null) { + effect.destroy = undefined; + if (destroy !== undefined) { destroy(); } } if ((effect.tag & mountTag) !== NoEffect$1) { // Mount var create = effect.create; - var _destroy = create(); - if (typeof _destroy !== 'function') { - { - if (_destroy !== null && _destroy !== undefined) { - warningWithoutStack$1(false, 'useEffect function must return a cleanup function or ' + 'nothing.%s%s', typeof _destroy.then === 'function' ? ' Promises and useEffect(async () => ...) are not ' + 'supported, but you can call an async function inside an ' + 'effect.' : '', getStackByFiberInDevAndProd(finishedWork)); + effect.destroy = create(); + + { + var _destroy = effect.destroy; + if (_destroy !== undefined && typeof _destroy !== 'function') { + var addendum = void 0; + if (_destroy === null) { + addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).'; + } else if (typeof _destroy.then === 'function') { + addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + '}, [someId]); // Or [] if effect doesn\'t need props or state\n\n' + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching'; + } else { + addendum = ' You returned: ' + _destroy; } + warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork)); } - _destroy = null; } - effect.destroy = _destroy; } effect = effect.next; } while (effect !== firstEffect); @@ -16077,9 +17461,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidMount. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } instance.componentDidMount(); @@ -16092,9 +17476,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'componentDidUpdate. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); @@ -16104,9 +17488,9 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir var updateQueue = finishedWork.updateQueue; if (updateQueue !== null) { { - if (finishedWork.type === finishedWork.elementType) { - !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected instance props to match memoized props before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; - !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected instance state to match memoized state before ' + 'processing the update queue. This is likely due to a bug in React. ' + 'Please file an issue.') : void 0; + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; + !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0; } } // We could update instance props and state here, @@ -16187,7 +17571,7 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir function hideOrUnhideAllChildren(finishedWork, isHidden) { if (supportsMutation) { - // We only have the top Fiber that was inserted but we need recurse down its + // We only have the top Fiber that was inserted but we need to recurse down its var node = finishedWork; while (true) { if (node.tag === HostComponent) { @@ -16287,7 +17671,7 @@ function commitUnmount(current$$1) { var effect = firstEffect; do { var destroy = effect.destroy; - if (destroy !== null) { + if (destroy !== undefined) { safelyCallDestroy(current$$1, destroy); } effect = effect.next; @@ -16365,9 +17749,14 @@ function detachFiber(current$$1) { // itself will be GC:ed when the parent updates the next time. current$$1.return = null; current$$1.child = null; - if (current$$1.alternate) { - current$$1.alternate.child = null; - current$$1.alternate.return = null; + current$$1.memoizedState = null; + current$$1.updateQueue = null; + var alternate = current$$1.alternate; + if (alternate !== null) { + alternate.return = null; + alternate.child = null; + alternate.memoizedState = null; + alternate.updateQueue = null; } } @@ -16450,7 +17839,7 @@ function getHostSibling(fiber) { } node.sibling.return = node.return; node = node.sibling; - while (node.tag !== HostComponent && node.tag !== HostText) { + while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedSuspenseComponent) { // If it is not host node and, we might have a host node inside it. // Try to search down until we find one. if (node.effectTag & Placement) { @@ -16510,7 +17899,7 @@ function commitPlacement(finishedWork) { } var before = getHostSibling(finishedWork); - // We only have the top Fiber that was inserted but we need recurse down its + // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. var node = finishedWork; while (true) { @@ -16552,7 +17941,7 @@ function commitPlacement(finishedWork) { } function unmountHostComponents(current$$1) { - // We only have the top Fiber that was deleted but we need recurse down its + // We only have the top Fiber that was deleted but we need to recurse down its var node = current$$1; // Each iteration, currentParent is populated with node's host parent if not @@ -16597,13 +17986,20 @@ function unmountHostComponents(current$$1) { removeChild(currentParent, node.stateNode); } // Don't visit children because we already visited them. + } else if (enableSuspenseServerRenderer && node.tag === DehydratedSuspenseComponent) { + // Delete the dehydrated suspense boundary and all of its content. + if (currentParentIsContainer) { + clearSuspenseBoundaryFromContainer(currentParent, node.stateNode); + } else { + clearSuspenseBoundary(currentParent, node.stateNode); + } } else if (node.tag === HostPortal) { - // When we go into a portal, it becomes the parent to remove from. - // We will reassign it back when we pop the portal on the way up. - currentParent = node.stateNode.containerInfo; - currentParentIsContainer = true; - // Visit children because portals might contain host components. if (node.child !== null) { + // When we go into a portal, it becomes the parent to remove from. + // We will reassign it back when we pop the portal on the way up. + currentParent = node.stateNode.containerInfo; + currentParentIsContainer = true; + // Visit children because portals might contain host components. node.child.return = node; node = node.child; continue; @@ -16656,6 +18052,8 @@ function commitWork(current$$1, finishedWork) { case MemoComponent: case SimpleMemoComponent: { + // Note: We currently never use MountMutation, but useLayout uses + // UnmountMutation. commitHookEffectList(UnmountMutation, MountMutation, finishedWork); return; } @@ -16671,6 +18069,8 @@ function commitWork(current$$1, finishedWork) { case MemoComponent: case SimpleMemoComponent: { + // Note: We currently never use MountMutation, but useLayout uses + // UnmountMutation. commitHookEffectList(UnmountMutation, MountMutation, finishedWork); return; } @@ -16740,6 +18140,30 @@ function commitWork(current$$1, finishedWork) { if (primaryChildParent !== null) { hideOrUnhideAllChildren(primaryChildParent, newDidTimeout); } + + // If this boundary just timed out, then it will have a set of thenables. + // For each thenable, attach a listener so that when it resolves, React + // attempts to re-render the boundary in the primary (pre-timeout) state. + var thenables = finishedWork.updateQueue; + if (thenables !== null) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + if (retryCache === null) { + retryCache = finishedWork.stateNode = new PossiblyWeakSet$1(); + } + thenables.forEach(function (thenable) { + // Memoize using the boundary fiber to prevent redundant listeners. + var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable); + if (enableSchedulerTracing) { + retry = unstable_wrap(retry); + } + if (!retryCache.has(thenable)) { + retryCache.add(thenable); + thenable.then(retry, retry); + } + }); + } + return; } case IncompleteClassComponent: @@ -16760,6 +18184,9 @@ function commitResetTextContent(current$$1) { resetTextContent(current$$1.stateNode); } +var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set; +var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; + function createRootErrorUpdate(fiber, errorInfo, expirationTime) { var update = createUpdate(expirationTime); // Unmount the root by rendering null. @@ -16816,6 +18243,34 @@ function createClassErrorUpdate(fiber, errorInfo, expirationTime) { return update; } +function attachPingListener(root, renderExpirationTime, thenable) { + // Attach a listener to the promise to "ping" the root and retry. But + // only if one does not already exist for the current render expiration + // time (which acts like a "thread ID" here). + var pingCache = root.pingCache; + var threadIDs = void 0; + if (pingCache === null) { + pingCache = root.pingCache = new PossiblyWeakMap(); + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } else { + threadIDs = pingCache.get(thenable); + if (threadIDs === undefined) { + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } + } + if (!threadIDs.has(renderExpirationTime)) { + // Memoize using the thread ID to prevent redundant listeners. + threadIDs.add(renderExpirationTime); + var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime); + if (enableSchedulerTracing) { + ping = unstable_wrap(ping); + } + thenable.then(ping, ping); + } +} + function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) { // The source fiber did not complete. sourceFiber.effectTag |= Incomplete; @@ -16857,25 +18312,27 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT } } } + // If there is a DehydratedSuspenseComponent we don't have to do anything because + // if something suspends inside it, we will simply leave that as dehydrated. It + // will never timeout. _workInProgress = _workInProgress.return; } while (_workInProgress !== null); // Schedule the nearest Suspense to re-render the timed out view. _workInProgress = returnFiber; do { - if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress.alternate, _workInProgress)) { + if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) { // Found the nearest boundary. - // If the boundary is not in concurrent mode, we should not suspend, and - // likewise, when the promise resolves, we should ping synchronously. - var pingTime = (_workInProgress.mode & ConcurrentMode) === NoEffect ? Sync : renderExpirationTime; - - // Attach a listener to the promise to "ping" the root and retry. - var onResolveOrReject = retrySuspendedRoot.bind(null, root, _workInProgress, sourceFiber, pingTime); - if (enableSchedulerTracing) { - onResolveOrReject = unstable_wrap(onResolveOrReject); + // Stash the promise on the boundary fiber. If the boundary times out, we'll + var thenables = _workInProgress.updateQueue; + if (thenables === null) { + var updateQueue = new Set(); + updateQueue.add(thenable); + _workInProgress.updateQueue = updateQueue; + } else { + thenables.add(thenable); } - thenable.then(onResolveOrReject, onResolveOrReject); // If the boundary is outside of concurrent mode, we should *not* // suspend the commit. Pretend as if the suspended component rendered @@ -16894,18 +18351,25 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete); if (sourceFiber.tag === ClassComponent) { - var _current = sourceFiber.alternate; - if (_current === null) { + var currentSourceFiber = sourceFiber.alternate; + if (currentSourceFiber === null) { // This is a new mount. Change the tag so it's not mistaken for a // completed class component. For example, we should not call // componentWillUnmount if it is deleted. sourceFiber.tag = IncompleteClassComponent; + } else { + // When we try rendering again, we should not reuse the current fiber, + // since it's known to be in an inconsistent state. Use a force updte to + // prevent a bail out. + var update = createUpdate(Sync); + update.tag = ForceUpdate; + enqueueUpdate(sourceFiber, update); } } - // The source fiber did not complete. Mark it with the current - // render priority to indicate that it still has pending work. - sourceFiber.expirationTime = renderExpirationTime; + // The source fiber did not complete. Mark it with Sync priority to + // indicate that it still has pending work. + sourceFiber.expirationTime = Sync; // Exit without suspending. return; @@ -16914,9 +18378,11 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT // Confirmed that the boundary is in a concurrent mode tree. Continue // with the normal suspend path. + attachPingListener(root, renderExpirationTime, thenable); + var absoluteTimeoutMs = void 0; if (earliestTimeoutMs === -1) { - // If no explicit threshold is given, default to an abitrarily large + // If no explicit threshold is given, default to an arbitrarily large // value. The actual size doesn't matter because the threshold for the // whole tree will be clamped to the expiration time. absoluteTimeoutMs = maxSigned31BitInt; @@ -16944,6 +18410,29 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT // whole tree. renderDidSuspend(root, absoluteTimeoutMs, renderExpirationTime); + _workInProgress.effectTag |= ShouldCapture; + _workInProgress.expirationTime = renderExpirationTime; + return; + } else if (enableSuspenseServerRenderer && _workInProgress.tag === DehydratedSuspenseComponent) { + attachPingListener(root, renderExpirationTime, thenable); + + // Since we already have a current fiber, we can eagerly add a retry listener. + var retryCache = _workInProgress.memoizedState; + if (retryCache === null) { + retryCache = _workInProgress.memoizedState = new PossiblyWeakSet(); + var _current = _workInProgress.alternate; + !_current ? invariant(false, 'A dehydrated suspense boundary must commit before trying to render. This is probably a bug in React.') : void 0; + _current.memoizedState = retryCache; + } + // Memoize using the boundary fiber to prevent redundant listeners. + if (!retryCache.has(thenable)) { + retryCache.add(thenable); + var retry = retryTimedOutBoundary.bind(null, _workInProgress, thenable); + if (enableSchedulerTracing) { + retry = unstable_wrap(retry); + } + thenable.then(retry, retry); + } _workInProgress.effectTag |= ShouldCapture; _workInProgress.expirationTime = renderExpirationTime; return; @@ -16970,8 +18459,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT var _errorInfo = value; workInProgress.effectTag |= ShouldCapture; workInProgress.expirationTime = renderExpirationTime; - var update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime); - enqueueCapturedUpdate(workInProgress, update); + var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime); + enqueueCapturedUpdate(workInProgress, _update); return; } case ClassComponent: @@ -16983,8 +18472,8 @@ function throwException(root, returnFiber, sourceFiber, value, renderExpirationT workInProgress.effectTag |= ShouldCapture; workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state - var _update = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime); - enqueueCapturedUpdate(workInProgress, _update); + var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime); + enqueueCapturedUpdate(workInProgress, _update2); return; } break; @@ -17021,6 +18510,7 @@ function unwindWork(workInProgress, renderExpirationTime) { } case HostComponent: { + // TODO: popHydrationState popHostContext(workInProgress); return null; } @@ -17034,6 +18524,19 @@ function unwindWork(workInProgress, renderExpirationTime) { } return null; } + case DehydratedSuspenseComponent: + { + if (enableSuspenseServerRenderer) { + // TODO: popHydrationState + var _effectTag3 = workInProgress.effectTag; + if (_effectTag3 & ShouldCapture) { + workInProgress.effectTag = _effectTag3 & ~ShouldCapture | DidCapture; + // Captured a suspense effect. Re-render the boundary. + return workInProgress; + } + } + return null; + } case HostPortal: popHostContainer(workInProgress); return null; @@ -17077,23 +18580,7 @@ function unwindInterruptedWork(interruptedWork) { } } -var Dispatcher = { - readContext: readContext, - useCallback: useCallback, - useContext: useContext, - useEffect: useEffect, - useImperativeMethods: useImperativeMethods, - useLayoutEffect: useLayoutEffect, - useMemo: useMemo, - useMutationEffect: useMutationEffect, - useReducer: useReducer, - useRef: useRef, - useState: useState -}; -var DispatcherWithoutHooks = { - readContext: readContext -}; - +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; @@ -17147,11 +18634,6 @@ if (enableSchedulerTracing) { // Used to ensure computeUniqueAsyncExpiration is monotonically decreasing. var lastUniqueAsyncExpiration = Sync - 1; -// Represents the expiration time that incoming updates should use. (If this -// is NoWork, use the default strategy: async updates in async mode, sync -// updates in sync mode.) -var expirationContext = NoWork; - var isWorking = false; // The next work in progress fiber that we're currently working on. @@ -17378,6 +18860,9 @@ function commitAllLifeCycles(finishedRoot, committedExpirationTime) { } } while (nextEffect !== null) { + { + setCurrentFiber(nextEffect); + } var effectTag = nextEffect.effectTag; if (effectTag & (Update | Callback)) { @@ -17391,12 +18876,15 @@ function commitAllLifeCycles(finishedRoot, committedExpirationTime) { commitAttachRef(nextEffect); } - if (enableHooks && effectTag & Passive) { + if (effectTag & Passive) { rootWithPendingPassiveEffects = finishedRoot; } nextEffect = nextEffect.nextEffect; } + { + resetCurrentFiber(); + } } function commitPassiveEffects(root, firstEffect) { @@ -17410,6 +18898,10 @@ function commitPassiveEffects(root, firstEffect) { var effect = firstEffect; do { + { + setCurrentFiber(effect); + } + if (effect.effectTag & Passive) { var didError = false; var error = void 0; @@ -17426,6 +18918,9 @@ function commitPassiveEffects(root, firstEffect) { } effect = effect.nextEffect; } while (effect !== null); + { + resetCurrentFiber(); + } isRendering = previousIsRendering; @@ -17434,6 +18929,10 @@ function commitPassiveEffects(root, firstEffect) { if (rootExpirationTime !== NoWork) { requestWork(root, rootExpirationTime); } + // Flush any sync work that was scheduled by effects + if (!isBatchingUpdates && !isRendering) { + performSyncWork(); + } } function isAlreadyFailedLegacyErrorBoundary(instance) { @@ -17449,8 +18948,10 @@ function markLegacyErrorBoundaryAsFailed(instance) { } function flushPassiveEffects() { + if (passiveEffectCallbackHandle !== null) { + cancelPassiveEffects(passiveEffectCallbackHandle); + } if (passiveEffectCallback !== null) { - unstable_cancelCallback(passiveEffectCallbackHandle); // We call the scheduled callback instead of commitPassiveEffects directly // to ensure tracing works correctly. passiveEffectCallback(); @@ -17594,7 +19095,7 @@ function commitRoot(root, finishedWork) { } } - if (enableHooks && firstEffect !== null && rootWithPendingPassiveEffects !== null) { + if (firstEffect !== null && rootWithPendingPassiveEffects !== null) { // This commit included a passive effect. These do not need to fire until // after the next paint. Schedule an callback to fire them in an async // event. To ensure serial execution, the callback will be flushed early if @@ -17606,7 +19107,9 @@ function commitRoot(root, finishedWork) { // here because that code is still in flux. callback = unstable_wrap(callback); } - passiveEffectCallbackHandle = unstable_scheduleCallback(callback); + passiveEffectCallbackHandle = unstable_runWithPriority(unstable_NormalPriority, function () { + return schedulePassiveEffects(callback); + }); passiveEffectCallback = callback; } @@ -17997,11 +19500,8 @@ function renderRoot(root, isYieldy) { flushPassiveEffects(); isWorking = true; - if (enableHooks) { - ReactCurrentOwner$2.currentDispatcher = Dispatcher; - } else { - ReactCurrentOwner$2.currentDispatcher = DispatcherWithoutHooks; - } + var previousDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = ContextOnlyDispatcher; var expirationTime = root.nextExpirationTimeToWorkOn; @@ -18041,7 +19541,7 @@ function renderRoot(root, isYieldy) { subscriber.onWorkStarted(interactions, threadID); } catch (error) { // Work thrown by an interaction tracing subscriber should be rethrown, - // But only once it's safe (to avoid leaveing the scheduler in an invalid state). + // But only once it's safe (to avoid leaving the scheduler in an invalid state). // Store the error for now and we'll re-throw in finishRendering(). if (!hasUnhandledError) { hasUnhandledError = true; @@ -18137,7 +19637,7 @@ function renderRoot(root, isYieldy) { // We're done performing work. Time to clean up. isWorking = false; - ReactCurrentOwner$2.currentDispatcher = null; + ReactCurrentDispatcher.current = previousDispatcher; resetContextDependences(); resetHooks(); @@ -18198,7 +19698,7 @@ function renderRoot(root, isYieldy) { return; } else if ( // There's no lower priority work, but we're rendering asynchronously. - // Synchronsouly attempt to render the same level one more time. This is + // Synchronously attempt to render the same level one more time. This is // similar to a suspend, but without a timeout because we're not waiting // for a promise to resolve. !root.didError && isYieldy) { @@ -18303,49 +19803,50 @@ function computeUniqueAsyncExpiration() { } function computeExpirationForFiber(currentTime, fiber) { + var priorityLevel = unstable_getCurrentPriorityLevel(); + var expirationTime = void 0; - if (expirationContext !== NoWork) { - // An explicit expiration context was set; - expirationTime = expirationContext; - } else if (isWorking) { - if (isCommitting$1) { - // Updates that occur during the commit phase should have sync priority - // by default. - expirationTime = Sync; - } else { - // Updates during the render phase should expire at the same time as - // the work that is being rendered. - expirationTime = nextRenderExpirationTime; - } + if ((fiber.mode & ConcurrentMode) === NoContext) { + // Outside of concurrent mode, updates are always synchronous. + expirationTime = Sync; + } else if (isWorking && !isCommitting$1) { + // During render phase, updates expire during as the current render. + expirationTime = nextRenderExpirationTime; } else { - // No explicit expiration context was set, and we're not currently - // performing work. Calculate a new expiration time. - if (fiber.mode & ConcurrentMode) { - if (isBatchingInteractiveUpdates) { - // This is an interactive update + switch (priorityLevel) { + case unstable_ImmediatePriority: + expirationTime = Sync; + break; + case unstable_UserBlockingPriority: expirationTime = computeInteractiveExpiration(currentTime); - } else { - // This is an async update + break; + case unstable_NormalPriority: + // This is a normal, concurrent update expirationTime = computeAsyncExpiration(currentTime); - } - // If we're in the middle of rendering a tree, do not update at the same - // expiration time that is already rendering. - if (nextRoot !== null && expirationTime === nextRenderExpirationTime) { - expirationTime -= 1; - } - } else { - // This is a sync update - expirationTime = Sync; + break; + case unstable_LowPriority: + case unstable_IdlePriority: + expirationTime = Never; + break; + default: + invariant(false, 'Unknown priority level. This error is likely caused by a bug in React. Please file an issue.'); } - } - if (isBatchingInteractiveUpdates) { - // This is an interactive update. Keep track of the lowest pending - // interactive expiration time. This allows us to synchronously flush - // all interactive updates when needed. - if (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime) { - lowestPriorityPendingInteractiveExpirationTime = expirationTime; + + // If we're in the middle of rendering a tree, do not update at the same + // expiration time that is already rendering. + if (nextRoot !== null && expirationTime === nextRenderExpirationTime) { + expirationTime -= 1; } } + + // Keep track of the lowest pending interactive expiration time. This + // allows us to synchronously flush all interactive updates + // when needed. + // TODO: Move this to renderer? + if (priorityLevel === unstable_UserBlockingPriority && (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime)) { + lowestPriorityPendingInteractiveExpirationTime = expirationTime; + } + return expirationTime; } @@ -18360,56 +19861,68 @@ function renderDidError() { nextRenderDidError = true; } -function retrySuspendedRoot(root, boundaryFiber, sourceFiber, suspendedTime) { - var retryTime = void 0; - - if (isPriorityLevelSuspended(root, suspendedTime)) { - // Ping at the original level - retryTime = suspendedTime; +function pingSuspendedRoot(root, thenable, pingTime) { + // A promise that previously suspended React from committing has resolved. + // If React is still suspended, try again at the previous level (pingTime). - markPingedPriorityLevel(root, retryTime); - } else { - // Suspense already timed out. Compute a new expiration time - var currentTime = requestCurrentTime(); - retryTime = computeExpirationForFiber(currentTime, boundaryFiber); - markPendingPriorityLevel(root, retryTime); + var pingCache = root.pingCache; + if (pingCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + pingCache.delete(thenable); } - // TODO: If the suspense fiber has already rendered the primary children - // without suspending (that is, all of the promises have already resolved), - // we should not trigger another update here. One case this happens is when - // we are in sync mode and a single promise is thrown both on initial render - // and on update; we attach two .then(retrySuspendedRoot) callbacks and each - // one performs Sync work, rerendering the Suspense. - - if ((boundaryFiber.mode & ConcurrentMode) !== NoContext) { - if (root === nextRoot && nextRenderExpirationTime === suspendedTime) { - // Received a ping at the same priority level at which we're currently - // rendering. Restart from the root. - nextRoot = null; + if (nextRoot !== null && nextRenderExpirationTime === pingTime) { + // Received a ping at the same priority level at which we're currently + // rendering. Restart from the root. + nextRoot = null; + } else { + // Confirm that the root is still suspended at this level. Otherwise exit. + if (isPriorityLevelSuspended(root, pingTime)) { + // Ping at the original level + markPingedPriorityLevel(root, pingTime); + var rootExpirationTime = root.expirationTime; + if (rootExpirationTime !== NoWork) { + requestWork(root, rootExpirationTime); + } } } +} - scheduleWorkToRoot(boundaryFiber, retryTime); - if ((boundaryFiber.mode & ConcurrentMode) === NoContext) { - // Outside of concurrent mode, we must schedule an update on the source - // fiber, too, since it already committed in an inconsistent state and - // therefore does not have any pending work. - scheduleWorkToRoot(sourceFiber, retryTime); - var sourceTag = sourceFiber.tag; - if (sourceTag === ClassComponent && sourceFiber.stateNode !== null) { - // When we try rendering again, we should not reuse the current fiber, - // since it's known to be in an inconsistent state. Use a force updte to - // prevent a bail out. - var update = createUpdate(retryTime); - update.tag = ForceUpdate; - enqueueUpdate(sourceFiber, update); +function retryTimedOutBoundary(boundaryFiber, thenable) { + // The boundary fiber (a Suspense component) previously timed out and was + // rendered in its fallback state. One of the promises that suspended it has + // resolved, which means at least part of the tree was likely unblocked. Try + var retryCache = void 0; + if (enableSuspenseServerRenderer) { + switch (boundaryFiber.tag) { + case SuspenseComponent: + retryCache = boundaryFiber.stateNode; + break; + case DehydratedSuspenseComponent: + retryCache = boundaryFiber.memoizedState; + break; + default: + invariant(false, 'Pinged unknown suspense boundary type. This is probably a bug in React.'); } + } else { + retryCache = boundaryFiber.stateNode; + } + if (retryCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + retryCache.delete(thenable); } - var rootExpirationTime = root.expirationTime; - if (rootExpirationTime !== NoWork) { - requestWork(root, rootExpirationTime); + var currentTime = requestCurrentTime(); + var retryTime = computeExpirationForFiber(currentTime, boundaryFiber); + var root = scheduleWorkToRoot(boundaryFiber, retryTime); + if (root !== null) { + markPendingPriorityLevel(root, retryTime); + var rootExpirationTime = root.expirationTime; + if (rootExpirationTime !== NoWork) { + requestWork(root, rootExpirationTime); + } } } @@ -18490,6 +20003,14 @@ function scheduleWorkToRoot(fiber, expirationTime) { return root; } +function warnIfNotCurrentlyBatchingInDev(fiber) { + { + if (isRendering === false && isBatchingUpdates === false) { + warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see in the browser." + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber)); + } + } +} + function scheduleWork(fiber, expirationTime) { var root = scheduleWorkToRoot(fiber, expirationTime); if (root === null) { @@ -18532,13 +20053,9 @@ function scheduleWork(fiber, expirationTime) { } function syncUpdates(fn, a, b, c, d) { - var previousExpirationContext = expirationContext; - expirationContext = Sync; - try { + return unstable_runWithPriority(unstable_ImmediatePriority, function () { return fn(a, b, c, d); - } finally { - expirationContext = previousExpirationContext; - } + }); } // TODO: Everything below this is written as if it has been lifted to the @@ -18559,7 +20076,6 @@ var unhandledError = null; var isBatchingUpdates = false; var isUnbatchingUpdates = false; -var isBatchingInteractiveUpdates = false; var completedBatches = null; @@ -19033,7 +20549,9 @@ function completeRoot(root, finishedWork, expirationTime) { lastCommittedRootDuringThisBatch = root; nestedUpdateCount = 0; } - commitRoot(root, finishedWork); + unstable_runWithPriority(unstable_ImmediatePriority, function () { + commitRoot(root, finishedWork); + }); } function onUncaughtError(error) { @@ -19091,9 +20609,6 @@ function flushSync(fn, a) { } function interactiveUpdates$1(fn, a, b) { - if (isBatchingInteractiveUpdates) { - return fn(a, b); - } // If there are any pending interactive updates, synchronously flush them. // This needs to happen before we read any handlers, because the effect of // the previous event may influence which handlers are called during @@ -19103,14 +20618,13 @@ function interactiveUpdates$1(fn, a, b) { performWork(lowestPriorityPendingInteractiveExpirationTime, false); lowestPriorityPendingInteractiveExpirationTime = NoWork; } - var previousIsBatchingInteractiveUpdates = isBatchingInteractiveUpdates; var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingInteractiveUpdates = true; isBatchingUpdates = true; try { - return fn(a, b); + return unstable_runWithPriority(unstable_UserBlockingPriority, function () { + return fn(a, b); + }); } finally { - isBatchingInteractiveUpdates = previousIsBatchingInteractiveUpdates; isBatchingUpdates = previousIsBatchingUpdates; if (!isBatchingUpdates && !isRendering) { performSyncWork(); @@ -19299,10 +20813,43 @@ function findHostInstanceWithNoPortals(fiber) { return hostFiber.stateNode; } +var overrideProps = null; + +{ + var copyWithSetImpl = function (obj, path, idx, value) { + if (idx >= path.length) { + return value; + } + var key = path[idx]; + var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); + // $FlowFixMe number or string is fine here + updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value); + return updated; + }; + + var copyWithSet = function (obj, path, value) { + return copyWithSetImpl(obj, path, 0, value); + }; + + // Support DevTools props for function components, forwardRef, memo, host components, etc. + overrideProps = function (fiber, path, value) { + flushPassiveEffects(); + fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + scheduleWork(fiber, Sync); + }; +} + function injectIntoDevTools(devToolsConfig) { var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + return injectInternals(_assign({}, devToolsConfig, { + overrideProps: overrideProps, + currentDispatcherRef: ReactCurrentDispatcher, findHostInstanceByFiber: function (fiber) { var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { @@ -19340,10 +20887,11 @@ implementation) { // TODO: this is special because it gets imported during build. -var ReactVersion = '16.6.3'; +var ReactVersion = '16.8.6'; // TODO: This type is shared between the reconciler and ReactDOM, but will // eventually be lifted out to the renderer. + var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; var topLevelUpdateWarnings = void 0; @@ -19652,9 +21200,6 @@ function legacyCreateRootFromDOMContainer(container, forceHydrate) { } function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { - // TODO: Ensure all entry points contain this check - !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; - { topLevelUpdateWarnings(container); } @@ -19698,7 +21243,7 @@ function legacyRenderSubtreeIntoContainer(parentComponent, children, container, return getPublicRootInstance(root._internalRoot); } -function createPortal(children, container) { +function createPortal$$1(children, container) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; @@ -19707,7 +21252,7 @@ function createPortal(children, container) { } var ReactDOM = { - createPortal: createPortal, + createPortal: createPortal$$1, findDOMNode: function (componentOrElement) { { @@ -19730,19 +21275,32 @@ var ReactDOM = { return findHostInstance(componentOrElement); }, hydrate: function (element, container, callback) { + !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } // TODO: throw or warn if we couldn't hydrate? return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); }, render: function (element, container, callback) { + !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call root.render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); }, unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) { + !isValidContainer(containerNode) ? invariant(false, 'Target container is not a DOM element.') : void 0; !(parentComponent != null && has(parentComponent)) ? invariant(false, 'parentComponent must be a valid React Component') : void 0; return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); }, unmountComponentAtNode: function (container) { !isValidContainer(container) ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0; + { + !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. Did you mean to call root.unmount()?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + } + if (container._reactRootContainer) { { var rootEl = getReactRootElementInContainer(container); @@ -19782,7 +21340,7 @@ var ReactDOM = { didWarnAboutUnstableCreatePortal = true; lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.'); } - return createPortal.apply(undefined, arguments); + return createPortal$$1.apply(undefined, arguments); }, @@ -19792,6 +21350,7 @@ var ReactDOM = { flushSync: flushSync, + unstable_createRoot: createRoot, unstable_flushControlled: flushControlled, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { @@ -19804,14 +21363,17 @@ var ReactDOM = { function createRoot(container, options) { var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot'; !isValidContainer(container) ? invariant(false, '%s(...): Target container is not a DOM element.', functionName) : void 0; + { + !!container._reactRootContainer ? warningWithoutStack$1(false, 'You are calling ReactDOM.%s() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0; + container._reactHasBeenPassedToCreateRootDEV = true; + } var hydrate = options != null && options.hydrate === true; return new ReactRoot(container, true, hydrate); } if (enableStableConcurrentModeAPIs) { ReactDOM.createRoot = createRoot; -} else { - ReactDOM.unstable_createRoot = createRoot; + ReactDOM.unstable_createRoot = undefined; } var foundDevTools = injectIntoDevTools({ diff --git a/frontend/node_modules/react-dom/umd/react-dom.production.min.js b/frontend/node_modules/react-dom/umd/react-dom.production.min.js index 8e5f9574..f447cda4 100644 --- a/frontend/node_modules/react-dom/umd/react-dom.production.min.js +++ b/frontend/node_modules/react-dom/umd/react-dom.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -9,196 +9,212 @@ /* Modernizr 3.0.0pre (Custom Build) | MIT */ -'use strict';(function(Y,cb){"object"===typeof exports&&"undefined"!==typeof module?module.exports=cb(require("react")):"function"===typeof define&&define.amd?define(["react"],cb):Y.ReactDOM=cb(Y.React)})(this,function(Y){function cb(a,b,c,d,e,f,g,h){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 k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name= -"Invariant Violation"}a.framesToPop=1;throw a;}}function p(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;dthis.eventPool.length&&this.eventPool.push(a)}function he(a){a.eventPool=[];a.getPooled=Lg;a.release=Mg}function ie(a,b){switch(a){case "keyup":return-1!==Ng.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function je(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}function Og(a,b){switch(a){case "compositionend":return je(b); -case "keypress":if(32!==b.which)return null;ke=!0;return le;case "textInput":return a=b.data,a===le&&ke?null:a;default:return null}}function Pg(a,b){if(Ia)return"compositionend"===a||!Oc&&ie(a,b)?(a=ge(),Qb=Nc=ia=null,Ia=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function K(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}function Yc(a,b,c,d){var e=x.hasOwnProperty(b)? -x[b]:null;var f=null!==e?0===e.type:d?!1:!(2$b.length&&$b.push(a)}}}function Ue(a){Object.prototype.hasOwnProperty.call(a,ac)||(a[ac]=hh++,Ve[a[ac]]= -{});return Ve[a[ac]]}function dd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function We(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Xe(a,b){var c=We(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=We(c)}}function Ye(a,b){return a&&b?a=== -b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Ye(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function Ze(){for(var a=window,b=dd();b instanceof a.HTMLIFrameElement;){try{a=b.contentDocument.defaultView}catch(c){break}b=dd(a.document)}return b}function ed(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b|| -"true"===a.contentEditable)}function $e(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(fd||null==Ma||Ma!==dd(c))return null;c=Ma;"selectionStart"in c&&ed(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return kb&&ib(kb,c)?null:(kb=c,a=J.getPooled(af.select,gd,a,b),a.type="select",a.target=Ma,Ga(a), -a)}function ih(a){var b="";Y.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function hd(a,b){a=y({children:void 0},b);if(b=ih(b.children))a.children=b;return a}function Na(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=b.length?void 0:p("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:ma(c)}}function cf(a,b){var c=ma(b.value),d=ma(b.defaultValue);null!=c&&(c=""+c,c!== -a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function df(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jd(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?df(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function ef(a,b,c){return null==b||"boolean"===typeof b|| -""===b?"":c||"number"!==typeof b||0===b||lb.hasOwnProperty(a)&&lb[a]?(""+b).trim():b+"px"}function ff(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ef(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}function kd(a,b){b&&(jh[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?p("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?p("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML? -void 0:p("61")),null!=b.style&&"object"!==typeof b.style?p("62",""):void 0)}function ld(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}function ba(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Ue(a);b=Gc[b];for(var d=0;dOa||(a.current=od[Oa],od[Oa]=null,Oa--)}function O(a,b,c){Oa++;od[Oa]=a.current;a.current=b}function Pa(a,b){var c=a.type.contextTypes;if(!c)return na;var d= -a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function E(a){a=a.childContextTypes;return null!==a&&void 0!==a}function cc(a){L(I,a);L(F,a)}function pd(a){L(I,a);L(F,a)}function jf(a,b,c){F.current!==na?p("168"):void 0;O(F,b,a);O(I,c,a)}function kf(a,b,c){var d=a.stateNode;a= -b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:p("108",ka(b)||"Unknown",e);return y({},c,d)}function dc(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||na;va=F.current;O(F,b,a);O(I,I.current,a);return!0}function lf(a,b,c){var d=a.stateNode;d?void 0:p("169");c?(b=kf(a,b,va),d.__reactInternalMemoizedMergedChildContext=b,L(I,a),L(F,a),O(F,b,a)):L(I,a);O(I,c,a)}function mf(a){return function(b){try{return a(b)}catch(c){}}} -function kh(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);qd=mf(function(a){return b.onCommitFiberRoot(c,a)});rd=mf(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function lh(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency= -this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function sd(a){a=a.prototype;return!(!a||!a.isReactComponent)}function mh(a){if("function"===typeof a)return sd(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Vc)return 11;if(a===Wc)return 14}return 2}function wa(a,b,c){c=a.alternate;null===c?(c=R(a.tag,b,a.key,a.mode),c.elementType=a.elementType, -c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.firstContextDependency=a.firstContextDependency;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function ec(a,b,c,d,e,f){var g=2;d=a;if("function"=== -typeof a)sd(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case la:return oa(c.children,e,f,b);case Sc:return nf(c,e|3,f,b);case Tc:return nf(c,e|2,f,b);case Ub:return a=R(12,c,b,e|4),a.elementType=Ub,a.type=Ub,a.expirationTime=f,a;case Uc:return a=R(13,c,b,e),b=Uc,a.elementType=b,a.type=b,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ae:g=10;break a;case ze:g=9;break a;case Vc:g=11;break a;case Wc:g=14;break a;case Be:g=16;d=null;break a}p("130", -null==a?a:typeof a,"")}b=R(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function oa(a,b,c,d){a=R(7,a,d,b);a.expirationTime=c;return a}function nf(a,b,c,d){a=R(8,a,d,b);b=0===(b&1)?Tc:Sc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function td(a,b,c){a=R(6,a,null,b);a.expirationTime=c;return a}function ud(a,b,c){b=R(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation}; -return b}function nb(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);fc(b,a)}function of(a,b){a.didError=!1;var c=a.latestPingedTime;0!==c&&c>=b&&(a.latestPingedTime=0);c=a.earliestPendingTime;var d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime= -a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);fc(b,a)}function pf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function fc(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function gc(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null, -lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function vd(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function pa(a){return{expirationTime:a,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function hc(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next= -b,a.lastUpdate=b)}function ca(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=gc(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=gc(a.memoizedState),e=c.updateQueue=gc(c.memoizedState)):d=a.updateQueue=vd(e):null===e&&(e=c.updateQueue=vd(d));null===e||d===e?hc(d,b):null===d.lastUpdate||null===e.lastUpdate?(hc(d,b),hc(e,b)):(hc(d,b),e.lastUpdate=b)}function qf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=gc(a.memoizedState): -rf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function rf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=vd(b));return b}function sf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return y({},d,e);case 2:qa=!0}return d} -function ob(a,b,c,d,e){qa=!1;b=rf(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;mr?(q=m,m=null):q=m.sibling;var t=Df(e,m,h[r],k);if(null===t){null===m&&(m=q);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,r);null===p?l=t:p.sibling=t;p=t;m=q}if(r===h.length)return c(e,m),l;if(null===m){for(;rt?(q=r,r=null):q=r.sibling;var Sa=Df(e,r,A.value,k);if(null===Sa){r||(r=q);break}a&&r&&null===Sa.alternate&&b(e,r);g=f(Sa,g,t);null===m?l=Sa:m.sibling=Sa;m=Sa;r=q}if(A.done)return c(e, -r),l;if(null===r){for(;!A.done;t++,A=h.next())A=n(e,A.value,k),null!==A&&(g=f(A,g,t),null===m?l=A:m.sibling=A,m=A);return l}for(r=d(e,r);!A.done;t++,A=h.next())A=z(r,e,t,A.value,k),null!==A&&(a&&null!==A.alternate&&r.delete(null===A.key?t:A.key),g=f(A,g,t),null===m?l=A:m.sibling=A,m=A);a&&r.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===la&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case nc:a:{l= -f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===la:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===la?f.props.children:f.props,h);d.ref=ub(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=k.sibling}f.type===la?(d=oa(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=ec(f.type,f.key,f.props,null,a.mode,h),h.ref=ub(a,d,f),h.return=a,a=h)}return g(a);case La:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation=== -f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ud(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=td(f,a.mode,h),d.return=a,a=d),g(a);if(oc(f))return v(a,d,f,h);if(fb(f))return B(a,d,f,h);l&&mc(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,p("152",h.displayName||h.name||"Component")}return c(a, -d)}}function Ef(a,b){var c=R(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function Ff(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;default:return!1}}function Gf(a){if(za){var b= -Ta;if(b){var c=b;if(!Ff(a,b)){b=nd(c);if(!b||!Ff(a,b)){a.effectTag|=2;za=!1;da=a;return}Ef(da,c)}da=a;Ta=hf(b)}else a.effectTag|=2,za=!1,da=a}}function Hf(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag;)a=a.return;da=a}function Bd(a){if(a!==da)return!1;if(!za)return Hf(a),za=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!md(b,a.memoizedProps))for(b=Ta;b;)Ef(a,b),b=nd(b);Hf(a);Ta=da?nd(a.stateNode):null;return!0}function Cd(){Ta=da=null;za=!1}function P(a,b,c,d){b.child=null===a?Dd(b, -null,c,d):Ua(b,a.child,c,d)}function If(a,b,c,d,e){c=c.render;var f=b.ref;Qa(b,e);d=c(d,f);b.effectTag|=1;P(a,b,d,e);return b.child}function Jf(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!sd(g)&&void 0===g.defaultProps&&null===c.compare)return b.tag=15,b.type=g,Kf(a,b,g,d,e,f);a=ec(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Of(a,b,c);b=Aa(a,b,c);return null!==b?b.sibling:null}}return Aa(a,b,c)}b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate= -null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Pa(b,F.current);Qa(b,c);e=d(a,e);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;if(E(d)){var f=!0;dc(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&jc(b,d,g,a);e.updater=lc;b.stateNode=e;e._reactInternalFiber=b;Ad(b,d,a,c);b=Fd(null,b,d,!0,f,c)}else b.tag=0,P(null,b,e,c),b=b.child;return b;case 16:e= -b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=nh(e);b.type=a;e=b.tag=mh(a);f=T(a,f);g=void 0;switch(e){case 0:g=Ed(null,b,a,f,c);break;case 1:g=Mf(null,b,a,f,c);break;case 11:g=If(null,b,a,f,c);break;case 14:g=Jf(null,b,a,T(a.type,f),d,c);break;default:p("283",a)}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:T(d,e),Ed(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:T(d,e),Mf(a,b,d,e,c);case 3:Nf(b);d= -b.updateQueue;null===d?p("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;ob(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Cd(),b=Aa(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)Ta=hf(b.stateNode.containerInfo),da=b,e=za=!0;e?(b.effectTag|=2,b.child=Dd(b,null,d,c)):(P(a,b,d,c),Cd());b=b.child}return b;case 5:return xf(b),null===a&&Gf(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,md(d,e)?g=null:null!==f&&md(d,f)&&(b.effectTag|= -16),Lf(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=1,b=null):(P(a,b,g,c),b=b.child),b;case 6:return null===a&&Gf(b),null;case 13:return Of(a,b,c);case 4:return yd(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ua(b,null,d,c):P(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:T(d,e),If(a,b,d,e,c);case 7:return P(a,b,b.pendingProps,c),b.child;case 8:return P(a,b,b.pendingProps.children,c),b.child;case 12:return P(a,b,b.pendingProps.children,c),b.child; -case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;vf(b,f);if(null!==g){var h=g.value;f=h===f&&(0!==h||1/h===1/f)||h!==h&&f!==f?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!I.current){b=Aa(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){h=g.firstContextDependency;if(null!==h){do{if(h.context===d&&0!==(h.observedBits&f)){if(1===g.tag){var k=pa(c);k.tag=2;ca(g,k)}g.expirationTime< -c&&(g.expirationTime=c);k=g.alternate;null!==k&&k.expirationTime\x3c/script>", -l=e.removeChild(e.firstChild)):"string"===typeof n.is?l=l.createElement(e,{is:n.is}):(l=l.createElement(e),"select"===e&&n.multiple&&(l.multiple=!0)):l=l.createElementNS(k,e);e=l;e[Z]=m;e[Nb]=g;cg(e,b,!1,!1);m=e;l=f;n=g;var x=h,z=ld(l,n);switch(l){case "iframe":case "object":v("load",m);h=n;break;case "video":case "audio":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==B)return B;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect= -a.lastEffect),1=z)n=0;else if(-1===n||z component higher in the tree to provide a loading indicator or placeholder to display."+Xc(k))}Id=!0;l=ic(l,k);g=h;do{switch(g.tag){case 3:k=l;g.effectTag|=2048;g.expirationTime=f;f=Gd(g,k,f);qf(g,f);break a;case 1:if(k=l,h=g.type,m=g.stateNode, -0===(g.effectTag&64)&&("function"===typeof h.getDerivedStateFromError||null!==m&&"function"===typeof m.componentDidCatch&&(null===sa||!sa.has(m)))){g.effectTag|=2048;g.expirationTime=f;f=Xf(g,k,f);qf(g,f);break a}}g=g.return}while(null!==g)}B=ag(e);continue}}}break}while(1);ta=!1;qb=xa=pb=pc.currentDispatcher=null;if(d)U=null,a.finishedWork=null;else if(null!==B)a.finishedWork=null;else{d=a.current.alternate;null===d?p("281"):void 0;U=null;if(Id){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime; -if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime=c,a.finishedWork=d)}}function Va(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError|| -"function"===typeof d.componentDidCatch&&(null===sa||!sa.has(d))){a=ic(b,a);a=Xf(c,a,1073741823);ca(c,a);Ca(c,1073741823);return}break;case 3:a=ic(b,a);a=Gd(c,a,1073741823);ca(c,a);Ca(c,1073741823);return}c=c.return}3===a.tag&&(c=ic(b,a),c=Gd(a,c,1073741823),ca(a,c),Ca(a,1073741823))}function zb(a,b){0!==Ab?a=Ab:ta?a=rc?1073741823:H:b.mode&1?(a=Wa?1073741822-10*(((1073741822-a+15)/10|0)+1):1073741822-25*(((1073741822-a+500)/25|0)+1),null!==U&&a===H&&--a):a=1073741823;Wa&&(0===ea||a=f){f=e=d;a.didError=!1;var g=a.latestPingedTime;if(0===g||g>f)a.latestPingedTime=f;fc(f,a)}else e=ra(),e=zb(e,b),nb(a,e);0!==(b.mode&1)&&a===U&&H===d&&(U=null);Ld(b,e);0===(b.mode&1)&&(Ld(c,e),1===c.tag&&null!==c.stateNode&&(b=pa(e),b.tag=2,ca(c,b)));c=a.expirationTime;0!==c&&gg(a,c)}function Ld(a,b){a.expirationTimeH&&Yf(),nb(a,b),ta&&!rc&&U===a||gg(a,a.expirationTime),Bb>uh&&(Bb=0,p("185")))}function hg(a,b,c,d,e){var f=Ab;Ab=1073741823;try{return a(b,c,d,e)}finally{Ab=f}}function Cb(){V= -1073741822-((Md()-Nd)/10|0)}function ig(a,b){if(0!==sc){if(ba.expirationTime&&(a.expirationTime=b);M||(C?vc&&(X=a,u=1073741823,wc(a,1073741823,!1)):1073741823===b?fa(1073741823,!1):ig(a,b))}function uc(){var a=0,b=null;if(null!==N)for(var c=N,d=W;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===N?p("244"):void 0;if(d===d.nextScheduledRoot){W=N=d.nextScheduledRoot=null;break}else if(d===W)W=e=d.nextScheduledRoot,N.nextScheduledRoot=e,d.nextScheduledRoot= -null;else if(d===N){N=c;N.nextScheduledRoot=W;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===N)break;if(1073741823===a)break;c=d;d=d.nextScheduledRoot}}X=b;u=a}function qc(){return xc?!0:zh()?xc=!0:!1}function wh(){try{if(!qc()&&null!==W){Cb();var a=W;do{var b=a.expirationTime;0!==b&&V<=b&&(a.nextExpirationTimeToWorkOn=V);a=a.nextScheduledRoot}while(a!==W)}fa(0,!0)}finally{xc=!1}}function fa(a,b){uc(); -if(b)for(Cb(),Xa=V;null!==X&&0!==u&&a<=u&&!(xc&&V>u);)wc(X,u,V>u),uc(),Cb(),Xa=V;else for(;null!==X&&0!==u&&a<=u;)wc(X,u,!1),uc();b&&(sc=0,tc=null);0!==u&&ig(X,u);Bb=0;Od=null;if(null!==Ya)for(a=Ya,Ya=null,b=0;b=c&&(null===Ya?Ya=[d]:Ya.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Od?Bb++:(Od=a,Bb=0);rc=ta=!0;a.current=== -b?p("177"):void 0;c=a.pendingCommitExpirationTime;0===c?p("261"):void 0;a.pendingCommitExpirationTime=0;d=b.expirationTime;var e=b.childExpirationTime;d=e>d?e:d;a.didError=!1;0===d?(a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0):(e=a.latestPendingTime,0!==e&&(e>d?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>d&&(a.earliestPendingTime=a.latestPendingTime)),e=a.earliestSuspendedTime,0===e?nb(a,d):de&&nb(a,d));fc(0,a);pc.current=null;1t&&(G=t,t=r,r=G),G=Xe(w, -r),y=Xe(w,t),G&&y&&(1!==q.rangeCount||q.anchorNode!==G.node||q.anchorOffset!==G.offset||q.focusNode!==y.node||q.focusOffset!==y.offset)&&(D=D.createRange(),D.setStart(G.node,G.offset),q.removeAllRanges(),r>t?(q.addRange(D),q.extend(y.node,y.offset)):(D.setEnd(y.node,y.offset),q.addRange(D))))));D=[];for(q=w;q=q.parentNode;)1===q.nodeType&&D.push({element:q,left:q.scrollLeft,top:q.scrollTop});"function"===typeof w.focus&&w.focus();for(w=0;wE?b:E;0===b&&(sa=null);a.expirationTime=b;a.finishedWork=null}function Hd(a){null===X?p("246"):void 0;X.expirationTime=0;Za||(Za=!0,yc=a)}function lg(a,b){var c=C;C=!0;try{return a(b)}finally{(C=c)||M||fa(1073741823,!1)}}function mg(a,b){if(C&&!vc){vc=!0;try{return a(b)}finally{vc=!1}}return a(b)}function ng(a,b,c){if(Wa)return a(b,c);C||M||0===ea||(fa(ea,!1), -ea=0);var d=Wa,e=C;C=Wa=!0;try{return a(b,c)}finally{Wa=d,(C=e)||M||fa(1073741823,!1)}}function og(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===jb(c)&&1===c.tag?void 0:p("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(E(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);p("171");g=void 0}if(1===c.tag){var h=c.type;if(E(h)){c=kf(c,h,g);break a}}c=g}else c=na;null===b.context?b.context=c:b.pendingContext= -c;b=e;e=pa(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);yb();ca(f,e);Ca(f,d);return d}function Rd(a,b,c,d){var e=b.current,f=ra();e=zb(f,e);return og(a,b,c,e,d)}function Sd(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Ah(a,b,c){var d=3=Td&&(b=Td-1);this._expirationTime=Td=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}function ab(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}function bb(a,b,c){b=R(3,null,null,b?3:0);a={current:b,containerInfo:a,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0, -didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null};this._internalRoot=b.stateNode=a}function Ac(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function Bh(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot"))); -if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new bb(a,!1,b)}function Bc(a,b,c,d,e){Ac(c)?void 0:p("200");var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Sd(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Bh(c,d);if("function"===typeof e){var h=e;e=function(){var a=Sd(f._internalRoot);h.call(a)}}mg(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Sd(f._internalRoot)} -function pg(a,b){var c=2=Eb),le=String.fromCharCode(32),ha={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]}, -compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}}, -ke=!1,Ia=!1,Fh={eventTypes:ha,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(Oc)b:{switch(a){case "compositionstart":e=ha.compositionStart;break b;case "compositionend":e=ha.compositionEnd;break b;case "compositionupdate":e=ha.compositionUpdate;break b}e=void 0}else Ia?ie(a,c)&&(e=ha.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=ha.compositionStart);e?(me&&"ko"!==c.locale&&(Ia||e!==ha.compositionStart?e===ha.compositionEnd&&Ia&&(f=ge()):(ia=d,Nc="value"in ia?ia.value:ia.textContent, -Ia=!0)),e=Ch.getPooled(e,b,c,d),f?e.data=f:(f=je(c),null!==f&&(e.data=f)),Ga(e),f=e):f=null;(a=Eh?Og(a,c):Pg(a,c))?(b=Dh.getPooled(ha.beforeInput,b,c,d),b.data=a,Ga(b)):b=null;return null===f?b:null===b?f:[f,b]}},Pc=null,Ja=null,Ka=null,se=function(a,b){return a(b)},Te=function(a,b,c){return a(b,c)},te=function(){},Qc=!1,Qg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Vd=Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, -Sg=/^(.*)[\\\/]/,Q="function"===typeof Symbol&&Symbol.for,nc=Q?Symbol.for("react.element"):60103,La=Q?Symbol.for("react.portal"):60106,la=Q?Symbol.for("react.fragment"):60107,Tc=Q?Symbol.for("react.strict_mode"):60108,Ub=Q?Symbol.for("react.profiler"):60114,Ae=Q?Symbol.for("react.provider"):60109,ze=Q?Symbol.for("react.context"):60110,Sc=Q?Symbol.for("react.concurrent_mode"):60111,Vc=Q?Symbol.for("react.forward_ref"):60112,Uc=Q?Symbol.for("react.suspense"):60113,Wc=Q?Symbol.for("react.memo"):60115, -Be=Q?Symbol.for("react.lazy"):60116,ye="function"===typeof Symbol&&Symbol.iterator,Ug=/^[: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]*$/,Ce=Object.prototype.hasOwnProperty,Ee={},De={},x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){x[a]= -new K(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];x[b]=new K(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){x[a]=new K(a,2,!1,a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){x[a]=new K(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){x[a]= -new K(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){x[a]=new K(a,3,!0,a,null)});["capture","download"].forEach(function(a){x[a]=new K(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){x[a]=new K(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){x[a]=new K(a,5,!1,a.toLowerCase(),null)});var Wd=/[\-:]([a-z])/g,Xd=function(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(Wd,Xd);x[b]=new K(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(Wd,Xd);x[b]=new K(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(Wd,Xd);x[b]=new K(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});x.tabIndex=new K("tabIndex",1,!1,"tabindex",null);var Je={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"}, -dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},gb=null,hb=null,Yd=!1;ja&&(Yd=ve("input")&&(!document.documentMode||9this.eventPool.length&&this.eventPool.push(a)}function Ne(a){a.eventPool=[];a.getPooled=yh;a.release=zh}function Oe(a,b){switch(a){case "keyup":return-1!==Ah.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function Pe(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}function Bh(a,b){switch(a){case "compositionend":return Pe(b); +case "keypress":if(32!==b.which)return null;Qe=!0;return Re;case "textInput":return a=b.data,a===Re&&Qe?null:a;default:return null}}function Ch(a,b){if(Sa)return"compositionend"===a||!hd&&Oe(a,b)?(a=Me(),hc=gd=qa=null,Sa=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function K(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}function rd(a,b,c,d){var e=A.hasOwnProperty(b)? +A[b]:null;var f=null!==e?0===e.type:d?!1:!(2rc.length&&rc.push(a)}}}function zf(a){Object.prototype.hasOwnProperty.call(a,sc)||(a[sc]=Vh++,Af[a[sc]]= +{});return Af[a[sc]]}function xd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Bf(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Cf(a,b){var c=Bf(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Bf(c)}}function Df(a,b){return a&&b?a=== +b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Df(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function Ef(){for(var a=window,b=xd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=xd(a.document)}return b}function yd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type|| +"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function Wh(){var a=Ef();if(yd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(cj){b=null;break a}var f=0,g=-1,h=-1,l=0,k=0,m=a,n=null;b:for(;;){for(var p;;){m!==b||0!==d&&3!== +m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length);if(null===(p=m.firstChild))break;n=m;m=p}for(;;){if(m===a)break b;n===b&&++l===d&&(g=f);n===e&&++k===c&&(h=f);if(null!==(p=m.nextSibling))break;m=n;n=m.parentNode}m=p}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}}function Xh(a){var b=Ef(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Df(c.ownerDocument.documentElement, +c)){if(null!==d&&yd(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Cf(c,f);var g=Cf(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&& +(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=b.length?void 0:n("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:ua(c)}}function Jf(a,b){var c=ua(b.value),d=ua(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function Kf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg"; +case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Dd(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Kf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function Lf(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||yb.hasOwnProperty(a)&&yb[a]?(""+b).trim():b+"px"}function Mf(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"), +e=Lf(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}function Ed(a,b){b&&(Zh[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?n("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?n("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:n("61")),null!=b.style&&"object"!==typeof b.style?n("62",""):void 0)}function Fd(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1; +default:return!0}}function ha(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=zf(a);b=$c[b];for(var d=0;dYa||(a.current= +Id[Ya],Id[Ya]=null,Ya--)}function L(a,b,c){Ya++;Id[Ya]=a.current;a.current=b}function Za(a,b){var c=a.type.contextTypes;if(!c)return va;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function E(a){a=a.childContextTypes;return null!==a&&void 0!==a}function uc(a){D(M,a); +D(F,a)}function Jd(a){D(M,a);D(F,a)}function Qf(a,b,c){F.current!==va?n("168"):void 0;L(F,b,a);L(M,c,a)}function Rf(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:n("108",sa(b)||"Unknown",e);return B({},c,d)}function vc(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||va;Fa=F.current;L(F,b,a);L(M,M.current,a);return!0}function Sf(a,b,c){var d=a.stateNode;d?void 0:n("169");c?(b= +Rf(a,b,Fa),d.__reactInternalMemoizedMergedChildContext=b,D(M,a),D(F,a),L(F,b,a)):D(M,a);L(M,c,a)}function Tf(a){return function(b){try{return a(b)}catch(c){}}}function ai(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Kd=Tf(function(a){return b.onCommitFiberRoot(c,a)});Ld=Tf(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function bi(a,b,c,d){this.tag=a;this.key= +c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function Md(a){a=a.prototype;return!(!a||!a.isReactComponent)}function ci(a){if("function"===typeof a)return Md(a)?1:0;if(void 0!==a&& +null!==a){a=a.$$typeof;if(a===od)return 11;if(a===pd)return 14}return 2}function Ga(a,b,c){c=a.alternate;null===c?(c=S(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue; +c.contextDependencies=a.contextDependencies;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}function wc(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Md(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ta:return wa(c.children,e,f,b);case ld:return Uf(c,e|3,f,b);case md:return Uf(c,e|2,f,b);case lc:return a=S(12,c,b,e|4),a.elementType=lc,a.type=lc,a.expirationTime=f,a;case nd:return a=S(13,c,b,e),b=nd,a.elementType=b,a.type=b,a.expirationTime=f,a;default:if("object"===typeof a&& +null!==a)switch(a.$$typeof){case ff:g=10;break a;case ef:g=9;break a;case od:g=11;break a;case pd:g=14;break a;case gf:g=16;d=null;break a}n("130",null==a?a:typeof a,"")}b=S(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function wa(a,b,c,d){a=S(7,a,d,b);a.expirationTime=c;return a}function Uf(a,b,c,d){a=S(8,a,d,b);b=0===(b&1)?md:ld;a.elementType=b;a.type=b;a.expirationTime=c;return a}function Nd(a,b,c){a=S(6,a,null,b);a.expirationTime=c;return a}function Od(a,b,c){b=S(4,null!==a.children? +a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Bb(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);xc(b,a)}function di(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{b< +a.latestPingedTime&&(a.latestPingedTime=0);var c=a.latestPendingTime;0!==c&&(c>b?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?Bb(a,b):bc&&Bb(a,b)}xc(0,a)}function Vf(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime= +d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);xc(b,a)}function Wf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function xc(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function P(a,b){if(a&&a.defaultProps){b=B({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}function ei(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result; +}a._result=b;throw b;}}function yc(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:B({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}function Xf(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!vb(c,d)||!vb(e,f):!0}function Yf(a,b,c,d){var e=!1;d=va;var f=b.contextType;"object"===typeof f&&null!==f?f=T(f):(d=E(b)?Fa:F.current,e=b.contextTypes, +f=(e=null!==e&&void 0!==e)?Za(a,d):va);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=zc;a.stateNode=b;b._reactInternalFiber=a;e&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=d,a.__reactInternalMemoizedMaskedChildContext=f);return b}function Zf(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!== +a&&zc.enqueueReplaceState(b,b.state,null)}function Pd(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=$f;var f=b.contextType;"object"===typeof f&&null!==f?e.context=T(f):(f=E(b)?Fa:F.current,e.context=Za(a,f));f=a.updateQueue;null!==f&&(Cb(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(yc(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&& +"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&zc.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Cb(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}function Db(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!== +c.tag?n("309"):void 0,d=c.stateNode);d?void 0:n("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===$f&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?n("284"):void 0;c._owner?void 0:n("290",a)}return a}function Ac(a,b){"textarea"!==a.type&&n("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")}function ag(a){function b(b, +c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=Ga(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,dq?(v=n,n=null):v=n.sibling;var Q=p(e,n,h[q],k);if(null===Q){null===n&&(n=v);break}a&& +n&&null===Q.alternate&&b(e,n);g=f(Q,g,q);null===m?l=Q:m.sibling=Q;m=Q;n=v}if(q===h.length)return c(e,n),l;if(null===n){for(;qv?(Q=q,q=null):Q=q.sibling;var u=p(e,q,t.value,k);if(null===u){q||(q=Q);break}a&&q&&null===u.alternate&&b(e,q);g=f(u,g,v);null===m?l=u:m.sibling=u;m=u;q=Q}if(t.done)return c(e,q),l;if(null===q){for(;!t.done;v++,t=h.next())t=Ff(e,t.value,k),null!==t&&(g=f(t,g,v),null===m?l=t:m.sibling=t,m=t);return l}for(q=d(e,q);!t.done;v++,t=h.next())t=r(q,e,v,t.value,k),null!==t&&(a&&null!==t.alternate&&q.delete(null===t.key? +v:t.key),g=f(t,g,v),null===m?l=t:m.sibling=t,m=t);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ta&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Bc:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===ta:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ta?f.props.children:f.props,h);d.ref=Db(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k); +k=k.sibling}f.type===ta?(d=wa(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=wc(f.type,f.key,f.props,null,a.mode,h),h.ref=Db(a,d,f),h.return=a,a=h)}return g(a);case Va:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Od(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"=== +typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=Nd(f,a.mode,h),d.return=a,a=d),g(a);if(Cc(f))return u(a,d,f,h);if(sb(f))return x(a,d,f,h);l&&Ac(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,n("152",h.displayName||h.name||"Component")}return c(a,d)}}function Ha(a){a===Eb?n("174"):void 0;return a}function Qd(a,b){L(Fb,b,a);L(Gb,a,a);L(U,Eb,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Dd(null, +"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=Dd(b,c)}D(U,a);L(U,b,a)}function $a(a){D(U,a);D(Gb,a);D(Fb,a)}function bg(a){Ha(Fb.current);var b=Ha(U.current);var c=Dd(b,a.type);b!==c&&(L(Gb,a,a),L(U,c,a))}function Rd(a){Gb.current===a&&(D(U,a),D(Gb,a))}function V(){n("321")}function Sd(a,b){if(null===b)return!1;for(var c=0;cKb&&(Kb=m)):f=l.eagerReducer===a?l.eagerState:a(f,l.action);g=l;l=l.next}while(null!==l&&l!== +d);k||(h=g,e=f);Ea(f,b.memoizedState)||(ja=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}function Wd(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===X?(X={lastEffect:null},X.lastEffect=a.next=a):(b=X.lastEffect,null===b?X.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,X.lastEffect=a));return a}function Xd(a,b,c,d){var e=cb();Lb|=a;e.memoizedState=Wd(b,c,void 0,void 0===d?null:d)}function Yd(a,b,c,d){var e=Mb();d=void 0=== +d?null:d;var f=void 0;if(null!==y){var g=y.memoizedState;f=g.destroy;if(null!==d&&Sd(d,g.deps)){Wd(db,c,f,d);return}}Lb|=a;e.memoizedState=Wd(b,c,f,d)}function fg(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function gg(a,b){}function hg(a,b,c){25>Jb?void 0:n("301");var d=a.alternate;if(a===xa||null!==d&&d===xa)if(Ib=!0,a={expirationTime:Hb,action:c,eagerReducer:null,eagerState:null,next:null},null=== +ia&&(ia=new Map),c=ia.get(b),void 0===c)ia.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{eb();var e=ka();e=fb(e,a);var f={expirationTime:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var l=b.lastRenderedState,k=d(l,c);f.eagerReducer=d;f.eagerState=k;if(Ea(k,l))return}catch(m){}finally{}ya(a, +e)}}function ig(a,b){var c=S(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function jg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}function kg(a){if(Ia){var b= +gb;if(b){var c=b;if(!jg(a,b)){b=Hd(c);if(!b||!jg(a,b)){a.effectTag|=2;Ia=!1;la=a;return}ig(la,c)}la=a;gb=Pf(b)}else a.effectTag|=2,Ia=!1,la=a}}function lg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;la=a}function Zd(a){if(a!==la)return!1;if(!Ia)return lg(a),Ia=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Gd(b,a.memoizedProps))for(b=gb;b;)ig(a,b),b=Hd(b);lg(a);gb=la?Hd(a.stateNode):null;return!0}function $d(){gb=la=null;Ia=!1}function N(a,b,c,d){b.child=null=== +a?ae(b,null,c,d):hb(b,a.child,c,d)}function mg(a,b,c,d,e){c=c.render;var f=b.ref;ib(b,e);d=Td(a,b,c,d,f,e);if(null!==a&&!ja)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),ma(a,b,e);b.effectTag|=1;N(a,b,d,e);return b.child}function ng(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Md(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,og(a,b,g,d,e,f);a=wc(c.type,null,d,null,b.mode,f);a.ref= +b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return sg(a,b,c);b=ma(a,b,c);return null!==b?b.sibling:null}}return ma(a,b,c)}}else ja=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Za(b,F.current);ib(b,c);e=Td(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag= +1;Vd();if(E(d)){var f=!0;vc(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&yc(b,d,g,a);e.updater=zc;b.stateNode=e;e._reactInternalFiber=b;Pd(b,d,a,c);b=ce(null,b,d,!0,f,c)}else b.tag=0,N(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=ei(e);b.type=a;e=b.tag=ci(a);f=P(a,f);g=void 0;switch(e){case 0:g=be(null,b,a,f,c);break;case 1:g= +qg(null,b,a,f,c);break;case 11:g=mg(null,b,a,f,c);break;case 14:g=ng(null,b,a,P(a.type,f),d,c);break;default:n("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),be(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),qg(a,b,d,e,c);case 3:rg(b);d=b.updateQueue;null===d?n("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;Cb(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)$d(),b=ma(a,b,c);else{e=b.stateNode;if(e= +(null===a||null===a.child)&&e.hydrate)gb=Pf(b.stateNode.containerInfo),la=b,e=Ia=!0;e?(b.effectTag|=2,b.child=ae(b,null,d,c)):(N(a,b,d,c),$d());b=b.child}return b;case 5:return bg(b),null===a&&kg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Gd(d,e)?g=null:null!==f&&Gd(d,f)&&(b.effectTag|=16),pg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(N(a,b,g,c),b=b.child),b;case 6:return null===a&&kg(b),null;case 13:return sg(a,b,c);case 4:return Qd(b, +b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=hb(b,null,d,c):N(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),mg(a,b,d,e,c);case 7:return N(a,b,b.pendingProps,c),b.child;case 8:return N(a,b,b.pendingProps.children,c),b.child;case 12:return N(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;tg(b,f);if(null!==g){var h=g.value;f=Ea(h,f)?0:("function"===typeof d._calculateChangedBits? +d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!M.current){b=ma(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var l=h.contextDependencies;if(null!==l){g=h.child;for(var k=l.first;null!==k;){if(k.context===d&&0!==(k.observedBits&f)){1===h.tag&&(k=Aa(c),k.tag=Ec,na(h,k));h.expirationTime=b&&(ja=!0);a.contextDependencies=null}function T(a,b){if(Ob!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Ob=a,b=1073741823;b={context:a,observedBits:b,next:null};null===Ja?(null===Nb?n("308"):void 0,Ja=b,Nb.contextDependencies={first:b,expirationTime:0}):Ja=Ja.next=b}return a._currentValue}function Fc(a){return{baseState:a, +firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function fe(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Aa(a){return{expirationTime:a,tag:ug,payload:null,callback:null,next:null,nextEffect:null}}function Gc(a, +b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}function na(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=Fc(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=Fc(a.memoizedState),e=c.updateQueue=Fc(c.memoizedState)):d=a.updateQueue=fe(e):null===e&&(e=c.updateQueue=fe(d));null===e||d===e?Gc(d,b):null===d.lastUpdate||null===e.lastUpdate?(Gc(d,b),Gc(e,b)):(Gc(d,b),e.lastUpdate= +b)}function vg(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=Fc(a.memoizedState):wg(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function wg(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=fe(b));return b}function xg(a,b,c,d,e,f){switch(c.tag){case yg:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case ge:a.effectTag=a.effectTag&-2049|64;case ug:a=c.payload;e="function"===typeof a? +a.call(f,d,e):a;if(null===e||void 0===e)break;return B({},d,e);case Ec:za=!0}return d}function Cb(a,b,c,d,e){za=!1;b=wg(a,b);for(var f=b.baseState,g=null,h=0,l=b.firstUpdate,k=f;null!==l;){var m=l.expirationTime;md?e:d);Kg.current=null;d=void 0;1c?b:c;0===b&&(Ba=null);wi(a,b)}function Mg(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){x=a;a:{var e=b;b=a;var f=H;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:E(b.type)&&uc(b);break;case 3:$a(b);Jd(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)Zd(b),b.effectTag&= +-3;pe(b);break;case 5:Rd(b);var h=Ha(Fb.current);f=b.type;if(null!==e&&null!=b.stateNode)Ng(e,b,f,g,h),e.ref!==b.ref&&(b.effectTag|=128);else if(g){var l=Ha(U.current);if(Zd(b)){g=b;e=g.stateNode;var k=g.type,m=g.memoizedProps,p=h;e[ea]=g;e[ec]=m;f=void 0;h=k;switch(h){case "iframe":case "object":r("load",e);break;case "video":case "audio":for(k=0;k\x3c/script>",k=e.removeChild(e.firstChild)): +"string"===typeof e.is?k=k.createElement(p,{is:e.is}):(k=k.createElement(p),"select"===p&&(p=k,e.multiple?p.multiple=!0:e.size&&(p.size=e.size))):k=k.createElementNS(l,p);e=k;e[ea]=m;e[ec]=g;Og(e,b,!1,!1);m=e;k=f;p=g;var t=h,y=Fd(k,p);switch(k){case "iframe":case "object":r("load",m);h=p;break;case "video":case "audio":for(h=0;hg&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==x)return x;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect), +1=u)t=0;else if(-1===t||u component higher in the tree to provide a loading indicator or placeholder to display."+ +qd(k))}je=!0;m=Hc(m,k);h=l;do{switch(h.tag){case 3:h.effectTag|=2048;h.expirationTime=g;g=he(h,m,g);vg(h,g);break a;case 1:if(t=m,r=h.type,k=h.stateNode,0===(h.effectTag&64)&&("function"===typeof r.getDerivedStateFromError||null!==k&&"function"===typeof k.componentDidCatch&&(null===Ba||!Ba.has(k)))){h.effectTag|=2048;h.expirationTime=g;g=Ig(h,t,g);vg(h,g);break a}}h=h.return}while(null!==h)}x=Mg(f);continue}}}break}while(1);Ca=!1;qe.current=c;Ob=Ja=Nb=null;Vd();if(e)Y=null,a.finishedWork=null;else if(null!== +x)a.finishedWork=null;else{c=a.current.alternate;null===c?n("281"):void 0;Y=null;if(je){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&eb?0:b)):(a.pendingCommitExpirationTime= +d,a.finishedWork=c)}}function Ka(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Ba||!Ba.has(d))){a=Hc(b,a);a=Ig(c,a,1073741823);na(c,a);ya(c,1073741823);return}break;case 3:a=Hc(b,a);a=he(c,a,1073741823);na(c,a);ya(c,1073741823);return}c=c.return}3===a.tag&&(c=Hc(b,a),c=he(a,c,1073741823),na(a,c),ya(a,1073741823))}function fb(a,b){var c=zi(),d=void 0;if(0===(b.mode&1))d= +1073741823;else if(Ca&&!Lc)d=H;else{switch(c){case se:d=1073741823;break;case te:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case Lg:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case Ai:case Bi:d=1;break;default:n("313")}null!==Y&&d===H&&--d}c===te&&(0===oa||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b|| +b>c)a.latestPingedTime=c;xc(c,a);c=a.expirationTime;0!==c&&Kc(a,c)}}function li(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=ka();b=fb(b,a);a=Sg(a,b);null!==a&&(Bb(a,b),b=a.expirationTime,0!==b&&Kc(a,b))}function Sg(a,b){a.expirationTimeH&&Jg(),Bb(a,b),Ca&&!Lc&&Y===a||Kc(a,a.expirationTime),Tb>Ci&&(Tb=0,n("185")))}function Tg(a,b,c,d,e){return Mc(se,function(){return a(b,c,d,e)})}function Ub(){aa=1073741822-((ue()-ve)/10|0)}function Ug(a,b){if(0!==Oc){if(ba.expirationTime&&(a.expirationTime= +b);w||(z?Rc&&(ca=a,C=1073741823,Sc(a,1073741823,!1)):1073741823===b?Z(1073741823,!1):Ug(a,b))}function Qc(){var a=0,b=null;if(null!==I)for(var c=I,d=ba;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===I?n("244"):void 0;if(d===d.nextScheduledRoot){ba=I=d.nextScheduledRoot=null;break}else if(d===ba)ba=e=d.nextScheduledRoot,I.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===I){I=c;I.nextScheduledRoot=ba;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot= +null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===I)break;if(1073741823===a)break;c=d;d=d.nextScheduledRoot}}ca=b;C=a}function Nc(){return Tc?!0:Gi()?Tc=!0:!1}function Di(){try{if(!Nc()&&null!==ba){Ub();var a=ba;do{var b=a.expirationTime;0!==b&&aa<=b&&(a.nextExpirationTimeToWorkOn=aa);a=a.nextScheduledRoot}while(a!==ba)}Z(0,!0)}finally{Tc=!1}}function Z(a,b){Qc();if(b)for(Ub(),jb=aa;null!==ca&&0!==C&&a<=C&&!(Tc&&aa>C);)Sc(ca,C,aa>C),Qc(),Ub(),jb=aa;else for(;null!==ca&&0!==C&&a<=C;)Sc(ca,C,!1), +Qc();b&&(Oc=0,Pc=null);0!==C&&Ug(ca,C);Tb=0;we=null;if(null!==kb)for(a=kb,kb=null,b=0;b=c&&(null===kb?kb=[d]:kb.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===we?Tb++:(we=a,Tb=0);Mc(se,function(){ui(a,b)})}function ie(a){null===ca?n("246"):void 0;ca.expirationTime=0;lb||(lb=!0,Uc=a)}function Zg(a,b){var c=z;z=!0;try{return a(b)}finally{(z= +c)||w||Z(1073741823,!1)}}function $g(a,b){if(z&&!Rc){Rc=!0;try{return a(b)}finally{Rc=!1}}return a(b)}function ah(a,b,c){z||w||0===oa||(Z(oa,!1),oa=0);var d=z;z=!0;try{return Mc(te,function(){return a(b,c)})}finally{(z=d)||w||Z(1073741823,!1)}}function bh(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===wb(c)&&1===c.tag?void 0:n("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(E(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g= +g.return}while(null!==g);n("171");g=void 0}if(1===c.tag){var h=c.type;if(E(h)){c=Rf(c,h,g);break a}}c=g}else c=va;null===b.context?b.context=c:b.pendingContext=c;b=e;e=Aa(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);eb();na(f,e);ya(f,d);return d}function xe(a,b,c,d){var e=b.current,f=ka();e=fb(f,e);return bh(a,b,c,e,d)}function ye(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Hi(a,b,c){var d= +3=ze&&(b=ze-1);this._expirationTime=ze=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}function mb(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}function nb(a,b,c){b=S(3,null,null, +b?3:0);a={current:b,containerInfo:a,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null};this._internalRoot=b.stateNode=a}function ob(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType|| +" react-mount-point-unstable "!==a.nodeValue))}function Ii(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new nb(a,!1,b)}function Wc(a,b,c,d,e){var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=ye(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Ii(c,d);if("function"=== +typeof e){var h=e;e=function(){var a=ye(f._internalRoot);h.call(a)}}$g(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return ye(f._internalRoot)}function ch(a,b){var c=2=Wb),Re=String.fromCharCode(32),pa={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput", +captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate", +captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Qe=!1,Sa=!1,Mi={eventTypes:pa,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(hd)b:{switch(a){case "compositionstart":e=pa.compositionStart;break b;case "compositionend":e=pa.compositionEnd;break b;case "compositionupdate":e=pa.compositionUpdate;break b}e=void 0}else Sa?Oe(a,c)&&(e=pa.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=pa.compositionStart);e?(Se&& +"ko"!==c.locale&&(Sa||e!==pa.compositionStart?e===pa.compositionEnd&&Sa&&(f=Me()):(qa=d,gd="value"in qa?qa.value:qa.textContent,Sa=!0)),e=Ji.getPooled(e,b,c,d),f?e.data=f:(f=Pe(c),null!==f&&(e.data=f)),Qa(e),f=e):f=null;(a=Li?Bh(a,c):Ch(a,c))?(b=Ki.getPooled(pa.beforeInput,b,c,d),b.data=a,Qa(b)):b=null;return null===f?b:null===b?f:[f,b]}},id=null,Ta=null,Ua=null,Ye=function(a,b){return a(b)},yf=function(a,b,c){return a(b,c)},Ze=function(){},jd=!1,Dh={color:!0,date:!0,datetime:!0,"datetime-local":!0, +email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Ma=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ma.hasOwnProperty("ReactCurrentDispatcher")||(Ma.ReactCurrentDispatcher={current:null});var Fh=/^(.*)[\\\/]/,O="function"===typeof Symbol&&Symbol.for,Bc=O?Symbol.for("react.element"):60103,Va=O?Symbol.for("react.portal"):60106,ta=O?Symbol.for("react.fragment"):60107,md=O?Symbol.for("react.strict_mode"):60108,lc=O?Symbol.for("react.profiler"):60114, +ff=O?Symbol.for("react.provider"):60109,ef=O?Symbol.for("react.context"):60110,ld=O?Symbol.for("react.concurrent_mode"):60111,od=O?Symbol.for("react.forward_ref"):60112,nd=O?Symbol.for("react.suspense"):60113,pd=O?Symbol.for("react.memo"):60115,gf=O?Symbol.for("react.lazy"):60116,df="function"===typeof Symbol&&Symbol.iterator,Hh=/^[: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]*$/, +hf=Object.prototype.hasOwnProperty,kf={},jf={},A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){A[a]=new K(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];A[b]=new K(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){A[a]=new K(a,2,!1, +a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){A[a]=new K(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){A[a]=new K(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){A[a]=new K(a,3,!0,a,null)});["capture", +"download"].forEach(function(a){A[a]=new K(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){A[a]=new K(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){A[a]=new K(a,5,!1,a.toLowerCase(),null)});var Be=/[\-:]([a-z])/g,Ce=function(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(Be,Ce);A[b]=new K(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(Be,Ce);A[b]=new K(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(Be,Ce);A[b]=new K(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});["tabIndex","crossOrigin"].forEach(function(a){A[a]=new K(a,1,!1,a.toLowerCase(),null)});var pf={change:{phasedRegistrationNames:{bubbled:"onChange", +captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},tb=null,ub=null,De=!1;ra&&(De=af("input")&&(!document.documentMode||9=document.documentMode,af={select:{phasedRegistrationNames:{bubbled:"onSelect", -captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Ma=null,gd=null,kb=null,fd=!1,Uh={eventTypes:af,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Ue(e);f=Gc.onSelect;for(var g=0;g"+b+"";for(b=Cc.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}), -xb=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b},lb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0, -lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vh=["Webkit","ms","Moz","O"];Object.keys(lb).forEach(function(a){Vh.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);lb[b]=lb[a]})});var jh=y({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0, -source:!0,track:!0,wbr:!0}),Dc=Y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,$f=Dc.unstable_cancelCallback,Md=Dc.unstable_now,vh=Dc.unstable_scheduleCallback,zh=Dc.unstable_shouldYield,Pd=null,Qd=null,xh="function"===typeof setTimeout?setTimeout:void 0,kg="function"===typeof clearTimeout?clearTimeout:void 0;new Set;var od=[],Oa=-1,na={},F={current:na},I={current:!1},va=na,qd=null,rd=null,R=function(a,b,c,d){return new lh(a,b,c,d)},qa=!1,wd={current:null},pb=null,xa=null,qb=null,rb= -{},S={current:rb},tb={current:rb},sb={current:rb},kc=Vd.ReactCurrentOwner,Bf=(new Y.Component).refs,lc={isMounted:function(a){return(a=a._reactInternalFiber)?2===jb(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=ra();d=zb(d,a);var e=pa(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);yb();ca(a,e);Ca(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=ra();d=zb(d,a);var e=pa(d);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);yb();ca(a,e);Ca(a,d)}, -enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=ra();c=zb(c,a);var d=pa(c);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);yb();ca(a,d);Ca(a,c)}},oc=Array.isArray,Ua=Cf(!0),Dd=Cf(!1),da=null,Ta=null,za=!1,oh=Vd.ReactCurrentOwner,cg=void 0,Jd=void 0,bg=void 0,dg=void 0;cg=function(a,b,c,d){for(c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return|| -c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Jd=function(a){};bg=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;ya(S.current);a=null;switch(c){case "input":f=Zc(g,f);d=Zc(g,d);a=[];break;case "option":f=hd(g,f);d=hd(g,d);a=[];break;case "select":f=y({},f,{value:void 0});d=y({},d,{value:void 0});a=[];break;case "textarea":f=id(g,f);d=id(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=bc)}kd(c,d);g=c=void 0; -var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===c){var k=f[c];for(g in k)k.hasOwnProperty(g)&&(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Ea.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(g in k)!k.hasOwnProperty(g)|| -l&&l.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in l)l.hasOwnProperty(g)&&k[g]!==l[g]&&(h||(h={}),h[g]=l[g])}else h||(a||(a=[]),a.push(c,h)),h=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(Ea.hasOwnProperty(c)?(null!=l&&ba(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}h&& -(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&wb(b)}};dg=function(a,b,c,d){c!==d&&wb(b)};var sh={readContext:wf},pc=Vd.ReactCurrentOwner,Td=1073741822,Ab=0,ta=!1,B=null,U=null,H=0,Ba=-1,Id=!1,n=null,rc=!1,rh=null,Zf=null,sa=null,W=null,N=null,sc=0,tc=void 0,M=!1,X=null,u=0,ea=0,Za=!1,yc=null,C=!1,vc=!1,Wa=!1,Ya=null,Nd=Md(),V=1073741822-(Nd/10|0),Xa=V,uh=50,Bb=0,Od=null,xc=!1;Pc=function(a,b,c){switch(b){case "input":$c(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode; -c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};(function(a,b,c){se=a;Te=b;te=c})(lg,ng,function(){M||0===ea||(fa(ea,!1),ea=0)});var Bg={createPortal:pg,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0=== -b&&("function"===typeof a.render?p("188"):p("268",Object.keys(a)));a=Oe(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){return Bc(null,a,b,!0,c)},render:function(a,b,c){return Bc(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){null==a||void 0===a._reactInternalFiber?p("38"):void 0;return Bc(a,b,c,!1,d)},unmountComponentAtNode:function(a){Ac(a)?void 0:p("40");return a._reactRootContainer?(mg(function(){Bc(null,null,a,!1,function(){a._reactRootContainer=null})}), -!0):!1},unstable_createPortal:function(){return pg.apply(void 0,arguments)},unstable_batchedUpdates:lg,unstable_interactiveUpdates:ng,flushSync:function(a,b){M?p("187"):void 0;var c=C;C=!0;try{return hg(a,b)}finally{C=c,fa(1073741823,!1)}},unstable_flushControlled:function(a){var b=C;C=!0;try{hg(a)}finally{(C=b)||M||fa(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[de,ua,Kc,Ud.injectEventPluginsByName,Fc,Ga,function(a){Hc(a,Kg)},pe,qe,Xb,Jc]},unstable_createRoot:function(a, -b){Ac(a)?void 0:p("299","unstable_createRoot");return new bb(a,!0,null!=b&&!0===b.hydrate)}};(function(a){var b=a.findFiberByHostInstance;return kh(y({},a,{findHostInstanceByFiber:function(a){a=Oe(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Mb,bundleType:0,version:"16.6.3",rendererPackageName:"react-dom"});var Cg={default:Bg},Dg=Cg&&Bg||Cg;return Dg.default||Dg}); +"reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(a){uf(a,!0)});Zi.forEach(function(a){uf(a,!1)});var nh={eventTypes:vf,isInteractiveTopLevelEventType:function(a){a=wd[a];return void 0!==a&&!0===a.isInteractive},extractEvents:function(a,b,c,d){var e=wd[a];if(!e)return null;switch(a){case "keypress":if(0===nc(c))return null;case "keydown":case "keyup":a=Ui;break;case "blur":case "focus":a= +Ri;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=Yb;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a=Vi;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=Wi;break;case eh:case fh:case gh:a=Pi;break;case hh:a=Xi;break;case "scroll":a=Xb;break;case "wheel":a= +Yi;break;case "copy":case "cut":case "paste":a=Qi;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=mh;break;default:a=J}b=a.getPooled(e,b,c,d);Qa(b);return b}},wf=nh.isInteractiveTopLevelEventType,rc=[],qc=!0,Af={},Vh=0,sc="_reactListenersID"+(""+Math.random()).slice(2),$i=ra&&"documentMode"in document&&11>=document.documentMode,Hf={select:{phasedRegistrationNames:{bubbled:"onSelect", +captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Wa=null,Ad=null,xb=null,zd=!1,aj={eventTypes:Hf,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=zf(e);f=$c.onSelect;for(var g=0;g"+b+"";for(b=Xc.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}), +Ab=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b},yb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0, +lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bj=["Webkit","ms","Moz","O"];Object.keys(yb).forEach(function(a){bj.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);yb[b]=yb[a]})});var Zh=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0, +source:!0,track:!0,wbr:!0}),R=da.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,Vg=R.unstable_cancelCallback,ue=R.unstable_now,Wg=R.unstable_scheduleCallback,Gi=R.unstable_shouldYield,Mc=R.unstable_runWithPriority,zi=R.unstable_getCurrentPriorityLevel,se=R.unstable_ImmediatePriority,te=R.unstable_UserBlockingPriority,Lg=R.unstable_NormalPriority,Ai=R.unstable_LowPriority,Bi=R.unstable_IdlePriority,ne=null,oe=null,Ei="function"===typeof setTimeout?setTimeout:void 0,Yg="function"===typeof clearTimeout? +clearTimeout:void 0,vi=Wg,ti=Vg;new Set;var Id=[],Ya=-1,va={},F={current:va},M={current:!1},Fa=va,Kd=null,Ld=null,S=function(a,b,c,d){return new bi(a,b,c,d)},$f=(new da.Component).refs,zc={isMounted:function(a){return(a=a._reactInternalFiber)?2===wb(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=ka();d=fb(d,a);var e=Aa(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);eb();na(a,e);ya(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=ka();d=fb(d,a);var e= +Aa(d);e.tag=yg;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);eb();na(a,e);ya(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=ka();c=fb(c,a);var d=Aa(c);d.tag=Ec;void 0!==b&&null!==b&&(d.callback=b);eb();na(a,d);ya(a,c)}},Cc=Array.isArray,hb=ag(!0),ae=ag(!1),Eb={},U={current:Eb},Gb={current:Eb},Fb={current:Eb},db=0,pi=2,Rb=4,ji=8,ri=16,Sb=32,me=64,le=128,Dc=Ma.ReactCurrentDispatcher,Hb=0,xa=null,y=null,W=null,bb=null,G=null,ab=null,Kb=0,X=null,Lb=0,Ib=!1,ia=null,Jb=0,Ud={readContext:T, +useCallback:V,useContext:V,useEffect:V,useImperativeHandle:V,useLayoutEffect:V,useMemo:V,useReducer:V,useRef:V,useState:V,useDebugValue:V},fi={readContext:T,useCallback:function(a,b){cb().memoizedState=[a,void 0===b?null:b];return a},useContext:T,useEffect:function(a,b){return Xd(516,le|me,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Xd(4,Rb|Sb,fg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Xd(4,Rb|Sb,a,b)},useMemo:function(a,b){var c=cb(); +b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=cb();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=hg.bind(null,xa,a);return[d.memoizedState,a]},useRef:function(a){var b=cb();a={current:a};return b.memoizedState=a},useState:function(a){var b=cb();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null,lastRenderedReducer:dg, +lastRenderedState:a};a=a.dispatch=hg.bind(null,xa,a);return[b.memoizedState,a]},useDebugValue:gg},cg={readContext:T,useCallback:function(a,b){var c=Mb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Sd(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:T,useEffect:function(a,b){return Yd(516,le|me,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Yd(4,Rb|Sb,fg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Yd(4,Rb|Sb, +a,b)},useMemo:function(a,b){var c=Mb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Sd(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:eg,useRef:function(a){return Mb().memoizedState},useState:function(a){return eg(dg,a)},useDebugValue:gg},la=null,gb=null,Ia=!1,gi=Ma.ReactCurrentOwner,ja=!1,de={current:null},Nb=null,Ja=null,Ob=null,ug=0,yg=1,Ec=2,ge=3,za=!1,Og=void 0,pe=void 0,Ng=void 0,Pg=void 0;Og=function(a,b,c,d){for(c=b.child;null!==c;){if(5===c.tag|| +6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};pe=function(a){};Ng=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;Ha(U.current);a=null;switch(c){case "input":f=sd(g,f);d=sd(g,d);a=[];break;case "option":f=Bd(g,f);d=Bd(g,d);a=[];break;case "select":f=B({},f,{value:void 0});d=B({},d,{value:void 0}); +a=[];break;case "textarea":f=Cd(g,f);d=Cd(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=tc)}Ed(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===c){var l=f[c];for(g in l)l.hasOwnProperty(g)&&(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Oa.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c, +null));for(c in d){var k=d[c];l=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&k!==l&&(null!=k||null!=l))if("style"===c)if(l){for(g in l)!l.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in k)k.hasOwnProperty(g)&&l[g]!==k[g]&&(h||(h={}),h[g]=k[g])}else h||(a||(a=[]),a.push(c,h)),h=k;else"dangerouslySetInnerHTML"===c?(k=k?k.__html:void 0,l=l?l.__html:void 0,null!=k&&l!==k&&(a=a||[]).push(c,""+k)):"children"===c?l===k||"string"!==typeof k&&"number"!==typeof k||(a=a||[]).push(c,""+ +k):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(Oa.hasOwnProperty(c)?(null!=k&&ha(e,c),a||l===k||(a=[])):(a=a||[]).push(c,k))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&Pb(b)}};Pg=function(a,b,c,d){c!==d&&Pb(b)};var ki="function"===typeof WeakSet?WeakSet:Set,xi="function"===typeof WeakMap?WeakMap:Map,qe=Ma.ReactCurrentDispatcher,Kg=Ma.ReactCurrentOwner,ze=1073741822,Ca=!1,x=null,Y=null,H=0,La=-1,je=!1,p=null,Lc=!1,ke=null,Jc=null,Ic=null,Ba=null,ba=null,I=null,Oc= +0,Pc=void 0,w=!1,ca=null,C=0,oa=0,lb=!1,Uc=null,z=!1,Rc=!1,kb=null,ve=ue(),aa=1073741822-(ve/10|0),jb=aa,Ci=50,Tb=0,we=null,Tc=!1;id=function(a,b,c){switch(b){case "input":td(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b=b;)c=d,d=d._next;a._next=d;null!== +c&&(c._next=a)}return a};(function(a,b,c){Ye=a;yf=b;Ze=c})(Zg,ah,function(){w||0===oa||(Z(oa,!1),oa=0)});var oh={createPortal:ch,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=tf(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!0,c)},render:function(a,b,c){ob(b)?void 0:n("200");return Wc(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a, +b,c,d){ob(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return Wc(a,b,c,!1,d)},unmountComponentAtNode:function(a){ob(a)?void 0:n("40");return a._reactRootContainer?($g(function(){Wc(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ch.apply(void 0,arguments)},unstable_batchedUpdates:Zg,unstable_interactiveUpdates:ah,flushSync:function(a,b){w?n("187"):void 0;var c=z;z=!0;try{return Tg(a,b)}finally{z=c,Z(1073741823,!1)}}, +unstable_createRoot:function(a,b){ob(a)?void 0:n("299","unstable_createRoot");return new nb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=z;z=!0;try{Tg(a)}finally{(z=b)||w||Z(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Je,Da,dd,Ae.injectEventPluginsByName,Zc,Qa,function(a){ad(a,xh)},Ve,We,oc,cd]}};(function(a){var b=a.findFiberByHostInstance;return ai(B({},a,{overrideProps:null,currentDispatcherRef:Ma.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a= +tf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:dc,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"});var ph={default:oh},qh=ph&&oh||ph;return qh.default||qh}); diff --git a/frontend/node_modules/react-dom/umd/react-dom.profiling.min.js b/frontend/node_modules/react-dom/umd/react-dom.profiling.min.js index e90f100d..941f1dd9 100644 --- a/frontend/node_modules/react-dom/umd/react-dom.profiling.min.js +++ b/frontend/node_modules/react-dom/umd/react-dom.profiling.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react-dom.profiling.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -9,202 +9,218 @@ /* Modernizr 3.0.0pre (Custom Build) | MIT */ -'use strict';(function(O,ab){"object"===typeof exports&&"undefined"!==typeof module?module.exports=ab(require("react")):"function"===typeof define&&define.amd?define(["react"],ab):O.ReactDOM=ab(O.React)})(this,function(O){function ab(a,b,c,d,e,f,g,h){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 k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name= -"Invariant Violation"}a.framesToPop=1;throw a;}}function n(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;dthis.eventPool.length&&this.eventPool.push(a)}function fe(a){a.eventPool=[];a.getPooled=Lg;a.release=Mg}function ge(a,b){switch(a){case "keyup":return-1!==Ng.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}function Og(a,b){switch(a){case "compositionend":return he(b); -case "keypress":if(32!==b.which)return null;ie=!0;return je;case "textInput":return a=b.data,a===je&&ie?null:a;default:return null}}function Pg(a,b){if(Ja)return"compositionend"===a||!Mc&&ge(a,b)?(a=ee(),Nb=Lc=ha=null,Ja=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function G(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}function Wc(a,b,c,d){var e=w.hasOwnProperty(b)? -w[b]:null;var f=null!==e?0===e.type:d?!1:!(2Xb.length&&Xb.push(a)}}}function Se(a){Object.prototype.hasOwnProperty.call(a,Yb)||(a[Yb]=hh++,Te[a[Yb]]= -{});return Te[a[Yb]]}function bd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Ue(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ve(a,b){var c=Ue(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ue(c)}}function We(a,b){return a&&b?a=== -b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?We(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function Xe(){for(var a=window,b=bd();b instanceof a.HTMLIFrameElement;){try{a=b.contentDocument.defaultView}catch(c){break}b=bd(a.document)}return b}function cd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b|| -"true"===a.contentEditable)}function ih(){var a=Xe();if(cd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(Ye){b=null;break a}var f=0,g=-1,h=-1,k=0,l=0,m=a,n=null;b:for(;;){for(var p;;){m!==b||0!==d&&3!==m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h= -f+c);3===m.nodeType&&(f+=m.nodeValue.length);if(null===(p=m.firstChild))break;n=m;m=p}for(;;){if(m===a)break b;n===b&&++k===d&&(g=f);n===e&&++l===c&&(h=f);if(null!==(p=m.nextSibling))break;m=n;n=m.parentNode}m=p}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}}function jh(a){var b=Xe(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&We(c.ownerDocument.documentElement,c)){if(null!==d&&cd(c))if(b=d.start,a=d.end, -void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ve(c,f);var g=Ve(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset), -a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=b.length?void 0:n("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:la(c)}}function cf(a,b){var c=la(b.value),d=la(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function df(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML"; -default:return"http://www.w3.org/1999/xhtml"}}function hd(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?df(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function ef(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||jb.hasOwnProperty(a)&&jb[a]?(""+b).trim():b+"px"}function ff(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=ef(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c, -e):a[c]=e}}function id(a,b){b&&(lh[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?n("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?n("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:n("61")),null!=b.style&&"object"!==typeof b.style?n("62",""):void 0)}function jd(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1; -default:return!0}}function Y(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Se(a);b=Ec[b];for(var d=0;dPa||(a.current=md[Pa],md[Pa]=null,Pa--)}function H(a, -b,c){Pa++;md[Pa]=a.current;a.current=b}function Qa(a,b){var c=a.type.contextTypes;if(!c)return ma;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function B(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $b(a){x(I,a);x(C,a)}function nd(a){x(I,a);x(C,a)}function jf(a, -b,c){C.current!==ma?n("168"):void 0;H(C,b,a);H(I,c,a)}function kf(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:n("108",ja(b)||"Unknown",e);return A({},c,d)}function ac(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||ma;ua=C.current;H(C,b,a);H(I,I.current,a);return!0}function lf(a,b,c){var d=a.stateNode;d?void 0:n("169");c?(b=kf(a,b,ua),d.__reactInternalMemoizedMergedChildContext= -b,x(I,a),x(C,a),H(C,b,a)):x(I,a);H(I,c,a)}function mf(a){return function(b){try{return a(b)}catch(c){}}}function mh(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);od=mf(function(a){return b.onCommitFiberRoot(c,a)});pd=mf(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function nh(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode= -this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null;this.actualDuration=0;this.actualStartTime=-1;this.treeBaseDuration=this.selfBaseDuration=0}function qd(a){a=a.prototype;return!(!a||!a.isReactComponent)}function oh(a){if("function"=== -typeof a)return qd(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Tc)return 11;if(a===Uc)return 14}return 2}function va(a,b,c){c=a.alternate;null===c?(c=P(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null,c.actualDuration=0,c.actualStartTime=-1);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps= -a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.firstContextDependency=a.firstContextDependency;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;c.selfBaseDuration=a.selfBaseDuration;c.treeBaseDuration=a.treeBaseDuration;return c}function bc(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)qd(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ka:return na(c.children,e,f,b);case Qc:return nf(c,e|3,f,b);case Rc:return nf(c,e|2,f,b);case Rb:return a=P(12,c, -b,e|4),a.elementType=Rb,a.type=Rb,a.expirationTime=f,a;case Sc:return a=P(13,c,b,e),b=Sc,a.elementType=b,a.type=b,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case ye:g=10;break a;case xe:g=9;break a;case Tc:g=11;break a;case Uc:g=14;break a;case ze:g=16;d=null;break a}n("130",null==a?a:typeof a,"")}b=P(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function na(a,b,c,d){a=P(7,a,d,b);a.expirationTime=c;return a}function nf(a,b,c,d){a=P(8,a,d,b);b= -0===(b&1)?Rc:Qc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function rd(a,b,c){a=P(6,a,null,b);a.expirationTime=c;return a}function sd(a,b,c){b=P(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function lb(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime= -b);cc(b,a)}function ph(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{var c=a.latestPendingTime;0!==c&&(c>b?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime;0===c?lb(a,b):bc&&lb(a,b)}cc(0,a)}function qh(a, -b){var c=a.latestPendingTime,d=a.latestSuspendedTime;a=a.latestPingedTime;return 0!==c&&c=b&&(a.latestPingedTime=0);c=a.earliestPendingTime;var d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime= -b);cc(b,a)}function pf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function cc(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function dc(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null, -lastCapturedEffect:null}}function td(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function oa(a){return{expirationTime:a,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function ec(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}function Z(a,b){var c=a.alternate;if(null===c){var d= -a.updateQueue;var e=null;null===d&&(d=a.updateQueue=dc(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=dc(a.memoizedState),e=c.updateQueue=dc(c.memoizedState)):d=a.updateQueue=td(e):null===e&&(e=c.updateQueue=td(d));null===e||d===e?ec(d,b):null===d.lastUpdate||null===e.lastUpdate?(ec(d,b),ec(e,b)):(ec(d,b),e.lastUpdate=b)}function qf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=dc(a.memoizedState):rf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate= -c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function rf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=td(b));return b}function sf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return A({},d,e);case 2:pa=!0}return d}function mb(a,b,c,d,e){pa=!1;b=rf(a,b);for(var f=b.baseState, -g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;mq?(u=n,n=null):u=n.sibling;var N=Ze(e,n,h[q],k);if(null===N){null===n&&(n=u);break}a&&n&&null===N.alternate&&b(e,n);g=f(N,g,q);null===m?l=N:m.sibling=N;m=N;n=u}if(q===h.length)return c(e,n),l;if(null===n){for(;qu?(N=q,q=null):N=q.sibling;var r=Ze(e,q,v.value,k);if(null===r){q||(q=N);break}a&&q&&null===r.alternate&&b(e,q);g=f(r,g,u);null===m?l=r:m.sibling=r;m=r;q=N}if(v.done)return c(e, -q),l;if(null===q){for(;!v.done;u++,v=h.next())v=p(e,v.value,k),null!==v&&(g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);return l}for(q=d(e,q);!v.done;u++,v=h.next())v=t(q,e,u,v.value,k),null!==v&&(a&&null!==v.alternate&&q.delete(null===v.key?u:v.key),g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ka&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case lc:a:{l= -f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===ka:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ka?f.props.children:f.props,h);d.ref=sb(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=k.sibling}f.type===ka?(d=na(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=bc(f.type,f.key,f.props,null,a.mode,h),h.ref=sb(a,d,f),h.return=a,a=h)}return g(a);case Ma:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation=== -f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=sd(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=rd(f,a.mode,h),d.return=a,a=d),g(a);if(mc(f))return r(a,d,f,h);if(db(f))return w(a,d,f,h);l&&kc(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,n("152",h.displayName||h.name||"Component")}return c(a, -d)}}function Df(a,b){var c=P(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function Ef(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;default:return!1}}function Ff(a){if(za){var b= -Ta;if(b){var c=b;if(!Ef(a,b)){b=ld(c);if(!b||!Ef(a,b)){a.effectTag|=2;za=!1;ba=a;return}Df(ba,c)}ba=a;Ta=hf(b)}else a.effectTag|=2,za=!1,ba=a}}function Gf(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag;)a=a.return;ba=a}function zd(a){if(a!==ba)return!1;if(!za)return Gf(a),za=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!kd(b,a.memoizedProps))for(b=Ta;b;)Df(a,b),b=ld(b);Gf(a);Ta=ba?ld(a.stateNode):null;return!0}function Ad(){Ta=ba=null;za=!1}function J(a,b,c,d){b.child=null===a?Bd(b, -null,c,d):Ua(b,a.child,c,d)}function Hf(a,b,c,d,e){c=c.render;var f=b.ref;Ra(b,e);d=c(d,f);b.effectTag|=1;J(a,b,d,e);return b.child}function If(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!qd(g)&&void 0===g.defaultProps&&null===c.compare)return b.tag=15,b.type=g,Jf(a,b,g,d,e,f);a=bc(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e=c)return Nf(a,b,c);b=Aa(a,b,c);return null!==b?b.sibling:null}}return Aa(a,b,c)}b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Qa(b,C.current);Ra(b,c);e=d(a,e);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;if(B(d)){var f=!0;ac(b)}else f= -!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&hc(b,d,g,a);e.updater=jc;b.stateNode=e;e._reactInternalFiber=b;yd(b,d,a,c);b=Dd(null,b,d,!0,f,c)}else b.tag=0,J(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=rh(e);b.type=a;e=b.tag=oh(a);f=R(a,f);g=void 0;switch(e){case 0:g=Cd(null,b,a,f,c);break;case 1:g=Lf(null,b,a,f,c);break;case 11:g=Hf(null, -b,a,f,c);break;case 14:g=If(null,b,a,R(a.type,f),d,c);break;default:n("283",a)}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:R(d,e),Cd(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:R(d,e),Lf(a,b,d,e,c);case 3:Mf(b);d=b.updateQueue;null===d?n("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;mb(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)Ad(),b=Aa(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)Ta=hf(b.stateNode.containerInfo), -ba=b,e=za=!0;e?(b.effectTag|=2,b.child=Bd(b,null,d,c)):(J(a,b,d,c),Ad());b=b.child}return b;case 5:return xf(b),null===a&&Ff(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,kd(d,e)?g=null:null!==f&&kd(d,f)&&(b.effectTag|=16),Kf(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=1,b=null):(J(a,b,g,c),b=b.child),b;case 6:return null===a&&Ff(b),null;case 13:return Nf(a,b,c);case 4:return wd(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ua(b,null,d,c):J(a,b,d, -c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:R(d,e),Hf(a,b,d,e,c);case 7:return J(a,b,b.pendingProps,c),b.child;case 8:return J(a,b,b.pendingProps.children,c),b.child;case 12:return b.effectTag|=4,J(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;vf(b,f);if(null!==g){var h=g.value;f=h===f&&(0!==h||1/h===1/f)||h!==h&&f!==f?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)| -0;if(0===f){if(g.children===e.children&&!I.current){b=Aa(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){h=g.firstContextDependency;if(null!==h){do{if(h.context===d&&0!==(h.observedBits&f)){if(1===g.tag){var k=oa(c);k.tag=2;Z(g,k)}g.expirationTime=k)g=0;else if(-1===g||k component higher in the tree to provide a loading indicator or placeholder to display."+Vc(c))}Gd=!0;d=fc(d,c);a=b;do{switch(a.tag){case 3:c=d;a.effectTag|=2048;a.expirationTime=e;e=Ed(a,c,e);qf(a,e);return;case 1:if(c=d,b=a.type,f=a.stateNode,0===(a.effectTag&64)&&("function"===typeof b.getDerivedStateFromError|| -null!==f&&"function"===typeof f.componentDidCatch&&(null===ra||!ra.has(f)))){a.effectTag|=2048;a.expirationTime=e;e=Wf(a,c,e);qf(a,e);return}}a=a.return}while(null!==a)}function xh(a,b){switch(a.tag){case 1:return B(a.type)&&$b(a),b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return Sa(a),nd(a),b=a.effectTag,0!==(b&64)?n("285"):void 0,a.effectTag=b&-2049|64,a;case 5:return xd(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 4:return Sa(a),null;case 10:return vd(a), -null;default:return null}}function Xf(){if(null!==r)for(var a=r.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&$b(b);break;case 3:Sa(b);nd(b);break;case 5:xd(b);break;case 4:Sa(b);break;case 10:vd(b)}a=a.return}S=null;D=0;Ba=-1;Gd=!1;r=null}function yh(){for(;null!==p;){var a=p.effectTag;a&16&&ub(p.stateNode,"");if(a&128){var b=p.alternate;null!==b&&(b=b.ref,null!==b&&("function"===typeof b?b(null):b.current=null))}switch(a&14){case 2:Tf(p);p.effectTag&= --3;break;case 6:Tf(p);p.effectTag&=-3;Uf(p.alternate,p);break;case 4:Uf(p.alternate,p);break;case 8:a=p,Rf(a),a.return=null,a.child=null,a.alternate&&(a.alternate.child=null,a.alternate.return=null)}p=p.nextEffect}}function zh(){for(;null!==p;){if(p.effectTag&256)a:{var a=p.alternate,b=p;switch(b.tag){case 0:case 11:case 15:break a;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:R(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate= -b}break a;case 3:case 5:case 6:case 4:case 17:break a;default:n("163")}}p=p.nextEffect}}function Ah(a,b){for(;null!==p;){var c=p.effectTag;if(c&36){var d=a,e=p.alternate,f=p,g=b;switch(f.tag){case 0:case 11:case 15:break;case 1:d=f.stateNode;if(f.effectTag&4)if(null===e)d.componentDidMount();else{var h=f.elementType===f.type?e.memoizedProps:R(f.type,e.memoizedProps);d.componentDidUpdate(h,e.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}e=f.updateQueue;null!==e&&tf(f,e,d,g);break;case 3:e=f.updateQueue; -if(null!==e){d=null;if(null!==f.child)switch(f.child.tag){case 5:d=f.child.stateNode;break;case 1:d=f.child.stateNode}tf(f,e,d,g)}break;case 5:g=f.stateNode;null===e&&f.effectTag&4&&gf(f.type,f.memoizedProps)&&g.focus();break;case 6:break;case 4:break;case 12:g=f.memoizedProps.onRender;g(f.memoizedProps.id,null===e?"mount":"update",f.actualDuration,f.treeBaseDuration,f.actualStartTime,Yf,d.memoizedInteractions);break;case 13:break;case 17:break;default:n("163")}}c&128&&(c=p.ref,null!==c&&(f=p.stateNode, -"function"===typeof c?c(f):c.current=f));p=p.nextEffect}}function vb(){null!==Zf&&($f(Bh),Zf())}function Ch(a,b){nc=sa=!0;a.current===b?n("177"):void 0;var c=a.pendingCommitExpirationTime;0===c?n("261"):void 0;a.pendingCommitExpirationTime=0;var d=b.expirationTime,e=b.childExpirationTime;ph(a,e>d?e:d);d=null;d=ca.current;ca.current=a.memoizedInteractions;oc.current=null;e=void 0;1e?b:e;0===h&&(ra=null);Dh(a,h);ca.current=d;var k=void 0;try{if(k=Jd.current,null!==k&&0h&&(l.delete(b),a.forEach(function(a){a.__count--;if(null!==k&&0===a.__count)try{k.onInteractionScheduledWorkCompleted(a)}catch(Ye){K||(K=!0,Ca=Ye)}}))})}}function ag(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0=== -(a.effectTag&1024)){r=a;if(a.mode&4){var e=a;ya=aa();0>e.actualStartTime&&(e.actualStartTime=aa())}a:{var f=b;b=a;var g=D;e=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:B(b.type)&&$b(b);break;case 3:Sa(b);nd(b);e=b.stateNode;e.pendingContext&&(e.context=e.pendingContext,e.pendingContext=null);if(null===f||null===f.child)zd(b),b.effectTag&=-3;Kd(b);break;case 5:xd(b);var h=xa(qb.current);g=b.type;if(null!==f&&null!=b.stateNode)bg(f,b,g,e,h),f.ref!==b.ref&&(b.effectTag|= -128);else if(e){var k=xa(Q.current);if(zd(b)){e=b;f=e.stateNode;var l=e.type,m=e.memoizedProps,p=h;f[W]=e;f[Kb]=m;g=void 0;h=l;switch(h){case "iframe":case "object":t("load",f);break;case "video":case "audio":for(l=0;l\x3c/script>",l=f.removeChild(f.firstChild)):"string"===typeof p.is?l=l.createElement(f,{is:p.is}):(l=l.createElement(f),"select"===f&&p.multiple&&(l.multiple=!0)):l=l.createElementNS(k,f);f=l;f[W]=m;f[Kb]=e; -cg(f,b,!1,!1);m=f;l=g;p=e;var w=h,y=jd(l,p);switch(l){case "iframe":case "object":t("load",m);h=p;break;case "video":case "audio":for(h=0;he&&(e=p),l>e&&(e=l),h&&(g+=m.actualDuration),f+=m.treeBaseDuration,m=m.sibling;b.actualDuration=g;b.treeBaseDuration=f}else for(g=b.child;null!==g;)f=g.expirationTime,h=g.childExpirationTime,f>e&&(e=f),h>e&&(e=h),g=g.sibling;b.childExpirationTime=e}if(null!==r)return r;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect), -null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1a.actualStartTime&&(a.actualStartTime=aa()));b=th(b,a,D);a.memoizedProps=a.pendingProps;a.mode&4&&gc(a,!0);null===b&&(b=ag(a));oc.current=null;return b}function fg(a,b){sa?n("243"):void 0;vb();sa=!0;oc.currentDispatcher=Eh;var c=a.nextExpirationTimeToWorkOn;if(c!==D||a!==S||null===r){Xf();S=a;D=c;r=va(S.current,null,D);a.pendingCommitExpirationTime=0;var d=new Set;a.pendingInteractionMap.forEach(function(a,b){b>=c&&a.forEach(function(a){return d.add(a)})});a.memoizedInteractions= -d;if(0b?0:b)):Fh(a,e,c)}}function Va(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d= -c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===ra||!ra.has(d))){a=fc(b,a);a=Wf(c,a,1073741823);Z(c,a);Da(c,1073741823);return}break;case 3:a=fc(b,a);a=Ed(c,a,1073741823);Z(c,a);Da(c,1073741823);return}c=c.return}3===a.tag&&(c=fc(b,a),c=Ed(a,c,1073741823),Z(a,c),Da(a,1073741823))}function wb(a,b){0!==xb?a=xb:sa?a=nc?1073741823:D:b.mode&1?(a=Wa?1073741822-10*(((1073741822-a+15)/10|0)+1):1073741822-25*(((1073741822-a+500)/25|0)+1), -null!==S&&a===D&&--a):a=1073741823;Wa&&(0===da||a=f){f=e=d;a.didError=!1;var g=a.latestPingedTime;if(0===g||g>f)a.latestPingedTime=f;cc(f,a)}else e=qa(),e=wb(e,b),lb(a,e);0!==(b.mode&1)&&a===S&&D===d&&(S=null);Md(b,e);0===(b.mode&1)&&(Md(c,e),1===c.tag&&null!==c.stateNode&&(b=oa(e),b.tag=2,Z(c,b)));c=a.expirationTime;0!==c&&gg(a,c)}function Md(a,b){a.expirationTimeD&&Xf(),lb(a,b),sa&&!nc&&S===a||gg(a,a.expirationTime),yb>Gh&&(yb=0,n("185")))}function hg(a,b,c,d,e){var f=xb;xb=1073741823;try{return a(b,c,d,e)}finally{xb=f}}function zb(){T=1073741822-((aa()-Nd)/10|0)}function ig(a,b){if(0!==qc){if(ba.expirationTime&&(a.expirationTime=b);L||(z?tc&&(V=a,y=1073741823,uc(a,1073741823,!1)):1073741823===b?ea(1073741823,!1):ig(a,b))}function sc(){var a=0,b=null;if(null!==E)for(var c=E,d=U;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===E?n("244"):void 0;if(d===d.nextScheduledRoot){U=E=d.nextScheduledRoot=null;break}else if(d===U)U=e=d.nextScheduledRoot,E.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===E){E=c;E.nextScheduledRoot= -U;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===E)break;if(1073741823===a)break;c=d;d=d.nextScheduledRoot}}V=b;y=a}function pc(){return vc?!0:Lh()?vc=!0:!1}function Ih(){try{if(!pc()&&null!==U){zb();var a=U;do{var b=a.expirationTime;0!==b&&T<=b&&(a.nextExpirationTimeToWorkOn=T);a=a.nextScheduledRoot}while(a!==U)}ea(0,!0)}finally{vc=!1}}function ea(a,b){sc();if(b)for(zb(),Xa=T;null!==V&&0!==y&&a<= -y&&!(vc&&T>y);)uc(V,y,T>y),sc(),zb(),Xa=T;else for(;null!==V&&0!==y&&a<=y;)uc(V,y,!1),sc();b&&(qc=0,rc=null);0!==y&&ig(V,y);yb=0;Od=null;if(null!==Ya)for(a=Ya,Ya=null,b=0;b=c&&(null===Ya?Ya=[d]:Ya.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Od?yb++:(Od=a,yb=0);Ch(a,b)}function Fd(a){null===V?n("246"):void 0;V.expirationTime= -0;K||(K=!0,Ca=a)}function lg(a,b){var c=z;z=!0;try{return a(b)}finally{(z=c)||L||ea(1073741823,!1)}}function mg(a,b){if(z&&!tc){tc=!0;try{return a(b)}finally{tc=!1}}return a(b)}function ng(a,b,c){if(Wa)return a(b,c);z||L||0===da||(ea(da,!1),da=0);var d=Wa,e=z;z=Wa=!0;try{return a(b,c)}finally{Wa=d,(z=e)||L||ea(1073741823,!1)}}function og(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===hb(c)&&1===c.tag?void 0:n("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b; -case 1:if(B(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);n("171");g=void 0}if(1===c.tag){var h=c.type;if(B(h)){c=kf(c,h,g);break a}}c=g}else c=ma;null===b.context?b.context=c:b.pendingContext=c;b=e;e=oa(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);vb();Z(f,e);Da(f,d);return d}function Pd(a,b,c,d){var e=b.current,f=qa();e=wb(f,e);return og(a,b,c,e,d)}function Qd(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode; -default:return a.child.stateNode}}function Mh(a,b,c){var d=3=Rd&&(b=Rd-1);this._expirationTime=Rd=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}function Za(){this._callbacks=null;this._didCommit=!1;this._onCommit= -this._onCommit.bind(this)}function $a(a,b,c){b=b?3:0;Nh&&(b|=4);b=P(3,null,null,b);a={current:b,containerInfo:a,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null,interactionThreadID:Oh(),memoizedInteractions:new Set,pendingInteractionMap:new Map}; -this._internalRoot=b.stateNode=a}function xc(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function Ph(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new $a(a,!1,b)}function yc(a,b,c,d,e){xc(c)?void 0:n("200");var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a= -Qd(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Ph(c,d);if("function"===typeof e){var h=e;e=function(){var a=Qd(f._internalRoot);h.call(a)}}mg(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Qd(f._internalRoot)}function pg(a,b){var c=2=Bb),je=String.fromCharCode(32),fa={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")}, -compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},ie=!1,Ja=!1,Th={eventTypes:fa,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(Mc)b:{switch(a){case "compositionstart":e= -fa.compositionStart;break b;case "compositionend":e=fa.compositionEnd;break b;case "compositionupdate":e=fa.compositionUpdate;break b}e=void 0}else Ja?ge(a,c)&&(e=fa.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=fa.compositionStart);e?(ke&&"ko"!==c.locale&&(Ja||e!==fa.compositionStart?e===fa.compositionEnd&&Ja&&(f=ee()):(ha=d,Lc="value"in ha?ha.value:ha.textContent,Ja=!0)),e=Qh.getPooled(e,b,c,d),f?e.data=f:(f=he(c),null!==f&&(e.data=f)),Ha(e),f=e):f=null;(a=Sh?Og(a,c):Pg(a,c))?(b=Rh.getPooled(fa.beforeInput, -b,c,d),b.data=a,Ha(b)):b=null;return null===f?b:null===b?f:[f,b]}},Nc=null,Ka=null,La=null,qe=function(a,b){return a(b)},Re=function(a,b,c){return a(b,c)},re=function(){},Oc=!1,Qg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Td=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sg=/^(.*)[\\\/]/,M="function"===typeof Symbol&&Symbol.for,lc=M?Symbol.for("react.element"):60103,Ma=M?Symbol.for("react.portal"): -60106,ka=M?Symbol.for("react.fragment"):60107,Rc=M?Symbol.for("react.strict_mode"):60108,Rb=M?Symbol.for("react.profiler"):60114,ye=M?Symbol.for("react.provider"):60109,xe=M?Symbol.for("react.context"):60110,Qc=M?Symbol.for("react.concurrent_mode"):60111,Tc=M?Symbol.for("react.forward_ref"):60112,Sc=M?Symbol.for("react.suspense"):60113,Uc=M?Symbol.for("react.memo"):60115,ze=M?Symbol.for("react.lazy"):60116,we="function"===typeof Symbol&&Symbol.iterator,Ug=/^[: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]*$/, -Ae=Object.prototype.hasOwnProperty,Ce={},Be={},w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new G(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];w[b]=new G(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new G(a,2,!1, -a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new G(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){w[a]=new G(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){w[a]=new G(a,3,!0,a,null)});["capture", -"download"].forEach(function(a){w[a]=new G(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){w[a]=new G(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){w[a]=new G(a,5,!1,a.toLowerCase(),null)});var Ud=/[\-:]([a-z])/g,Vd=function(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(Ud,Vd);w[b]=new G(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(Ud,Vd);w[b]=new G(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(Ud,Vd);w[b]=new G(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});w.tabIndex=new G("tabIndex",1,!1,"tabindex",null);var He={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"}, -dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},eb=null,fb=null,Wd=!1;ia&&(Wd=te("input")&&(!document.documentMode||9=document.documentMode,af={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}}, -Na=null,ed=null,ib=null,dd=!1,hi={eventTypes:af,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Se(e);f=Ec.onSelect;for(var g=0;g"+b+"";for(b=zc.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}),ub=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b; -return}}a.textContent=b},jb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0, -zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ii=["Webkit","ms","Moz","O"];Object.keys(jb).forEach(function(a){ii.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);jb[b]=jb[a]})});var lh=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Ac=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler, -$f=Ac.unstable_cancelCallback,aa=Ac.unstable_now,Hh=Ac.unstable_scheduleCallback,Lh=Ac.unstable_shouldYield,Hd=null,Id=null,Jh="function"===typeof setTimeout?setTimeout:void 0,kg="function"===typeof clearTimeout?clearTimeout:void 0;new Set;var md=[],Pa=-1,ma={},C={current:ma},I={current:!1},ua=ma,od=null,pd=null,Nh="undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__,P=function(a,b,c,d){return new nh(a,b,c,d)},Bc=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing,ca=Bc.__interactionsRef, -Jd=Bc.__subscriberRef,Oh=Bc.unstable_getThreadID,wh=Bc.unstable_wrap,pa=!1,ud={current:null},nb=null,wa=null,ob=null,pb={},Q={current:pb},rb={current:pb},qb={current:pb},Yf=0,ya=-1,ic=Td.ReactCurrentOwner,Bf=(new O.Component).refs,jc={isMounted:function(a){return(a=a._reactInternalFiber)?2===hb(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=qa();d=wb(d,a);var e=oa(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);vb();Z(a,e);Da(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber; -var d=qa();d=wb(d,a);var e=oa(d);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);vb();Z(a,e);Da(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=qa();c=wb(c,a);var d=oa(c);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);vb();Z(a,d);Da(a,c)}},mc=Array.isArray,Ua=Cf(!0),Bd=Cf(!1),ba=null,Ta=null,za=!1,sh=Td.ReactCurrentOwner,cg=void 0,Kd=void 0,bg=void 0,dg=void 0;cg=function(a,b,c,d){for(c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&& -null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Kd=function(a){};bg=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;xa(Q.current);a=null;switch(c){case "input":f=Xc(g,f);d=Xc(g,d);a=[];break;case "option":f=fd(g,f);d=fd(g,d);a=[];break;case "select":f=A({},f,{value:void 0});d=A({},d,{value:void 0});a=[];break;case "textarea":f=gd(g,f);d=gd(g,d); -a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=Zb)}id(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===c){var k=f[c];for(g in k)k.hasOwnProperty(g)&&(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Fa.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]: -void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(g in k)!k.hasOwnProperty(g)||l&&l.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in l)l.hasOwnProperty(g)&&k[g]!==l[g]&&(h||(h={}),h[g]=l[g])}else h||(a||(a=[]),a.push(c,h)),h=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!== -c&&(Fa.hasOwnProperty(c)?(null!=l&&Y(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&tb(b)}};dg=function(a,b,c,d){c!==d&&tb(b)};var Eh={readContext:wf},oc=Td.ReactCurrentOwner;null==ca||null==ca.current?n("302"):void 0;var Rd=1073741822,xb=0,sa=!1,r=null,S=null,D=0,Ba=-1,Gd=!1,p=null,nc=!1,Bh=null,Zf=null,ra=null,U=null,E=null,qc=0,rc=void 0,L=!1,V=null,y=0,da=0,K=!1,Ca=null,z=!1,tc=!1,Wa=!1,Ya=null,Nd=aa(),T=1073741822-(Nd/10|0),Xa=T,Gh=50,yb=0,Od= -null,vc=!1;Nc=function(a,b,c){switch(b){case "input":Yc(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};(function(a,b,c){qe=a;Re=b;re=c})(lg,ng,function(){L||0===da||(ea(da, -!1),da=0)});var Bg={createPortal:pg,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=Me(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){return yc(null,a,b,!0,c)},render:function(a,b,c){return yc(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){null==a||void 0===a._reactInternalFiber?n("38"):void 0;return yc(a,b,c,!1,d)},unmountComponentAtNode:function(a){xc(a)? -void 0:n("40");return a._reactRootContainer?(mg(function(){yc(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return pg.apply(void 0,arguments)},unstable_batchedUpdates:lg,unstable_interactiveUpdates:ng,flushSync:function(a,b){L?n("187"):void 0;var c=z;z=!0;try{return hg(a,b)}finally{z=c,ea(1073741823,!1)}},unstable_flushControlled:function(a){var b=z;z=!0;try{hg(a)}finally{(z=b)||L||ea(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[be, -ta,Ic,Sd.injectEventPluginsByName,Dc,Ha,function(a){Fc(a,Kg)},ne,oe,Ub,Hc]},unstable_createRoot:function(a,b){xc(a)?void 0:n("299","unstable_createRoot");return new $a(a,!0,null!=b&&!0===b.hydrate)}};(function(a){var b=a.findFiberByHostInstance;return mh(A({},a,{findHostInstanceByFiber:function(a){a=Me(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Jb,bundleType:0,version:"16.6.3",rendererPackageName:"react-dom"}); -var Cg={default:Bg},Dg=Cg&&Bg||Cg;return Dg.default||Dg}); +'use strict';(function(R,tb){"object"===typeof exports&&"undefined"!==typeof module?module.exports=tb(require("react")):"function"===typeof define&&define.amd?define(["react"],tb):R.ReactDOM=tb(R.React)})(this,function(R){function tb(a,b,c,d,e,f,g,h){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 k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name= +"Invariant Violation"}a.framesToPop=1;throw a;}}function n(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;dthis.eventPool.length&&this.eventPool.push(a)}function Te(a){a.eventPool=[];a.getPooled=Eh;a.release=Fh}function Ue(a,b){switch(a){case "keyup":return-1!==Gh.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function Ve(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}function Hh(a,b){switch(a){case "compositionend":return Ve(b); +case "keypress":if(32!==b.which)return null;We=!0;return Xe;case "textInput":return a=b.data,a===Xe&&We?null:a;default:return null}}function Ih(a,b){if(Wa)return"compositionend"===a||!md&&Ue(a,b)?(a=Se(),lc=ld=sa=null,Wa=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1}function I(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}function wd(a,b,c,d){var e=w.hasOwnProperty(b)? +w[b]:null;var f=null!==e?0===e.type:d?!1:!(2vc.length&&vc.push(a)}}}function Ff(a){Object.prototype.hasOwnProperty.call(a,wc)||(a[wc]=ai++,Gf[a[wc]]= +{});return Gf[a[wc]]}function Cd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Hf(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function If(a,b){var c=Hf(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Hf(c)}}function Jf(a,b){return a&&b?a=== +b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Jf(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function Kf(){for(var a=window,b=Cd();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Cd(a.document)}return b}function Dd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type|| +"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}function bi(){var a=Kf();if(Dd(a)){if("selectionStart"in a)var b={start:a.selectionStart,end:a.selectionEnd};else a:{b=(b=a.ownerDocument)&&b.defaultView||window;var c=b.getSelection&&b.getSelection();if(c&&0!==c.rangeCount){b=c.anchorNode;var d=c.anchorOffset,e=c.focusNode;c=c.focusOffset;try{b.nodeType,e.nodeType}catch(oj){b=null;break a}var f=0,g=-1,h=-1,k=0,l=0,m=a,n=null;b:for(;;){for(var p;;){m!==b||0!==d&&3!== +m.nodeType||(g=f+d);m!==e||0!==c&&3!==m.nodeType||(h=f+c);3===m.nodeType&&(f+=m.nodeValue.length);if(null===(p=m.firstChild))break;n=m;m=p}for(;;){if(m===a)break b;n===b&&++k===d&&(g=f);n===e&&++l===c&&(h=f);if(null!==(p=m.nextSibling))break;m=n;n=m.parentNode}m=p}b=-1===g||-1===h?null:{start:g,end:h}}else b=null}b=b||{start:0,end:0}}else b=null;return{focusedElem:a,selectionRange:b}}function ci(a){var b=Kf(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Jf(c.ownerDocument.documentElement, +c)){if(null!==d&&Dd(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=If(c,f);var g=If(c,d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&& +(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c=b.length?void 0:n("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:wa(c)}}function Of(a,b){var c=wa(b.value),d=wa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function Pf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg"; +case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Id(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Pf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}function Qf(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||Cb.hasOwnProperty(a)&&Cb[a]?(""+b).trim():b+"px"}function Rf(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"), +e=Qf(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}function Jd(a,b){b&&(ei[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?n("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?n("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:n("61")),null!=b.style&&"object"!==typeof b.style?n("62",""):void 0)}function Kd(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1; +default:return!0}}function ha(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Ff(a);b=ed[b];for(var d=0;dcb||(a.current= +Nd[cb],Nd[cb]=null,cb--)}function J(a,b,c){cb++;Nd[cb]=a.current;a.current=b}function db(a,b){var c=a.type.contextTypes;if(!c)return xa;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function C(a){a=a.childContextTypes;return null!==a&&void 0!==a}function yc(a){B(K,a); +B(D,a)}function Od(a){B(K,a);B(D,a)}function Vf(a,b,c){D.current!==xa?n("168"):void 0;J(D,b,a);J(K,c,a)}function Wf(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:n("108",ua(b)||"Unknown",e);return z({},c,d)}function zc(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||xa;Ha=D.current;J(D,b,a);J(K,K.current,a);return!0}function Xf(a,b,c){var d=a.stateNode;d?void 0:n("169");c?(b= +Wf(a,b,Ha),d.__reactInternalMemoizedMergedChildContext=b,B(K,a),B(D,a),J(D,b,a)):B(K,a);J(K,c,a)}function Yf(a){return function(b){try{return a(b)}catch(c){}}}function gi(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Pd=Yf(function(a){return b.onCommitFiberRoot(c,a)});Qd=Yf(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function hi(a,b,c,d){this.tag=a;this.key= +c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.contextDependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null;this.treeBaseDuration=this.selfBaseDuration=this.actualStartTime=this.actualDuration=Number.NaN;this.actualDuration=0;this.actualStartTime= +-1;this.treeBaseDuration=this.selfBaseDuration=0}function Rd(a){a=a.prototype;return!(!a||!a.isReactComponent)}function ii(a){if("function"===typeof a)return Rd(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===td)return 11;if(a===ud)return 14}return 2}function Ia(a,b,c){c=a.alternate;null===c?(c=T(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect= +null,c.actualDuration=0,c.actualStartTime=-1);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.contextDependencies=a.contextDependencies;c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;c.selfBaseDuration=a.selfBaseDuration;c.treeBaseDuration=a.treeBaseDuration;return c}function Ac(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Rd(a)&&(g=1);else if("string"=== +typeof a)g=5;else a:switch(a){case va:return ya(c.children,e,f,b);case qd:return Zf(c,e|3,f,b);case rd:return Zf(c,e|2,f,b);case pc:return a=T(12,c,b,e|4),a.elementType=pc,a.type=pc,a.expirationTime=f,a;case sd:return a=T(13,c,b,e),b=sd,a.elementType=b,a.type=b,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case mf:g=10;break a;case lf:g=9;break a;case td:g=11;break a;case ud:g=14;break a;case nf:g=16;d=null;break a}n("130",null==a?a:typeof a,"")}b=T(g,c,b,e);b.elementType= +a;b.type=d;b.expirationTime=f;return b}function ya(a,b,c,d){a=T(7,a,d,b);a.expirationTime=c;return a}function Zf(a,b,c,d){a=T(8,a,d,b);b=0===(b&1)?rd:qd;a.elementType=b;a.type=b;a.expirationTime=c;return a}function Sd(a,b,c){a=T(6,a,null,b);a.expirationTime=c;return a}function Td(a,b,c){b=T(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function Fb(a,b){a.didError=!1;var c=a.earliestPendingTime; +0===c?a.earliestPendingTime=a.latestPendingTime=b:cb&&(a.latestPendingTime=b);Bc(b,a)}function ji(a,b){a.didError=!1;if(0===b)a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0;else{bb?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>b&&(a.earliestPendingTime=a.latestPendingTime));c=a.earliestSuspendedTime; +0===c?Fb(a,b):bc&&Fb(a,b)}Bc(0,a)}function ki(a,b){var c=a.latestPendingTime,d=a.latestSuspendedTime;a=a.latestPingedTime;return 0!==c&&c=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime; +d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:cb&&(a.latestSuspendedTime=b);Bc(b,a)}function ag(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}function Bc(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||da&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}function O(a,b){if(a&&a.defaultProps){b= +z({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}function li(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:a._status=0;b=a._ctor;b=b();b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)});switch(a._status){case 1:return a._result;case 2:throw a._result;}a._result=b;throw b;}}function Cc(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:z({}, +b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}function bg(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!zb(c,d)||!zb(e,f):!0}function cg(a,b,c,d){var e=!1;d=xa;var f=b.contextType;"object"===typeof f&&null!==f?f=U(f):(d=C(b)?Ha:D.current,e=b.contextTypes,f=(e=null!==e&&void 0!==e)?db(a,d):xa);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state? +b.state:null;b.updater=Dc;a.stateNode=b;b._reactInternalFiber=a;e&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=d,a.__reactInternalMemoizedMaskedChildContext=f);return b}function dg(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Dc.enqueueReplaceState(b,b.state,null)}function Ud(a,b,c,d){var e=a.stateNode;e.props=c;e.state= +a.memoizedState;e.refs=eg;var f=b.contextType;"object"===typeof f&&null!==f?e.context=U(f):(f=C(b)?Ha:D.current,e.context=db(a,f));f=a.updateQueue;null!==f&&(Gb(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(Cc(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&& +e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Dc.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Gb(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}function Hb(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?n("309"):void 0,d=c.stateNode);d?void 0:n("147",a);var e=""+a;if(null!==b&&null!==b.ref&& +"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===eg&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?n("284"):void 0;c._owner?void 0:n("290",a)}return a}function Ec(a,b){"textarea"!==a.type&&n("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")}function fg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect= +b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=Ia(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,dr?(u=n,n=null):u=n.sibling;var P=p(e,n,h[r],k);if(null===P){null===n&&(n=u);break}a&&n&&null===P.alternate&&b(e,n);g=f(P,g,r);null===m?l=P:m.sibling=P;m=P;n=u}if(r===h.length)return c(e, +n),l;if(null===n){for(;ru?(P=r,r=null): +P=r.sibling;var $a=p(e,r,q.value,k);if(null===$a){r||(r=P);break}a&&r&&null===$a.alternate&&b(e,r);g=f($a,g,u);null===m?l=$a:m.sibling=$a;m=$a;r=P}if(q.done)return c(e,r),l;if(null===r){for(;!q.done;u++,q=h.next())q=S(e,q.value,k),null!==q&&(g=f(q,g,u),null===m?l=q:m.sibling=q,m=q);return l}for(r=d(e,r);!q.done;u++,q=h.next())q=t(r,e,u,q.value,k),null!==q&&(a&&null!==q.alternate&&r.delete(null===q.key?u:q.key),g=f(q,g,u),null===m?l=q:m.sibling=q,m=q);a&&r.forEach(function(a){return b(e,a)});return l} +return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===va&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Fc:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===va:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===va?f.props.children:f.props,h);d.ref=Hb(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=k.sibling}f.type===va?(d=ya(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Ac(f.type,f.key,f.props, +null,a.mode,h),h.ref=Hb(a,d,f),h.return=a,a=h)}return g(a);case Za:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Td(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=Sd(f,a.mode, +h),d.return=a,a=d),g(a);if(Gc(f))return q(a,d,f,h);if(wb(f))return v(a,d,f,h);l&&Ec(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,n("152",h.displayName||h.name||"Component")}return c(a,d)}}function Ja(a){a===Ib?n("174"):void 0;return a}function Vd(a,b){J(Jb,b,a);J(Kb,a,a);J(V,Ib,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Id(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=Id(b,c)}B(V,a);J(V,b,a)}function eb(a){B(V, +a);B(Kb,a);B(Jb,a)}function gg(a){Ja(Jb.current);var b=Ja(V.current);var c=Id(b,a.type);b!==c&&(J(Kb,a,a),J(V,c,a))}function Wd(a){Kb.current===a&&(B(V,a),B(Kb,a))}function W(){n("321")}function Xd(a,b){if(null===b)return!1;for(var c=0;cOb&&(Ob=m)):f=k.eagerReducer===a?k.eagerState:a(f,k.action);g=k;k=k.next}while(null!==k&&k!==d);l||(h=g,e=f);Ga(f,b.memoizedState)||(ja=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState, +c.dispatch]}function ae(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===Y?(Y={lastEffect:null},Y.lastEffect=a.next=a):(b=Y.lastEffect,null===b?Y.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,Y.lastEffect=a));return a}function be(a,b,c,d){var e=hb();Pb|=a;e.memoizedState=ae(b,c,void 0,void 0===d?null:d)}function ce(a,b,c,d){var e=Qb();d=void 0===d?null:d;var f=void 0;if(null!==v){var g=v.memoizedState;f=g.destroy;if(null!==d&&Xd(d,g.deps)){ae(ib,c,f,d);return}}Pb|=a;e.memoizedState= +ae(b,c,f,d)}function kg(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function lg(a,b){}function mg(a,b,c){25>Nb?void 0:n("301");var d=a.alternate;if(a===za||null!==d&&d===za)if(Mb=!0,a={expirationTime:Lb,action:c,eagerReducer:null,eagerState:null,next:null},null===ia&&(ia=new Map),c=ia.get(b),void 0===c)ia.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{jb();var e=ka();e=kb(e,a);var f={expirationTime:e, +action:c,eagerReducer:null,eagerState:null,next:null},g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&(f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(Ga(l,k))return}catch(m){}finally{}Aa(a,e)}}function Ic(a,b){if(0<=Ka){var c=la()-Ka;a.actualDuration+=c;b&&(a.selfBaseDuration=c);Ka=-1}}function ng(a,b){var c=T(5,null,null,0);c.elementType="DELETED"; +c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function og(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}function pg(a){if(La){var b=lb;if(b){var c=b;if(!og(a,b)){b=Md(c);if(!b|| +!og(a,b)){a.effectTag|=2;La=!1;ma=a;return}ng(ma,c)}ma=a;lb=Uf(b)}else a.effectTag|=2,La=!1,ma=a}}function qg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&18!==a.tag;)a=a.return;ma=a}function de(a){if(a!==ma)return!1;if(!La)return qg(a),La=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ld(b,a.memoizedProps))for(b=lb;b;)ng(a,b),b=Md(b);qg(a);lb=ma?Md(a.stateNode):null;return!0}function ee(){lb=ma=null;La=!1}function L(a,b,c,d){b.child=null===a?fe(b,null,c,d):mb(b,a.child,c,d)}function rg(a, +b,c,d,e){c=c.render;var f=b.ref;nb(b,e);d=Yd(a,b,c,d,f,e);if(null!==a&&!ja)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),na(a,b,e);b.effectTag|=1;L(a,b,d,e);return b.child}function sg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Rd(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,tg(a,b,g,d,e,f);a=Ac(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e< +f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:zb,c(e,d)&&a.ref===b.ref))return na(a,b,f);b.effectTag|=1;a=Ia(g,d,f);a.ref=b.ref;a.return=b;return b.child=a}function tg(a,b,c,d,e,f){return null!==a&&zb(a.memoizedProps,d)&&a.ref===b.ref&&(ja=!1,e=c)return xg(a,b,c);b=na(a,b,c);return null!==b?b.sibling:null}}return na(a,b,c)}}else ja=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|= +2);a=b.pendingProps;var e=db(b,D.current);nb(b,c);e=Yd(null,b,d,a,e,c);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;$d();if(C(d)){var f=!0;zc(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Cc(b,d,g,a);e.updater=Dc;b.stateNode=e;e._reactInternalFiber=b;Ud(b,d,a,c);b=he(null,b,d,!0,f,c)}else b.tag=0,L(null,b,e,c),b=b.child;return b;case 16:e=b.elementType; +null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=li(e);b.type=a;e=b.tag=ii(a);f=O(a,f);g=void 0;switch(e){case 0:g=ge(null,b,a,f,c);break;case 1:g=vg(null,b,a,f,c);break;case 11:g=rg(null,b,a,f,c);break;case 14:g=sg(null,b,a,O(a.type,f),d,c);break;default:n("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),ge(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),vg(a,b,d,e,c);case 3:wg(b);d=b.updateQueue; +null===d?n("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;Gb(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)ee(),b=na(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)lb=Uf(b.stateNode.containerInfo),ma=b,e=La=!0;e?(b.effectTag|=2,b.child=fe(b,null,d,c)):(L(a,b,d,c),ee());b=b.child}return b;case 5:return gg(b),null===a&&pg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ld(d,e)?g=null:null!==f&&Ld(d,f)&&(b.effectTag|=16),ug(a, +b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=b.childExpirationTime=1,b=null):(L(a,b,g,c),b=b.child),b;case 6:return null===a&&pg(b),null;case 13:return xg(a,b,c);case 4:return Vd(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=mb(b,null,d,c):L(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:O(d,e),rg(a,b,d,e,c);case 7:return L(a,b,b.pendingProps,c),b.child;case 8:return L(a,b,b.pendingProps.children,c),b.child;case 12:return b.effectTag|=4,L(a,b,b.pendingProps.children, +c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;yg(b,f);if(null!==g){var h=g.value;f=Ga(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!K.current){b=na(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.contextDependencies;if(null!==k){g=h.child;for(var l=k.first;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=Ca(c),l.tag=Jc,oa(h,l)); +h.expirationTime=b&&(ja=!0);a.contextDependencies=null}function U(a,b){if(Sb!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Sb=a,b=1073741823;b={context:a, +observedBits:b,next:null};null===Ma?(null===Rb?n("308"):void 0,Ma=b,Rb.contextDependencies={first:b,expirationTime:0}):Ma=Ma.next=b}return a._currentValue}function Kc(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function ke(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null, +lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ca(a){return{expirationTime:a,tag:zg,payload:null,callback:null,next:null,nextEffect:null}}function Lc(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}function oa(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=Kc(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=Kc(a.memoizedState),e=c.updateQueue= +Kc(c.memoizedState)):d=a.updateQueue=ke(e):null===e&&(e=c.updateQueue=ke(d));null===e||d===e?Lc(d,b):null===d.lastUpdate||null===e.lastUpdate?(Lc(d,b),Lc(e,b)):(Lc(d,b),e.lastUpdate=b)}function Ag(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=Kc(a.memoizedState):Bg(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function Bg(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=ke(b));return b}function Cg(a, +b,c,d,e,f){switch(c.tag){case Dg:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case le:a.effectTag=a.effectTag&-2049|64;case zg:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return z({},d,e);case Jc:Ba=!0}return d}function Gb(a,b,c,d,e){Ba=!1;b=Bg(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;m=k)g=0;else if(-1=== +g||k component higher in the tree to provide a loading indicator or placeholder to display."+vd(c))}pe=!0;d=Mc(d,c);a=b;do{switch(a.tag){case 3:a.effectTag|= +2048;a.expirationTime=e;e=ne(a,d,e);Ag(a,e);return;case 1:if(g=d,h=a.type,c=a.stateNode,0===(a.effectTag&64)&&("function"===typeof h.getDerivedStateFromError||null!==c&&"function"===typeof c.componentDidCatch&&(null===Da||!Da.has(c)))){a.effectTag|=2048;a.expirationTime=e;e=Ng(a,g,e);Ag(a,e);return}}a=a.return}while(null!==a)}function xi(a,b){switch(a.tag){case 1:return C(a.type)&&yc(a),b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return eb(a),Od(a),b=a.effectTag,0!==(b&64)?n("285"): +void 0,a.effectTag=b&-2049|64,a;case 5:return Wd(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 18:return null;case 4:return eb(a),null;case 10:return je(a),null;default:return null}}function Og(){if(null!==q)for(var a=q.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&yc(b);break;case 3:eb(b);Od(b);break;case 5:Wd(b);break;case 4:eb(b);break;case 10:je(b)}a=a.return}Z=null;F=0;Oa=-1;pe=!1;q=null}function yi(){for(;null!== +p;){var a=p.effectTag;a&16&&Eb(p.stateNode,"");if(a&128){var b=p.alternate;null!==b&&(b=b.ref,null!==b&&("function"===typeof b?b(null):b.current=null))}switch(a&14){case 2:Lg(p);p.effectTag&=-3;break;case 6:Lg(p);p.effectTag&=-3;Mg(p.alternate,p);break;case 4:Mg(p.alternate,p);break;case 8:a=p,Jg(a),a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null,a=a.alternate,null!==a&&(a.return=null,a.child=null,a.memoizedState=null,a.updateQueue=null)}p=p.nextEffect}}function zi(){for(;null!== +p;){if(p.effectTag&256)a:{var a=p.alternate,b=p;switch(b.tag){case 0:case 11:case 15:Ub(Ai,ib,b);break a;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:O(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}break a;case 3:case 5:case 6:case 4:case 17:break a;default:n("163")}}p=p.nextEffect}}function Bi(a,b){for(;null!==p;){var c=p.effectTag;if(c&36){var d=a,e=p.alternate,f=p,g=b;switch(f.tag){case 0:case 11:case 15:Ub(Ci, +Wb,f);break;case 1:d=f.stateNode;if(f.effectTag&4)if(null===e)d.componentDidMount();else{var h=f.elementType===f.type?e.memoizedProps:O(f.type,e.memoizedProps);d.componentDidUpdate(h,e.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}e=f.updateQueue;null!==e&&Eg(f,e,d,g);break;case 3:e=f.updateQueue;if(null!==e){d=null;if(null!==f.child)switch(f.child.tag){case 5:d=f.child.stateNode;break;case 1:d=f.child.stateNode}Eg(f,e,d,g)}break;case 5:g=f.stateNode;null===e&&f.effectTag&4&&Sf(f.type,f.memoizedProps)&& +g.focus();break;case 6:break;case 4:break;case 12:g=f.memoizedProps.onRender;g(f.memoizedProps.id,null===e?"mount":"update",f.actualDuration,f.treeBaseDuration,f.actualStartTime,Pg,d.memoizedInteractions);break;case 13:break;case 17:break;default:n("163")}}c&128&&(f=p.ref,null!==f&&(g=p.stateNode,"function"===typeof f?f(g):f.current=g));c&512&&(qe=a);p=p.nextEffect}}function Di(a,b){Nc=Oc=qe=null;var c=x;x=!0;do{if(b.effectTag&512){var d=!1,e=void 0;try{var f=b;Ub(re,ib,f);Ub(ib,se,f)}catch(g){d= +!0,e=g}d&&Na(b,e)}b=b.nextEffect}while(null!==b);x=c;c=a.expirationTime;0!==c&&Pc(a,c);y||x||aa(1073741823,!1)}function jb(){null!==Oc&&Ei(Oc);null!==Nc&&Nc()}function Fi(a,b){Qc=Ea=!0;a.current===b?n("177"):void 0;var c=a.pendingCommitExpirationTime;0===c?n("261"):void 0;a.pendingCommitExpirationTime=0;var d=b.expirationTime,e=b.childExpirationTime;ji(a,e>d?e:d);d=null;d=pa.current;pa.current=a.memoizedInteractions;Qg.current=null;e=void 0;1e?b:e;0===k&&(Da=null);Hi(a,k);pa.current=d;var l=void 0;try{if(l=ve.current,null!==l&&0k&&(m.delete(b),a.forEach(function(a){a.__count--; +if(null!==l&&0===a.__count)try{l.onInteractionScheduledWorkCompleted(a)}catch(mi){M||(M=!0,Pa=mi)}}))})}}function Sg(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){q=a;if(a.mode&4){var e=a;Ka=la();0>e.actualStartTime&&(e.actualStartTime=la())}a:{var f=b;b=a;var g=F;e=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:C(b.type)&&yc(b);break;case 3:eb(b);Od(b);e=b.stateNode;e.pendingContext&&(e.context=e.pendingContext,e.pendingContext= +null);if(null===f||null===f.child)de(b),b.effectTag&=-3;we(b);break;case 5:Wd(b);var h=Ja(Jb.current);g=b.type;if(null!==f&&null!=b.stateNode)Tg(f,b,g,e,h),f.ref!==b.ref&&(b.effectTag|=128);else if(e){var k=Ja(V.current);if(de(b)){e=b;f=e.stateNode;var l=e.type,m=e.memoizedProps,p=h;f[ea]=e;f[ic]=m;g=void 0;h=l;switch(h){case "iframe":case "object":t("load",f);break;case "video":case "audio":for(l=0;l\x3c/script>", +l=f.removeChild(f.firstChild)):"string"===typeof f.is?l=l.createElement(p,{is:f.is}):(l=l.createElement(p),"select"===p&&(p=l,f.multiple?p.multiple=!0:f.size&&(p.size=f.size))):l=l.createElementNS(k,p);f=l;f[ea]=m;f[ic]=e;Ug(f,b,!1,!1);m=f;l=g;p=e;var v=h,x=Kd(l,p);switch(l){case "iframe":case "object":t("load",m);h=p;break;case "video":case "audio":for(h=0;he&&(e=p),l>e&&(e=l),h&&(g+=m.actualDuration),f+=m.treeBaseDuration,m=m.sibling;b.actualDuration=g;b.treeBaseDuration=f}else for(g=b.child;null!== +g;)f=g.expirationTime,h=g.childExpirationTime,f>e&&(e=f),h>e&&(e=h),g=g.sibling;b.childExpirationTime=e}if(null!==q)return q;null!==c&&0===(c.effectTag&1024)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1a.actualStartTime&&(a.actualStartTime=la()));b=pi(b,a,F);a.memoizedProps=a.pendingProps;a.mode&4&&Ic(a,!0);null===b&&(b=Sg(a));Qg.current=null;return b}function Xg(a,b){Ea?n("243"):void 0;jb();Ea=!0;var c=xe.current;xe.current=Zd;var d=a.nextExpirationTimeToWorkOn; +if(d!==F||a!==Z||null===q){Og();Z=a;F=d;q=Ia(Z.current,null,F);a.pendingCommitExpirationTime=0;var e=new Set;a.pendingInteractionMap.forEach(function(a,b){b>=d&&a.forEach(function(a){return e.add(a)})});a.memoizedInteractions=e;if(0b?0:b)):Ii(a,c,d)}}function Na(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Da||!Da.has(d))){a=Mc(b,a);a=Ng(c,a,1073741823);oa(c,a);Aa(c,1073741823);return}break;case 3:a=Mc(b,a);a=ne(c,a,1073741823);oa(c,a);Aa(c,1073741823); +return}c=c.return}3===a.tag&&(c=Mc(b,a),c=ne(a,c,1073741823),oa(a,c),Aa(a,1073741823))}function kb(a,b){var c=Ji(),d=void 0;if(0===(b.mode&1))d=1073741823;else if(Ea&&!Qc)d=F;else{switch(c){case ze:d=1073741823;break;case Ae:d=1073741822-10*(((1073741822-a+15)/10|0)+1);break;case Rg:d=1073741822-25*(((1073741822-a+500)/25|0)+1);break;case Ki:case Li:d=1;break;default:n("313")}null!==Z&&d===F&&--d}c===Ae&&(0===qa||d=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;Bc(c,a);c=a.expirationTime;0!==c&&Pc(a,c)}}function ti(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=ka();b=kb(b,a);a=Yg(a,b);null!==a&&(Fb(a,b),b=a.expirationTime,0!==b&&Pc(a,b))}function Yg(a,b){a.expirationTimeF&&Og(),Fb(a,b),Ea&&!Qc&&Z===a||Pc(a,a.expirationTime),Xb>Mi&&(Xb=0,n("185")))}function Zg(a,b,c,d,e){return Rc(ze,function(){return a(b,c,d,e)})}function Yb(){ba=1073741822-((la()-Be)/10|0)}function $g(a,b){if(0!==Tc){if(ba.expirationTime&&(a.expirationTime=b);x||(y?Wc&&(da= +a,A=1073741823,Xc(a,1073741823,!1)):1073741823===b?aa(1073741823,!1):$g(a,b))}function Vc(){var a=0,b=null;if(null!==G)for(var c=G,d=ca;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===G?n("244"):void 0;if(d===d.nextScheduledRoot){ca=G=d.nextScheduledRoot=null;break}else if(d===ca)ca=e=d.nextScheduledRoot,G.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===G){G=c;G.nextScheduledRoot=ca;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot= +null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===G)break;if(1073741823===a)break;c=d;d=d.nextScheduledRoot}}da=b;A=a}function Sc(){return Yc?!0:Qi()?Yc=!0:!1}function Ni(){try{if(!Sc()&&null!==ca){Yb();var a=ca;do{var b=a.expirationTime;0!==b&&ba<=b&&(a.nextExpirationTimeToWorkOn=ba);a=a.nextScheduledRoot}while(a!==ca)}aa(0,!0)}finally{Yc=!1}}function aa(a,b){Vc();if(b)for(Yb(),ob=ba;null!==da&&0!==A&&a<=A&&!(Yc&&ba>A);)Xc(da,A,ba>A),Vc(),Yb(),ob=ba;else for(;null!==da&&0!==A&&a<=A;)Xc(da,A, +!1),Vc();b&&(Tc=0,Uc=null);0!==A&&$g(da,A);Xb=0;Ce=null;if(null!==pb)for(a=pb,pb=null,b=0;b=c&&(null===pb?pb=[d]:pb.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Ce?Xb++:(Ce=a,Xb=0);Rc(ze,function(){Fi(a,b)})}function oe(a){null===da?n("246"):void 0;da.expirationTime=0;M||(M=!0,Pa=a)}function eh(a,b){var c=y;y=!0;try{return a(b)}finally{(y= +c)||x||aa(1073741823,!1)}}function fh(a,b){if(y&&!Wc){Wc=!0;try{return a(b)}finally{Wc=!1}}return a(b)}function gh(a,b,c){y||x||0===qa||(aa(qa,!1),qa=0);var d=y;y=!0;try{return Rc(Ae,function(){return a(b,c)})}finally{(y=d)||x||aa(1073741823,!1)}}function hh(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===Ab(c)&&1===c.tag?void 0:n("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(C(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g= +g.return}while(null!==g);n("171");g=void 0}if(1===c.tag){var h=c.type;if(C(h)){c=Wf(c,h,g);break a}}c=g}else c=xa;null===b.context?b.context=c:b.pendingContext=c;b=e;e=Ca(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);jb();oa(f,e);Aa(f,d);return d}function De(a,b,c,d){var e=b.current,f=ka();e=kb(f,e);return hh(a,b,c,e,d)}function Ee(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Ri(a,b,c){var d= +3=Fe&&(b=Fe-1);this._expirationTime=Fe=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}function qb(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}function rb(a,b,c){b=b?3:0;Si&& +(b|=4);b=T(3,null,null,b);a={current:b,containerInfo:a,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,pingCache:null,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null,interactionThreadID:Ti(),memoizedInteractions:new Set,pendingInteractionMap:new Map};this._internalRoot= +b.stateNode=a}function sb(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function Ui(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new rb(a,!1,b)}function $c(a,b,c,d,e){var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Ee(f._internalRoot);g.call(a)}}null!= +a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=Ui(c,d);if("function"===typeof e){var h=e;e=function(){var a=Ee(f._internalRoot);h.call(a)}}fh(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Ee(f._internalRoot)}function ih(a,b){var c=2=$b),Xe=String.fromCharCode(32),ra={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput", +captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate", +captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},We=!1,Wa=!1,Yi={eventTypes:ra,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(md)b:{switch(a){case "compositionstart":e=ra.compositionStart;break b;case "compositionend":e=ra.compositionEnd;break b;case "compositionupdate":e=ra.compositionUpdate;break b}e=void 0}else Wa?Ue(a,c)&&(e=ra.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=ra.compositionStart);e?(Ye&& +"ko"!==c.locale&&(Wa||e!==ra.compositionStart?e===ra.compositionEnd&&Wa&&(f=Se()):(sa=d,ld="value"in sa?sa.value:sa.textContent,Wa=!0)),e=Vi.getPooled(e,b,c,d),f?e.data=f:(f=Ve(c),null!==f&&(e.data=f)),Ua(e),f=e):f=null;(a=Xi?Hh(a,c):Ih(a,c))?(b=Wi.getPooled(ra.beforeInput,b,c,d),b.data=a,Ua(b)):b=null;return null===f?b:null===b?f:[f,b]}},nd=null,Xa=null,Ya=null,df=function(a,b){return a(b)},Ef=function(a,b,c){return a(b,c)},ef=function(){},od=!1,Jh={color:!0,date:!0,datetime:!0,"datetime-local":!0, +email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},Qa=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Qa.hasOwnProperty("ReactCurrentDispatcher")||(Qa.ReactCurrentDispatcher={current:null});var Lh=/^(.*)[\\\/]/,N="function"===typeof Symbol&&Symbol.for,Fc=N?Symbol.for("react.element"):60103,Za=N?Symbol.for("react.portal"):60106,va=N?Symbol.for("react.fragment"):60107,rd=N?Symbol.for("react.strict_mode"):60108,pc=N?Symbol.for("react.profiler"):60114, +mf=N?Symbol.for("react.provider"):60109,lf=N?Symbol.for("react.context"):60110,qd=N?Symbol.for("react.concurrent_mode"):60111,td=N?Symbol.for("react.forward_ref"):60112,sd=N?Symbol.for("react.suspense"):60113,ud=N?Symbol.for("react.memo"):60115,nf=N?Symbol.for("react.lazy"):60116,kf="function"===typeof Symbol&&Symbol.iterator,Nh=/^[: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]*$/, +of=Object.prototype.hasOwnProperty,qf={},pf={},w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[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];w[b]=new I(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new I(a,2,!1, +a.toLowerCase(),null)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[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){w[a]=new I(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){w[a]=new I(a,3,!0,a,null)});["capture", +"download"].forEach(function(a){w[a]=new I(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){w[a]=new I(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){w[a]=new I(a,5,!1,a.toLowerCase(),null)});var He=/[\-:]([a-z])/g,Ie=function(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(He,Ie);w[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(He,Ie);w[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(He,Ie);w[b]=new I(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});["tabIndex","crossOrigin"].forEach(function(a){w[a]=new I(a,1,!1,a.toLowerCase(),null)});var vf={change:{phasedRegistrationNames:{bubbled:"onChange", +captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}},xb=null,yb=null,Je=!1;ta&&(Je=gf("input")&&(!document.documentMode||9=document.documentMode,Mf={select:{phasedRegistrationNames:{bubbled:"onSelect", +captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},ab=null,Fd=null,Bb=null,Ed=!1,mj={eventTypes:Mf,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Ff(e);f=ed.onSelect;for(var g=0;g"+b+"";for(b=ad.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}}), +Eb=function(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b},Cb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0, +lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nj=["Webkit","ms","Moz","O"];Object.keys(Cb).forEach(function(a){nj.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Cb[b]=Cb[a]})});var ei=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0, +source:!0,track:!0,wbr:!0}),Q=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,ah=Q.unstable_cancelCallback,la=Q.unstable_now,bh=Q.unstable_scheduleCallback,Qi=Q.unstable_shouldYield,Rc=Q.unstable_runWithPriority,Ji=Q.unstable_getCurrentPriorityLevel,ze=Q.unstable_ImmediatePriority,Ae=Q.unstable_UserBlockingPriority,Rg=Q.unstable_NormalPriority,Ki=Q.unstable_LowPriority,Li=Q.unstable_IdlePriority,te=null,ue=null,Oi="function"===typeof setTimeout?setTimeout:void 0,dh="function"===typeof clearTimeout? +clearTimeout:void 0,Gi=bh,Ei=ah;new Set;var Nd=[],cb=-1,xa={},D={current:xa},K={current:!1},Ha=xa,Pd=null,Qd=null,Si="undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__,T=function(a,b,c,d){return new hi(a,b,c,d)},bd=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.SchedulerTracing,pa=bd.__interactionsRef,ve=bd.__subscriberRef,Ti=bd.unstable_getThreadID,me=bd.unstable_wrap,eg=(new R.Component).refs,Dc={isMounted:function(a){return(a=a._reactInternalFiber)?2===Ab(a):!1},enqueueSetState:function(a, +b,c){a=a._reactInternalFiber;var d=ka();d=kb(d,a);var e=Ca(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);jb();oa(a,e);Aa(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=ka();d=kb(d,a);var e=Ca(d);e.tag=Dg;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);jb();oa(a,e);Aa(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=ka();c=kb(c,a);var d=Ca(c);d.tag=Jc;void 0!==b&&null!==b&&(d.callback=b);jb();oa(a,d);Aa(a,c)}},Gc=Array.isArray,mb=fg(!0),fe=fg(!1), +Ib={},V={current:Ib},Kb={current:Ib},Jb={current:Ib},ib=0,Ai=2,Vb=4,ri=8,Ci=16,Wb=32,se=64,re=128,Hc=Qa.ReactCurrentDispatcher,Lb=0,za=null,v=null,X=null,gb=null,E=null,fb=null,Ob=0,Y=null,Pb=0,Mb=!1,ia=null,Nb=0,Zd={readContext:U,useCallback:W,useContext:W,useEffect:W,useImperativeHandle:W,useLayoutEffect:W,useMemo:W,useReducer:W,useRef:W,useState:W,useDebugValue:W},ni={readContext:U,useCallback:function(a,b){hb().memoizedState=[a,void 0===b?null:b];return a},useContext:U,useEffect:function(a,b){return be(516, +re|se,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return be(4,Vb|Wb,kg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return be(4,Vb|Wb,a,b)},useMemo:function(a,b){var c=hb();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=hb();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=mg.bind(null,za,a);return[d.memoizedState,a]},useRef:function(a){var b= +hb();a={current:a};return b.memoizedState=a},useState:function(a){var b=hb();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null,lastRenderedReducer:ig,lastRenderedState:a};a=a.dispatch=mg.bind(null,za,a);return[b.memoizedState,a]},useDebugValue:lg},hg={readContext:U,useCallback:function(a,b){var c=Qb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Xd(b,d[1]))return d[0];c.memoizedState=[a,b];return a},useContext:U,useEffect:function(a, +b){return ce(516,re|se,a,b)},useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ce(4,Vb|Wb,kg.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ce(4,Vb|Wb,a,b)},useMemo:function(a,b){var c=Qb();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Xd(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:jg,useRef:function(a){return Qb().memoizedState},useState:function(a){return jg(ig,a)},useDebugValue:lg},Pg=0,Ka=-1,ma=null,lb=null, +La=!1,oi=Qa.ReactCurrentOwner,ja=!1,ie={current:null},Rb=null,Ma=null,Sb=null,zg=0,Dg=1,Jc=2,le=3,Ba=!1,Ug=void 0,we=void 0,Tg=void 0,Vg=void 0;Ug=function(a,b,c,d){for(c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};we=function(a){};Tg=function(a,b,c,d,e){var f=a.memoizedProps; +if(f!==d){var g=b.stateNode;Ja(V.current);a=null;switch(c){case "input":f=xd(g,f);d=xd(g,d);a=[];break;case "option":f=Gd(g,f);d=Gd(g,d);a=[];break;case "select":f=z({},f,{value:void 0});d=z({},d,{value:void 0});a=[];break;case "textarea":f=Hd(g,f);d=Hd(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=xc)}Jd(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===c){var k=f[c];for(g in k)k.hasOwnProperty(g)&& +(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(Sa.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(g in k)!k.hasOwnProperty(g)||l&&l.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in l)l.hasOwnProperty(g)&&k[g]!==l[g]&&(h||(h={}),h[g]=l[g])}else h||(a||(a=[]),a.push(c, +h)),h=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(Sa.hasOwnProperty(c)?(null!=l&&ha(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&Tb(b)}};Vg=function(a,b,c,d){c!==d&&Tb(b)};var si="function"===typeof WeakSet?WeakSet:Set, +vi="function"===typeof WeakMap?WeakMap:Map,xe=Qa.ReactCurrentDispatcher,Qg=Qa.ReactCurrentOwner;null==pa||null==pa.current?n("302"):void 0;var Fe=1073741822,Ea=!1,q=null,Z=null,F=0,Oa=-1,pe=!1,p=null,Qc=!1,qe=null,Oc=null,Nc=null,Da=null,ca=null,G=null,Tc=0,Uc=void 0,x=!1,da=null,A=0,qa=0,M=!1,Pa=null,y=!1,Wc=!1,pb=null,Be=la(),ba=1073741822-(Be/10|0),ob=ba,Mi=50,Xb=0,Ce=null,Yc=!1;nd=function(a,b,c){switch(b){case "input":yd(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode; +c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};(function(a,b,c){df=a;Ef=b;ef=c})(eh,gh,function(){x||0===qa||(aa(qa,!1),qa=0)});var uh={createPortal:ih,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0=== +b&&("function"===typeof a.render?n("188"):n("268",Object.keys(a)));a=zf(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!0,c)},render:function(a,b,c){sb(b)?void 0:n("200");return $c(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){sb(c)?void 0:n("200");null==a||void 0===a._reactInternalFiber?n("38"):void 0;return $c(a,b,c,!1,d)},unmountComponentAtNode:function(a){sb(a)?void 0:n("40");return a._reactRootContainer?(fh(function(){$c(null, +null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return ih.apply(void 0,arguments)},unstable_batchedUpdates:eh,unstable_interactiveUpdates:gh,flushSync:function(a,b){x?n("187"):void 0;var c=y;y=!0;try{return Zg(a,b)}finally{y=c,aa(1073741823,!1)}},unstable_createRoot:function(a,b){sb(a)?void 0:n("299","unstable_createRoot");return new rb(a,!0,null!=b&&!0===b.hydrate)},unstable_flushControlled:function(a){var b=y;y=!0;try{Zg(a)}finally{(y=b)||x||aa(1073741823, +!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Pe,Fa,id,Ge.injectEventPluginsByName,dd,Ua,function(a){fd(a,Dh)},af,bf,sc,hd]}};(function(a){var b=a.findFiberByHostInstance;return gi(z({},a,{overrideProps:null,currentDispatcherRef:Qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=zf(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:hc,bundleType:0,version:"16.8.6",rendererPackageName:"react-dom"}); +var vh={default:uh},wh=vh&&uh||vh;return wh.default||wh}); diff --git a/frontend/node_modules/react/cjs/react.development.js b/frontend/node_modules/react/cjs/react.development.js index cc20a377..8cf06cfd 100644 --- a/frontend/node_modules/react/cjs/react.development.js +++ b/frontend/node_modules/react/cjs/react.development.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -20,7 +20,7 @@ var checkPropTypes = require('prop-types/checkPropTypes'); // TODO: this is special because it gets imported during build. -var ReactVersion = '16.6.3'; +var ReactVersion = '16.8.6'; // 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. @@ -54,43 +54,6 @@ function getIteratorFn(maybeIterable) { return null; } -var enableHooks = false; -// Helps identify side effects in begin-phase lifecycle hooks and setState reducers: - - -// In some cases, StrictMode should also double-render lifecycles. -// This can be confusing for tests though, -// And it can be bad for performance in production. -// This feature flag can be used to control the behavior: - - -// To preserve the "Pause on caught exceptions" behavior of the debugger, we -// replay the begin phase of a failed component inside invokeGuardedCallback. - - -// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: - - -// Gather advanced timing metrics for Profiler subtrees. - - -// Trace which interactions trigger each commit. - - -// Only used in www builds. - - -// 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; - /** * Use invariant() to assert state which your program assumes to be true. * @@ -446,6 +409,17 @@ function createRef() { return refObject; } +/** + * Keeps track of the current dispatcher. + */ +var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null +}; + /** * Keeps track of the current owner. * @@ -457,8 +431,7 @@ var ReactCurrentOwner = { * @internal * @type {ReactComponent} */ - current: null, - currentDispatcher: null + current: null }; var BEFORE_SLASH_RE = /^(.*)[\\\/]/; @@ -589,6 +562,7 @@ function setCurrentlyValidatingElement(element) { } var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentOwner: ReactCurrentOwner, // Used by renderers to avoid bundling object-assign twice in UMD bundles: assign: _assign @@ -1368,13 +1342,51 @@ function createContext(defaultValue, calculateChangedBits) { } function lazy(ctor) { - return { + 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) { @@ -1420,14 +1432,16 @@ function memo(type, compare) { } function resolveDispatcher() { - var dispatcher = ReactCurrentOwner.currentDispatcher; - !(dispatcher !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0; + 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, observedBits) { +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; @@ -1440,7 +1454,7 @@ function useContext(Context, observedBits) { } } } - return dispatcher.useContext(Context, observedBits); + return dispatcher.useContext(Context, unstable_observedBits); } function useState(initialState) { @@ -1448,9 +1462,9 @@ function useState(initialState) { return dispatcher.useState(initialState); } -function useReducer(reducer, initialState, initialAction) { +function useReducer(reducer, initialArg, init) { var dispatcher = resolveDispatcher(); - return dispatcher.useReducer(reducer, initialState, initialAction); + return dispatcher.useReducer(reducer, initialArg, init); } function useRef(initialValue) { @@ -1463,11 +1477,6 @@ function useEffect(create, inputs) { return dispatcher.useEffect(create, inputs); } -function useMutationEffect(create, inputs) { - var dispatcher = resolveDispatcher(); - return dispatcher.useMutationEffect(create, inputs); -} - function useLayoutEffect(create, inputs) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, inputs); @@ -1483,9 +1492,16 @@ function useMemo(create, inputs) { return dispatcher.useMemo(create, inputs); } -function useImperativeMethods(ref, create, inputs) { +function useImperativeHandle(ref, create, inputs) { var dispatcher = resolveDispatcher(); - return dispatcher.useImperativeMethods(ref, create, inputs); + return dispatcher.useImperativeHandle(ref, create, inputs); +} + +function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } } /** @@ -1574,7 +1590,7 @@ function validateExplicitKey(element, parentType) { setCurrentlyValidatingElement(element); { - warning$1(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.', currentComponentErrorInfo, childOwner); + 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); } setCurrentlyValidatingElement(null); } @@ -1630,16 +1646,17 @@ function validateChildKeys(node, parentType) { */ 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 function 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 = type.displayName || (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; @@ -1770,6 +1787,45 @@ function cloneElementWithValidation(element, props, children) { return newElement; } +// Helps identify side effects in begin-phase lifecycle hooks and setState reducers: + + +// In some cases, StrictMode should also double-render lifecycles. +// This can be confusing for tests though, +// And it can be bad for performance in production. +// This feature flag can be used to control the behavior: + + +// To preserve the "Pause on caught exceptions" behavior of the debugger, we +// replay the begin phase of a failed component inside invokeGuardedCallback. + + +// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: + + +// Gather advanced timing metrics for Profiler subtrees. + + +// Trace which interactions trigger each commit. + + +// Only used in www builds. + // TODO: true? Here it might just be false. + +// Only used in www builds. + + +// Only used in www builds. + + +// 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, @@ -1788,6 +1844,17 @@ var React = { 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, @@ -1799,28 +1866,22 @@ var React = { version: ReactVersion, + unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE, + unstable_Profiler: REACT_PROFILER_TYPE, + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals }; +// Note: some APIs are added with feature flags. +// Make sure that stable builds for open source +// don't modify the React object to avoid deopts. +// Also let's not expose their names in stable builds. + if (enableStableConcurrentModeAPIs) { React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; React.Profiler = REACT_PROFILER_TYPE; -} else { - React.unstable_ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; - React.unstable_Profiler = REACT_PROFILER_TYPE; -} - -if (enableHooks) { - React.useCallback = useCallback; - React.useContext = useContext; - React.useEffect = useEffect; - React.useImperativeMethods = useImperativeMethods; - React.useLayoutEffect = useLayoutEffect; - React.useMemo = useMemo; - React.useMutationEffect = useMutationEffect; - React.useReducer = useReducer; - React.useRef = useRef; - React.useState = useState; + React.unstable_ConcurrentMode = undefined; + React.unstable_Profiler = undefined; } diff --git a/frontend/node_modules/react/cjs/react.production.min.js b/frontend/node_modules/react/cjs/react.production.min.js index a1a28306..1cc5fb07 100644 --- a/frontend/node_modules/react/cjs/react.production.min.js +++ b/frontend/node_modules/react/cjs/react.production.min.js @@ -1,4 +1,4 @@ -/** @license React v16.6.1 +/** @license React v16.8.6 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. @@ -7,18 +7,19 @@ * LICENSE file in the root directory of this source tree. */ -'use strict';var k=require("object-assign"),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,z=n?Symbol.for("react.suspense"):60113,A=n?Symbol.for("react.memo"): -60115,B=n?Symbol.for("react.lazy"):60116,C="function"===typeof Symbol&&Symbol.iterator;function aa(a,b,e,c,d,g,h,f){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 l=[e,c,d,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}} -function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;cQ.length&&Q.push(a)} -function T(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 p:case q:g=!0}}if(g)return e(c,a,""===b?"."+U(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=b){d=a;break}a=a.next}while(a!==c);null===d?d= -c:d===c&&(c=g,v());b=d.previous;b.next=d.previous=g;g.next=d;g.previous=b}}function R(){if(-1===m&&null!==c&&1===c.priorityLevel){w=!0;try{do Q();while(null!==c&&1===c.priorityLevel)}finally{w=!1,null!==c?v():D=!1}}}function ua(a){w=!0;var b=G;G=a;try{if(a)for(;null!==c;){var d=l();if(c.expirationTime<=d){do Q();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do Q();while(null!==c&&!H())}}finally{w=!1,G=b,null!==c?v():D=!1,R()}}function fa(a,b,d){var f=void 0,n={},c=null,e=null; -if(null!=b)for(f in void 0!==b.ref&&(e=b.ref),void 0!==b.key&&(c=""+b.key),b)ha.call(b,f)&&!ia.hasOwnProperty(f)&&(n[f]=b[f]);var h=arguments.length-2;if(1===h)n.children=d;else if(1I.length&&I.push(a)}function U(a,b,d,f){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var g=!1;if(null=== -a)g=!0;else switch(c){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case x:case xa:g=!0}}if(g)return d(f,a,""===b?"."+V(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var e=0;ea;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1; -var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(f){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var c,e=1;e=L-d)if(-1!==b&&b<=d)c=!0;else{B||(B=!0,Y(ba));u=a;A=b;return}if(null!==a){Z=!0;try{a(c)}finally{Z=!1}}}},!1);var ba=function(a){if(null!==u){Y(ba);var b=a-L+C;bb&&(b=8),C=bb?window.postMessage(aa,"*"):B||(B= -!0,Y(ba))};P=function(){u=null;K=!1;A=-1}}var Oa=0,S={current:null,currentDispatcher:null};e={ReactCurrentOwner:S,assign:J};J(e,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}},unstable_shouldYield:function(){return!G&&(null!==c&&c.expirationTimeb){d=f;break}f=f.next}while(f!==c);null===d?d=c:d===c&&(c=a,v());b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break; -default:a=3}var d=k,c=m;k=a;m=l();try{return b()}finally{k=d,m=c,R()}},unstable_wrapCallback:function(a){var b=k;return function(){var d=k,c=m;k=b;m=l();try{return a.apply(this,arguments)}finally{k=d,m=c,R()}}},unstable_getCurrentPriorityLevel:function(){return k}},SchedulerTracing:{__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Oa},unstable_subscribe:function(a){},unstable_trace:function(a, -b,d){return d()},unstable_unsubscribe:function(a){},unstable_wrap:function(a){return a}}});var ha=Object.prototype.hasOwnProperty,ia={key:!0,ref:!0,__self:!0,__source:!0},ma=/\/+/g,I=[];r={Children:{map:function(a,b,d){if(null==a)return a;var c=[];X(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=ja(null,null,b,d);W(a,ya,b);ka(b)},count:function(a){return W(a,function(){return null},null)},toArray:function(a){var b=[];X(a,b,null,function(a){return a});return b},only:function(a){T(a)? -void 0:p("143");return a}},createRef:function(){return{current:null}},Component:q,PureComponent:O,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:Ca,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:Ba,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:Ea,render:a}},lazy:function(a){return{$$typeof:Ha,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:Ga,type:a,compare:void 0=== -b?null:b}},Fragment:r,StrictMode:Aa,Suspense:Fa,createElement:fa,cloneElement:function(a,b,d){null===a||void 0===a?p("267",a):void 0;var c=void 0,e=J({},a.props),g=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=S.current);void 0!==b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)ha.call(b,c)&&!ia.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d=== +c&&(c=n,u());b=d.previous;b.next=d.previous=n;n.next=d;n.previous=b}}function F(){if(-1===k&&null!==c&&1===c.priorityLevel){x=!0;try{do Q();while(null!==c&&1===c.priorityLevel)}finally{x=!1,null!==c?u():C=!1}}}function ta(a){x=!0;var b=G;G=a;try{if(a)for(;null!==c;){var d=l();if(c.expirationTime<=d){do Q();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do Q();while(null!==c&&!H())}}finally{x=!1,G=b,null!==c?u():C=!1,F()}}function ea(a,b,d){var g=void 0,p={},c=null,e=null;if(null!= +b)for(g in void 0!==b.ref&&(e=b.ref),void 0!==b.key&&(c=""+b.key),b)fa.call(b,g)&&!ha.hasOwnProperty(g)&&(p[g]=b[g]);var h=arguments.length-2;if(1===h)p.children=d;else if(1I.length&&I.push(a)}function T(a,b,d,g){var c=typeof a;if("undefined"===c||"boolean"===c)a=null;var e=!1;if(null=== +a)e=!0;else switch(c){case "string":case "number":e=!0;break;case "object":switch(a.$$typeof){case y:case wa:e=!0}}if(e)return d(g,a,""===b?"."+U(a,0):b),1;e=0;b=""===b?".":b+":";if(Array.isArray(a))for(var f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(g){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var c,e=1;e=L-d)if(-1!==b&&b<=d)c=!0;else{A||(A=!0,Y(aa));w=a;z=b;return}if(null!==a){Z=!0;try{a(c)}finally{Z=!1}}};var aa=function(a){if(null!==w){Y(aa);var b=a-L+B;bb&&(b=8),B=bb?sa.postMessage(void 0):A||(A=!0,Y(aa))};P=function(){w=null;K=!1;z=-1}}var Oa= +0,ma={current:null},R={current:null};e={ReactCurrentDispatcher:ma,ReactCurrentOwner:R,assign:J};J(e,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}},unstable_shouldYield:function(){return!G&&(null!==c&&c.expirationTimeb){d=g;break}g=g.next}while(g!==c);null===d?d=c:d===c&&(c=a,u());b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a= +3}var d=f,c=k;f=a;k=l();try{return b()}finally{f=d,k=c,F()}},unstable_next:function(a){switch(f){case 1:case 2:case 3:var b=3;break;default:b=f}var d=f,c=k;f=b;k=l();try{return a()}finally{f=d,k=c,F()}},unstable_wrapCallback:function(a){var b=f;return function(){var d=f,c=k;f=b;k=l();try{return a.apply(this,arguments)}finally{f=d,k=c,F()}}},unstable_getFirstCallbackNode:function(){return c},unstable_pauseExecution:function(){},unstable_continueExecution:function(){null!==c&&u()},unstable_getCurrentPriorityLevel:function(){return f}, +unstable_IdlePriority:5,unstable_ImmediatePriority:1,unstable_LowPriority:4,unstable_NormalPriority:3,unstable_UserBlockingPriority:2},SchedulerTracing:{__interactionsRef:null,__subscriberRef:null,unstable_clear:function(a){return a()},unstable_getCurrent:function(){return null},unstable_getThreadID:function(){return++Oa},unstable_subscribe:function(a){},unstable_trace:function(a,b,d){return d()},unstable_unsubscribe:function(a){},unstable_wrap:function(a){return a}}});var fa=Object.prototype.hasOwnProperty, +ha={key:!0,ref:!0,__self:!0,__source:!0},la=/\/+/g,I=[];r={Children:{map:function(a,b,d){if(null==a)return a;var c=[];W(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=ia(null,null,b,d);V(a,xa,b);ja(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){S(a)?void 0:q("143");return a}},createRef:function(){return{current:null}},Component:t,PureComponent:O,createContext:function(a, +b){void 0===b&&(b=null);a={$$typeof:Ba,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:Aa,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:Da,render:a}},lazy:function(a){return{$$typeof:Ga,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:Fa,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return m().useCallback(a,b)},useContext:function(a,b){return m().useContext(a,b)}, +useEffect:function(a,b){return m().useEffect(a,b)},useImperativeHandle:function(a,b,d){return m().useImperativeHandle(a,b,d)},useDebugValue:function(a,b){},useLayoutEffect:function(a,b){return m().useLayoutEffect(a,b)},useMemo:function(a,b){return m().useMemo(a,b)},useReducer:function(a,b,d){return m().useReducer(a,b,d)},useRef:function(a){return m().useRef(a)},useState:function(a){return m().useState(a)},Fragment:r,StrictMode:X,Suspense:Ea,createElement:ea,cloneElement:function(a,b,d){null===a|| +void 0===a?q("267",a):void 0;var c=void 0,e=J({},a.props),f=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=R.current);void 0!==b.key&&(f=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)fa.call(b,c)&&!ha.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1=b){c=a;break}a=a.next}while(a!==f);null===c?c= -f:c===f&&(f=g,y());b=c.previous;b.next=c.previous=g;g.next=c;g.previous=b}}function U(){if(-1===q&&null!==f&&1===f.priorityLevel){z=!0;try{do T();while(null!==f&&1===f.priorityLevel)}finally{z=!1,null!==f?y():G=!1}}}function xa(a){z=!0;var b=J;J=a;try{if(a)for(;null!==f;){var c=p();if(f.expirationTime<=c){do T();while(null!==f&&f.expirationTime<=c)}else break}else if(null!==f){do T();while(null!==f&&!K())}}finally{z=!1,J=b,null!==f?y():G=!1,U()}}function ya(a){var b=!1,c=null;n.forEach(function(d){try{d.onInteractionTraced(a)}catch(e){b|| -(b=!0,c=e)}});if(b)throw c;}function za(a){var b=!1,c=null;n.forEach(function(d){try{d.onInteractionScheduledWorkCompleted(a)}catch(e){b||(b=!0,c=e)}});if(b)throw c;}function Aa(a,b){var c=!1,d=null;n.forEach(function(e){try{e.onWorkScheduled(a,b)}catch(g){c||(c=!0,d=g)}});if(c)throw d;}function Ba(a,b){var c=!1,d=null;n.forEach(function(e){try{e.onWorkStarted(a,b)}catch(g){c||(c=!0,d=g)}});if(c)throw d;}function Ca(a,b){var c=!1,d=null;n.forEach(function(e){try{e.onWorkStopped(a,b)}catch(g){c||(c= -!0,d=g)}});if(c)throw d;}function Da(a,b){var c=!1,d=null;n.forEach(function(e){try{e.onWorkCanceled(a,b)}catch(g){c||(c=!0,d=g)}});if(c)throw d;}function ja(a,b,c){var d=void 0,e={},g=null,f=null;if(null!=b)for(d in void 0!==b.ref&&(f=b.ref),void 0!==b.key&&(g=""+b.key),b)ka.call(b,d)&&!la.hasOwnProperty(d)&&(e[d]=b[d]);var h=arguments.length-2;if(1===h)e.children=c;else if(1L.length&&L.push(a)}function X(a,b,c,d){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 A:case Ga:g=!0}}if(g)return c(d,a,""===b?"."+Y(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var c={};"abcdefghijklmnopqrst".split("").forEach(function(a){c[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},c)).join("")?!1:!0}catch(d){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined"); -var c=Object(a);for(var d,e=1;e=O-c)if(-1!==b&&b<=c)d=!0;else{E||(E=!0,ba(ea));x=a;D=b;return}if(null!==a){ca=!0;try{a(d)}finally{ca=!1}}}},!1);var ea=function(a){if(null!==x){ba(ea);var b=a-O+F;bb&&(b=8),F=bb?window.postMessage(da,"*"):E||(E=!0,ba(ea))};S=function(){x=null;N=!1;D=-1}}var Xa=0,Ya=0,m=null,t=null;m={current:new Set};t={current:null};var n=null;n=new Set;var V={current:null,currentDispatcher:null};k={ReactCurrentOwner:V,assign:M};M(k,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)f=null;else{a===f&&(f=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}},unstable_shouldYield:function(){return!J&& -(null!==f&&f.expirationTimeb){c=d;break}d=d.next}while(d!==f);null=== -c?c=f:c===f&&(f=a,y());b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=l,d=q;l=a;q=p();try{return b()}finally{l=c,q=d,U()}},unstable_wrapCallback:function(a){var b=l;return function(){var c=l,d=q;l=b;q=p();try{return a.apply(this,arguments)}finally{l=c,q=d,U()}}},unstable_getCurrentPriorityLevel:function(){return l}},SchedulerTracing:{__interactionsRef:m,__subscriberRef:t,unstable_clear:function(a){var b= -m.current;m.current=new Set;try{return a()}finally{m.current=b}},unstable_getCurrent:function(){return m.current},unstable_getThreadID:function(){return++Ya},unstable_subscribe:function(a){n.add(a);1===n.size&&(t.current={onInteractionScheduledWorkCompleted:za,onInteractionTraced:ya,onWorkCanceled:Da,onWorkScheduled:Aa,onWorkStarted:Ba,onWorkStopped:Ca})},unstable_trace:function(a,b,c){var d=3=b){c=a;break}a=a.next}while(a!==f);null===c?c= +f:c===f&&(f=l,x());b=c.previous;b.next=c.previous=l;l.next=c;l.previous=b}}function I(){if(-1===n&&null!==f&&1===f.priorityLevel){A=!0;try{do T();while(null!==f&&1===f.priorityLevel)}finally{A=!1,null!==f?x():F=!1}}}function xa(a){A=!0;var b=J;J=a;try{if(a)for(;null!==f;){var c=p();if(f.expirationTime<=c){do T();while(null!==f&&f.expirationTime<=c)}else break}else if(null!==f){do T();while(null!==f&&!K())}}finally{A=!1,J=b,null!==f?x():F=!1,I()}}function ya(a){var b=!1,c=null;q.forEach(function(d){try{d.onInteractionTraced(a)}catch(e){b|| +(b=!0,c=e)}});if(b)throw c;}function za(a){var b=!1,c=null;q.forEach(function(d){try{d.onInteractionScheduledWorkCompleted(a)}catch(e){b||(b=!0,c=e)}});if(b)throw c;}function Aa(a,b){var c=!1,d=null;q.forEach(function(e){try{e.onWorkScheduled(a,b)}catch(l){c||(c=!0,d=l)}});if(c)throw d;}function Ba(a,b){var c=!1,d=null;q.forEach(function(e){try{e.onWorkStarted(a,b)}catch(l){c||(c=!0,d=l)}});if(c)throw d;}function Ca(a,b){var c=!1,d=null;q.forEach(function(e){try{e.onWorkStopped(a,b)}catch(l){c||(c= +!0,d=l)}});if(c)throw d;}function Da(a,b){var c=!1,d=null;q.forEach(function(e){try{e.onWorkCanceled(a,b)}catch(l){c||(c=!0,d=l)}});if(c)throw d;}function ia(a,b,c){var d=void 0,e={},l=null,f=null;if(null!=b)for(d in void 0!==b.ref&&(f=b.ref),void 0!==b.key&&(l=""+b.key),b)ja.call(b,d)&&!ka.hasOwnProperty(d)&&(e[d]=b[d]);var h=arguments.length-2;if(1===h)e.children=c;else if(1L.length&&L.push(a)}function W(a,b,c,d){var e=typeof a;if("undefined"===e||"boolean"===e)a=null;var l=!1;if(null===a)l=!0;else switch(e){case "string":case "number":l=!0;break;case "object":switch(a.$$typeof){case B:case Ga:l=!0}}if(l)return c(d,a,""===b?"."+X(a,0):b),1;l=0;b=""===b?".":b+":";if(Array.isArray(a))for(var f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var c={};"abcdefghijklmnopqrst".split("").forEach(function(a){c[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},c)).join("")?!1:!0}catch(d){return!1}}()?Object.assign: +function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var c=Object(a);for(var d,e=1;e=O-c)if(-1!==b&&b<=c)d=!0;else{D||(D=!0,ba(da));z=a;C=b;return}if(null!==a){ca=!0;try{a(d)}finally{ca=!1}}};var da=function(a){if(null!== +z){ba(da);var b=a-O+E;bb&&(b=8),E=bb?va.postMessage(void 0):D||(D=!0,ba(da))};S=function(){z=null;N=!1;C=-1}}var Ya=0,Za=0,m=null,u=null;m={current:new Set};u={current:null};var q=null;q=new Set;var pa={current:null},U={current:null};g={ReactCurrentDispatcher:pa,ReactCurrentOwner:U,assign:M};M(g,{Scheduler:{unstable_cancelCallback:function(a){var b=a.next;if(null!==b){if(b===a)f=null;else{a===f&& +(f=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}},unstable_shouldYield:function(){return!J&&(null!==f&&f.expirationTimeb){c=d;break}d=d.next}while(d!==f);null===c?c=f:c===f&&(f=a,x());b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a},unstable_runWithPriority:function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=k,d=n;k=a;n=p();try{return b()}finally{k=c,n=d,I()}},unstable_next:function(a){switch(k){case 1:case 2:case 3:var b=3;break;default:b=k}var c=k,d=n;k=b;n=p();try{return a()}finally{k=c,n=d,I()}}, +unstable_wrapCallback:function(a){var b=k;return function(){var c=k,d=n;k=b;n=p();try{return a.apply(this,arguments)}finally{k=c,n=d,I()}}},unstable_getFirstCallbackNode:function(){return f},unstable_pauseExecution:function(){},unstable_continueExecution:function(){null!==f&&x()},unstable_getCurrentPriorityLevel:function(){return k},unstable_IdlePriority:5,unstable_ImmediatePriority:1,unstable_LowPriority:4,unstable_NormalPriority:3,unstable_UserBlockingPriority:2},SchedulerTracing:{__interactionsRef:m, +__subscriberRef:u,unstable_clear:function(a){var b=m.current;m.current=new Set;try{return a()}finally{m.current=b}},unstable_getCurrent:function(){return m.current},unstable_getThreadID:function(){return++Za},unstable_subscribe:function(a){q.add(a);1===q.size&&(u.current={onInteractionScheduledWorkCompleted:za,onInteractionTraced:ya,onWorkCanceled:Da,onWorkScheduled:Aa,onWorkStarted:Ba,onWorkStopped:Ca})},unstable_trace:function(a,b,c){var d=3=b){c=a;break}a=a.next}while(a!==d);null===c?c=d:c===d&&(d=g,p());b=c.previous;b.next=c.previous=g;g.next=c;g.previous= -b}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,f=b,null!==d?p():n=!1,v()}} +'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var d=null,e=!1,g=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=d.expirationTime;n?q():n=!0;r(t,a)}} +function u(){var a=d,b=d.next;if(d===b)d=null;else{var c=d.previous;d=c.next=b;b.previous=c}a.next=a.previous=null;c=a.callback;b=a.expirationTime;a=a.priorityLevel;var f=g,Q=l;g=a;l=b;try{var h=c()}finally{g=f,l=Q}if("function"===typeof h)if(h={callback:h,priorityLevel:a,expirationTime:b,next:null,previous:null},null===d)d=h.next=h.previous=h;else{c=null;a=d;do{if(a.expirationTime>=b){c=a;break}a=a.next}while(a!==d);null===c?c=d:c===d&&(d=h,p());b=c.previous;b.next=c.previous=h;h.next=c;h.previous= +b}}function v(){if(-1===k&&null!==d&&1===d.priorityLevel){m=!0;try{do u();while(null!==d&&1===d.priorityLevel)}finally{m=!1,null!==d?p():n=!1}}}function t(a){m=!0;var b=e;e=a;try{if(a)for(;null!==d;){var c=exports.unstable_now();if(d.expirationTime<=c){do u();while(null!==d&&d.expirationTime<=c)}else break}else if(null!==d){do u();while(null!==d&&!w())}}finally{m=!1,e=b,null!==d?p():n=!1,v()}} var x=Date,y="function"===typeof setTimeout?setTimeout:void 0,z="function"===typeof clearTimeout?clearTimeout:void 0,A="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)} -if("object"===typeof performance&&"function"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w; -if("undefined"!==typeof window&&window._schedMock){var G=window._schedMock;r=G[0];q=G[1];w=G[2]}else if("undefined"===typeof window||"function"!==typeof window.addEventListener){var H=null,I=-1,J=function(a,b){if(null!==H){var c=H;H=null;try{I=b,c(a)}finally{I=-1}}};r=function(a,b){-1!==I?setTimeout(r,0,a,b):(H=a,setTimeout(J,b,!0,b),setTimeout(J,1073741823,!1,1073741823))};q=function(){H=null};w=function(){return!1};exports.unstable_now=function(){return-1===I?0:I}}else{"undefined"!==typeof console&& -("function"!==typeof A&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof B&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T="__reactIdleCallback$"+Math.random().toString(36).slice(2); -window.addEventListener("message",function(a){if(a.source===window&&a.data===T){L=!1;a=K;var b=M;K=null;M=-1;var c=exports.unstable_now(),e=!1;if(0>=P-c)if(-1!==b&&b<=c)e=!0;else{N||(N=!0,E(U));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}}},!1);var U=function(a){if(null!==K){E(U);var b=a-P+S;bb&&(b=8),S=bb?window.postMessage(T,"*"):N||(N=!0,E(U))};q=function(){K=null;L=!1;M=-1}} -exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=h,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=c,k=e,v()}}; -exports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=c+b.timeout;else switch(h){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var e=d;do{if(e.expirationTime>b){c=e;break}e=e.next}while(e!==d);null===c?c=d:c===d&&(d=a,p()); -b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var c=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=c,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h}; -exports.unstable_shouldYield=function(){return!f&&(null!==d&&d.expirationTime=P-c)if(-1!==b&&b<=c)f=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(f)}finally{O=!1}}}; +var V=function(a){if(null!==K){E(V);var b=a-P+S;bb&&(b=8),S=bb?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4; +exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=g,f=k;g=a;k=exports.unstable_now();try{return b()}finally{g=c,k=f,v()}};exports.unstable_next=function(a){switch(g){case 1:case 2:case 3:var b=3;break;default:b=g}var c=g,f=k;g=b;k=exports.unstable_now();try{return a()}finally{g=c,k=f,v()}}; +exports.unstable_scheduleCallback=function(a,b){var c=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=c+b.timeout;else switch(g){case 1:b=c+-1;break;case 2:b=c+250;break;case 5:b=c+1073741823;break;case 4:b=c+1E4;break;default:b=c+5E3}a={callback:a,priorityLevel:g,expirationTime:b,next:null,previous:null};if(null===d)d=a.next=a.previous=a,p();else{c=null;var f=d;do{if(f.expirationTime>b){c=f;break}f=f.next}while(f!==d);null===c?c=d:c===d&&(d=a,p()); +b=c.previous;b.next=c.previous=a;a.next=c;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)d=null;else{a===d&&(d=b);var c=a.previous;c.next=b;b.previous=c}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=g;return function(){var c=g,f=k;g=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{g=c,k=f,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return g}; +exports.unstable_shouldYield=function(){return!e&&(null!==d&&d.expirationTime
+ diff --git a/frontend/src/Navbar.js b/frontend/src/Navbar.js new file mode 100644 index 00000000..c70f65f4 --- /dev/null +++ b/frontend/src/Navbar.js @@ -0,0 +1,38 @@ +import React, { Component } from "react"; +import styled from 'styled-components'; + + + const Navbar = styled.div` + font-weight: 700; + color: white; + font-size: 12px; + height: 40px; + display:inline-block; + width: 100%; +`; + +const NavLink = styled.a` +display:inline-block; +color: #ADD8E6; +padding:10px; +`; + +class NavBar extends Component { + render() { + return ( +
+ + Profie + Study + Naturaization + Incentives + About Us + +
+ + + ); + } + } + + export default NavBar; \ No newline at end of file diff --git a/frontend/src/index.js b/frontend/src/index.js index 0c5e75da..5228a0cf 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; +import 'bootstrap/dist/css/bootstrap.css'; ReactDOM.render(, document.getElementById('root'));