}// AsyncMode is deprecated along with isAsyncMode
varAsyncMode=REACT_ASYNC_MODE_TYPE;
varConcurrentMode=REACT_CONCURRENT_MODE_TYPE;
varContextConsumer=REACT_CONTEXT_TYPE;
varContextProvider=REACT_PROVIDER_TYPE;
varElement=REACT_ELEMENT_TYPE;
varForwardRef=REACT_FORWARD_REF_TYPE;
varFragment=REACT_FRAGMENT_TYPE;
varLazy=REACT_LAZY_TYPE;
varMemo=REACT_MEMO_TYPE;
varPortal=REACT_PORTAL_TYPE;
varProfiler=REACT_PROFILER_TYPE;
varStrictMode=REACT_STRICT_MODE_TYPE;
varSuspense=REACT_SUSPENSE_TYPE;
varhasWarnedAboutDeprecatedIsAsyncMode=false;// AsyncMode should be deprecated
functionisAsyncMode(object){
{
if(!hasWarnedAboutDeprecatedIsAsyncMode){
hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');
}// AsyncMode is deprecated along with isAsyncMode
varAsyncMode=REACT_ASYNC_MODE_TYPE;
varConcurrentMode=REACT_CONCURRENT_MODE_TYPE;
varContextConsumer=REACT_CONTEXT_TYPE;
varContextProvider=REACT_PROVIDER_TYPE;
varElement=REACT_ELEMENT_TYPE;
varForwardRef=REACT_FORWARD_REF_TYPE;
varFragment=REACT_FRAGMENT_TYPE;
varLazy=REACT_LAZY_TYPE;
varMemo=REACT_MEMO_TYPE;
varPortal=REACT_PORTAL_TYPE;
varProfiler=REACT_PROFILER_TYPE;
varStrictMode=REACT_STRICT_MODE_TYPE;
varSuspense=REACT_SUSPENSE_TYPE;
varhasWarnedAboutDeprecatedIsAsyncMode=false;// AsyncMode should be deprecated
functionisAsyncMode(object){
{
if(!hasWarnedAboutDeprecatedIsAsyncMode){
hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');
React is a JavaScript library for creating user interfaces.
The `react` package contains only the functionality necessary to define React components. It is typically used together with a React renderer like `react-dom` for the web, or `react-native` for the native environments.
**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the [production build](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) when deploying your application.
varerror$1=void0;// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try{
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if(typeoftypeSpecs[typeSpecName]!=='function'){
varerr=Error((componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+typeoftypeSpecs[typeSpecName]+'`.'+'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
error('%s: type specification of %s'+' `%s` is invalid; the type checker '+'function must return `null` or an `Error` but returned a %s. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).',componentName||'React class',location,typeSpecName,typeoferror$1);
error('Component "%s" contains the string ref "%s". '+'Support for string refs will be removed in a future major release. '+'This case cannot be automatically converted to an arrow function. '+'We ask you to manually fix this case by using useRef() or createRef() instead. '+'Learn more about using refs safely here: '+'https://reactjs.org/link/strict-mode-string-ref',getComponentName(ReactCurrentOwner.current.type),config.ref);
error('%s: `key` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);
error('%s: `ref` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);
}
};
warnAboutAccessingRef.isReactWarning=true;
Object.defineProperty(props,'ref',{
get:warnAboutAccessingRef,
configurable:true
});
}
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, instanceof check
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} props
* @param {*} key
* @param {string|object} ref
* @param {*} owner
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
// Give the component that originally created this child.
childOwner=" It was passed a child from "+getComponentName(element._owner.type)+".";
}
setCurrentlyValidatingElement$1(element);
error('Each child in a list should have a unique "key" prop.'+'%s%s See https://reactjs.org/link/warning-keys for more information.',currentComponentErrorInfo,childOwner);
setCurrentlyValidatingElement$1(null);
}
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
functionvalidateChildKeys(node,parentType){
{
if(typeofnode!=='object'){
return;
}
if(Array.isArray(node)){
for(vari=0;i<node.length;i++){
varchild=node[i];
if(isValidElement(child)){
validateExplicitKey(child,parentType);
}
}
}elseif(isValidElement(node)){
// This element was passed in a valid location.
if(node._store){
node._store.validated=true;
}
}elseif(node){
variteratorFn=getIteratorFn(node);
if(typeofiteratorFn==='function'){
// Entry iterators used to provide implicit keys,
// but now we print a separate warning for them later.
if(iteratorFn!==node.entries){
variterator=iteratorFn.call(node);
varstep;
while(!(step=iterator.next()).done){
if(isValidElement(step.value)){
validateExplicitKey(step.value,parentType);
}
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
info=' Did you accidentally export a JSX literal instead of a component?';
}else{
typeString=typeoftype;
}
error('React.jsx: type is invalid -- expected a string (for '+'built-in components) or a class/function (for composite '+'components) but got: %s.%s',typeString,info);
}
varelement=jsxDEV(type,props,key,source,self);// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if(element==null){
returnelement;
}// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
// fixed, the key warnings will appear.)
if(validType){
varchildren=props.children;
if(children!==undefined){
if(isStaticChildren){
if(Array.isArray(children)){
for(vari=0;i<children.length;i++){
validateChildKeys(children[i],type);
}
if(Object.freeze){
Object.freeze(children);
}
}else{
error('React.jsx: Static children should always be an array. '+'You are likely explicitly calling React.jsxs or React.jsxDEV. '+'Use the Babel transform instead.');
}
}else{
validateChildKeys(children,type);
}
}
}
if(type===exports.Fragment){
validateFragmentProps(element);
}else{
validatePropTypes(element);
}
returnelement;
}
}// These two functions exist to still get child warnings in dev
varerror$1=void0;// Prop type validation may throw. In case they do, we don't want to
// fail the render phase where it didn't fail before. So we log it.
// After these have been cleaned up, we'll let them throw.
try{
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
if(typeoftypeSpecs[typeSpecName]!=='function'){
varerr=Error((componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+typeoftypeSpecs[typeSpecName]+'`.'+'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
error('%s: type specification of %s'+' `%s` is invalid; the type checker '+'function must return `null` or an `Error` but returned a %s. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).',componentName||'React class',location,typeSpecName,typeoferror$1);
error('Component "%s" contains the string ref "%s". '+'Support for string refs will be removed in a future major release. '+'This case cannot be automatically converted to an arrow function. '+'We ask you to manually fix this case by using useRef() or createRef() instead. '+'Learn more about using refs safely here: '+'https://reactjs.org/link/strict-mode-string-ref',getComponentName(ReactCurrentOwner.current.type),config.ref);
error('%s: `key` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);
error('%s: `ref` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);
}
};
warnAboutAccessingRef.isReactWarning=true;
Object.defineProperty(props,'ref',{
get:warnAboutAccessingRef,
configurable:true
});
}
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, instanceof check
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} props
* @param {*} key
* @param {string|object} ref
* @param {*} owner
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
// Give the component that originally created this child.
childOwner=" It was passed a child from "+getComponentName(element._owner.type)+".";
}
setCurrentlyValidatingElement$1(element);
error('Each child in a list should have a unique "key" prop.'+'%s%s See https://reactjs.org/link/warning-keys for more information.',currentComponentErrorInfo,childOwner);
setCurrentlyValidatingElement$1(null);
}
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
functionvalidateChildKeys(node,parentType){
{
if(typeofnode!=='object'){
return;
}
if(Array.isArray(node)){
for(vari=0;i<node.length;i++){
varchild=node[i];
if(isValidElement(child)){
validateExplicitKey(child,parentType);
}
}
}elseif(isValidElement(node)){
// This element was passed in a valid location.
if(node._store){
node._store.validated=true;
}
}elseif(node){
variteratorFn=getIteratorFn(node);
if(typeofiteratorFn==='function'){
// Entry iterators used to provide implicit keys,
// but now we print a separate warning for them later.
if(iteratorFn!==node.entries){
variterator=iteratorFn.call(node);
varstep;
while(!(step=iterator.next()).done){
if(isValidElement(step.value)){
validateExplicitKey(step.value,parentType);
}
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
info=' Did you accidentally export a JSX literal instead of a component?';
}else{
typeString=typeoftype;
}
error('React.jsx: type is invalid -- expected a string (for '+'built-in components) or a class/function (for composite '+'components) but got: %s.%s',typeString,info);
}
varelement=jsxDEV(type,props,key,source,self);// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if(element==null){
returnelement;
}// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
// fixed, the key warnings will appear.)
if(validType){
varchildren=props.children;
if(children!==undefined){
if(isStaticChildren){
if(Array.isArray(children)){
for(vari=0;i<children.length;i++){
validateChildKeys(children[i],type);
}
if(Object.freeze){
Object.freeze(children);
}
}else{
error('React.jsx: Static children should always be an array. '+'You are likely explicitly calling React.jsxs or React.jsxDEV. '+'Use the Babel transform instead.');
}
}else{
validateChildKeys(children,type);
}
}
}
if(type===exports.Fragment){
validateFragmentProps(element);
}else{
validatePropTypes(element);
}
returnelement;
}
}// These two functions exist to still get child warnings in dev
// even with the prod transform. This means that jsxDEV is purely
// opt-in behavior for better messages but that we won't stop
// giving you warnings if you use production apis.
functionjsxWithValidationStatic(type,props,key){
{
returnjsxWithValidation(type,props,key,true);
}
}
functionjsxWithValidationDynamic(type,props,key){
{
returnjsxWithValidation(type,props,key,false);
}
}
varjsx=jsxWithValidationDynamic;// we may want to special case jsxs internally to take advantage of static children.
error("Can't call %s on a component that is not yet mounted. "+'This is a no-op, but it might indicate a bug in your application. '+'Instead, assign to `this.state` directly or define a `state = {};` '+'class property with the desired state in the %s component.',callerName,componentName);
error('%s: `key` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://fb.me/react-special-props)',displayName);
error('%s: `ref` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://fb.me/react-special-props)',displayName);
error('Component "%s" contains the string ref "%s". '+'Support for string refs will be removed in a future major release. '+'This case cannot be automatically converted to an arrow function. '+'We ask you to manually fix this case by using useRef() or createRef() instead. '+'Learn more about using refs safely here: '+'https://fb.me/react-strict-mode-string-ref',getComponentName(ReactCurrentOwner.current.type),config.ref);
didWarnAboutStringRefs[componentName]=true;
}
}
}
}
/**
* Factory method to create a new React element. This no longer adheres to
* the class pattern, so do not use new to call it. Also, instanceof check
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
* if something is a React Element.
*
* @param {*} type
* @param {*} props
* @param {*} key
* @param {string|object} ref
* @param {*} owner
* @param {*} self A *temporary* helper to detect places where `this` is
* different from the `owner` when React.createElement is called, so that we
* can warn. We want to get rid of owner and replace string `ref`s with arrow
* functions, and as long as `this` and owner are the same, there will be no
* change in behavior.
* @param {*} source An annotation object (added by a transpiler or otherwise)
* indicating filename, line number, and/or other information.
warn('Using Maps as children is deprecated and will be removed in '+'a future major release. Consider converting children to '+'an array of keyed ReactElements instead.');
addendum=' If you meant to render a collection of children, use an array '+'instead.'+ReactDebugCurrentFrame.getStackAddendum();
}
varchildrenString=''+children;
{
{
throwError("Objects are not valid as a React child (found: "+(childrenString==='[object Object]'?'object with keys {'+Object.keys(children).join(', ')+'}':childrenString)+")."+addendum);
}
}
}
}
returnsubtreeCount;
}
/**
* Traverses children that are typically specified as `props.children`, but
};// $FlowFixMe: Flow complains about not setting a value, which is intentional here
Object.defineProperties(Consumer,{
Provider:{
get:function(){
if(!hasWarnedAboutUsingConsumerProvider){
hasWarnedAboutUsingConsumerProvider=true;
error('Rendering <Context.Consumer.Provider> is not supported and will be removed in '+'a future major release. Did you mean to render <Context.Provider> instead?');
}
returncontext.Provider;
},
set:function(_Provider){
context.Provider=_Provider;
}
},
_currentValue:{
get:function(){
returncontext._currentValue;
},
set:function(_currentValue){
context._currentValue=_currentValue;
}
},
_currentValue2:{
get:function(){
returncontext._currentValue2;
},
set:function(_currentValue2){
context._currentValue2=_currentValue2;
}
},
_threadCount:{
get:function(){
returncontext._threadCount;
},
set:function(_threadCount){
context._threadCount=_threadCount;
}
},
Consumer:{
get:function(){
if(!hasWarnedAboutUsingNestedContextConsumers){
hasWarnedAboutUsingNestedContextConsumers=true;
error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in '+'a future major release. Did you mean to render <Context.Consumer> instead?');
}
returncontext.Consumer;
}
}
});// $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
context.Consumer=Consumer;
}
{
context._currentRenderer=null;
context._currentRenderer2=null;
}
returncontext;
}
functionlazy(ctor){
varlazyType={
$$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.
vardefaultProps;
varpropTypes;
Object.defineProperties(lazyType,{
defaultProps:{
configurable:true,
get:function(){
returndefaultProps;
},
set:function(newDefaultProps){
error('React.lazy(...): It is not supported to assign `defaultProps` to '+'a lazy component import. Either specify them where the component '+'is defined, or create a wrapping component around it.');
defaultProps=newDefaultProps;// Match production behavior more closely:
Object.defineProperty(lazyType,'defaultProps',{
enumerable:true
});
}
},
propTypes:{
configurable:true,
get:function(){
returnpropTypes;
},
set:function(newPropTypes){
error('React.lazy(...): It is not supported to assign `propTypes` to '+'a lazy component import. Either specify them where the component '+'is defined, or create a wrapping component around it.');
propTypes=newPropTypes;// Match production behavior more closely:
error('forwardRef requires a render function but received a `memo` '+'component. Instead of forwardRef(memo(...)), use '+'memo(forwardRef(...)).');
}elseif(typeofrender!=='function'){
error('forwardRef requires a render function but was given %s.',render===null?'null':typeofrender);
}else{
if(render.length!==0&&render.length!==2){
error('forwardRef render functions accept exactly two parameters: props and ref. %s',render.length===1?'Did you forget to use the ref parameter?':'Any additional parameter will be undefined.');
error('memo: The first argument must be a component. Instead '+'received: %s',type===null?'null':typeoftype);
}
}
return{
$$typeof:REACT_MEMO_TYPE,
type:type,
compare:compare===undefined?null:compare
};
}
functionresolveDispatcher(){
vardispatcher=ReactCurrentDispatcher.current;
if(!(dispatcher!==null)){
{
throwError("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.");
error('useContext() second argument is reserved for future '+'use in React. Passing it is not supported. '+'You passed: %s.%s',unstable_observedBits,typeofunstable_observedBits==='number'&&Array.isArray(arguments[2])?'\n\nDid you call array.map(useContext)? '+'Calling Hooks inside a loop is not supported. '+'Learn more at https://fb.me/rules-of-hooks':'');
}// TODO: add a more generic warning for invalid values.
if(Context._context!==undefined){
varrealContext=Context._context;// Don't deduplicate because this legitimately causes bugs
// and nobody should be using this in existing code.
if(realContext.Consumer===Context){
error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be '+'removed in a future major release. Did you mean to call useContext(Context) instead?');
}elseif(realContext.Provider===Context){
error('Calling useContext(Context.Provider) is not supported. '+'Did you mean to call useContext(Context) instead?');
// Give the component that originally created this child.
childOwner=" It was passed a child from "+getComponentName(element._owner.type)+".";
}
setCurrentlyValidatingElement(element);
{
error('Each child in a list should have a unique "key" prop.'+'%s%s See https://fb.me/react-warning-keys for more information.',currentComponentErrorInfo,childOwner);
}
setCurrentlyValidatingElement(null);
}
/**
* Ensure that every element either is passed in a static location, in an
* array with an explicit keys property defined, or in an object literal
* with valid key property.
*
* @internal
* @param {ReactNode} node Statically passed child of any type.
* @param {*} parentType node's parent's type.
*/
functionvalidateChildKeys(node,parentType){
if(typeofnode!=='object'){
return;
}
if(Array.isArray(node)){
for(vari=0;i<node.length;i++){
varchild=node[i];
if(isValidElement(child)){
validateExplicitKey(child,parentType);
}
}
}elseif(isValidElement(node)){
// This element was passed in a valid location.
if(node._store){
node._store.validated=true;
}
}elseif(node){
variteratorFn=getIteratorFn(node);
if(typeofiteratorFn==='function'){
// Entry iterators used to provide implicit keys,
// but now we print a separate warning for them later.
if(iteratorFn!==node.entries){
variterator=iteratorFn.call(node);
varstep;
while(!(step=iterator.next()).done){
if(isValidElement(step.value)){
validateExplicitKey(step.value,parentType);
}
}
}
}
}
}
/**
* Given an element, validate that its props follow the propTypes definition,
info=' Did you accidentally export a JSX literal instead of a component?';
}else{
typeString=typeoftype;
}
{
error('React.createElement: type is invalid -- expected a string (for '+'built-in components) or a class/function (for composite '+'components) but got: %s.%s',typeString,info);
}
}
varelement=createElement.apply(this,arguments);// The result can be nullish if a mock or a custom function is used.
// TODO: Drop this when these are no longer allowed as the type argument.
if(element==null){
returnelement;
}// Skip key warning if the type isn't valid since our key validation logic
// doesn't expect a non-string/function type and can throw confusing errors.
// We don't want exception behavior to differ between dev and prod.
// (Rendering will throw with a helpful message and as soon as the type is
warn('React.createFactory() is deprecated and will be removed in '+'a future major release. Consider using JSX '+'or use React.createElement() directly instead.');
}// Legacy hook: remove it
Object.defineProperty(validatedFactory,'type',{
enumerable:false,
get:function(){
warn('Factory.type is deprecated. Access the class directly '+'before passing it to createFactory.');
60116,B="function"===typeofSymbol&&Symbol.iterator;functionC(a){for(varb="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}