react-simple-phone-input 1.1.2-beta → 1.1.8-beta
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 +1374 -2818
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1374 -2818
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -9
package/dist/esm/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3
|
-
}
|
|
1
|
+
import React from 'react';
|
|
4
2
|
|
|
5
|
-
var
|
|
3
|
+
var jsxRuntime = {exports: {}};
|
|
6
4
|
|
|
7
|
-
var
|
|
5
|
+
var reactJsxRuntime_production_min = {};
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* @license React
|
|
11
|
-
* react.production.min.js
|
|
9
|
+
* react-jsx-runtime.production.min.js
|
|
12
10
|
*
|
|
13
11
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
12
|
*
|
|
@@ -16,36 +14,21 @@ var react_production_min = {};
|
|
|
16
14
|
* LICENSE file in the root directory of this source tree.
|
|
17
15
|
*/
|
|
18
16
|
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
|
|
28
|
-
function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f;}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return {$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
|
|
29
|
-
function N(a,b){return {$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return "object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
30
|
-
function R(a,b,e,d,c){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 l:case n:h=!0;}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
|
|
31
|
-
a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c);}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
|
|
32
|
-
function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b;},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b;});-1===a._status&&(a._status=0,a._result=b);}if(1===a._status)return a._result.default;throw a._result;}
|
|
33
|
-
var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};react_production_min.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments);},e);},count:function(a){var b=0;S(a,function(){b++;});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};react_production_min.Component=E;react_production_min.Fragment=p;
|
|
34
|
-
react_production_min.Profiler=r;react_production_min.PureComponent=G;react_production_min.StrictMode=q;react_production_min.Suspense=w;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
|
|
35
|
-
react_production_min.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
|
|
36
|
-
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g;}return {$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};react_production_min.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};react_production_min.createElement=M;react_production_min.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};
|
|
37
|
-
react_production_min.forwardRef=function(a){return {$$typeof:v,render:a}};react_production_min.isValidElement=O;react_production_min.lazy=function(a){return {$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};react_production_min.memo=function(a,b){return {$$typeof:x,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V.transition;V.transition={};try{a();}finally{V.transition=b;}};react_production_min.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.");};
|
|
38
|
-
react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U.current.useDeferredValue(a)};react_production_min.useEffect=function(a,b){return U.current.useEffect(a,b)};react_production_min.useId=function(){return U.current.useId()};react_production_min.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};
|
|
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";
|
|
41
|
-
return react_production_min;
|
|
17
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
18
|
+
|
|
19
|
+
function requireReactJsxRuntime_production_min () {
|
|
20
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
21
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
22
|
+
var f=React,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
23
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
24
|
+
return reactJsxRuntime_production_min;
|
|
42
25
|
}
|
|
43
26
|
|
|
44
|
-
var
|
|
27
|
+
var reactJsxRuntime_development = {};
|
|
45
28
|
|
|
46
29
|
/**
|
|
47
30
|
* @license React
|
|
48
|
-
* react.development.js
|
|
31
|
+
* react-jsx-runtime.development.js
|
|
49
32
|
*
|
|
50
33
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
51
34
|
*
|
|
@@ -53,2752 +36,1324 @@ var react_development = {exports: {}};
|
|
|
53
36
|
* LICENSE file in the root directory of this source tree.
|
|
54
37
|
*/
|
|
55
38
|
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
1365
|
-
|
|
1366
|
-
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?');
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
return context.Consumer;
|
|
1370
|
-
}
|
|
1371
|
-
},
|
|
1372
|
-
displayName: {
|
|
1373
|
-
get: function () {
|
|
1374
|
-
return context.displayName;
|
|
1375
|
-
},
|
|
1376
|
-
set: function (displayName) {
|
|
1377
|
-
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
1378
|
-
warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
1379
|
-
|
|
1380
|
-
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
}); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
|
|
1385
|
-
|
|
1386
|
-
context.Consumer = Consumer;
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
{
|
|
1390
|
-
context._currentRenderer = null;
|
|
1391
|
-
context._currentRenderer2 = null;
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
return context;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
var Uninitialized = -1;
|
|
1398
|
-
var Pending = 0;
|
|
1399
|
-
var Resolved = 1;
|
|
1400
|
-
var Rejected = 2;
|
|
1401
|
-
|
|
1402
|
-
function lazyInitializer(payload) {
|
|
1403
|
-
if (payload._status === Uninitialized) {
|
|
1404
|
-
var ctor = payload._result;
|
|
1405
|
-
var thenable = ctor(); // Transition to the next state.
|
|
1406
|
-
// This might throw either because it's missing or throws. If so, we treat it
|
|
1407
|
-
// as still uninitialized and try again next time. Which is the same as what
|
|
1408
|
-
// happens if the ctor or any wrappers processing the ctor throws. This might
|
|
1409
|
-
// end up fixing it if the resolution was a concurrency bug.
|
|
1410
|
-
|
|
1411
|
-
thenable.then(function (moduleObject) {
|
|
1412
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1413
|
-
// Transition to the next state.
|
|
1414
|
-
var resolved = payload;
|
|
1415
|
-
resolved._status = Resolved;
|
|
1416
|
-
resolved._result = moduleObject;
|
|
1417
|
-
}
|
|
1418
|
-
}, function (error) {
|
|
1419
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
|
1420
|
-
// Transition to the next state.
|
|
1421
|
-
var rejected = payload;
|
|
1422
|
-
rejected._status = Rejected;
|
|
1423
|
-
rejected._result = error;
|
|
1424
|
-
}
|
|
1425
|
-
});
|
|
1426
|
-
|
|
1427
|
-
if (payload._status === Uninitialized) {
|
|
1428
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
|
1429
|
-
// to resolve. Set it as pending in the meantime.
|
|
1430
|
-
var pending = payload;
|
|
1431
|
-
pending._status = Pending;
|
|
1432
|
-
pending._result = thenable;
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
if (payload._status === Resolved) {
|
|
1437
|
-
var moduleObject = payload._result;
|
|
1438
|
-
|
|
1439
|
-
{
|
|
1440
|
-
if (moduleObject === undefined) {
|
|
1441
|
-
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.
|
|
1442
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
{
|
|
1447
|
-
if (!('default' in moduleObject)) {
|
|
1448
|
-
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.
|
|
1449
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
return moduleObject.default;
|
|
1454
|
-
} else {
|
|
1455
|
-
throw payload._result;
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
function lazy(ctor) {
|
|
1460
|
-
var payload = {
|
|
1461
|
-
// We use these fields to store the result.
|
|
1462
|
-
_status: Uninitialized,
|
|
1463
|
-
_result: ctor
|
|
1464
|
-
};
|
|
1465
|
-
var lazyType = {
|
|
1466
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
1467
|
-
_payload: payload,
|
|
1468
|
-
_init: lazyInitializer
|
|
1469
|
-
};
|
|
1470
|
-
|
|
1471
|
-
{
|
|
1472
|
-
// In production, this would just set it on the object.
|
|
1473
|
-
var defaultProps;
|
|
1474
|
-
var propTypes; // $FlowFixMe
|
|
1475
|
-
|
|
1476
|
-
Object.defineProperties(lazyType, {
|
|
1477
|
-
defaultProps: {
|
|
1478
|
-
configurable: true,
|
|
1479
|
-
get: function () {
|
|
1480
|
-
return defaultProps;
|
|
1481
|
-
},
|
|
1482
|
-
set: function (newDefaultProps) {
|
|
1483
|
-
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.');
|
|
1484
|
-
|
|
1485
|
-
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1486
|
-
// $FlowFixMe
|
|
1487
|
-
|
|
1488
|
-
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1489
|
-
enumerable: true
|
|
1490
|
-
});
|
|
1491
|
-
}
|
|
1492
|
-
},
|
|
1493
|
-
propTypes: {
|
|
1494
|
-
configurable: true,
|
|
1495
|
-
get: function () {
|
|
1496
|
-
return propTypes;
|
|
1497
|
-
},
|
|
1498
|
-
set: function (newPropTypes) {
|
|
1499
|
-
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.');
|
|
1500
|
-
|
|
1501
|
-
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1502
|
-
// $FlowFixMe
|
|
1503
|
-
|
|
1504
|
-
Object.defineProperty(lazyType, 'propTypes', {
|
|
1505
|
-
enumerable: true
|
|
1506
|
-
});
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
});
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
return lazyType;
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
function forwardRef(render) {
|
|
1516
|
-
{
|
|
1517
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1518
|
-
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
1519
|
-
} else if (typeof render !== 'function') {
|
|
1520
|
-
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1521
|
-
} else {
|
|
1522
|
-
if (render.length !== 0 && render.length !== 2) {
|
|
1523
|
-
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.');
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
if (render != null) {
|
|
1528
|
-
if (render.defaultProps != null || render.propTypes != null) {
|
|
1529
|
-
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
var elementType = {
|
|
1535
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
|
1536
|
-
render: render
|
|
1537
|
-
};
|
|
1538
|
-
|
|
1539
|
-
{
|
|
1540
|
-
var ownName;
|
|
1541
|
-
Object.defineProperty(elementType, 'displayName', {
|
|
1542
|
-
enumerable: false,
|
|
1543
|
-
configurable: true,
|
|
1544
|
-
get: function () {
|
|
1545
|
-
return ownName;
|
|
1546
|
-
},
|
|
1547
|
-
set: function (name) {
|
|
1548
|
-
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1549
|
-
// because the component may be used elsewhere.
|
|
1550
|
-
// But it's nice for anonymous functions to inherit the name,
|
|
1551
|
-
// so that our component-stack generation logic will display their frames.
|
|
1552
|
-
// An anonymous function generally suggests a pattern like:
|
|
1553
|
-
// React.forwardRef((props, ref) => {...});
|
|
1554
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1555
|
-
|
|
1556
|
-
if (!render.name && !render.displayName) {
|
|
1557
|
-
render.displayName = name;
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
});
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
return elementType;
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
var REACT_MODULE_REFERENCE;
|
|
1567
|
-
|
|
1568
|
-
{
|
|
1569
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
function isValidElementType(type) {
|
|
1573
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
1574
|
-
return true;
|
|
1575
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
1579
|
-
return true;
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
if (typeof type === 'object' && type !== null) {
|
|
1583
|
-
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 || // This needs to include all possible module reference object
|
|
1584
|
-
// types supported by any Flight configuration anywhere since
|
|
1585
|
-
// we don't know which Flight build this will end up being used
|
|
1586
|
-
// with.
|
|
1587
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1588
|
-
return true;
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
return false;
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
function memo(type, compare) {
|
|
1596
|
-
{
|
|
1597
|
-
if (!isValidElementType(type)) {
|
|
1598
|
-
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
var elementType = {
|
|
1603
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
1604
|
-
type: type,
|
|
1605
|
-
compare: compare === undefined ? null : compare
|
|
1606
|
-
};
|
|
1607
|
-
|
|
1608
|
-
{
|
|
1609
|
-
var ownName;
|
|
1610
|
-
Object.defineProperty(elementType, 'displayName', {
|
|
1611
|
-
enumerable: false,
|
|
1612
|
-
configurable: true,
|
|
1613
|
-
get: function () {
|
|
1614
|
-
return ownName;
|
|
1615
|
-
},
|
|
1616
|
-
set: function (name) {
|
|
1617
|
-
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1618
|
-
// because the component may be used elsewhere.
|
|
1619
|
-
// But it's nice for anonymous functions to inherit the name,
|
|
1620
|
-
// so that our component-stack generation logic will display their frames.
|
|
1621
|
-
// An anonymous function generally suggests a pattern like:
|
|
1622
|
-
// React.memo((props) => {...});
|
|
1623
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1624
|
-
|
|
1625
|
-
if (!type.name && !type.displayName) {
|
|
1626
|
-
type.displayName = name;
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
});
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
return elementType;
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
function resolveDispatcher() {
|
|
1636
|
-
var dispatcher = ReactCurrentDispatcher.current;
|
|
1637
|
-
|
|
1638
|
-
{
|
|
1639
|
-
if (dispatcher === null) {
|
|
1640
|
-
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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
|
1641
|
-
}
|
|
1642
|
-
} // Will result in a null access error if accessed outside render phase. We
|
|
1643
|
-
// intentionally don't throw our own error because this is in a hot path.
|
|
1644
|
-
// Also helps ensure this is inlined.
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
return dispatcher;
|
|
1648
|
-
}
|
|
1649
|
-
function useContext(Context) {
|
|
1650
|
-
var dispatcher = resolveDispatcher();
|
|
1651
|
-
|
|
1652
|
-
{
|
|
1653
|
-
// TODO: add a more generic warning for invalid values.
|
|
1654
|
-
if (Context._context !== undefined) {
|
|
1655
|
-
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1656
|
-
// and nobody should be using this in existing code.
|
|
1657
|
-
|
|
1658
|
-
if (realContext.Consumer === Context) {
|
|
1659
|
-
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?');
|
|
1660
|
-
} else if (realContext.Provider === Context) {
|
|
1661
|
-
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
return dispatcher.useContext(Context);
|
|
1667
|
-
}
|
|
1668
|
-
function useState(initialState) {
|
|
1669
|
-
var dispatcher = resolveDispatcher();
|
|
1670
|
-
return dispatcher.useState(initialState);
|
|
1671
|
-
}
|
|
1672
|
-
function useReducer(reducer, initialArg, init) {
|
|
1673
|
-
var dispatcher = resolveDispatcher();
|
|
1674
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1675
|
-
}
|
|
1676
|
-
function useRef(initialValue) {
|
|
1677
|
-
var dispatcher = resolveDispatcher();
|
|
1678
|
-
return dispatcher.useRef(initialValue);
|
|
1679
|
-
}
|
|
1680
|
-
function useEffect(create, deps) {
|
|
1681
|
-
var dispatcher = resolveDispatcher();
|
|
1682
|
-
return dispatcher.useEffect(create, deps);
|
|
1683
|
-
}
|
|
1684
|
-
function useInsertionEffect(create, deps) {
|
|
1685
|
-
var dispatcher = resolveDispatcher();
|
|
1686
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1687
|
-
}
|
|
1688
|
-
function useLayoutEffect(create, deps) {
|
|
1689
|
-
var dispatcher = resolveDispatcher();
|
|
1690
|
-
return dispatcher.useLayoutEffect(create, deps);
|
|
1691
|
-
}
|
|
1692
|
-
function useCallback(callback, deps) {
|
|
1693
|
-
var dispatcher = resolveDispatcher();
|
|
1694
|
-
return dispatcher.useCallback(callback, deps);
|
|
1695
|
-
}
|
|
1696
|
-
function useMemo(create, deps) {
|
|
1697
|
-
var dispatcher = resolveDispatcher();
|
|
1698
|
-
return dispatcher.useMemo(create, deps);
|
|
1699
|
-
}
|
|
1700
|
-
function useImperativeHandle(ref, create, deps) {
|
|
1701
|
-
var dispatcher = resolveDispatcher();
|
|
1702
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1703
|
-
}
|
|
1704
|
-
function useDebugValue(value, formatterFn) {
|
|
1705
|
-
{
|
|
1706
|
-
var dispatcher = resolveDispatcher();
|
|
1707
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
function useTransition() {
|
|
1711
|
-
var dispatcher = resolveDispatcher();
|
|
1712
|
-
return dispatcher.useTransition();
|
|
1713
|
-
}
|
|
1714
|
-
function useDeferredValue(value) {
|
|
1715
|
-
var dispatcher = resolveDispatcher();
|
|
1716
|
-
return dispatcher.useDeferredValue(value);
|
|
1717
|
-
}
|
|
1718
|
-
function useId() {
|
|
1719
|
-
var dispatcher = resolveDispatcher();
|
|
1720
|
-
return dispatcher.useId();
|
|
1721
|
-
}
|
|
1722
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1723
|
-
var dispatcher = resolveDispatcher();
|
|
1724
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1728
|
-
// replaying on render function. This currently only patches the object
|
|
1729
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
1730
|
-
// We could also eagerly patch the method.
|
|
1731
|
-
var disabledDepth = 0;
|
|
1732
|
-
var prevLog;
|
|
1733
|
-
var prevInfo;
|
|
1734
|
-
var prevWarn;
|
|
1735
|
-
var prevError;
|
|
1736
|
-
var prevGroup;
|
|
1737
|
-
var prevGroupCollapsed;
|
|
1738
|
-
var prevGroupEnd;
|
|
1739
|
-
|
|
1740
|
-
function disabledLog() {}
|
|
1741
|
-
|
|
1742
|
-
disabledLog.__reactDisabledLog = true;
|
|
1743
|
-
function disableLogs() {
|
|
1744
|
-
{
|
|
1745
|
-
if (disabledDepth === 0) {
|
|
1746
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
1747
|
-
prevLog = console.log;
|
|
1748
|
-
prevInfo = console.info;
|
|
1749
|
-
prevWarn = console.warn;
|
|
1750
|
-
prevError = console.error;
|
|
1751
|
-
prevGroup = console.group;
|
|
1752
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1753
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
1754
|
-
|
|
1755
|
-
var props = {
|
|
1756
|
-
configurable: true,
|
|
1757
|
-
enumerable: true,
|
|
1758
|
-
value: disabledLog,
|
|
1759
|
-
writable: true
|
|
1760
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1761
|
-
|
|
1762
|
-
Object.defineProperties(console, {
|
|
1763
|
-
info: props,
|
|
1764
|
-
log: props,
|
|
1765
|
-
warn: props,
|
|
1766
|
-
error: props,
|
|
1767
|
-
group: props,
|
|
1768
|
-
groupCollapsed: props,
|
|
1769
|
-
groupEnd: props
|
|
1770
|
-
});
|
|
1771
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
disabledDepth++;
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
function reenableLogs() {
|
|
1778
|
-
{
|
|
1779
|
-
disabledDepth--;
|
|
1780
|
-
|
|
1781
|
-
if (disabledDepth === 0) {
|
|
1782
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
1783
|
-
var props = {
|
|
1784
|
-
configurable: true,
|
|
1785
|
-
enumerable: true,
|
|
1786
|
-
writable: true
|
|
1787
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1788
|
-
|
|
1789
|
-
Object.defineProperties(console, {
|
|
1790
|
-
log: assign({}, props, {
|
|
1791
|
-
value: prevLog
|
|
1792
|
-
}),
|
|
1793
|
-
info: assign({}, props, {
|
|
1794
|
-
value: prevInfo
|
|
1795
|
-
}),
|
|
1796
|
-
warn: assign({}, props, {
|
|
1797
|
-
value: prevWarn
|
|
1798
|
-
}),
|
|
1799
|
-
error: assign({}, props, {
|
|
1800
|
-
value: prevError
|
|
1801
|
-
}),
|
|
1802
|
-
group: assign({}, props, {
|
|
1803
|
-
value: prevGroup
|
|
1804
|
-
}),
|
|
1805
|
-
groupCollapsed: assign({}, props, {
|
|
1806
|
-
value: prevGroupCollapsed
|
|
1807
|
-
}),
|
|
1808
|
-
groupEnd: assign({}, props, {
|
|
1809
|
-
value: prevGroupEnd
|
|
1810
|
-
})
|
|
1811
|
-
});
|
|
1812
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
if (disabledDepth < 0) {
|
|
1816
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1821
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1822
|
-
var prefix;
|
|
1823
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1824
|
-
{
|
|
1825
|
-
if (prefix === undefined) {
|
|
1826
|
-
// Extract the VM specific prefix used by each line.
|
|
1827
|
-
try {
|
|
1828
|
-
throw Error();
|
|
1829
|
-
} catch (x) {
|
|
1830
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1831
|
-
prefix = match && match[1] || '';
|
|
1832
|
-
}
|
|
1833
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
return '\n' + prefix + name;
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
var reentry = false;
|
|
1840
|
-
var componentFrameCache;
|
|
1841
|
-
|
|
1842
|
-
{
|
|
1843
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1844
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1848
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1849
|
-
if ( !fn || reentry) {
|
|
1850
|
-
return '';
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
{
|
|
1854
|
-
var frame = componentFrameCache.get(fn);
|
|
1855
|
-
|
|
1856
|
-
if (frame !== undefined) {
|
|
1857
|
-
return frame;
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
var control;
|
|
1862
|
-
reentry = true;
|
|
1863
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
1864
|
-
|
|
1865
|
-
Error.prepareStackTrace = undefined;
|
|
1866
|
-
var previousDispatcher;
|
|
1867
|
-
|
|
1868
|
-
{
|
|
1869
|
-
previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
1870
|
-
// for warnings.
|
|
1871
|
-
|
|
1872
|
-
ReactCurrentDispatcher$1.current = null;
|
|
1873
|
-
disableLogs();
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
try {
|
|
1877
|
-
// This should throw.
|
|
1878
|
-
if (construct) {
|
|
1879
|
-
// Something should be setting the props in the constructor.
|
|
1880
|
-
var Fake = function () {
|
|
1881
|
-
throw Error();
|
|
1882
|
-
}; // $FlowFixMe
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
|
1886
|
-
set: function () {
|
|
1887
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
1888
|
-
// because that won't throw in a non-strict mode function.
|
|
1889
|
-
throw Error();
|
|
1890
|
-
}
|
|
1891
|
-
});
|
|
1892
|
-
|
|
1893
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1894
|
-
// We construct a different control for this case to include any extra
|
|
1895
|
-
// frames added by the construct call.
|
|
1896
|
-
try {
|
|
1897
|
-
Reflect.construct(Fake, []);
|
|
1898
|
-
} catch (x) {
|
|
1899
|
-
control = x;
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
Reflect.construct(fn, [], Fake);
|
|
1903
|
-
} else {
|
|
1904
|
-
try {
|
|
1905
|
-
Fake.call();
|
|
1906
|
-
} catch (x) {
|
|
1907
|
-
control = x;
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
fn.call(Fake.prototype);
|
|
1911
|
-
}
|
|
1912
|
-
} else {
|
|
1913
|
-
try {
|
|
1914
|
-
throw Error();
|
|
1915
|
-
} catch (x) {
|
|
1916
|
-
control = x;
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
fn();
|
|
1920
|
-
}
|
|
1921
|
-
} catch (sample) {
|
|
1922
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
1923
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
1924
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
1925
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
1926
|
-
var sampleLines = sample.stack.split('\n');
|
|
1927
|
-
var controlLines = control.stack.split('\n');
|
|
1928
|
-
var s = sampleLines.length - 1;
|
|
1929
|
-
var c = controlLines.length - 1;
|
|
1930
|
-
|
|
1931
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1932
|
-
// We expect at least one stack frame to be shared.
|
|
1933
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
1934
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
1935
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
1936
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
1937
|
-
// the sample somewhere in the control.
|
|
1938
|
-
c--;
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1942
|
-
// Next we find the first one that isn't the same which should be the
|
|
1943
|
-
// frame that called our sample function and the control.
|
|
1944
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
1945
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
1946
|
-
// If we're about to return the first line, and the control is also on the same
|
|
1947
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
1948
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
1949
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
1950
|
-
if (s !== 1 || c !== 1) {
|
|
1951
|
-
do {
|
|
1952
|
-
s--;
|
|
1953
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
1954
|
-
// The next one that isn't the same should be our match though.
|
|
1955
|
-
|
|
1956
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1957
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1958
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
1959
|
-
// but we have a user-provided "displayName"
|
|
1960
|
-
// splice it in to make the stack more readable.
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
1964
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
{
|
|
1968
|
-
if (typeof fn === 'function') {
|
|
1969
|
-
componentFrameCache.set(fn, _frame);
|
|
1970
|
-
}
|
|
1971
|
-
} // Return the line we found.
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
return _frame;
|
|
1975
|
-
}
|
|
1976
|
-
} while (s >= 1 && c >= 0);
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
break;
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
}
|
|
1983
|
-
} finally {
|
|
1984
|
-
reentry = false;
|
|
1985
|
-
|
|
1986
|
-
{
|
|
1987
|
-
ReactCurrentDispatcher$1.current = previousDispatcher;
|
|
1988
|
-
reenableLogs();
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1992
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
1996
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
1997
|
-
|
|
1998
|
-
{
|
|
1999
|
-
if (typeof fn === 'function') {
|
|
2000
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
return syntheticFrame;
|
|
2005
|
-
}
|
|
2006
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
2007
|
-
{
|
|
2008
|
-
return describeNativeComponentFrame(fn, false);
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
function shouldConstruct(Component) {
|
|
2013
|
-
var prototype = Component.prototype;
|
|
2014
|
-
return !!(prototype && prototype.isReactComponent);
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2018
|
-
|
|
2019
|
-
if (type == null) {
|
|
2020
|
-
return '';
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
if (typeof type === 'function') {
|
|
2024
|
-
{
|
|
2025
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2026
|
-
}
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
if (typeof type === 'string') {
|
|
2030
|
-
return describeBuiltInComponentFrame(type);
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
switch (type) {
|
|
2034
|
-
case REACT_SUSPENSE_TYPE:
|
|
2035
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
2036
|
-
|
|
2037
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2038
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
if (typeof type === 'object') {
|
|
2042
|
-
switch (type.$$typeof) {
|
|
2043
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2044
|
-
return describeFunctionComponentFrame(type.render);
|
|
2045
|
-
|
|
2046
|
-
case REACT_MEMO_TYPE:
|
|
2047
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
2048
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2049
|
-
|
|
2050
|
-
case REACT_LAZY_TYPE:
|
|
2051
|
-
{
|
|
2052
|
-
var lazyComponent = type;
|
|
2053
|
-
var payload = lazyComponent._payload;
|
|
2054
|
-
var init = lazyComponent._init;
|
|
2055
|
-
|
|
2056
|
-
try {
|
|
2057
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
2058
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2059
|
-
} catch (x) {}
|
|
2060
|
-
}
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
return '';
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
var loggedTypeFailures = {};
|
|
2068
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2069
|
-
|
|
2070
|
-
function setCurrentlyValidatingElement(element) {
|
|
2071
|
-
{
|
|
2072
|
-
if (element) {
|
|
2073
|
-
var owner = element._owner;
|
|
2074
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2075
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
2076
|
-
} else {
|
|
2077
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2083
|
-
{
|
|
2084
|
-
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
2085
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
2086
|
-
|
|
2087
|
-
for (var typeSpecName in typeSpecs) {
|
|
2088
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
2089
|
-
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
2090
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
2091
|
-
// After these have been cleaned up, we'll let them throw.
|
|
2092
|
-
|
|
2093
|
-
try {
|
|
2094
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
2095
|
-
// behavior as without this statement except with a better message.
|
|
2096
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2097
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
2098
|
-
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`.');
|
|
2099
|
-
err.name = 'Invariant Violation';
|
|
2100
|
-
throw err;
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
2104
|
-
} catch (ex) {
|
|
2105
|
-
error$1 = ex;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
2109
|
-
setCurrentlyValidatingElement(element);
|
|
2110
|
-
|
|
2111
|
-
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, typeof error$1);
|
|
2112
|
-
|
|
2113
|
-
setCurrentlyValidatingElement(null);
|
|
2114
|
-
}
|
|
2115
|
-
|
|
2116
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
2117
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
2118
|
-
// same error.
|
|
2119
|
-
loggedTypeFailures[error$1.message] = true;
|
|
2120
|
-
setCurrentlyValidatingElement(element);
|
|
2121
|
-
|
|
2122
|
-
error('Failed %s type: %s', location, error$1.message);
|
|
2123
|
-
|
|
2124
|
-
setCurrentlyValidatingElement(null);
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
2132
|
-
{
|
|
2133
|
-
if (element) {
|
|
2134
|
-
var owner = element._owner;
|
|
2135
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
2136
|
-
setExtraStackFrame(stack);
|
|
2137
|
-
} else {
|
|
2138
|
-
setExtraStackFrame(null);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
|
-
var propTypesMisspellWarningShown;
|
|
2144
|
-
|
|
2145
|
-
{
|
|
2146
|
-
propTypesMisspellWarningShown = false;
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
function getDeclarationErrorAddendum() {
|
|
2150
|
-
if (ReactCurrentOwner.current) {
|
|
2151
|
-
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
2152
|
-
|
|
2153
|
-
if (name) {
|
|
2154
|
-
return '\n\nCheck the render method of `' + name + '`.';
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
return '';
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
function getSourceInfoErrorAddendum(source) {
|
|
2162
|
-
if (source !== undefined) {
|
|
2163
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
2164
|
-
var lineNumber = source.lineNumber;
|
|
2165
|
-
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
2166
|
-
}
|
|
2167
|
-
|
|
2168
|
-
return '';
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
2172
|
-
if (elementProps !== null && elementProps !== undefined) {
|
|
2173
|
-
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
2174
|
-
}
|
|
2175
|
-
|
|
2176
|
-
return '';
|
|
2177
|
-
}
|
|
2178
|
-
/**
|
|
2179
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
2180
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
2181
|
-
* updates.
|
|
2182
|
-
*/
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
var ownerHasKeyUseWarning = {};
|
|
2186
|
-
|
|
2187
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
2188
|
-
var info = getDeclarationErrorAddendum();
|
|
2189
|
-
|
|
2190
|
-
if (!info) {
|
|
2191
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
2192
|
-
|
|
2193
|
-
if (parentName) {
|
|
2194
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
return info;
|
|
2199
|
-
}
|
|
2200
|
-
/**
|
|
2201
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
2202
|
-
* This element is in an array. The array could grow and shrink or be
|
|
2203
|
-
* reordered. All children that haven't already been validated are required to
|
|
2204
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
2205
|
-
* will only be shown once.
|
|
2206
|
-
*
|
|
2207
|
-
* @internal
|
|
2208
|
-
* @param {ReactElement} element Element that requires a key.
|
|
2209
|
-
* @param {*} parentType element's parent's type.
|
|
2210
|
-
*/
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
function validateExplicitKey(element, parentType) {
|
|
2214
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
2215
|
-
return;
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
element._store.validated = true;
|
|
2219
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
2220
|
-
|
|
2221
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
2222
|
-
return;
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
2226
|
-
// property, it may be the creator of the child that's responsible for
|
|
2227
|
-
// assigning it a key.
|
|
2228
|
-
|
|
2229
|
-
var childOwner = '';
|
|
2230
|
-
|
|
2231
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
2232
|
-
// Give the component that originally created this child.
|
|
2233
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
{
|
|
2237
|
-
setCurrentlyValidatingElement$1(element);
|
|
2238
|
-
|
|
2239
|
-
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);
|
|
2240
|
-
|
|
2241
|
-
setCurrentlyValidatingElement$1(null);
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
/**
|
|
2245
|
-
* Ensure that every element either is passed in a static location, in an
|
|
2246
|
-
* array with an explicit keys property defined, or in an object literal
|
|
2247
|
-
* with valid key property.
|
|
2248
|
-
*
|
|
2249
|
-
* @internal
|
|
2250
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
2251
|
-
* @param {*} parentType node's parent's type.
|
|
2252
|
-
*/
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
function validateChildKeys(node, parentType) {
|
|
2256
|
-
if (typeof node !== 'object') {
|
|
2257
|
-
return;
|
|
2258
|
-
}
|
|
2259
|
-
|
|
2260
|
-
if (isArray(node)) {
|
|
2261
|
-
for (var i = 0; i < node.length; i++) {
|
|
2262
|
-
var child = node[i];
|
|
2263
|
-
|
|
2264
|
-
if (isValidElement(child)) {
|
|
2265
|
-
validateExplicitKey(child, parentType);
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
} else if (isValidElement(node)) {
|
|
2269
|
-
// This element was passed in a valid location.
|
|
2270
|
-
if (node._store) {
|
|
2271
|
-
node._store.validated = true;
|
|
2272
|
-
}
|
|
2273
|
-
} else if (node) {
|
|
2274
|
-
var iteratorFn = getIteratorFn(node);
|
|
2275
|
-
|
|
2276
|
-
if (typeof iteratorFn === 'function') {
|
|
2277
|
-
// Entry iterators used to provide implicit keys,
|
|
2278
|
-
// but now we print a separate warning for them later.
|
|
2279
|
-
if (iteratorFn !== node.entries) {
|
|
2280
|
-
var iterator = iteratorFn.call(node);
|
|
2281
|
-
var step;
|
|
2282
|
-
|
|
2283
|
-
while (!(step = iterator.next()).done) {
|
|
2284
|
-
if (isValidElement(step.value)) {
|
|
2285
|
-
validateExplicitKey(step.value, parentType);
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
/**
|
|
2293
|
-
* Given an element, validate that its props follow the propTypes definition,
|
|
2294
|
-
* provided by the type.
|
|
2295
|
-
*
|
|
2296
|
-
* @param {ReactElement} element
|
|
2297
|
-
*/
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
function validatePropTypes(element) {
|
|
2301
|
-
{
|
|
2302
|
-
var type = element.type;
|
|
2303
|
-
|
|
2304
|
-
if (type === null || type === undefined || typeof type === 'string') {
|
|
2305
|
-
return;
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
var propTypes;
|
|
2309
|
-
|
|
2310
|
-
if (typeof type === 'function') {
|
|
2311
|
-
propTypes = type.propTypes;
|
|
2312
|
-
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
2313
|
-
// Inner props are checked in the reconciler.
|
|
2314
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
2315
|
-
propTypes = type.propTypes;
|
|
2316
|
-
} else {
|
|
2317
|
-
return;
|
|
2318
|
-
}
|
|
2319
|
-
|
|
2320
|
-
if (propTypes) {
|
|
2321
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
2322
|
-
var name = getComponentNameFromType(type);
|
|
2323
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2324
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2325
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2326
|
-
|
|
2327
|
-
var _name = getComponentNameFromType(type);
|
|
2328
|
-
|
|
2329
|
-
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
2333
|
-
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
/**
|
|
2338
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
2339
|
-
* @param {ReactElement} fragment
|
|
2340
|
-
*/
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
function validateFragmentProps(fragment) {
|
|
2344
|
-
{
|
|
2345
|
-
var keys = Object.keys(fragment.props);
|
|
2346
|
-
|
|
2347
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2348
|
-
var key = keys[i];
|
|
2349
|
-
|
|
2350
|
-
if (key !== 'children' && key !== 'key') {
|
|
2351
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2352
|
-
|
|
2353
|
-
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
2354
|
-
|
|
2355
|
-
setCurrentlyValidatingElement$1(null);
|
|
2356
|
-
break;
|
|
2357
|
-
}
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
if (fragment.ref !== null) {
|
|
2361
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
2362
|
-
|
|
2363
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
2364
|
-
|
|
2365
|
-
setCurrentlyValidatingElement$1(null);
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
}
|
|
2369
|
-
function createElementWithValidation(type, props, children) {
|
|
2370
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
2371
|
-
// succeed and there will likely be errors in render.
|
|
2372
|
-
|
|
2373
|
-
if (!validType) {
|
|
2374
|
-
var info = '';
|
|
2375
|
-
|
|
2376
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2377
|
-
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
2378
|
-
}
|
|
2379
|
-
|
|
2380
|
-
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
2381
|
-
|
|
2382
|
-
if (sourceInfo) {
|
|
2383
|
-
info += sourceInfo;
|
|
2384
|
-
} else {
|
|
2385
|
-
info += getDeclarationErrorAddendum();
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
var typeString;
|
|
2389
|
-
|
|
2390
|
-
if (type === null) {
|
|
2391
|
-
typeString = 'null';
|
|
2392
|
-
} else if (isArray(type)) {
|
|
2393
|
-
typeString = 'array';
|
|
2394
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2395
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
2396
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2397
|
-
} else {
|
|
2398
|
-
typeString = typeof type;
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
{
|
|
2402
|
-
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);
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
2407
|
-
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
2408
|
-
|
|
2409
|
-
if (element == null) {
|
|
2410
|
-
return element;
|
|
2411
|
-
} // Skip key warning if the type isn't valid since our key validation logic
|
|
2412
|
-
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
2413
|
-
// We don't want exception behavior to differ between dev and prod.
|
|
2414
|
-
// (Rendering will throw with a helpful message and as soon as the type is
|
|
2415
|
-
// fixed, the key warnings will appear.)
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
if (validType) {
|
|
2419
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
2420
|
-
validateChildKeys(arguments[i], type);
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
2425
|
-
validateFragmentProps(element);
|
|
2426
|
-
} else {
|
|
2427
|
-
validatePropTypes(element);
|
|
2428
|
-
}
|
|
2429
|
-
|
|
2430
|
-
return element;
|
|
2431
|
-
}
|
|
2432
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2433
|
-
function createFactoryWithValidation(type) {
|
|
2434
|
-
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
2435
|
-
validatedFactory.type = type;
|
|
2436
|
-
|
|
2437
|
-
{
|
|
2438
|
-
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
2439
|
-
didWarnAboutDeprecatedCreateFactory = true;
|
|
2440
|
-
|
|
2441
|
-
warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
|
2442
|
-
} // Legacy hook: remove it
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
Object.defineProperty(validatedFactory, 'type', {
|
|
2446
|
-
enumerable: false,
|
|
2447
|
-
get: function () {
|
|
2448
|
-
warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
2449
|
-
|
|
2450
|
-
Object.defineProperty(this, 'type', {
|
|
2451
|
-
value: type
|
|
2452
|
-
});
|
|
2453
|
-
return type;
|
|
2454
|
-
}
|
|
2455
|
-
});
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
return validatedFactory;
|
|
2459
|
-
}
|
|
2460
|
-
function cloneElementWithValidation(element, props, children) {
|
|
2461
|
-
var newElement = cloneElement.apply(this, arguments);
|
|
2462
|
-
|
|
2463
|
-
for (var i = 2; i < arguments.length; i++) {
|
|
2464
|
-
validateChildKeys(arguments[i], newElement.type);
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
validatePropTypes(newElement);
|
|
2468
|
-
return newElement;
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
function startTransition(scope, options) {
|
|
2472
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
2473
|
-
ReactCurrentBatchConfig.transition = {};
|
|
2474
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
2475
|
-
|
|
2476
|
-
{
|
|
2477
|
-
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
try {
|
|
2481
|
-
scope();
|
|
2482
|
-
} finally {
|
|
2483
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
2484
|
-
|
|
2485
|
-
{
|
|
2486
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
2487
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
2488
|
-
|
|
2489
|
-
if (updatedFibersCount > 10) {
|
|
2490
|
-
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.');
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
|
-
currentTransition._updatedFibers.clear();
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
var didWarnAboutMessageChannel = false;
|
|
2500
|
-
var enqueueTaskImpl = null;
|
|
2501
|
-
function enqueueTask(task) {
|
|
2502
|
-
if (enqueueTaskImpl === null) {
|
|
2503
|
-
try {
|
|
2504
|
-
// read require off the module object to get around the bundlers.
|
|
2505
|
-
// we don't want them to detect a require and bundle a Node polyfill.
|
|
2506
|
-
var requireString = ('require' + Math.random()).slice(0, 7);
|
|
2507
|
-
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
|
|
2508
|
-
// version of setImmediate, bypassing fake timers if any.
|
|
2509
|
-
|
|
2510
|
-
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
|
2511
|
-
} catch (_err) {
|
|
2512
|
-
// we're in a browser
|
|
2513
|
-
// we can't use regular timers because they may still be faked
|
|
2514
|
-
// so we try MessageChannel+postMessage instead
|
|
2515
|
-
enqueueTaskImpl = function (callback) {
|
|
2516
|
-
{
|
|
2517
|
-
if (didWarnAboutMessageChannel === false) {
|
|
2518
|
-
didWarnAboutMessageChannel = true;
|
|
2519
|
-
|
|
2520
|
-
if (typeof MessageChannel === 'undefined') {
|
|
2521
|
-
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.');
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2526
|
-
var channel = new MessageChannel();
|
|
2527
|
-
channel.port1.onmessage = callback;
|
|
2528
|
-
channel.port2.postMessage(undefined);
|
|
2529
|
-
};
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
return enqueueTaskImpl(task);
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
var actScopeDepth = 0;
|
|
2537
|
-
var didWarnNoAwaitAct = false;
|
|
2538
|
-
function act(callback) {
|
|
2539
|
-
{
|
|
2540
|
-
// `act` calls can be nested, so we track the depth. This represents the
|
|
2541
|
-
// number of `act` scopes on the stack.
|
|
2542
|
-
var prevActScopeDepth = actScopeDepth;
|
|
2543
|
-
actScopeDepth++;
|
|
2544
|
-
|
|
2545
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2546
|
-
// This is the outermost `act` scope. Initialize the queue. The reconciler
|
|
2547
|
-
// will detect the queue and use it instead of Scheduler.
|
|
2548
|
-
ReactCurrentActQueue.current = [];
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
2552
|
-
var result;
|
|
2553
|
-
|
|
2554
|
-
try {
|
|
2555
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
|
|
2556
|
-
// set to `true` while the given callback is executed, not for updates
|
|
2557
|
-
// triggered during an async event, because this is how the legacy
|
|
2558
|
-
// implementation of `act` behaved.
|
|
2559
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
2560
|
-
result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
|
|
2561
|
-
// which flushed updates immediately after the scope function exits, even
|
|
2562
|
-
// if it's an async function.
|
|
2563
|
-
|
|
2564
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
2565
|
-
var queue = ReactCurrentActQueue.current;
|
|
2566
|
-
|
|
2567
|
-
if (queue !== null) {
|
|
2568
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
2569
|
-
flushActQueue(queue);
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
} catch (error) {
|
|
2573
|
-
popActScope(prevActScopeDepth);
|
|
2574
|
-
throw error;
|
|
2575
|
-
} finally {
|
|
2576
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
|
2580
|
-
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
|
2581
|
-
// for it to resolve before exiting the current scope.
|
|
2582
|
-
|
|
2583
|
-
var wasAwaited = false;
|
|
2584
|
-
var thenable = {
|
|
2585
|
-
then: function (resolve, reject) {
|
|
2586
|
-
wasAwaited = true;
|
|
2587
|
-
thenableResult.then(function (returnValue) {
|
|
2588
|
-
popActScope(prevActScopeDepth);
|
|
2589
|
-
|
|
2590
|
-
if (actScopeDepth === 0) {
|
|
2591
|
-
// We've exited the outermost act scope. Recursively flush the
|
|
2592
|
-
// queue until there's no remaining work.
|
|
2593
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2594
|
-
} else {
|
|
2595
|
-
resolve(returnValue);
|
|
2596
|
-
}
|
|
2597
|
-
}, function (error) {
|
|
2598
|
-
// The callback threw an error.
|
|
2599
|
-
popActScope(prevActScopeDepth);
|
|
2600
|
-
reject(error);
|
|
2601
|
-
});
|
|
2602
|
-
}
|
|
2603
|
-
};
|
|
2604
|
-
|
|
2605
|
-
{
|
|
2606
|
-
if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
|
2607
|
-
// eslint-disable-next-line no-undef
|
|
2608
|
-
Promise.resolve().then(function () {}).then(function () {
|
|
2609
|
-
if (!wasAwaited) {
|
|
2610
|
-
didWarnNoAwaitAct = true;
|
|
2611
|
-
|
|
2612
|
-
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 () => ...);');
|
|
2613
|
-
}
|
|
2614
|
-
});
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
return thenable;
|
|
2619
|
-
} else {
|
|
2620
|
-
var returnValue = result; // The callback is not an async function. Exit the current scope
|
|
2621
|
-
// immediately, without awaiting.
|
|
2622
|
-
|
|
2623
|
-
popActScope(prevActScopeDepth);
|
|
2624
|
-
|
|
2625
|
-
if (actScopeDepth === 0) {
|
|
2626
|
-
// Exiting the outermost act scope. Flush the queue.
|
|
2627
|
-
var _queue = ReactCurrentActQueue.current;
|
|
2628
|
-
|
|
2629
|
-
if (_queue !== null) {
|
|
2630
|
-
flushActQueue(_queue);
|
|
2631
|
-
ReactCurrentActQueue.current = null;
|
|
2632
|
-
} // Return a thenable. If the user awaits it, we'll flush again in
|
|
2633
|
-
// case additional work was scheduled by a microtask.
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
var _thenable = {
|
|
2637
|
-
then: function (resolve, reject) {
|
|
2638
|
-
// Confirm we haven't re-entered another `act` scope, in case
|
|
2639
|
-
// the user does something weird like await the thenable
|
|
2640
|
-
// multiple times.
|
|
2641
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2642
|
-
// Recursively flush the queue until there's no remaining work.
|
|
2643
|
-
ReactCurrentActQueue.current = [];
|
|
2644
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2645
|
-
} else {
|
|
2646
|
-
resolve(returnValue);
|
|
2647
|
-
}
|
|
2648
|
-
}
|
|
2649
|
-
};
|
|
2650
|
-
return _thenable;
|
|
2651
|
-
} else {
|
|
2652
|
-
// Since we're inside a nested `act` scope, the returned thenable
|
|
2653
|
-
// immediately resolves. The outer scope will flush the queue.
|
|
2654
|
-
var _thenable2 = {
|
|
2655
|
-
then: function (resolve, reject) {
|
|
2656
|
-
resolve(returnValue);
|
|
2657
|
-
}
|
|
2658
|
-
};
|
|
2659
|
-
return _thenable2;
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
|
|
2665
|
-
function popActScope(prevActScopeDepth) {
|
|
2666
|
-
{
|
|
2667
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2668
|
-
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
actScopeDepth = prevActScopeDepth;
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
|
|
2675
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2676
|
-
{
|
|
2677
|
-
var queue = ReactCurrentActQueue.current;
|
|
2678
|
-
|
|
2679
|
-
if (queue !== null) {
|
|
2680
|
-
try {
|
|
2681
|
-
flushActQueue(queue);
|
|
2682
|
-
enqueueTask(function () {
|
|
2683
|
-
if (queue.length === 0) {
|
|
2684
|
-
// No additional work was scheduled. Finish.
|
|
2685
|
-
ReactCurrentActQueue.current = null;
|
|
2686
|
-
resolve(returnValue);
|
|
2687
|
-
} else {
|
|
2688
|
-
// Keep flushing work until there's none left.
|
|
2689
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2690
|
-
}
|
|
2691
|
-
});
|
|
2692
|
-
} catch (error) {
|
|
2693
|
-
reject(error);
|
|
2694
|
-
}
|
|
2695
|
-
} else {
|
|
2696
|
-
resolve(returnValue);
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
|
-
var isFlushing = false;
|
|
2702
|
-
|
|
2703
|
-
function flushActQueue(queue) {
|
|
2704
|
-
{
|
|
2705
|
-
if (!isFlushing) {
|
|
2706
|
-
// Prevent re-entrance.
|
|
2707
|
-
isFlushing = true;
|
|
2708
|
-
var i = 0;
|
|
2709
|
-
|
|
2710
|
-
try {
|
|
2711
|
-
for (; i < queue.length; i++) {
|
|
2712
|
-
var callback = queue[i];
|
|
2713
|
-
|
|
2714
|
-
do {
|
|
2715
|
-
callback = callback(true);
|
|
2716
|
-
} while (callback !== null);
|
|
2717
|
-
}
|
|
2718
|
-
|
|
2719
|
-
queue.length = 0;
|
|
2720
|
-
} catch (error) {
|
|
2721
|
-
// If something throws, leave the remaining callbacks on the queue.
|
|
2722
|
-
queue = queue.slice(i + 1);
|
|
2723
|
-
throw error;
|
|
2724
|
-
} finally {
|
|
2725
|
-
isFlushing = false;
|
|
2726
|
-
}
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
}
|
|
2730
|
-
|
|
2731
|
-
var createElement$1 = createElementWithValidation ;
|
|
2732
|
-
var cloneElement$1 = cloneElementWithValidation ;
|
|
2733
|
-
var createFactory = createFactoryWithValidation ;
|
|
2734
|
-
var Children = {
|
|
2735
|
-
map: mapChildren,
|
|
2736
|
-
forEach: forEachChildren,
|
|
2737
|
-
count: countChildren,
|
|
2738
|
-
toArray: toArray,
|
|
2739
|
-
only: onlyChild
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
exports.Children = Children;
|
|
2743
|
-
exports.Component = Component;
|
|
2744
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2745
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2746
|
-
exports.PureComponent = PureComponent;
|
|
2747
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2748
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2749
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2750
|
-
exports.cloneElement = cloneElement$1;
|
|
2751
|
-
exports.createContext = createContext;
|
|
2752
|
-
exports.createElement = createElement$1;
|
|
2753
|
-
exports.createFactory = createFactory;
|
|
2754
|
-
exports.createRef = createRef;
|
|
2755
|
-
exports.forwardRef = forwardRef;
|
|
2756
|
-
exports.isValidElement = isValidElement;
|
|
2757
|
-
exports.lazy = lazy;
|
|
2758
|
-
exports.memo = memo;
|
|
2759
|
-
exports.startTransition = startTransition;
|
|
2760
|
-
exports.unstable_act = act;
|
|
2761
|
-
exports.useCallback = useCallback;
|
|
2762
|
-
exports.useContext = useContext;
|
|
2763
|
-
exports.useDebugValue = useDebugValue;
|
|
2764
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2765
|
-
exports.useEffect = useEffect;
|
|
2766
|
-
exports.useId = useId;
|
|
2767
|
-
exports.useImperativeHandle = useImperativeHandle;
|
|
2768
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2769
|
-
exports.useLayoutEffect = useLayoutEffect;
|
|
2770
|
-
exports.useMemo = useMemo;
|
|
2771
|
-
exports.useReducer = useReducer;
|
|
2772
|
-
exports.useRef = useRef;
|
|
2773
|
-
exports.useState = useState;
|
|
2774
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2775
|
-
exports.useTransition = useTransition;
|
|
2776
|
-
exports.version = ReactVersion;
|
|
2777
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
2778
|
-
if (
|
|
2779
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
2780
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
2781
|
-
'function'
|
|
2782
|
-
) {
|
|
2783
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2784
|
-
}
|
|
2785
|
-
|
|
2786
|
-
})();
|
|
2787
|
-
}
|
|
2788
|
-
} (react_development, react_development.exports));
|
|
2789
|
-
return react_development.exports;
|
|
39
|
+
var hasRequiredReactJsxRuntime_development;
|
|
40
|
+
|
|
41
|
+
function requireReactJsxRuntime_development () {
|
|
42
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
43
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
44
|
+
|
|
45
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46
|
+
(function() {
|
|
47
|
+
|
|
48
|
+
var React$1 = React;
|
|
49
|
+
|
|
50
|
+
// ATTENTION
|
|
51
|
+
// When adding new symbols to this file,
|
|
52
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
53
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
54
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
55
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
56
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
57
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
58
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
59
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
60
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
61
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
62
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
63
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
64
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
65
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
66
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
67
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
68
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
69
|
+
function getIteratorFn(maybeIterable) {
|
|
70
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
75
|
+
|
|
76
|
+
if (typeof maybeIterator === 'function') {
|
|
77
|
+
return maybeIterator;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
84
|
+
|
|
85
|
+
function error(format) {
|
|
86
|
+
{
|
|
87
|
+
{
|
|
88
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
89
|
+
args[_key2 - 1] = arguments[_key2];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
printWarning('error', format, args);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function printWarning(level, format, args) {
|
|
98
|
+
// When changing this logic, you might want to also
|
|
99
|
+
// update consoleWithStackDev.www.js as well.
|
|
100
|
+
{
|
|
101
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
102
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
103
|
+
|
|
104
|
+
if (stack !== '') {
|
|
105
|
+
format += '%s';
|
|
106
|
+
args = args.concat([stack]);
|
|
107
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
var argsWithFormat = args.map(function (item) {
|
|
111
|
+
return String(item);
|
|
112
|
+
}); // Careful: RN currently depends on this prefix
|
|
113
|
+
|
|
114
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
115
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
116
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
117
|
+
|
|
118
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// -----------------------------------------------------------------------------
|
|
123
|
+
|
|
124
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
125
|
+
var enableCacheElement = false;
|
|
126
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
127
|
+
|
|
128
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
129
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
130
|
+
// issues in DEV builds.
|
|
131
|
+
|
|
132
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
133
|
+
|
|
134
|
+
var REACT_MODULE_REFERENCE;
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function isValidElementType(type) {
|
|
141
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
142
|
+
return true;
|
|
143
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (typeof type === 'object' && type !== null) {
|
|
151
|
+
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 || // This needs to include all possible module reference object
|
|
152
|
+
// types supported by any Flight configuration anywhere since
|
|
153
|
+
// we don't know which Flight build this will end up being used
|
|
154
|
+
// with.
|
|
155
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
164
|
+
var displayName = outerType.displayName;
|
|
165
|
+
|
|
166
|
+
if (displayName) {
|
|
167
|
+
return displayName;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
171
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
172
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
function getContextName(type) {
|
|
176
|
+
return type.displayName || 'Context';
|
|
177
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
function getComponentNameFromType(type) {
|
|
181
|
+
if (type == null) {
|
|
182
|
+
// Host root, text node or just invalid type.
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
{
|
|
187
|
+
if (typeof type.tag === 'number') {
|
|
188
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (typeof type === 'function') {
|
|
193
|
+
return type.displayName || type.name || null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (typeof type === 'string') {
|
|
197
|
+
return type;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
switch (type) {
|
|
201
|
+
case REACT_FRAGMENT_TYPE:
|
|
202
|
+
return 'Fragment';
|
|
203
|
+
|
|
204
|
+
case REACT_PORTAL_TYPE:
|
|
205
|
+
return 'Portal';
|
|
206
|
+
|
|
207
|
+
case REACT_PROFILER_TYPE:
|
|
208
|
+
return 'Profiler';
|
|
209
|
+
|
|
210
|
+
case REACT_STRICT_MODE_TYPE:
|
|
211
|
+
return 'StrictMode';
|
|
212
|
+
|
|
213
|
+
case REACT_SUSPENSE_TYPE:
|
|
214
|
+
return 'Suspense';
|
|
215
|
+
|
|
216
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
217
|
+
return 'SuspenseList';
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (typeof type === 'object') {
|
|
222
|
+
switch (type.$$typeof) {
|
|
223
|
+
case REACT_CONTEXT_TYPE:
|
|
224
|
+
var context = type;
|
|
225
|
+
return getContextName(context) + '.Consumer';
|
|
226
|
+
|
|
227
|
+
case REACT_PROVIDER_TYPE:
|
|
228
|
+
var provider = type;
|
|
229
|
+
return getContextName(provider._context) + '.Provider';
|
|
230
|
+
|
|
231
|
+
case REACT_FORWARD_REF_TYPE:
|
|
232
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
233
|
+
|
|
234
|
+
case REACT_MEMO_TYPE:
|
|
235
|
+
var outerName = type.displayName || null;
|
|
236
|
+
|
|
237
|
+
if (outerName !== null) {
|
|
238
|
+
return outerName;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
242
|
+
|
|
243
|
+
case REACT_LAZY_TYPE:
|
|
244
|
+
{
|
|
245
|
+
var lazyComponent = type;
|
|
246
|
+
var payload = lazyComponent._payload;
|
|
247
|
+
var init = lazyComponent._init;
|
|
248
|
+
|
|
249
|
+
try {
|
|
250
|
+
return getComponentNameFromType(init(payload));
|
|
251
|
+
} catch (x) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// eslint-disable-next-line no-fallthrough
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
var assign = Object.assign;
|
|
264
|
+
|
|
265
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
266
|
+
// replaying on render function. This currently only patches the object
|
|
267
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
268
|
+
// We could also eagerly patch the method.
|
|
269
|
+
var disabledDepth = 0;
|
|
270
|
+
var prevLog;
|
|
271
|
+
var prevInfo;
|
|
272
|
+
var prevWarn;
|
|
273
|
+
var prevError;
|
|
274
|
+
var prevGroup;
|
|
275
|
+
var prevGroupCollapsed;
|
|
276
|
+
var prevGroupEnd;
|
|
277
|
+
|
|
278
|
+
function disabledLog() {}
|
|
279
|
+
|
|
280
|
+
disabledLog.__reactDisabledLog = true;
|
|
281
|
+
function disableLogs() {
|
|
282
|
+
{
|
|
283
|
+
if (disabledDepth === 0) {
|
|
284
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
285
|
+
prevLog = console.log;
|
|
286
|
+
prevInfo = console.info;
|
|
287
|
+
prevWarn = console.warn;
|
|
288
|
+
prevError = console.error;
|
|
289
|
+
prevGroup = console.group;
|
|
290
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
291
|
+
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
292
|
+
|
|
293
|
+
var props = {
|
|
294
|
+
configurable: true,
|
|
295
|
+
enumerable: true,
|
|
296
|
+
value: disabledLog,
|
|
297
|
+
writable: true
|
|
298
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
299
|
+
|
|
300
|
+
Object.defineProperties(console, {
|
|
301
|
+
info: props,
|
|
302
|
+
log: props,
|
|
303
|
+
warn: props,
|
|
304
|
+
error: props,
|
|
305
|
+
group: props,
|
|
306
|
+
groupCollapsed: props,
|
|
307
|
+
groupEnd: props
|
|
308
|
+
});
|
|
309
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
disabledDepth++;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function reenableLogs() {
|
|
316
|
+
{
|
|
317
|
+
disabledDepth--;
|
|
318
|
+
|
|
319
|
+
if (disabledDepth === 0) {
|
|
320
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
321
|
+
var props = {
|
|
322
|
+
configurable: true,
|
|
323
|
+
enumerable: true,
|
|
324
|
+
writable: true
|
|
325
|
+
}; // $FlowFixMe Flow thinks console is immutable.
|
|
326
|
+
|
|
327
|
+
Object.defineProperties(console, {
|
|
328
|
+
log: assign({}, props, {
|
|
329
|
+
value: prevLog
|
|
330
|
+
}),
|
|
331
|
+
info: assign({}, props, {
|
|
332
|
+
value: prevInfo
|
|
333
|
+
}),
|
|
334
|
+
warn: assign({}, props, {
|
|
335
|
+
value: prevWarn
|
|
336
|
+
}),
|
|
337
|
+
error: assign({}, props, {
|
|
338
|
+
value: prevError
|
|
339
|
+
}),
|
|
340
|
+
group: assign({}, props, {
|
|
341
|
+
value: prevGroup
|
|
342
|
+
}),
|
|
343
|
+
groupCollapsed: assign({}, props, {
|
|
344
|
+
value: prevGroupCollapsed
|
|
345
|
+
}),
|
|
346
|
+
groupEnd: assign({}, props, {
|
|
347
|
+
value: prevGroupEnd
|
|
348
|
+
})
|
|
349
|
+
});
|
|
350
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (disabledDepth < 0) {
|
|
354
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
360
|
+
var prefix;
|
|
361
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
362
|
+
{
|
|
363
|
+
if (prefix === undefined) {
|
|
364
|
+
// Extract the VM specific prefix used by each line.
|
|
365
|
+
try {
|
|
366
|
+
throw Error();
|
|
367
|
+
} catch (x) {
|
|
368
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
369
|
+
prefix = match && match[1] || '';
|
|
370
|
+
}
|
|
371
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
return '\n' + prefix + name;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
var reentry = false;
|
|
378
|
+
var componentFrameCache;
|
|
379
|
+
|
|
380
|
+
{
|
|
381
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
382
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
386
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
387
|
+
if ( !fn || reentry) {
|
|
388
|
+
return '';
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
{
|
|
392
|
+
var frame = componentFrameCache.get(fn);
|
|
393
|
+
|
|
394
|
+
if (frame !== undefined) {
|
|
395
|
+
return frame;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
var control;
|
|
400
|
+
reentry = true;
|
|
401
|
+
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
402
|
+
|
|
403
|
+
Error.prepareStackTrace = undefined;
|
|
404
|
+
var previousDispatcher;
|
|
405
|
+
|
|
406
|
+
{
|
|
407
|
+
previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
|
|
408
|
+
// for warnings.
|
|
409
|
+
|
|
410
|
+
ReactCurrentDispatcher.current = null;
|
|
411
|
+
disableLogs();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
try {
|
|
415
|
+
// This should throw.
|
|
416
|
+
if (construct) {
|
|
417
|
+
// Something should be setting the props in the constructor.
|
|
418
|
+
var Fake = function () {
|
|
419
|
+
throw Error();
|
|
420
|
+
}; // $FlowFixMe
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
424
|
+
set: function () {
|
|
425
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
426
|
+
// because that won't throw in a non-strict mode function.
|
|
427
|
+
throw Error();
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
432
|
+
// We construct a different control for this case to include any extra
|
|
433
|
+
// frames added by the construct call.
|
|
434
|
+
try {
|
|
435
|
+
Reflect.construct(Fake, []);
|
|
436
|
+
} catch (x) {
|
|
437
|
+
control = x;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
Reflect.construct(fn, [], Fake);
|
|
441
|
+
} else {
|
|
442
|
+
try {
|
|
443
|
+
Fake.call();
|
|
444
|
+
} catch (x) {
|
|
445
|
+
control = x;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
fn.call(Fake.prototype);
|
|
449
|
+
}
|
|
450
|
+
} else {
|
|
451
|
+
try {
|
|
452
|
+
throw Error();
|
|
453
|
+
} catch (x) {
|
|
454
|
+
control = x;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
fn();
|
|
458
|
+
}
|
|
459
|
+
} catch (sample) {
|
|
460
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
461
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
462
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
463
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
464
|
+
var sampleLines = sample.stack.split('\n');
|
|
465
|
+
var controlLines = control.stack.split('\n');
|
|
466
|
+
var s = sampleLines.length - 1;
|
|
467
|
+
var c = controlLines.length - 1;
|
|
468
|
+
|
|
469
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
470
|
+
// We expect at least one stack frame to be shared.
|
|
471
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
472
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
473
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
474
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
475
|
+
// the sample somewhere in the control.
|
|
476
|
+
c--;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
480
|
+
// Next we find the first one that isn't the same which should be the
|
|
481
|
+
// frame that called our sample function and the control.
|
|
482
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
483
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
484
|
+
// If we're about to return the first line, and the control is also on the same
|
|
485
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
486
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
487
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
488
|
+
if (s !== 1 || c !== 1) {
|
|
489
|
+
do {
|
|
490
|
+
s--;
|
|
491
|
+
c--; // We may still have similar intermediate frames from the construct call.
|
|
492
|
+
// The next one that isn't the same should be our match though.
|
|
493
|
+
|
|
494
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
495
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
496
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
497
|
+
// but we have a user-provided "displayName"
|
|
498
|
+
// splice it in to make the stack more readable.
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
502
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
{
|
|
506
|
+
if (typeof fn === 'function') {
|
|
507
|
+
componentFrameCache.set(fn, _frame);
|
|
508
|
+
}
|
|
509
|
+
} // Return the line we found.
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
return _frame;
|
|
513
|
+
}
|
|
514
|
+
} while (s >= 1 && c >= 0);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
break;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
} finally {
|
|
522
|
+
reentry = false;
|
|
523
|
+
|
|
524
|
+
{
|
|
525
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
526
|
+
reenableLogs();
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
530
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
534
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
535
|
+
|
|
536
|
+
{
|
|
537
|
+
if (typeof fn === 'function') {
|
|
538
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return syntheticFrame;
|
|
543
|
+
}
|
|
544
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
545
|
+
{
|
|
546
|
+
return describeNativeComponentFrame(fn, false);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function shouldConstruct(Component) {
|
|
551
|
+
var prototype = Component.prototype;
|
|
552
|
+
return !!(prototype && prototype.isReactComponent);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
556
|
+
|
|
557
|
+
if (type == null) {
|
|
558
|
+
return '';
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (typeof type === 'function') {
|
|
562
|
+
{
|
|
563
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (typeof type === 'string') {
|
|
568
|
+
return describeBuiltInComponentFrame(type);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
switch (type) {
|
|
572
|
+
case REACT_SUSPENSE_TYPE:
|
|
573
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
574
|
+
|
|
575
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
576
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
if (typeof type === 'object') {
|
|
580
|
+
switch (type.$$typeof) {
|
|
581
|
+
case REACT_FORWARD_REF_TYPE:
|
|
582
|
+
return describeFunctionComponentFrame(type.render);
|
|
583
|
+
|
|
584
|
+
case REACT_MEMO_TYPE:
|
|
585
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
586
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
587
|
+
|
|
588
|
+
case REACT_LAZY_TYPE:
|
|
589
|
+
{
|
|
590
|
+
var lazyComponent = type;
|
|
591
|
+
var payload = lazyComponent._payload;
|
|
592
|
+
var init = lazyComponent._init;
|
|
593
|
+
|
|
594
|
+
try {
|
|
595
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
596
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
597
|
+
} catch (x) {}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
return '';
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
606
|
+
|
|
607
|
+
var loggedTypeFailures = {};
|
|
608
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
609
|
+
|
|
610
|
+
function setCurrentlyValidatingElement(element) {
|
|
611
|
+
{
|
|
612
|
+
if (element) {
|
|
613
|
+
var owner = element._owner;
|
|
614
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
615
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
616
|
+
} else {
|
|
617
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
623
|
+
{
|
|
624
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
625
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
626
|
+
|
|
627
|
+
for (var typeSpecName in typeSpecs) {
|
|
628
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
629
|
+
var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
|
|
630
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
631
|
+
// After these have been cleaned up, we'll let them throw.
|
|
632
|
+
|
|
633
|
+
try {
|
|
634
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
635
|
+
// behavior as without this statement except with a better message.
|
|
636
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
637
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
638
|
+
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`.');
|
|
639
|
+
err.name = 'Invariant Violation';
|
|
640
|
+
throw err;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
644
|
+
} catch (ex) {
|
|
645
|
+
error$1 = ex;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
649
|
+
setCurrentlyValidatingElement(element);
|
|
650
|
+
|
|
651
|
+
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, typeof error$1);
|
|
652
|
+
|
|
653
|
+
setCurrentlyValidatingElement(null);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
657
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
658
|
+
// same error.
|
|
659
|
+
loggedTypeFailures[error$1.message] = true;
|
|
660
|
+
setCurrentlyValidatingElement(element);
|
|
661
|
+
|
|
662
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
663
|
+
|
|
664
|
+
setCurrentlyValidatingElement(null);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
672
|
+
|
|
673
|
+
function isArray(a) {
|
|
674
|
+
return isArrayImpl(a);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/*
|
|
678
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
679
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
680
|
+
*
|
|
681
|
+
* The functions in this module will throw an easier-to-understand,
|
|
682
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
683
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
684
|
+
* of the `value` object).
|
|
685
|
+
*/
|
|
686
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
687
|
+
function typeName(value) {
|
|
688
|
+
{
|
|
689
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
690
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
691
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
692
|
+
return type;
|
|
693
|
+
}
|
|
694
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
function willCoercionThrow(value) {
|
|
698
|
+
{
|
|
699
|
+
try {
|
|
700
|
+
testStringCoercion(value);
|
|
701
|
+
return false;
|
|
702
|
+
} catch (e) {
|
|
703
|
+
return true;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function testStringCoercion(value) {
|
|
709
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
710
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
711
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
712
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
713
|
+
//
|
|
714
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
715
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
716
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
717
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
718
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
719
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
720
|
+
//
|
|
721
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
722
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
723
|
+
//
|
|
724
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
725
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
726
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
727
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
728
|
+
// In most cases, this console output also shows the component and its
|
|
729
|
+
// ancestor components where the exception happened.
|
|
730
|
+
//
|
|
731
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
732
|
+
return '' + value;
|
|
733
|
+
}
|
|
734
|
+
function checkKeyStringCoercion(value) {
|
|
735
|
+
{
|
|
736
|
+
if (willCoercionThrow(value)) {
|
|
737
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
738
|
+
|
|
739
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
745
|
+
var RESERVED_PROPS = {
|
|
746
|
+
key: true,
|
|
747
|
+
ref: true,
|
|
748
|
+
__self: true,
|
|
749
|
+
__source: true
|
|
750
|
+
};
|
|
751
|
+
var specialPropKeyWarningShown;
|
|
752
|
+
var specialPropRefWarningShown;
|
|
753
|
+
var didWarnAboutStringRefs;
|
|
754
|
+
|
|
755
|
+
{
|
|
756
|
+
didWarnAboutStringRefs = {};
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function hasValidRef(config) {
|
|
760
|
+
{
|
|
761
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
762
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
763
|
+
|
|
764
|
+
if (getter && getter.isReactWarning) {
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
return config.ref !== undefined;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
function hasValidKey(config) {
|
|
774
|
+
{
|
|
775
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
776
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
777
|
+
|
|
778
|
+
if (getter && getter.isReactWarning) {
|
|
779
|
+
return false;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
return config.key !== undefined;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
788
|
+
{
|
|
789
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
790
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
791
|
+
|
|
792
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
793
|
+
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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
794
|
+
|
|
795
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
802
|
+
{
|
|
803
|
+
var warnAboutAccessingKey = function () {
|
|
804
|
+
if (!specialPropKeyWarningShown) {
|
|
805
|
+
specialPropKeyWarningShown = true;
|
|
806
|
+
|
|
807
|
+
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);
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
812
|
+
Object.defineProperty(props, 'key', {
|
|
813
|
+
get: warnAboutAccessingKey,
|
|
814
|
+
configurable: true
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
820
|
+
{
|
|
821
|
+
var warnAboutAccessingRef = function () {
|
|
822
|
+
if (!specialPropRefWarningShown) {
|
|
823
|
+
specialPropRefWarningShown = true;
|
|
824
|
+
|
|
825
|
+
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);
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
830
|
+
Object.defineProperty(props, 'ref', {
|
|
831
|
+
get: warnAboutAccessingRef,
|
|
832
|
+
configurable: true
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
838
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
839
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
840
|
+
* if something is a React Element.
|
|
841
|
+
*
|
|
842
|
+
* @param {*} type
|
|
843
|
+
* @param {*} props
|
|
844
|
+
* @param {*} key
|
|
845
|
+
* @param {string|object} ref
|
|
846
|
+
* @param {*} owner
|
|
847
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
848
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
849
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
850
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
851
|
+
* change in behavior.
|
|
852
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
853
|
+
* indicating filename, line number, and/or other information.
|
|
854
|
+
* @internal
|
|
855
|
+
*/
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
859
|
+
var element = {
|
|
860
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
861
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
862
|
+
// Built-in properties that belong on the element
|
|
863
|
+
type: type,
|
|
864
|
+
key: key,
|
|
865
|
+
ref: ref,
|
|
866
|
+
props: props,
|
|
867
|
+
// Record the component responsible for creating this element.
|
|
868
|
+
_owner: owner
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
{
|
|
872
|
+
// The validation flag is currently mutative. We put it on
|
|
873
|
+
// an external backing store so that we can freeze the whole object.
|
|
874
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
875
|
+
// commonly used development environments.
|
|
876
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
877
|
+
// the validation flag non-enumerable (where possible, which should
|
|
878
|
+
// include every environment we run tests in), so the test framework
|
|
879
|
+
// ignores it.
|
|
880
|
+
|
|
881
|
+
Object.defineProperty(element._store, 'validated', {
|
|
882
|
+
configurable: false,
|
|
883
|
+
enumerable: false,
|
|
884
|
+
writable: true,
|
|
885
|
+
value: false
|
|
886
|
+
}); // self and source are DEV only properties.
|
|
887
|
+
|
|
888
|
+
Object.defineProperty(element, '_self', {
|
|
889
|
+
configurable: false,
|
|
890
|
+
enumerable: false,
|
|
891
|
+
writable: false,
|
|
892
|
+
value: self
|
|
893
|
+
}); // Two elements created in two different places should be considered
|
|
894
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
895
|
+
|
|
896
|
+
Object.defineProperty(element, '_source', {
|
|
897
|
+
configurable: false,
|
|
898
|
+
enumerable: false,
|
|
899
|
+
writable: false,
|
|
900
|
+
value: source
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
if (Object.freeze) {
|
|
904
|
+
Object.freeze(element.props);
|
|
905
|
+
Object.freeze(element);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return element;
|
|
910
|
+
};
|
|
911
|
+
/**
|
|
912
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
913
|
+
* @param {*} type
|
|
914
|
+
* @param {object} props
|
|
915
|
+
* @param {string} key
|
|
916
|
+
*/
|
|
917
|
+
|
|
918
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
919
|
+
{
|
|
920
|
+
var propName; // Reserved names are extracted
|
|
921
|
+
|
|
922
|
+
var props = {};
|
|
923
|
+
var key = null;
|
|
924
|
+
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
925
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
926
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
927
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
928
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
929
|
+
// key is explicitly declared to be undefined or not.
|
|
930
|
+
|
|
931
|
+
if (maybeKey !== undefined) {
|
|
932
|
+
{
|
|
933
|
+
checkKeyStringCoercion(maybeKey);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
key = '' + maybeKey;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if (hasValidKey(config)) {
|
|
940
|
+
{
|
|
941
|
+
checkKeyStringCoercion(config.key);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
key = '' + config.key;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
if (hasValidRef(config)) {
|
|
948
|
+
ref = config.ref;
|
|
949
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
950
|
+
} // Remaining properties are added to a new props object
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
for (propName in config) {
|
|
954
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
955
|
+
props[propName] = config[propName];
|
|
956
|
+
}
|
|
957
|
+
} // Resolve default props
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
if (type && type.defaultProps) {
|
|
961
|
+
var defaultProps = type.defaultProps;
|
|
962
|
+
|
|
963
|
+
for (propName in defaultProps) {
|
|
964
|
+
if (props[propName] === undefined) {
|
|
965
|
+
props[propName] = defaultProps[propName];
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
if (key || ref) {
|
|
971
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
972
|
+
|
|
973
|
+
if (key) {
|
|
974
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (ref) {
|
|
978
|
+
defineRefPropWarningGetter(props, displayName);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
987
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
988
|
+
|
|
989
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
990
|
+
{
|
|
991
|
+
if (element) {
|
|
992
|
+
var owner = element._owner;
|
|
993
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
994
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
995
|
+
} else {
|
|
996
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
var propTypesMisspellWarningShown;
|
|
1002
|
+
|
|
1003
|
+
{
|
|
1004
|
+
propTypesMisspellWarningShown = false;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Verifies the object is a ReactElement.
|
|
1008
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1009
|
+
* @param {?object} object
|
|
1010
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
1011
|
+
* @final
|
|
1012
|
+
*/
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
function isValidElement(object) {
|
|
1016
|
+
{
|
|
1017
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
function getDeclarationErrorAddendum() {
|
|
1022
|
+
{
|
|
1023
|
+
if (ReactCurrentOwner$1.current) {
|
|
1024
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1025
|
+
|
|
1026
|
+
if (name) {
|
|
1027
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
return '';
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1036
|
+
{
|
|
1037
|
+
if (source !== undefined) {
|
|
1038
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1039
|
+
var lineNumber = source.lineNumber;
|
|
1040
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
return '';
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1048
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
1049
|
+
* updates.
|
|
1050
|
+
*/
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
var ownerHasKeyUseWarning = {};
|
|
1054
|
+
|
|
1055
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1056
|
+
{
|
|
1057
|
+
var info = getDeclarationErrorAddendum();
|
|
1058
|
+
|
|
1059
|
+
if (!info) {
|
|
1060
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1061
|
+
|
|
1062
|
+
if (parentName) {
|
|
1063
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
return info;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1072
|
+
* This element is in an array. The array could grow and shrink or be
|
|
1073
|
+
* reordered. All children that haven't already been validated are required to
|
|
1074
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1075
|
+
* will only be shown once.
|
|
1076
|
+
*
|
|
1077
|
+
* @internal
|
|
1078
|
+
* @param {ReactElement} element Element that requires a key.
|
|
1079
|
+
* @param {*} parentType element's parent's type.
|
|
1080
|
+
*/
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
function validateExplicitKey(element, parentType) {
|
|
1084
|
+
{
|
|
1085
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
element._store.validated = true;
|
|
1090
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1091
|
+
|
|
1092
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1097
|
+
// property, it may be the creator of the child that's responsible for
|
|
1098
|
+
// assigning it a key.
|
|
1099
|
+
|
|
1100
|
+
var childOwner = '';
|
|
1101
|
+
|
|
1102
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1103
|
+
// Give the component that originally created this child.
|
|
1104
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
setCurrentlyValidatingElement$1(element);
|
|
1108
|
+
|
|
1109
|
+
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);
|
|
1110
|
+
|
|
1111
|
+
setCurrentlyValidatingElement$1(null);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Ensure that every element either is passed in a static location, in an
|
|
1116
|
+
* array with an explicit keys property defined, or in an object literal
|
|
1117
|
+
* with valid key property.
|
|
1118
|
+
*
|
|
1119
|
+
* @internal
|
|
1120
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
1121
|
+
* @param {*} parentType node's parent's type.
|
|
1122
|
+
*/
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
function validateChildKeys(node, parentType) {
|
|
1126
|
+
{
|
|
1127
|
+
if (typeof node !== 'object') {
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
if (isArray(node)) {
|
|
1132
|
+
for (var i = 0; i < node.length; i++) {
|
|
1133
|
+
var child = node[i];
|
|
1134
|
+
|
|
1135
|
+
if (isValidElement(child)) {
|
|
1136
|
+
validateExplicitKey(child, parentType);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
} else if (isValidElement(node)) {
|
|
1140
|
+
// This element was passed in a valid location.
|
|
1141
|
+
if (node._store) {
|
|
1142
|
+
node._store.validated = true;
|
|
1143
|
+
}
|
|
1144
|
+
} else if (node) {
|
|
1145
|
+
var iteratorFn = getIteratorFn(node);
|
|
1146
|
+
|
|
1147
|
+
if (typeof iteratorFn === 'function') {
|
|
1148
|
+
// Entry iterators used to provide implicit keys,
|
|
1149
|
+
// but now we print a separate warning for them later.
|
|
1150
|
+
if (iteratorFn !== node.entries) {
|
|
1151
|
+
var iterator = iteratorFn.call(node);
|
|
1152
|
+
var step;
|
|
1153
|
+
|
|
1154
|
+
while (!(step = iterator.next()).done) {
|
|
1155
|
+
if (isValidElement(step.value)) {
|
|
1156
|
+
validateExplicitKey(step.value, parentType);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
1166
|
+
* provided by the type.
|
|
1167
|
+
*
|
|
1168
|
+
* @param {ReactElement} element
|
|
1169
|
+
*/
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
function validatePropTypes(element) {
|
|
1173
|
+
{
|
|
1174
|
+
var type = element.type;
|
|
1175
|
+
|
|
1176
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
var propTypes;
|
|
1181
|
+
|
|
1182
|
+
if (typeof type === 'function') {
|
|
1183
|
+
propTypes = type.propTypes;
|
|
1184
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1185
|
+
// Inner props are checked in the reconciler.
|
|
1186
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1187
|
+
propTypes = type.propTypes;
|
|
1188
|
+
} else {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
if (propTypes) {
|
|
1193
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
1194
|
+
var name = getComponentNameFromType(type);
|
|
1195
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1196
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1197
|
+
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1198
|
+
|
|
1199
|
+
var _name = getComponentNameFromType(type);
|
|
1200
|
+
|
|
1201
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
1205
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1211
|
+
* @param {ReactElement} fragment
|
|
1212
|
+
*/
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
function validateFragmentProps(fragment) {
|
|
1216
|
+
{
|
|
1217
|
+
var keys = Object.keys(fragment.props);
|
|
1218
|
+
|
|
1219
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1220
|
+
var key = keys[i];
|
|
1221
|
+
|
|
1222
|
+
if (key !== 'children' && key !== 'key') {
|
|
1223
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1224
|
+
|
|
1225
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1226
|
+
|
|
1227
|
+
setCurrentlyValidatingElement$1(null);
|
|
1228
|
+
break;
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (fragment.ref !== null) {
|
|
1233
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
1234
|
+
|
|
1235
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1236
|
+
|
|
1237
|
+
setCurrentlyValidatingElement$1(null);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1243
|
+
{
|
|
1244
|
+
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1245
|
+
// succeed and there will likely be errors in render.
|
|
1246
|
+
|
|
1247
|
+
if (!validType) {
|
|
1248
|
+
var info = '';
|
|
1249
|
+
|
|
1250
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
1251
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
var sourceInfo = getSourceInfoErrorAddendum(source);
|
|
1255
|
+
|
|
1256
|
+
if (sourceInfo) {
|
|
1257
|
+
info += sourceInfo;
|
|
1258
|
+
} else {
|
|
1259
|
+
info += getDeclarationErrorAddendum();
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
var typeString;
|
|
1263
|
+
|
|
1264
|
+
if (type === null) {
|
|
1265
|
+
typeString = 'null';
|
|
1266
|
+
} else if (isArray(type)) {
|
|
1267
|
+
typeString = 'array';
|
|
1268
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1269
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1270
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1271
|
+
} else {
|
|
1272
|
+
typeString = typeof type;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
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);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
|
|
1279
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1280
|
+
|
|
1281
|
+
if (element == null) {
|
|
1282
|
+
return element;
|
|
1283
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1284
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1285
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1286
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1287
|
+
// fixed, the key warnings will appear.)
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
if (validType) {
|
|
1291
|
+
var children = props.children;
|
|
1292
|
+
|
|
1293
|
+
if (children !== undefined) {
|
|
1294
|
+
if (isStaticChildren) {
|
|
1295
|
+
if (isArray(children)) {
|
|
1296
|
+
for (var i = 0; i < children.length; i++) {
|
|
1297
|
+
validateChildKeys(children[i], type);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
if (Object.freeze) {
|
|
1301
|
+
Object.freeze(children);
|
|
1302
|
+
}
|
|
1303
|
+
} else {
|
|
1304
|
+
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.');
|
|
1305
|
+
}
|
|
1306
|
+
} else {
|
|
1307
|
+
validateChildKeys(children, type);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1313
|
+
validateFragmentProps(element);
|
|
1314
|
+
} else {
|
|
1315
|
+
validatePropTypes(element);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
return element;
|
|
1319
|
+
}
|
|
1320
|
+
} // These two functions exist to still get child warnings in dev
|
|
1321
|
+
// even with the prod transform. This means that jsxDEV is purely
|
|
1322
|
+
// opt-in behavior for better messages but that we won't stop
|
|
1323
|
+
// giving you warnings if you use production apis.
|
|
1324
|
+
|
|
1325
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
1326
|
+
{
|
|
1327
|
+
return jsxWithValidation(type, props, key, true);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
1331
|
+
{
|
|
1332
|
+
return jsxWithValidation(type, props, key, false);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
|
|
1337
|
+
// for now we can ship identical prod functions
|
|
1338
|
+
|
|
1339
|
+
var jsxs = jsxWithValidationStatic ;
|
|
1340
|
+
|
|
1341
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1342
|
+
reactJsxRuntime_development.jsx = jsx;
|
|
1343
|
+
reactJsxRuntime_development.jsxs = jsxs;
|
|
1344
|
+
})();
|
|
1345
|
+
}
|
|
1346
|
+
return reactJsxRuntime_development;
|
|
2790
1347
|
}
|
|
2791
1348
|
|
|
2792
1349
|
(function (module) {
|
|
2793
1350
|
|
|
2794
1351
|
if (process.env.NODE_ENV === 'production') {
|
|
2795
|
-
module.exports =
|
|
1352
|
+
module.exports = requireReactJsxRuntime_production_min();
|
|
2796
1353
|
} else {
|
|
2797
|
-
module.exports =
|
|
1354
|
+
module.exports = requireReactJsxRuntime_development();
|
|
2798
1355
|
}
|
|
2799
|
-
} (
|
|
2800
|
-
|
|
2801
|
-
var React = /*@__PURE__*/getDefaultExportFromCjs(react.exports);
|
|
1356
|
+
} (jsxRuntime));
|
|
2802
1357
|
|
|
2803
1358
|
function styleInject(css, ref) {
|
|
2804
1359
|
if ( ref === void 0 ) ref = {};
|
|
@@ -4020,10 +2575,10 @@ const getDefaultCountry = (code) => {
|
|
|
4020
2575
|
const getBySearch = (search, onlyCountry, excludeCountry) => {
|
|
4021
2576
|
var countries = [];
|
|
4022
2577
|
if (excludeCountry && excludeCountry.length > 0) {
|
|
4023
|
-
countries = countryData.filter((item) =>
|
|
2578
|
+
countries = countryData.filter((item) => excludeCountry?.indexOf(item.countryCode) === -1);
|
|
4024
2579
|
}
|
|
4025
|
-
else if (onlyCountry &&
|
|
4026
|
-
countries = countryData.filter((item) =>
|
|
2580
|
+
else if (onlyCountry && onlyCountry?.length > 0) {
|
|
2581
|
+
countries = countryData.filter((item) => onlyCountry?.indexOf(item.countryCode) !== -1);
|
|
4027
2582
|
}
|
|
4028
2583
|
else {
|
|
4029
2584
|
countries = countryData;
|
|
@@ -4038,19 +2593,36 @@ const getBySearch = (search, onlyCountry, excludeCountry) => {
|
|
|
4038
2593
|
const getCountryByFilter = (onlyCountry, excludeCountry, preferredCountry) => {
|
|
4039
2594
|
var countries = [];
|
|
4040
2595
|
if (excludeCountry && excludeCountry.length > 0) {
|
|
4041
|
-
countries = countryData.filter((item) =>
|
|
2596
|
+
countries = countryData.filter((item) => excludeCountry?.indexOf(item.countryCode) === -1);
|
|
4042
2597
|
}
|
|
4043
|
-
else if (onlyCountry &&
|
|
4044
|
-
countries = countryData.filter((item) =>
|
|
2598
|
+
else if (onlyCountry && onlyCountry?.length > 0) {
|
|
2599
|
+
countries = countryData.filter((item) => onlyCountry?.indexOf(item.countryCode) !== -1);
|
|
4045
2600
|
}
|
|
4046
2601
|
else {
|
|
4047
2602
|
countries = countryData;
|
|
4048
2603
|
}
|
|
4049
|
-
const result = countries.sort((a, b) => (Number(preferredCountry
|
|
4050
|
-
|| (
|
|
2604
|
+
const result = countries.sort((a, b) => (Number(preferredCountry?.indexOf(b.countryCode)) - Number(preferredCountry?.indexOf(a.countryCode)))
|
|
2605
|
+
|| (preferredCountry?.indexOf(a.countryCode) - preferredCountry?.indexOf(b.countryCode)));
|
|
4051
2606
|
return result;
|
|
4052
2607
|
};
|
|
4053
2608
|
|
|
2609
|
+
function useOnClickOutside(ref, handler) {
|
|
2610
|
+
React.useEffect(() => {
|
|
2611
|
+
const listener = (event) => {
|
|
2612
|
+
if (!ref.current || ref.current.contains(event.target)) {
|
|
2613
|
+
return;
|
|
2614
|
+
}
|
|
2615
|
+
handler(event);
|
|
2616
|
+
};
|
|
2617
|
+
document.addEventListener("mousedown", listener);
|
|
2618
|
+
document.addEventListener("touchstart", listener);
|
|
2619
|
+
return () => {
|
|
2620
|
+
document.removeEventListener("mousedown", listener);
|
|
2621
|
+
document.removeEventListener("touchstart", listener);
|
|
2622
|
+
};
|
|
2623
|
+
}, [ref, handler]);
|
|
2624
|
+
}
|
|
2625
|
+
|
|
4054
2626
|
const PhoneInput = ({ placeholder, country, onChange, value, iconComponent, inputProps, onlyCountries, excludeCountries, preferredCountries, showDropdownIcon = true, dialCodeInputField = false, search = true, searchPlaceholder = "Search country", showSearchIcon = true, searchIconComponent, searchProps, searchNotFound = "Not found" }) => {
|
|
4055
2627
|
const [selected, setSelected] = React.useState({});
|
|
4056
2628
|
const [isDropdown, setDropdown] = React.useState(false);
|
|
@@ -4068,13 +2640,15 @@ const PhoneInput = ({ placeholder, country, onChange, value, iconComponent, inpu
|
|
|
4068
2640
|
onChange(selected.callingCode + onlyNumber);
|
|
4069
2641
|
}
|
|
4070
2642
|
};
|
|
2643
|
+
//
|
|
4071
2644
|
const onSearchHandler = (e) => {
|
|
4072
2645
|
const search = e.target.value;
|
|
4073
2646
|
setCountryData(getBySearch(search, onlyCountries, excludeCountries));
|
|
4074
2647
|
};
|
|
2648
|
+
//
|
|
4075
2649
|
const handleSelected = (item) => {
|
|
4076
2650
|
if (dialCodeInputField) {
|
|
4077
|
-
const result = inputValue
|
|
2651
|
+
const result = inputValue?.replace(selected.callingCode, item.callingCode);
|
|
4078
2652
|
setInputValue(result.length > 0 ? result : item.callingCode);
|
|
4079
2653
|
onChange(result.length > 0 ? result : item.callingCode);
|
|
4080
2654
|
}
|
|
@@ -4084,56 +2658,38 @@ const PhoneInput = ({ placeholder, country, onChange, value, iconComponent, inpu
|
|
|
4084
2658
|
setSelected(item);
|
|
4085
2659
|
setDropdown(false);
|
|
4086
2660
|
};
|
|
2661
|
+
//Custom Hook
|
|
2662
|
+
const ref = React.useRef();
|
|
2663
|
+
useOnClickOutside(ref, () => setDropdown(false));
|
|
2664
|
+
//Effects
|
|
4087
2665
|
React.useMemo(() => {
|
|
4088
2666
|
if (dialCodeInputField) {
|
|
4089
|
-
const result = inputValue
|
|
2667
|
+
const result = inputValue?.replace(selected.callingCode, getDefaultCountry(country).callingCode);
|
|
4090
2668
|
console.log(result);
|
|
4091
2669
|
setInputValue(result.length > 0 ? result : getDefaultCountry(country).callingCode);
|
|
4092
2670
|
}
|
|
4093
2671
|
setSelected(getDefaultCountry(country));
|
|
4094
2672
|
}, [country, dialCodeInputField]);
|
|
2673
|
+
//
|
|
4095
2674
|
React.useMemo(() => {
|
|
4096
2675
|
setCountryData(getCountryByFilter(onlyCountries, excludeCountries, preferredCountries));
|
|
4097
2676
|
}, [onlyCountries, excludeCountries, preferredCountries]);
|
|
4098
|
-
return (
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
showSearchIcon &&
|
|
4113
|
-
React.createElement("div", { className: "simple-phone-input-sri198-search-icon" }, searchIconComponent !== null && searchIconComponent !== void 0 ? searchIconComponent : (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 48 48" },
|
|
4114
|
-
React.createElement("g", { fill: "#616161" },
|
|
4115
|
-
React.createElement("path", { d: "m29.175 31.99l2.828-2.827l12.019 12.019l-2.828 2.827z" }),
|
|
4116
|
-
React.createElement("circle", { cx: "20", cy: "20", r: "16" })),
|
|
4117
|
-
React.createElement("path", { fill: "#37474F", d: "m32.45 35.34l2.827-2.828l8.696 8.696l-2.828 2.828z" }),
|
|
4118
|
-
React.createElement("circle", { cx: "20", cy: "20", r: "13", fill: "#64B5F6" }),
|
|
4119
|
-
React.createElement("path", { fill: "#BBDEFB", d: "M26.9 14.2c-1.7-2-4.2-3.2-6.9-3.2s-5.2 1.2-6.9 3.2c-.4.4-.3 1.1.1 1.4c.4.4 1.1.3 1.4-.1C16 13.9 17.9 13 20 13s4 .9 5.4 2.5c.2.2.5.4.8.4c.2 0 .5-.1.6-.2c.4-.4.4-1.1.1-1.5z" }))))),
|
|
4120
|
-
countryDataInfo.length === 0 &&
|
|
4121
|
-
React.createElement("div", { className: "simple-phone-input-sri198-not-found" }, searchNotFound),
|
|
4122
|
-
countryDataInfo.map((item, i) => (React.createElement("li", { key: i, onClick: () => handleSelected(item), className: item.countryCode === selected.countryCode ? "active" : "" },
|
|
4123
|
-
React.createElement("img", { src: "https://cdn.jsdelivr.net/gh/siamahnaf198/country-flags@main/img/" + item.countryCode + ".svg", alt: item.country, width: "20px" }),
|
|
4124
|
-
React.createElement("span", { className: "simple-phone-input-sri198-dropdown-text" }, item.country),
|
|
4125
|
-
React.createElement("span", { className: "simple-phone-input-sri198-dropdown-country-code" }, item.callingCode)))))),
|
|
4126
|
-
React.createElement("input", Object.assign({ className: "simple-phone-input-sri198-input", placeholder: placeholder, onChange: handleChange, type: "tel", onInput: (e) => {
|
|
4127
|
-
if (dialCodeInputField) {
|
|
4128
|
-
const oldVal = inputValue.slice(selected.callingCode.length);
|
|
4129
|
-
if (e.target.value.startsWith(selected.callingCode)) {
|
|
4130
|
-
e.target.value = e.target.value;
|
|
4131
|
-
}
|
|
4132
|
-
else {
|
|
4133
|
-
e.target.value = selected.callingCode + oldVal;
|
|
2677
|
+
return (jsxRuntime.exports.jsx("div", { className: "simple-phone-input-sri198-container", children: jsxRuntime.exports.jsxs("div", { className: "simple-phone-input-sri198-main", children: [jsxRuntime.exports.jsxs("div", { className: "simple-phone-input-sri198-dropdown-container", ref: ref, children: [jsxRuntime.exports.jsxs("div", { onClick: () => setDropdown(!isDropdown), className: dialCodeInputField ? "simple-phone-input-sri198-dropdown-container-button dial" : "simple-phone-input-sri198-dropdown-container-button", children: [jsxRuntime.exports.jsx("img", { src: "https://cdn.jsdelivr.net/gh/siamahnaf198/country-flags@main/img/" + selected.countryCode + ".svg", alt: selected.country, width: "20px" }), !dialCodeInputField &&
|
|
2678
|
+
jsxRuntime.exports.jsx("span", { className: "simple-phone-input-sri198-selected-code", children: selected.callingCode }), showDropdownIcon &&
|
|
2679
|
+
jsxRuntime.exports.jsx("div", { className: isDropdown ? "simple-phone-input-sri198-dropdown-icon" : "simple-phone-input-sri198-dropdown-icon active", children: iconComponent ? iconComponent : (jsxRuntime.exports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 24 24", children: jsxRuntime.exports.jsx("path", { fill: "currentColor", d: "m7 10l5 5l5-5z" }) })) })] }), jsxRuntime.exports.jsxs("ul", { className: isDropdown ? "simple-phone-input-sri198-dropdown active" : "simple-phone-input-sri198-dropdown", children: [search &&
|
|
2680
|
+
jsxRuntime.exports.jsxs("div", { className: "simple-phone-input-sri198-search-container", children: [jsxRuntime.exports.jsx("input", { placeholder: searchPlaceholder, ...searchProps, onChange: onSearchHandler }), showSearchIcon &&
|
|
2681
|
+
jsxRuntime.exports.jsx("div", { className: "simple-phone-input-sri198-search-icon", children: searchIconComponent ?? (jsxRuntime.exports.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", preserveAspectRatio: "xMidYMid meet", viewBox: "0 0 48 48", children: [jsxRuntime.exports.jsxs("g", { fill: "#616161", children: [jsxRuntime.exports.jsx("path", { d: "m29.175 31.99l2.828-2.827l12.019 12.019l-2.828 2.827z" }), jsxRuntime.exports.jsx("circle", { cx: "20", cy: "20", r: "16" })] }), jsxRuntime.exports.jsx("path", { fill: "#37474F", d: "m32.45 35.34l2.827-2.828l8.696 8.696l-2.828 2.828z" }), jsxRuntime.exports.jsx("circle", { cx: "20", cy: "20", r: "13", fill: "#64B5F6" }), jsxRuntime.exports.jsx("path", { fill: "#BBDEFB", d: "M26.9 14.2c-1.7-2-4.2-3.2-6.9-3.2s-5.2 1.2-6.9 3.2c-.4.4-.3 1.1.1 1.4c.4.4 1.1.3 1.4-.1C16 13.9 17.9 13 20 13s4 .9 5.4 2.5c.2.2.5.4.8.4c.2 0 .5-.1.6-.2c.4-.4.4-1.1.1-1.5z" })] })) })] }), countryDataInfo.length === 0 &&
|
|
2682
|
+
jsxRuntime.exports.jsx("div", { className: "simple-phone-input-sri198-not-found", children: searchNotFound }), countryDataInfo.map((item, i) => (jsxRuntime.exports.jsxs("li", { onClick: () => handleSelected(item), className: item.countryCode === selected.countryCode ? "active" : "", children: [jsxRuntime.exports.jsx("img", { src: "https://cdn.jsdelivr.net/gh/siamahnaf198/country-flags@main/img/" + item.countryCode + ".svg", alt: item.country, width: "20px" }), jsxRuntime.exports.jsx("span", { className: "simple-phone-input-sri198-dropdown-text", children: item.country }), jsxRuntime.exports.jsx("span", { className: "simple-phone-input-sri198-dropdown-country-code", children: item.callingCode })] }, i)))] })] }), jsxRuntime.exports.jsx("input", { className: "simple-phone-input-sri198-input", placeholder: placeholder, onChange: handleChange, type: "tel", onInput: (e) => {
|
|
2683
|
+
if (dialCodeInputField) {
|
|
2684
|
+
const oldVal = inputValue.slice(selected.callingCode.length);
|
|
2685
|
+
if (e.target.value.startsWith(selected.callingCode)) {
|
|
2686
|
+
e.target.value = e.target.value;
|
|
2687
|
+
}
|
|
2688
|
+
else {
|
|
2689
|
+
e.target.value = selected.callingCode + oldVal;
|
|
2690
|
+
}
|
|
4134
2691
|
}
|
|
4135
|
-
}
|
|
4136
|
-
}, value: inputValue }, inputProps)))));
|
|
2692
|
+
}, value: inputValue, ...inputProps })] }) }));
|
|
4137
2693
|
};
|
|
4138
2694
|
|
|
4139
2695
|
export { PhoneInput };
|