willba-component-library 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +312 -626
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +312 -626
- package/dist/esm/index.js.map +1 -1
- package/package.json +5 -2
package/dist/esm/index.js
CHANGED
|
@@ -6,8 +6,105 @@ var react = {exports: {}};
|
|
|
6
6
|
|
|
7
7
|
var react_production_min = {};
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/*
|
|
10
|
+
object-assign
|
|
11
|
+
(c) Sindre Sorhus
|
|
12
|
+
@license MIT
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var objectAssign;
|
|
16
|
+
var hasRequiredObjectAssign;
|
|
17
|
+
|
|
18
|
+
function requireObjectAssign () {
|
|
19
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
20
|
+
hasRequiredObjectAssign = 1;
|
|
21
|
+
/* eslint-disable no-unused-vars */
|
|
22
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
23
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
24
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
25
|
+
|
|
26
|
+
function toObject(val) {
|
|
27
|
+
if (val === null || val === undefined) {
|
|
28
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return Object(val);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function shouldUseNative() {
|
|
35
|
+
try {
|
|
36
|
+
if (!Object.assign) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
41
|
+
|
|
42
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
43
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
44
|
+
test1[5] = 'de';
|
|
45
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
50
|
+
var test2 = {};
|
|
51
|
+
for (var i = 0; i < 10; i++) {
|
|
52
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
53
|
+
}
|
|
54
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
55
|
+
return test2[n];
|
|
56
|
+
});
|
|
57
|
+
if (order2.join('') !== '0123456789') {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
62
|
+
var test3 = {};
|
|
63
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
64
|
+
test3[letter] = letter;
|
|
65
|
+
});
|
|
66
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
67
|
+
'abcdefghijklmnopqrst') {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return true;
|
|
72
|
+
} catch (err) {
|
|
73
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
79
|
+
var from;
|
|
80
|
+
var to = toObject(target);
|
|
81
|
+
var symbols;
|
|
82
|
+
|
|
83
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
84
|
+
from = Object(arguments[s]);
|
|
85
|
+
|
|
86
|
+
for (var key in from) {
|
|
87
|
+
if (hasOwnProperty.call(from, key)) {
|
|
88
|
+
to[key] = from[key];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (getOwnPropertySymbols) {
|
|
93
|
+
symbols = getOwnPropertySymbols(from);
|
|
94
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
95
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
96
|
+
to[symbols[i]] = from[symbols[i]];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return to;
|
|
103
|
+
};
|
|
104
|
+
return objectAssign;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @license React v17.0.2
|
|
11
108
|
* react.production.min.js
|
|
12
109
|
*
|
|
13
110
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -21,30 +118,27 @@ var hasRequiredReact_production_min;
|
|
|
21
118
|
function requireReact_production_min () {
|
|
22
119
|
if (hasRequiredReact_production_min) return react_production_min;
|
|
23
120
|
hasRequiredReact_production_min = 1;
|
|
24
|
-
var l=
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
a
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
react_production_min.
|
|
35
|
-
react_production_min.cloneElement=function(a,b,
|
|
36
|
-
|
|
37
|
-
react_production_min.
|
|
38
|
-
react_production_min.
|
|
39
|
-
react_production_min.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};react_production_min.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return U.current.useMemo(a,b)};react_production_min.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};react_production_min.useRef=function(a){return U.current.useRef(a)};react_production_min.useState=function(a){return U.current.useState(a)};react_production_min.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};
|
|
40
|
-
react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.2.0";
|
|
121
|
+
var l=requireObjectAssign(),n=60103,p=60106;react_production_min.Fragment=60107;react_production_min.StrictMode=60108;react_production_min.Profiler=60114;var q=60109,r=60110,t=60112;react_production_min.Suspense=60113;var u=60115,v=60116;
|
|
122
|
+
if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");react_production_min.Fragment=w("react.fragment");react_production_min.StrictMode=w("react.strict_mode");react_production_min.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");react_production_min.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
|
|
123
|
+
function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="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."}
|
|
124
|
+
var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
|
|
125
|
+
function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
|
|
126
|
+
function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
|
|
127
|
+
function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
128
|
+
function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
|
|
129
|
+
0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
|
|
130
|
+
function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=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);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};
|
|
131
|
+
react_production_min.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};react_production_min.Component=C;react_production_min.PureComponent=E;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
|
|
132
|
+
react_production_min.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
|
|
133
|
+
key:d,ref:k,props:e,_owner:h}};react_production_min.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};react_production_min.createElement=J;react_production_min.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};react_production_min.forwardRef=function(a){return {$$typeof:t,render:a}};react_production_min.isValidElement=L;
|
|
134
|
+
react_production_min.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};react_production_min.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};react_production_min.useCallback=function(a,b){return S().useCallback(a,b)};react_production_min.useContext=function(a,b){return S().useContext(a,b)};react_production_min.useDebugValue=function(){};react_production_min.useEffect=function(a,b){return S().useEffect(a,b)};react_production_min.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
|
|
135
|
+
react_production_min.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return S().useMemo(a,b)};react_production_min.useReducer=function(a,b,c){return S().useReducer(a,b,c)};react_production_min.useRef=function(a){return S().useRef(a)};react_production_min.useState=function(a){return S().useState(a)};react_production_min.version="17.0.2";
|
|
41
136
|
return react_production_min;
|
|
42
137
|
}
|
|
43
138
|
|
|
44
|
-
var react_development = {
|
|
139
|
+
var react_development = {};
|
|
45
140
|
|
|
46
|
-
/**
|
|
47
|
-
* @license React
|
|
141
|
+
/** @license React v17.0.2
|
|
48
142
|
* react.development.js
|
|
49
143
|
*
|
|
50
144
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -52,46 +146,70 @@ var react_development = {exports: {}};
|
|
|
52
146
|
* This source code is licensed under the MIT license found in the
|
|
53
147
|
* LICENSE file in the root directory of this source tree.
|
|
54
148
|
*/
|
|
55
|
-
react_development.exports;
|
|
56
149
|
|
|
57
150
|
var hasRequiredReact_development;
|
|
58
151
|
|
|
59
152
|
function requireReact_development () {
|
|
60
|
-
if (hasRequiredReact_development) return react_development
|
|
153
|
+
if (hasRequiredReact_development) return react_development;
|
|
61
154
|
hasRequiredReact_development = 1;
|
|
62
|
-
(function (
|
|
155
|
+
(function (exports) {
|
|
63
156
|
|
|
64
157
|
if (process.env.NODE_ENV !== "production") {
|
|
65
158
|
(function() {
|
|
66
159
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
'function'
|
|
72
|
-
) {
|
|
73
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
74
|
-
}
|
|
75
|
-
var ReactVersion = '18.2.0';
|
|
160
|
+
var _assign = requireObjectAssign();
|
|
161
|
+
|
|
162
|
+
// TODO: this is special because it gets imported during build.
|
|
163
|
+
var ReactVersion = '17.0.2';
|
|
76
164
|
|
|
77
165
|
// ATTENTION
|
|
78
166
|
// When adding new symbols to this file,
|
|
79
167
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
80
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
-
var
|
|
168
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
169
|
+
// nor polyfill, then a plain number is used for performance.
|
|
170
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
171
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
172
|
+
exports.Fragment = 0xeacb;
|
|
173
|
+
exports.StrictMode = 0xeacc;
|
|
174
|
+
exports.Profiler = 0xead2;
|
|
175
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
176
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
177
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
178
|
+
exports.Suspense = 0xead1;
|
|
179
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
180
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
181
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
182
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
183
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
184
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
185
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
186
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
187
|
+
|
|
188
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
189
|
+
var symbolFor = Symbol.for;
|
|
190
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
191
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
192
|
+
exports.Fragment = symbolFor('react.fragment');
|
|
193
|
+
exports.StrictMode = symbolFor('react.strict_mode');
|
|
194
|
+
exports.Profiler = symbolFor('react.profiler');
|
|
195
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
196
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
197
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
198
|
+
exports.Suspense = symbolFor('react.suspense');
|
|
199
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
200
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
201
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
202
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
203
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
204
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
205
|
+
symbolFor('react.scope');
|
|
206
|
+
symbolFor('react.opaque.id');
|
|
207
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
208
|
+
symbolFor('react.offscreen');
|
|
209
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
95
213
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
96
214
|
function getIteratorFn(maybeIterable) {
|
|
97
215
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
@@ -123,14 +241,7 @@ function requireReact_development () {
|
|
|
123
241
|
* should suspend for if it needs to.
|
|
124
242
|
*/
|
|
125
243
|
var ReactCurrentBatchConfig = {
|
|
126
|
-
transition:
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
var ReactCurrentActQueue = {
|
|
130
|
-
current: null,
|
|
131
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
132
|
-
isBatchingLegacy: false,
|
|
133
|
-
didScheduleLegacyUpdate: false
|
|
244
|
+
transition: 0
|
|
134
245
|
};
|
|
135
246
|
|
|
136
247
|
/**
|
|
@@ -183,27 +294,24 @@ function requireReact_development () {
|
|
|
183
294
|
};
|
|
184
295
|
}
|
|
185
296
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
193
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
194
|
-
// issues in DEV builds.
|
|
195
|
-
|
|
196
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
297
|
+
/**
|
|
298
|
+
* Used by act() to track whether you're inside an act() scope.
|
|
299
|
+
*/
|
|
300
|
+
var IsSomeRendererActing = {
|
|
301
|
+
current: false
|
|
302
|
+
};
|
|
197
303
|
|
|
198
304
|
var ReactSharedInternals = {
|
|
199
305
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
200
306
|
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
201
|
-
ReactCurrentOwner: ReactCurrentOwner
|
|
307
|
+
ReactCurrentOwner: ReactCurrentOwner,
|
|
308
|
+
IsSomeRendererActing: IsSomeRendererActing,
|
|
309
|
+
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
310
|
+
assign: _assign
|
|
202
311
|
};
|
|
203
312
|
|
|
204
313
|
{
|
|
205
314
|
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
206
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
207
315
|
}
|
|
208
316
|
|
|
209
317
|
// by calls to these methods by a Babel plugin.
|
|
@@ -213,24 +321,20 @@ function requireReact_development () {
|
|
|
213
321
|
|
|
214
322
|
function warn(format) {
|
|
215
323
|
{
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
args[_key - 1] = arguments[_key];
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
printWarning('warn', format, args);
|
|
324
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
325
|
+
args[_key - 1] = arguments[_key];
|
|
222
326
|
}
|
|
327
|
+
|
|
328
|
+
printWarning('warn', format, args);
|
|
223
329
|
}
|
|
224
330
|
}
|
|
225
331
|
function error(format) {
|
|
226
332
|
{
|
|
227
|
-
{
|
|
228
|
-
|
|
229
|
-
args[_key2 - 1] = arguments[_key2];
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
printWarning('error', format, args);
|
|
333
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
334
|
+
args[_key2 - 1] = arguments[_key2];
|
|
233
335
|
}
|
|
336
|
+
|
|
337
|
+
printWarning('error', format, args);
|
|
234
338
|
}
|
|
235
339
|
}
|
|
236
340
|
|
|
@@ -244,11 +348,10 @@ function requireReact_development () {
|
|
|
244
348
|
if (stack !== '') {
|
|
245
349
|
format += '%s';
|
|
246
350
|
args = args.concat([stack]);
|
|
247
|
-
}
|
|
248
|
-
|
|
351
|
+
}
|
|
249
352
|
|
|
250
353
|
var argsWithFormat = args.map(function (item) {
|
|
251
|
-
return
|
|
354
|
+
return '' + item;
|
|
252
355
|
}); // Careful: RN currently depends on this prefix
|
|
253
356
|
|
|
254
357
|
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
@@ -346,8 +449,6 @@ function requireReact_development () {
|
|
|
346
449
|
}
|
|
347
450
|
};
|
|
348
451
|
|
|
349
|
-
var assign = Object.assign;
|
|
350
|
-
|
|
351
452
|
var emptyObject = {};
|
|
352
453
|
|
|
353
454
|
{
|
|
@@ -396,8 +497,10 @@ function requireReact_development () {
|
|
|
396
497
|
*/
|
|
397
498
|
|
|
398
499
|
Component.prototype.setState = function (partialState, callback) {
|
|
399
|
-
if (typeof partialState
|
|
400
|
-
|
|
500
|
+
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
501
|
+
{
|
|
502
|
+
throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
|
503
|
+
}
|
|
401
504
|
}
|
|
402
505
|
|
|
403
506
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
@@ -469,7 +572,8 @@ function requireReact_development () {
|
|
|
469
572
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
470
573
|
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
471
574
|
|
|
472
|
-
|
|
575
|
+
_assign(pureComponentPrototype, Component.prototype);
|
|
576
|
+
|
|
473
577
|
pureComponentPrototype.isPureReactComponent = true;
|
|
474
578
|
|
|
475
579
|
// an immutable object with a single mutable value
|
|
@@ -485,97 +589,16 @@ function requireReact_development () {
|
|
|
485
589
|
return refObject;
|
|
486
590
|
}
|
|
487
591
|
|
|
488
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
489
|
-
|
|
490
|
-
function isArray(a) {
|
|
491
|
-
return isArrayImpl(a);
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/*
|
|
495
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
496
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
497
|
-
*
|
|
498
|
-
* The functions in this module will throw an easier-to-understand,
|
|
499
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
500
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
501
|
-
* of the `value` object).
|
|
502
|
-
*/
|
|
503
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
504
|
-
function typeName(value) {
|
|
505
|
-
{
|
|
506
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
507
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
508
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
509
|
-
return type;
|
|
510
|
-
}
|
|
511
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
function willCoercionThrow(value) {
|
|
515
|
-
{
|
|
516
|
-
try {
|
|
517
|
-
testStringCoercion(value);
|
|
518
|
-
return false;
|
|
519
|
-
} catch (e) {
|
|
520
|
-
return true;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
function testStringCoercion(value) {
|
|
526
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
527
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
528
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
529
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
530
|
-
//
|
|
531
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
532
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
533
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
534
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
535
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
536
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
537
|
-
//
|
|
538
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
539
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
540
|
-
//
|
|
541
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
542
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
543
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
544
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
545
|
-
// In most cases, this console output also shows the component and its
|
|
546
|
-
// ancestor components where the exception happened.
|
|
547
|
-
//
|
|
548
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
549
|
-
return '' + value;
|
|
550
|
-
}
|
|
551
|
-
function checkKeyStringCoercion(value) {
|
|
552
|
-
{
|
|
553
|
-
if (willCoercionThrow(value)) {
|
|
554
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
555
|
-
|
|
556
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
592
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
562
|
-
var displayName = outerType.displayName;
|
|
563
|
-
|
|
564
|
-
if (displayName) {
|
|
565
|
-
return displayName;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
593
|
var functionName = innerType.displayName || innerType.name || '';
|
|
569
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
570
|
-
}
|
|
571
|
-
|
|
594
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
595
|
+
}
|
|
572
596
|
|
|
573
597
|
function getContextName(type) {
|
|
574
598
|
return type.displayName || 'Context';
|
|
575
|
-
}
|
|
576
|
-
|
|
599
|
+
}
|
|
577
600
|
|
|
578
|
-
function
|
|
601
|
+
function getComponentName(type) {
|
|
579
602
|
if (type == null) {
|
|
580
603
|
// Host root, text node or just invalid type.
|
|
581
604
|
return null;
|
|
@@ -583,7 +606,7 @@ function requireReact_development () {
|
|
|
583
606
|
|
|
584
607
|
{
|
|
585
608
|
if (typeof type.tag === 'number') {
|
|
586
|
-
error('Received an unexpected object in
|
|
609
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
587
610
|
}
|
|
588
611
|
}
|
|
589
612
|
|
|
@@ -596,24 +619,23 @@ function requireReact_development () {
|
|
|
596
619
|
}
|
|
597
620
|
|
|
598
621
|
switch (type) {
|
|
599
|
-
case
|
|
622
|
+
case exports.Fragment:
|
|
600
623
|
return 'Fragment';
|
|
601
624
|
|
|
602
625
|
case REACT_PORTAL_TYPE:
|
|
603
626
|
return 'Portal';
|
|
604
627
|
|
|
605
|
-
case
|
|
628
|
+
case exports.Profiler:
|
|
606
629
|
return 'Profiler';
|
|
607
630
|
|
|
608
|
-
case
|
|
631
|
+
case exports.StrictMode:
|
|
609
632
|
return 'StrictMode';
|
|
610
633
|
|
|
611
|
-
case
|
|
634
|
+
case exports.Suspense:
|
|
612
635
|
return 'Suspense';
|
|
613
636
|
|
|
614
637
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
615
638
|
return 'SuspenseList';
|
|
616
|
-
|
|
617
639
|
}
|
|
618
640
|
|
|
619
641
|
if (typeof type === 'object') {
|
|
@@ -630,13 +652,10 @@ function requireReact_development () {
|
|
|
630
652
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
631
653
|
|
|
632
654
|
case REACT_MEMO_TYPE:
|
|
633
|
-
|
|
655
|
+
return getComponentName(type.type);
|
|
634
656
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
657
|
+
case REACT_BLOCK_TYPE:
|
|
658
|
+
return getComponentName(type._render);
|
|
640
659
|
|
|
641
660
|
case REACT_LAZY_TYPE:
|
|
642
661
|
{
|
|
@@ -645,13 +664,11 @@ function requireReact_development () {
|
|
|
645
664
|
var init = lazyComponent._init;
|
|
646
665
|
|
|
647
666
|
try {
|
|
648
|
-
return
|
|
667
|
+
return getComponentName(init(payload));
|
|
649
668
|
} catch (x) {
|
|
650
669
|
return null;
|
|
651
670
|
}
|
|
652
671
|
}
|
|
653
|
-
|
|
654
|
-
// eslint-disable-next-line no-fallthrough
|
|
655
672
|
}
|
|
656
673
|
}
|
|
657
674
|
|
|
@@ -659,7 +676,6 @@ function requireReact_development () {
|
|
|
659
676
|
}
|
|
660
677
|
|
|
661
678
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
662
|
-
|
|
663
679
|
var RESERVED_PROPS = {
|
|
664
680
|
key: true,
|
|
665
681
|
ref: true,
|
|
@@ -739,7 +755,7 @@ function requireReact_development () {
|
|
|
739
755
|
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
740
756
|
{
|
|
741
757
|
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
742
|
-
var componentName =
|
|
758
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
743
759
|
|
|
744
760
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
745
761
|
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', componentName, config.ref);
|
|
@@ -848,10 +864,6 @@ function requireReact_development () {
|
|
|
848
864
|
}
|
|
849
865
|
|
|
850
866
|
if (hasValidKey(config)) {
|
|
851
|
-
{
|
|
852
|
-
checkKeyStringCoercion(config.key);
|
|
853
|
-
}
|
|
854
|
-
|
|
855
867
|
key = '' + config.key;
|
|
856
868
|
}
|
|
857
869
|
|
|
@@ -924,13 +936,16 @@ function requireReact_development () {
|
|
|
924
936
|
*/
|
|
925
937
|
|
|
926
938
|
function cloneElement(element, config, children) {
|
|
927
|
-
if (element === null || element === undefined) {
|
|
928
|
-
|
|
939
|
+
if (!!(element === null || element === undefined)) {
|
|
940
|
+
{
|
|
941
|
+
throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
|
942
|
+
}
|
|
929
943
|
}
|
|
930
944
|
|
|
931
945
|
var propName; // Original props are copied
|
|
932
946
|
|
|
933
|
-
var props =
|
|
947
|
+
var props = _assign({}, element.props); // Reserved names are extracted
|
|
948
|
+
|
|
934
949
|
|
|
935
950
|
var key = element.key;
|
|
936
951
|
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
@@ -951,10 +966,6 @@ function requireReact_development () {
|
|
|
951
966
|
}
|
|
952
967
|
|
|
953
968
|
if (hasValidKey(config)) {
|
|
954
|
-
{
|
|
955
|
-
checkKeyStringCoercion(config.key);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
969
|
key = '' + config.key;
|
|
959
970
|
} // Remaining properties override existing props
|
|
960
971
|
|
|
@@ -1053,10 +1064,6 @@ function requireReact_development () {
|
|
|
1053
1064
|
// that we don't block potential future ES APIs.
|
|
1054
1065
|
if (typeof element === 'object' && element !== null && element.key != null) {
|
|
1055
1066
|
// Explicit key
|
|
1056
|
-
{
|
|
1057
|
-
checkKeyStringCoercion(element.key);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
1067
|
return escape('' + element.key);
|
|
1061
1068
|
} // Implicit key determined by the index in the set
|
|
1062
1069
|
|
|
@@ -1100,7 +1107,7 @@ function requireReact_development () {
|
|
|
1100
1107
|
|
|
1101
1108
|
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
1102
1109
|
|
|
1103
|
-
if (isArray(mappedChild)) {
|
|
1110
|
+
if (Array.isArray(mappedChild)) {
|
|
1104
1111
|
var escapedChildKey = '';
|
|
1105
1112
|
|
|
1106
1113
|
if (childKey != null) {
|
|
@@ -1112,20 +1119,10 @@ function requireReact_development () {
|
|
|
1112
1119
|
});
|
|
1113
1120
|
} else if (mappedChild != null) {
|
|
1114
1121
|
if (isValidElement(mappedChild)) {
|
|
1115
|
-
{
|
|
1116
|
-
// The `if` statement here prevents auto-disabling of the safe
|
|
1117
|
-
// coercion ESLint rule, so we must manually disable it below.
|
|
1118
|
-
// $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1119
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
1120
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
1122
|
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1125
1123
|
// traverseAllChildren used to do for objects as children
|
|
1126
1124
|
escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1127
1125
|
mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
1128
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1129
1126
|
escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
|
1130
1127
|
}
|
|
1131
1128
|
|
|
@@ -1141,7 +1138,7 @@ function requireReact_development () {
|
|
|
1141
1138
|
|
|
1142
1139
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1143
1140
|
|
|
1144
|
-
if (isArray(children)) {
|
|
1141
|
+
if (Array.isArray(children)) {
|
|
1145
1142
|
for (var i = 0; i < children.length; i++) {
|
|
1146
1143
|
child = children[i];
|
|
1147
1144
|
nextName = nextNamePrefix + getElementKey(child, i);
|
|
@@ -1174,9 +1171,13 @@ function requireReact_development () {
|
|
|
1174
1171
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1175
1172
|
}
|
|
1176
1173
|
} else if (type === 'object') {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1174
|
+
var childrenString = '' + children;
|
|
1175
|
+
|
|
1176
|
+
{
|
|
1177
|
+
{
|
|
1178
|
+
throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1180
1181
|
}
|
|
1181
1182
|
}
|
|
1182
1183
|
|
|
@@ -1275,17 +1276,28 @@ function requireReact_development () {
|
|
|
1275
1276
|
|
|
1276
1277
|
function onlyChild(children) {
|
|
1277
1278
|
if (!isValidElement(children)) {
|
|
1278
|
-
|
|
1279
|
+
{
|
|
1280
|
+
throw Error( "React.Children.only expected to receive a single React element child." );
|
|
1281
|
+
}
|
|
1279
1282
|
}
|
|
1280
1283
|
|
|
1281
1284
|
return children;
|
|
1282
1285
|
}
|
|
1283
1286
|
|
|
1284
|
-
function createContext(defaultValue) {
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
+
function createContext(defaultValue, calculateChangedBits) {
|
|
1288
|
+
if (calculateChangedBits === undefined) {
|
|
1289
|
+
calculateChangedBits = null;
|
|
1290
|
+
} else {
|
|
1291
|
+
{
|
|
1292
|
+
if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
|
1293
|
+
error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1287
1298
|
var context = {
|
|
1288
1299
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1300
|
+
_calculateChangedBits: calculateChangedBits,
|
|
1289
1301
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1290
1302
|
// some renderers as primary and others as secondary. We only expect
|
|
1291
1303
|
// there to be two concurrent renderers at most: React Native (primary) and
|
|
@@ -1298,10 +1310,7 @@ function requireReact_development () {
|
|
|
1298
1310
|
_threadCount: 0,
|
|
1299
1311
|
// These are circular
|
|
1300
1312
|
Provider: null,
|
|
1301
|
-
Consumer: null
|
|
1302
|
-
// Add these to use same hidden class in VM as ServerContext
|
|
1303
|
-
_defaultValue: null,
|
|
1304
|
-
_globalName: null
|
|
1313
|
+
Consumer: null
|
|
1305
1314
|
};
|
|
1306
1315
|
context.Provider = {
|
|
1307
1316
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
@@ -1317,7 +1326,8 @@ function requireReact_development () {
|
|
|
1317
1326
|
// warn for the incorrect usage of Context as a Consumer.
|
|
1318
1327
|
var Consumer = {
|
|
1319
1328
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1320
|
-
_context: context
|
|
1329
|
+
_context: context,
|
|
1330
|
+
_calculateChangedBits: context._calculateChangedBits
|
|
1321
1331
|
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1322
1332
|
|
|
1323
1333
|
Object.defineProperties(Consumer, {
|
|
@@ -1404,54 +1414,38 @@ function requireReact_development () {
|
|
|
1404
1414
|
if (payload._status === Uninitialized) {
|
|
1405
1415
|
var ctor = payload._result;
|
|
1406
1416
|
var thenable = ctor(); // Transition to the next state.
|
|
1407
|
-
// This might throw either because it's missing or throws. If so, we treat it
|
|
1408
|
-
// as still uninitialized and try again next time. Which is the same as what
|
|
1409
|
-
// happens if the ctor or any wrappers processing the ctor throws. This might
|
|
1410
|
-
// end up fixing it if the resolution was a concurrency bug.
|
|
1411
1417
|
|
|
1418
|
+
var pending = payload;
|
|
1419
|
+
pending._status = Pending;
|
|
1420
|
+
pending._result = thenable;
|
|
1412
1421
|
thenable.then(function (moduleObject) {
|
|
1413
|
-
if (payload._status === Pending
|
|
1414
|
-
|
|
1422
|
+
if (payload._status === Pending) {
|
|
1423
|
+
var defaultExport = moduleObject.default;
|
|
1424
|
+
|
|
1425
|
+
{
|
|
1426
|
+
if (defaultExport === undefined) {
|
|
1427
|
+
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1428
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1429
|
+
}
|
|
1430
|
+
} // Transition to the next state.
|
|
1431
|
+
|
|
1432
|
+
|
|
1415
1433
|
var resolved = payload;
|
|
1416
1434
|
resolved._status = Resolved;
|
|
1417
|
-
resolved._result =
|
|
1435
|
+
resolved._result = defaultExport;
|
|
1418
1436
|
}
|
|
1419
1437
|
}, function (error) {
|
|
1420
|
-
if (payload._status === Pending
|
|
1438
|
+
if (payload._status === Pending) {
|
|
1421
1439
|
// Transition to the next state.
|
|
1422
1440
|
var rejected = payload;
|
|
1423
1441
|
rejected._status = Rejected;
|
|
1424
1442
|
rejected._result = error;
|
|
1425
1443
|
}
|
|
1426
1444
|
});
|
|
1427
|
-
|
|
1428
|
-
if (payload._status === Uninitialized) {
|
|
1429
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
|
1430
|
-
// to resolve. Set it as pending in the meantime.
|
|
1431
|
-
var pending = payload;
|
|
1432
|
-
pending._status = Pending;
|
|
1433
|
-
pending._result = thenable;
|
|
1434
|
-
}
|
|
1435
1445
|
}
|
|
1436
1446
|
|
|
1437
1447
|
if (payload._status === Resolved) {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
{
|
|
1441
|
-
if (moduleObject === undefined) {
|
|
1442
|
-
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1443
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
{
|
|
1448
|
-
if (!('default' in moduleObject)) {
|
|
1449
|
-
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1450
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
return moduleObject.default;
|
|
1448
|
+
return payload._result;
|
|
1455
1449
|
} else {
|
|
1456
1450
|
throw payload._result;
|
|
1457
1451
|
}
|
|
@@ -1460,7 +1454,7 @@ function requireReact_development () {
|
|
|
1460
1454
|
function lazy(ctor) {
|
|
1461
1455
|
var payload = {
|
|
1462
1456
|
// We use these fields to store the result.
|
|
1463
|
-
_status:
|
|
1457
|
+
_status: -1,
|
|
1464
1458
|
_result: ctor
|
|
1465
1459
|
};
|
|
1466
1460
|
var lazyType = {
|
|
@@ -1546,15 +1540,9 @@ function requireReact_development () {
|
|
|
1546
1540
|
return ownName;
|
|
1547
1541
|
},
|
|
1548
1542
|
set: function (name) {
|
|
1549
|
-
ownName = name;
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
// so that our component-stack generation logic will display their frames.
|
|
1553
|
-
// An anonymous function generally suggests a pattern like:
|
|
1554
|
-
// React.forwardRef((props, ref) => {...});
|
|
1555
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1556
|
-
|
|
1557
|
-
if (!render.name && !render.displayName) {
|
|
1543
|
+
ownName = name;
|
|
1544
|
+
|
|
1545
|
+
if (render.displayName == null) {
|
|
1558
1546
|
render.displayName = name;
|
|
1559
1547
|
}
|
|
1560
1548
|
}
|
|
@@ -1564,11 +1552,9 @@ function requireReact_development () {
|
|
|
1564
1552
|
return elementType;
|
|
1565
1553
|
}
|
|
1566
1554
|
|
|
1567
|
-
|
|
1555
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1568
1556
|
|
|
1569
|
-
|
|
1570
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1571
|
-
}
|
|
1557
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1572
1558
|
|
|
1573
1559
|
function isValidElementType(type) {
|
|
1574
1560
|
if (typeof type === 'string' || typeof type === 'function') {
|
|
@@ -1576,16 +1562,12 @@ function requireReact_development () {
|
|
|
1576
1562
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1577
1563
|
|
|
1578
1564
|
|
|
1579
|
-
if (type ===
|
|
1565
|
+
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
1580
1566
|
return true;
|
|
1581
1567
|
}
|
|
1582
1568
|
|
|
1583
1569
|
if (typeof type === 'object' && type !== null) {
|
|
1584
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
1585
|
-
// types supported by any Flight configuration anywhere since
|
|
1586
|
-
// we don't know which Flight build this will end up being used
|
|
1587
|
-
// with.
|
|
1588
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1570
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1589
1571
|
return true;
|
|
1590
1572
|
}
|
|
1591
1573
|
}
|
|
@@ -1615,15 +1597,9 @@ function requireReact_development () {
|
|
|
1615
1597
|
return ownName;
|
|
1616
1598
|
},
|
|
1617
1599
|
set: function (name) {
|
|
1618
|
-
ownName = name;
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
// so that our component-stack generation logic will display their frames.
|
|
1622
|
-
// An anonymous function generally suggests a pattern like:
|
|
1623
|
-
// React.memo((props) => {...});
|
|
1624
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1625
|
-
|
|
1626
|
-
if (!type.name && !type.displayName) {
|
|
1600
|
+
ownName = name;
|
|
1601
|
+
|
|
1602
|
+
if (type.displayName == null) {
|
|
1627
1603
|
type.displayName = name;
|
|
1628
1604
|
}
|
|
1629
1605
|
}
|
|
@@ -1636,22 +1612,24 @@ function requireReact_development () {
|
|
|
1636
1612
|
function resolveDispatcher() {
|
|
1637
1613
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1638
1614
|
|
|
1639
|
-
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1615
|
+
if (!(dispatcher !== null)) {
|
|
1616
|
+
{
|
|
1617
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1642
1618
|
}
|
|
1643
|
-
}
|
|
1644
|
-
// intentionally don't throw our own error because this is in a hot path.
|
|
1645
|
-
// Also helps ensure this is inlined.
|
|
1646
|
-
|
|
1619
|
+
}
|
|
1647
1620
|
|
|
1648
1621
|
return dispatcher;
|
|
1649
1622
|
}
|
|
1650
|
-
|
|
1623
|
+
|
|
1624
|
+
function useContext(Context, unstable_observedBits) {
|
|
1651
1625
|
var dispatcher = resolveDispatcher();
|
|
1652
1626
|
|
|
1653
1627
|
{
|
|
1654
|
-
|
|
1628
|
+
if (unstable_observedBits !== undefined) {
|
|
1629
|
+
error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
|
|
1630
|
+
} // TODO: add a more generic warning for invalid values.
|
|
1631
|
+
|
|
1632
|
+
|
|
1655
1633
|
if (Context._context !== undefined) {
|
|
1656
1634
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1657
1635
|
// and nobody should be using this in existing code.
|
|
@@ -1664,7 +1642,7 @@ function requireReact_development () {
|
|
|
1664
1642
|
}
|
|
1665
1643
|
}
|
|
1666
1644
|
|
|
1667
|
-
return dispatcher.useContext(Context);
|
|
1645
|
+
return dispatcher.useContext(Context, unstable_observedBits);
|
|
1668
1646
|
}
|
|
1669
1647
|
function useState(initialState) {
|
|
1670
1648
|
var dispatcher = resolveDispatcher();
|
|
@@ -1682,10 +1660,6 @@ function requireReact_development () {
|
|
|
1682
1660
|
var dispatcher = resolveDispatcher();
|
|
1683
1661
|
return dispatcher.useEffect(create, deps);
|
|
1684
1662
|
}
|
|
1685
|
-
function useInsertionEffect(create, deps) {
|
|
1686
|
-
var dispatcher = resolveDispatcher();
|
|
1687
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1688
|
-
}
|
|
1689
1663
|
function useLayoutEffect(create, deps) {
|
|
1690
1664
|
var dispatcher = resolveDispatcher();
|
|
1691
1665
|
return dispatcher.useLayoutEffect(create, deps);
|
|
@@ -1708,22 +1682,6 @@ function requireReact_development () {
|
|
|
1708
1682
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1709
1683
|
}
|
|
1710
1684
|
}
|
|
1711
|
-
function useTransition() {
|
|
1712
|
-
var dispatcher = resolveDispatcher();
|
|
1713
|
-
return dispatcher.useTransition();
|
|
1714
|
-
}
|
|
1715
|
-
function useDeferredValue(value) {
|
|
1716
|
-
var dispatcher = resolveDispatcher();
|
|
1717
|
-
return dispatcher.useDeferredValue(value);
|
|
1718
|
-
}
|
|
1719
|
-
function useId() {
|
|
1720
|
-
var dispatcher = resolveDispatcher();
|
|
1721
|
-
return dispatcher.useId();
|
|
1722
|
-
}
|
|
1723
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1724
|
-
var dispatcher = resolveDispatcher();
|
|
1725
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1726
|
-
}
|
|
1727
1685
|
|
|
1728
1686
|
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1729
1687
|
// replaying on render function. This currently only patches the object
|
|
@@ -1788,25 +1746,25 @@ function requireReact_development () {
|
|
|
1788
1746
|
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1789
1747
|
|
|
1790
1748
|
Object.defineProperties(console, {
|
|
1791
|
-
log:
|
|
1749
|
+
log: _assign({}, props, {
|
|
1792
1750
|
value: prevLog
|
|
1793
1751
|
}),
|
|
1794
|
-
info:
|
|
1752
|
+
info: _assign({}, props, {
|
|
1795
1753
|
value: prevInfo
|
|
1796
1754
|
}),
|
|
1797
|
-
warn:
|
|
1755
|
+
warn: _assign({}, props, {
|
|
1798
1756
|
value: prevWarn
|
|
1799
1757
|
}),
|
|
1800
|
-
error:
|
|
1758
|
+
error: _assign({}, props, {
|
|
1801
1759
|
value: prevError
|
|
1802
1760
|
}),
|
|
1803
|
-
group:
|
|
1761
|
+
group: _assign({}, props, {
|
|
1804
1762
|
value: prevGroup
|
|
1805
1763
|
}),
|
|
1806
|
-
groupCollapsed:
|
|
1764
|
+
groupCollapsed: _assign({}, props, {
|
|
1807
1765
|
value: prevGroupCollapsed
|
|
1808
1766
|
}),
|
|
1809
|
-
groupEnd:
|
|
1767
|
+
groupEnd: _assign({}, props, {
|
|
1810
1768
|
value: prevGroupEnd
|
|
1811
1769
|
})
|
|
1812
1770
|
});
|
|
@@ -1847,7 +1805,7 @@ function requireReact_development () {
|
|
|
1847
1805
|
|
|
1848
1806
|
function describeNativeComponentFrame(fn, construct) {
|
|
1849
1807
|
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1850
|
-
if (
|
|
1808
|
+
if (!fn || reentry) {
|
|
1851
1809
|
return '';
|
|
1852
1810
|
}
|
|
1853
1811
|
|
|
@@ -1956,14 +1914,7 @@ function requireReact_development () {
|
|
|
1956
1914
|
|
|
1957
1915
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1958
1916
|
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1959
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1960
|
-
// but we have a user-provided "displayName"
|
|
1961
|
-
// splice it in to make the stack more readable.
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
1965
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
1966
|
-
}
|
|
1917
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1967
1918
|
|
|
1968
1919
|
{
|
|
1969
1920
|
if (typeof fn === 'function') {
|
|
@@ -2032,7 +1983,7 @@ function requireReact_development () {
|
|
|
2032
1983
|
}
|
|
2033
1984
|
|
|
2034
1985
|
switch (type) {
|
|
2035
|
-
case
|
|
1986
|
+
case exports.Suspense:
|
|
2036
1987
|
return describeBuiltInComponentFrame('Suspense');
|
|
2037
1988
|
|
|
2038
1989
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
@@ -2048,6 +1999,9 @@ function requireReact_development () {
|
|
|
2048
1999
|
// Memo may contain any component type so we recursively resolve it.
|
|
2049
2000
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2050
2001
|
|
|
2002
|
+
case REACT_BLOCK_TYPE:
|
|
2003
|
+
return describeFunctionComponentFrame(type._render);
|
|
2004
|
+
|
|
2051
2005
|
case REACT_LAZY_TYPE:
|
|
2052
2006
|
{
|
|
2053
2007
|
var lazyComponent = type;
|
|
@@ -2083,7 +2037,7 @@ function requireReact_development () {
|
|
|
2083
2037
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2084
2038
|
{
|
|
2085
2039
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
2086
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
2040
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2087
2041
|
|
|
2088
2042
|
for (var typeSpecName in typeSpecs) {
|
|
2089
2043
|
if (has(typeSpecs, typeSpecName)) {
|
|
@@ -2095,7 +2049,6 @@ function requireReact_development () {
|
|
|
2095
2049
|
// This is intentionally an invariant that gets caught. It's the same
|
|
2096
2050
|
// behavior as without this statement except with a better message.
|
|
2097
2051
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2098
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
2099
2052
|
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
2100
2053
|
err.name = 'Invariant Violation';
|
|
2101
2054
|
throw err;
|
|
@@ -2149,7 +2102,7 @@ function requireReact_development () {
|
|
|
2149
2102
|
|
|
2150
2103
|
function getDeclarationErrorAddendum() {
|
|
2151
2104
|
if (ReactCurrentOwner.current) {
|
|
2152
|
-
var name =
|
|
2105
|
+
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
2153
2106
|
|
|
2154
2107
|
if (name) {
|
|
2155
2108
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
@@ -2231,7 +2184,7 @@ function requireReact_development () {
|
|
|
2231
2184
|
|
|
2232
2185
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
2233
2186
|
// Give the component that originally created this child.
|
|
2234
|
-
childOwner = " It was passed a child from " +
|
|
2187
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
2235
2188
|
}
|
|
2236
2189
|
|
|
2237
2190
|
{
|
|
@@ -2258,7 +2211,7 @@ function requireReact_development () {
|
|
|
2258
2211
|
return;
|
|
2259
2212
|
}
|
|
2260
2213
|
|
|
2261
|
-
if (isArray(node)) {
|
|
2214
|
+
if (Array.isArray(node)) {
|
|
2262
2215
|
for (var i = 0; i < node.length; i++) {
|
|
2263
2216
|
var child = node[i];
|
|
2264
2217
|
|
|
@@ -2320,12 +2273,12 @@ function requireReact_development () {
|
|
|
2320
2273
|
|
|
2321
2274
|
if (propTypes) {
|
|
2322
2275
|
// Intentionally inside to avoid triggering lazy initializers:
|
|
2323
|
-
var name =
|
|
2276
|
+
var name = getComponentName(type);
|
|
2324
2277
|
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2325
2278
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2326
2279
|
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2327
2280
|
|
|
2328
|
-
var _name =
|
|
2281
|
+
var _name = getComponentName(type);
|
|
2329
2282
|
|
|
2330
2283
|
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2331
2284
|
}
|
|
@@ -2390,10 +2343,10 @@ function requireReact_development () {
|
|
|
2390
2343
|
|
|
2391
2344
|
if (type === null) {
|
|
2392
2345
|
typeString = 'null';
|
|
2393
|
-
} else if (isArray(type)) {
|
|
2346
|
+
} else if (Array.isArray(type)) {
|
|
2394
2347
|
typeString = 'array';
|
|
2395
2348
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2396
|
-
typeString = "<" + (
|
|
2349
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2397
2350
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2398
2351
|
} else {
|
|
2399
2352
|
typeString = typeof type;
|
|
@@ -2422,7 +2375,7 @@ function requireReact_development () {
|
|
|
2422
2375
|
}
|
|
2423
2376
|
}
|
|
2424
2377
|
|
|
2425
|
-
if (type ===
|
|
2378
|
+
if (type === exports.Fragment) {
|
|
2426
2379
|
validateFragmentProps(element);
|
|
2427
2380
|
} else {
|
|
2428
2381
|
validatePropTypes(element);
|
|
@@ -2469,263 +2422,16 @@ function requireReact_development () {
|
|
|
2469
2422
|
return newElement;
|
|
2470
2423
|
}
|
|
2471
2424
|
|
|
2472
|
-
|
|
2473
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
2474
|
-
ReactCurrentBatchConfig.transition = {};
|
|
2475
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
2476
|
-
|
|
2477
|
-
{
|
|
2478
|
-
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
|
|
2479
|
-
}
|
|
2425
|
+
{
|
|
2480
2426
|
|
|
2481
2427
|
try {
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
2485
|
-
|
|
2486
|
-
{
|
|
2487
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
2488
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
2489
|
-
|
|
2490
|
-
if (updatedFibersCount > 10) {
|
|
2491
|
-
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
|
2492
|
-
}
|
|
2428
|
+
var frozenObject = Object.freeze({});
|
|
2429
|
+
/* eslint-disable no-new */
|
|
2493
2430
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
|
-
var didWarnAboutMessageChannel = false;
|
|
2501
|
-
var enqueueTaskImpl = null;
|
|
2502
|
-
function enqueueTask(task) {
|
|
2503
|
-
if (enqueueTaskImpl === null) {
|
|
2504
|
-
try {
|
|
2505
|
-
// read require off the module object to get around the bundlers.
|
|
2506
|
-
// we don't want them to detect a require and bundle a Node polyfill.
|
|
2507
|
-
var requireString = ('require' + Math.random()).slice(0, 7);
|
|
2508
|
-
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
|
|
2509
|
-
// version of setImmediate, bypassing fake timers if any.
|
|
2510
|
-
|
|
2511
|
-
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
|
2512
|
-
} catch (_err) {
|
|
2513
|
-
// we're in a browser
|
|
2514
|
-
// we can't use regular timers because they may still be faked
|
|
2515
|
-
// so we try MessageChannel+postMessage instead
|
|
2516
|
-
enqueueTaskImpl = function (callback) {
|
|
2517
|
-
{
|
|
2518
|
-
if (didWarnAboutMessageChannel === false) {
|
|
2519
|
-
didWarnAboutMessageChannel = true;
|
|
2520
|
-
|
|
2521
|
-
if (typeof MessageChannel === 'undefined') {
|
|
2522
|
-
error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
var channel = new MessageChannel();
|
|
2528
|
-
channel.port1.onmessage = callback;
|
|
2529
|
-
channel.port2.postMessage(undefined);
|
|
2530
|
-
};
|
|
2531
|
-
}
|
|
2532
|
-
}
|
|
2533
|
-
|
|
2534
|
-
return enqueueTaskImpl(task);
|
|
2535
|
-
}
|
|
2536
|
-
|
|
2537
|
-
var actScopeDepth = 0;
|
|
2538
|
-
var didWarnNoAwaitAct = false;
|
|
2539
|
-
function act(callback) {
|
|
2540
|
-
{
|
|
2541
|
-
// `act` calls can be nested, so we track the depth. This represents the
|
|
2542
|
-
// number of `act` scopes on the stack.
|
|
2543
|
-
var prevActScopeDepth = actScopeDepth;
|
|
2544
|
-
actScopeDepth++;
|
|
2545
|
-
|
|
2546
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2547
|
-
// This is the outermost `act` scope. Initialize the queue. The reconciler
|
|
2548
|
-
// will detect the queue and use it instead of Scheduler.
|
|
2549
|
-
ReactCurrentActQueue.current = [];
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
2553
|
-
var result;
|
|
2554
|
-
|
|
2555
|
-
try {
|
|
2556
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
|
|
2557
|
-
// set to `true` while the given callback is executed, not for updates
|
|
2558
|
-
// triggered during an async event, because this is how the legacy
|
|
2559
|
-
// implementation of `act` behaved.
|
|
2560
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
2561
|
-
result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
|
|
2562
|
-
// which flushed updates immediately after the scope function exits, even
|
|
2563
|
-
// if it's an async function.
|
|
2564
|
-
|
|
2565
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
2566
|
-
var queue = ReactCurrentActQueue.current;
|
|
2567
|
-
|
|
2568
|
-
if (queue !== null) {
|
|
2569
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
2570
|
-
flushActQueue(queue);
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
} catch (error) {
|
|
2574
|
-
popActScope(prevActScopeDepth);
|
|
2575
|
-
throw error;
|
|
2576
|
-
} finally {
|
|
2577
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2578
|
-
}
|
|
2579
|
-
|
|
2580
|
-
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
|
2581
|
-
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
|
2582
|
-
// for it to resolve before exiting the current scope.
|
|
2583
|
-
|
|
2584
|
-
var wasAwaited = false;
|
|
2585
|
-
var thenable = {
|
|
2586
|
-
then: function (resolve, reject) {
|
|
2587
|
-
wasAwaited = true;
|
|
2588
|
-
thenableResult.then(function (returnValue) {
|
|
2589
|
-
popActScope(prevActScopeDepth);
|
|
2590
|
-
|
|
2591
|
-
if (actScopeDepth === 0) {
|
|
2592
|
-
// We've exited the outermost act scope. Recursively flush the
|
|
2593
|
-
// queue until there's no remaining work.
|
|
2594
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2595
|
-
} else {
|
|
2596
|
-
resolve(returnValue);
|
|
2597
|
-
}
|
|
2598
|
-
}, function (error) {
|
|
2599
|
-
// The callback threw an error.
|
|
2600
|
-
popActScope(prevActScopeDepth);
|
|
2601
|
-
reject(error);
|
|
2602
|
-
});
|
|
2603
|
-
}
|
|
2604
|
-
};
|
|
2605
|
-
|
|
2606
|
-
{
|
|
2607
|
-
if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
|
2608
|
-
// eslint-disable-next-line no-undef
|
|
2609
|
-
Promise.resolve().then(function () {}).then(function () {
|
|
2610
|
-
if (!wasAwaited) {
|
|
2611
|
-
didWarnNoAwaitAct = true;
|
|
2612
|
-
|
|
2613
|
-
error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
|
|
2614
|
-
}
|
|
2615
|
-
});
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
return thenable;
|
|
2620
|
-
} else {
|
|
2621
|
-
var returnValue = result; // The callback is not an async function. Exit the current scope
|
|
2622
|
-
// immediately, without awaiting.
|
|
2623
|
-
|
|
2624
|
-
popActScope(prevActScopeDepth);
|
|
2625
|
-
|
|
2626
|
-
if (actScopeDepth === 0) {
|
|
2627
|
-
// Exiting the outermost act scope. Flush the queue.
|
|
2628
|
-
var _queue = ReactCurrentActQueue.current;
|
|
2629
|
-
|
|
2630
|
-
if (_queue !== null) {
|
|
2631
|
-
flushActQueue(_queue);
|
|
2632
|
-
ReactCurrentActQueue.current = null;
|
|
2633
|
-
} // Return a thenable. If the user awaits it, we'll flush again in
|
|
2634
|
-
// case additional work was scheduled by a microtask.
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
var _thenable = {
|
|
2638
|
-
then: function (resolve, reject) {
|
|
2639
|
-
// Confirm we haven't re-entered another `act` scope, in case
|
|
2640
|
-
// the user does something weird like await the thenable
|
|
2641
|
-
// multiple times.
|
|
2642
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2643
|
-
// Recursively flush the queue until there's no remaining work.
|
|
2644
|
-
ReactCurrentActQueue.current = [];
|
|
2645
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2646
|
-
} else {
|
|
2647
|
-
resolve(returnValue);
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
};
|
|
2651
|
-
return _thenable;
|
|
2652
|
-
} else {
|
|
2653
|
-
// Since we're inside a nested `act` scope, the returned thenable
|
|
2654
|
-
// immediately resolves. The outer scope will flush the queue.
|
|
2655
|
-
var _thenable2 = {
|
|
2656
|
-
then: function (resolve, reject) {
|
|
2657
|
-
resolve(returnValue);
|
|
2658
|
-
}
|
|
2659
|
-
};
|
|
2660
|
-
return _thenable2;
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
|
|
2666
|
-
function popActScope(prevActScopeDepth) {
|
|
2667
|
-
{
|
|
2668
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2669
|
-
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
|
-
actScopeDepth = prevActScopeDepth;
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
|
|
2676
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2677
|
-
{
|
|
2678
|
-
var queue = ReactCurrentActQueue.current;
|
|
2679
|
-
|
|
2680
|
-
if (queue !== null) {
|
|
2681
|
-
try {
|
|
2682
|
-
flushActQueue(queue);
|
|
2683
|
-
enqueueTask(function () {
|
|
2684
|
-
if (queue.length === 0) {
|
|
2685
|
-
// No additional work was scheduled. Finish.
|
|
2686
|
-
ReactCurrentActQueue.current = null;
|
|
2687
|
-
resolve(returnValue);
|
|
2688
|
-
} else {
|
|
2689
|
-
// Keep flushing work until there's none left.
|
|
2690
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2691
|
-
}
|
|
2692
|
-
});
|
|
2693
|
-
} catch (error) {
|
|
2694
|
-
reject(error);
|
|
2695
|
-
}
|
|
2696
|
-
} else {
|
|
2697
|
-
resolve(returnValue);
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
var isFlushing = false;
|
|
2703
|
-
|
|
2704
|
-
function flushActQueue(queue) {
|
|
2705
|
-
{
|
|
2706
|
-
if (!isFlushing) {
|
|
2707
|
-
// Prevent re-entrance.
|
|
2708
|
-
isFlushing = true;
|
|
2709
|
-
var i = 0;
|
|
2710
|
-
|
|
2711
|
-
try {
|
|
2712
|
-
for (; i < queue.length; i++) {
|
|
2713
|
-
var callback = queue[i];
|
|
2714
|
-
|
|
2715
|
-
do {
|
|
2716
|
-
callback = callback(true);
|
|
2717
|
-
} while (callback !== null);
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
queue.length = 0;
|
|
2721
|
-
} catch (error) {
|
|
2722
|
-
// If something throws, leave the remaining callbacks on the queue.
|
|
2723
|
-
queue = queue.slice(i + 1);
|
|
2724
|
-
throw error;
|
|
2725
|
-
} finally {
|
|
2726
|
-
isFlushing = false;
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2431
|
+
new Map([[frozenObject, null]]);
|
|
2432
|
+
new Set([frozenObject]);
|
|
2433
|
+
/* eslint-enable no-new */
|
|
2434
|
+
} catch (e) {
|
|
2729
2435
|
}
|
|
2730
2436
|
}
|
|
2731
2437
|
|
|
@@ -2742,11 +2448,7 @@ function requireReact_development () {
|
|
|
2742
2448
|
|
|
2743
2449
|
exports.Children = Children;
|
|
2744
2450
|
exports.Component = Component;
|
|
2745
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2746
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2747
2451
|
exports.PureComponent = PureComponent;
|
|
2748
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2749
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2750
2452
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2751
2453
|
exports.cloneElement = cloneElement$1;
|
|
2752
2454
|
exports.createContext = createContext;
|
|
@@ -2757,37 +2459,21 @@ function requireReact_development () {
|
|
|
2757
2459
|
exports.isValidElement = isValidElement;
|
|
2758
2460
|
exports.lazy = lazy;
|
|
2759
2461
|
exports.memo = memo;
|
|
2760
|
-
exports.startTransition = startTransition;
|
|
2761
|
-
exports.unstable_act = act;
|
|
2762
2462
|
exports.useCallback = useCallback;
|
|
2763
2463
|
exports.useContext = useContext;
|
|
2764
2464
|
exports.useDebugValue = useDebugValue;
|
|
2765
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2766
2465
|
exports.useEffect = useEffect;
|
|
2767
|
-
exports.useId = useId;
|
|
2768
2466
|
exports.useImperativeHandle = useImperativeHandle;
|
|
2769
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2770
2467
|
exports.useLayoutEffect = useLayoutEffect;
|
|
2771
2468
|
exports.useMemo = useMemo;
|
|
2772
2469
|
exports.useReducer = useReducer;
|
|
2773
2470
|
exports.useRef = useRef;
|
|
2774
2471
|
exports.useState = useState;
|
|
2775
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2776
|
-
exports.useTransition = useTransition;
|
|
2777
2472
|
exports.version = ReactVersion;
|
|
2778
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
2779
|
-
if (
|
|
2780
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
2781
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
2782
|
-
'function'
|
|
2783
|
-
) {
|
|
2784
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
2473
|
})();
|
|
2788
2474
|
}
|
|
2789
|
-
} (react_development
|
|
2790
|
-
return react_development
|
|
2475
|
+
} (react_development));
|
|
2476
|
+
return react_development;
|
|
2791
2477
|
}
|
|
2792
2478
|
|
|
2793
2479
|
if (process.env.NODE_ENV === 'production') {
|