react 19.0.0-rc-20b6f4c0e8-20240607 → 19.0.0-rc-a532d91d01-20240610
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/cjs/react-compiler-runtime.development.js +36 -81
- package/cjs/react-jsx-dev-runtime.development.js +643 -1225
- package/cjs/react-jsx-dev-runtime.react-server.development.js +654 -1260
- package/cjs/react-jsx-runtime.development.js +639 -1243
- package/cjs/react-jsx-runtime.react-server.development.js +654 -1260
- package/cjs/react.development.js +1507 -2761
- package/cjs/react.production.js +1 -1
- package/cjs/react.react-server.development.js +1093 -2047
- package/cjs/react.react-server.production.js +1 -1
- package/package.json +1 -1
@@ -8,2095 +8,1141 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
23
|
-
// as a normal prop instead of stripping it from the props object.
|
24
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
25
|
-
// during element creation.
|
26
|
-
|
27
|
-
var enableRefAsProp = true;
|
28
|
-
|
29
|
-
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
30
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
31
|
-
// issues in DEV builds.
|
32
|
-
|
33
|
-
var enableDebugTracing = false;
|
34
|
-
|
35
|
-
var ReactSharedInternals = {
|
36
|
-
H: null,
|
37
|
-
A: null
|
38
|
-
};
|
39
|
-
|
40
|
-
{
|
41
|
-
// Stack implementation injected by the current renderer.
|
42
|
-
ReactSharedInternals.getCurrentStack = null;
|
43
|
-
}
|
44
|
-
|
45
|
-
// by calls to these methods by a Babel plugin.
|
46
|
-
//
|
47
|
-
// In PROD (or in packages without access to React internals),
|
48
|
-
// they are left as they are instead.
|
49
|
-
|
50
|
-
function warn(format) {
|
51
|
-
{
|
52
|
-
{
|
53
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
11
|
+
"use strict";
|
12
|
+
"production" !== process.env.NODE_ENV &&
|
13
|
+
(function () {
|
14
|
+
function warn(format) {
|
15
|
+
for (
|
16
|
+
var _len = arguments.length,
|
17
|
+
args = Array(1 < _len ? _len - 1 : 0),
|
18
|
+
_key = 1;
|
19
|
+
_key < _len;
|
20
|
+
_key++
|
21
|
+
)
|
54
22
|
args[_key - 1] = arguments[_key];
|
55
|
-
|
56
|
-
|
57
|
-
printWarning('warn', format, args, new Error('react-stack-top-frame'));
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
function error(format) {
|
62
|
-
{
|
63
|
-
{
|
64
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
65
|
-
args[_key2 - 1] = arguments[_key2];
|
66
|
-
}
|
67
|
-
|
68
|
-
printWarning('error', format, args, new Error('react-stack-top-frame'));
|
69
|
-
}
|
70
|
-
}
|
71
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
72
|
-
|
73
|
-
function printWarning(level, format, args, currentStack) {
|
74
|
-
// When changing this logic, you might want to also
|
75
|
-
// update consoleWithStackDev.www.js as well.
|
76
|
-
{
|
77
|
-
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
|
78
|
-
|
79
|
-
if (ReactSharedInternals.getCurrentStack) {
|
80
|
-
// We only add the current stack to the console when createTask is not supported.
|
81
|
-
// Since createTask requires DevTools to be open to work, this means that stacks
|
82
|
-
// can be lost while DevTools isn't open but we can't detect this.
|
83
|
-
var stack = ReactSharedInternals.getCurrentStack(currentStack);
|
84
|
-
|
85
|
-
if (stack !== '') {
|
86
|
-
format += '%s';
|
87
|
-
args = args.concat([stack]);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
if (isErrorLogger) {
|
92
|
-
// Don't prefix our default logging formatting in ReactFiberErrorLoggger.
|
93
|
-
// Don't toString the arguments.
|
94
|
-
args.unshift(format);
|
95
|
-
} else {
|
96
|
-
// TODO: Remove this prefix and stop toStringing in the wrapper and
|
97
|
-
// instead do it at each callsite as needed.
|
98
|
-
// Careful: RN currently depends on this prefix
|
99
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
100
|
-
args = args.map(function (item) {
|
101
|
-
return String(item);
|
102
|
-
});
|
103
|
-
args.unshift('Warning: ' + format);
|
104
|
-
} // We intentionally don't use spread (or .apply) directly because it
|
105
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
106
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
107
|
-
|
108
|
-
|
109
|
-
Function.prototype.apply.call(console[level], console, args);
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
114
|
-
|
115
|
-
function isArray(a) {
|
116
|
-
return isArrayImpl(a);
|
117
|
-
}
|
118
|
-
|
119
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
120
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
121
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
122
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
123
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
124
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
125
|
-
|
126
|
-
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
127
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
128
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
129
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
130
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
131
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
132
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
133
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
134
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
135
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
136
|
-
function getIteratorFn(maybeIterable) {
|
137
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
138
|
-
return null;
|
139
|
-
}
|
140
|
-
|
141
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
142
|
-
|
143
|
-
if (typeof maybeIterator === 'function') {
|
144
|
-
return maybeIterator;
|
145
|
-
}
|
146
|
-
|
147
|
-
return null;
|
148
|
-
}
|
149
|
-
|
150
|
-
/*
|
151
|
-
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
152
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
153
|
-
*
|
154
|
-
* The functions in this module will throw an easier-to-understand,
|
155
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
156
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
157
|
-
* of the `value` object).
|
158
|
-
*/
|
159
|
-
// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
160
|
-
function typeName(value) {
|
161
|
-
{
|
162
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
163
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
164
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
|
165
|
-
|
166
|
-
return type;
|
167
|
-
}
|
168
|
-
} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
169
|
-
|
170
|
-
|
171
|
-
function willCoercionThrow(value) {
|
172
|
-
{
|
173
|
-
try {
|
174
|
-
testStringCoercion(value);
|
175
|
-
return false;
|
176
|
-
} catch (e) {
|
177
|
-
return true;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
function testStringCoercion(value) {
|
183
|
-
// If you ended up here by following an exception call stack, here's what's
|
184
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
185
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
186
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
187
|
-
//
|
188
|
-
// The most common types that will cause this exception are `Symbol` instances
|
189
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
190
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
191
|
-
// exception. (Library authors do this to prevent users from using built-in
|
192
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
193
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
194
|
-
//
|
195
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
196
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
197
|
-
//
|
198
|
-
// To find which value is throwing, check the browser or debugger console.
|
199
|
-
// Before this exception was thrown, there should be `console.error` output
|
200
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
201
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
202
|
-
// In most cases, this console output also shows the component and its
|
203
|
-
// ancestor components where the exception happened.
|
204
|
-
//
|
205
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
206
|
-
return '' + value;
|
207
|
-
}
|
208
|
-
function checkKeyStringCoercion(value) {
|
209
|
-
{
|
210
|
-
if (willCoercionThrow(value)) {
|
211
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
|
212
|
-
|
213
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
219
|
-
var displayName = outerType.displayName;
|
220
|
-
|
221
|
-
if (displayName) {
|
222
|
-
return displayName;
|
223
|
-
}
|
224
|
-
|
225
|
-
var functionName = innerType.displayName || innerType.name || '';
|
226
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
227
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
228
|
-
|
229
|
-
|
230
|
-
function getContextName(type) {
|
231
|
-
return type.displayName || 'Context';
|
232
|
-
}
|
233
|
-
|
234
|
-
var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
235
|
-
|
236
|
-
function getComponentNameFromType(type) {
|
237
|
-
if (type == null) {
|
238
|
-
// Host root, text node or just invalid type.
|
239
|
-
return null;
|
240
|
-
}
|
241
|
-
|
242
|
-
if (typeof type === 'function') {
|
243
|
-
if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
|
244
|
-
// TODO: Create a convention for naming client references with debug info.
|
245
|
-
return null;
|
246
|
-
}
|
247
|
-
|
248
|
-
return type.displayName || type.name || null;
|
249
|
-
}
|
250
|
-
|
251
|
-
if (typeof type === 'string') {
|
252
|
-
return type;
|
253
|
-
}
|
254
|
-
|
255
|
-
switch (type) {
|
256
|
-
case REACT_FRAGMENT_TYPE:
|
257
|
-
return 'Fragment';
|
258
|
-
|
259
|
-
case REACT_PORTAL_TYPE:
|
260
|
-
return 'Portal';
|
261
|
-
|
262
|
-
case REACT_PROFILER_TYPE:
|
263
|
-
return 'Profiler';
|
264
|
-
|
265
|
-
case REACT_STRICT_MODE_TYPE:
|
266
|
-
return 'StrictMode';
|
267
|
-
|
268
|
-
case REACT_SUSPENSE_TYPE:
|
269
|
-
return 'Suspense';
|
270
|
-
|
271
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
272
|
-
return 'SuspenseList';
|
273
|
-
|
274
|
-
}
|
275
|
-
|
276
|
-
if (typeof type === 'object') {
|
277
|
-
{
|
278
|
-
if (typeof type.tag === 'number') {
|
279
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
switch (type.$$typeof) {
|
284
|
-
case REACT_PROVIDER_TYPE:
|
285
|
-
{
|
286
|
-
return null;
|
287
|
-
}
|
288
|
-
|
289
|
-
case REACT_CONTEXT_TYPE:
|
290
|
-
var context = type;
|
291
|
-
|
292
|
-
{
|
293
|
-
return getContextName(context) + '.Provider';
|
294
|
-
}
|
295
|
-
|
296
|
-
case REACT_CONSUMER_TYPE:
|
297
|
-
{
|
298
|
-
var consumer = type;
|
299
|
-
return getContextName(consumer._context) + '.Consumer';
|
300
|
-
}
|
301
|
-
|
302
|
-
case REACT_FORWARD_REF_TYPE:
|
303
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
304
|
-
|
305
|
-
case REACT_MEMO_TYPE:
|
306
|
-
var outerName = type.displayName || null;
|
307
|
-
|
308
|
-
if (outerName !== null) {
|
309
|
-
return outerName;
|
310
|
-
}
|
311
|
-
|
312
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
313
|
-
|
314
|
-
case REACT_LAZY_TYPE:
|
315
|
-
{
|
316
|
-
var lazyComponent = type;
|
317
|
-
var payload = lazyComponent._payload;
|
318
|
-
var init = lazyComponent._init;
|
319
|
-
|
320
|
-
try {
|
321
|
-
return getComponentNameFromType(init(payload));
|
322
|
-
} catch (x) {
|
323
|
-
return null;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
}
|
327
|
-
}
|
328
|
-
|
329
|
-
return null;
|
330
|
-
}
|
331
|
-
|
332
|
-
// $FlowFixMe[method-unbinding]
|
333
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
334
|
-
|
335
|
-
var assign = Object.assign;
|
336
|
-
|
337
|
-
var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
|
338
|
-
// TODO: Delete this when enableOwnerStacks ships.
|
339
|
-
|
340
|
-
function isValidElementType(type) {
|
341
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
342
|
-
return true;
|
343
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
344
|
-
|
345
|
-
|
346
|
-
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 || enableTransitionTracing ) {
|
347
|
-
return true;
|
348
|
-
}
|
349
|
-
|
350
|
-
if (typeof type === 'object' && type !== null) {
|
351
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
352
|
-
// types supported by any Flight configuration anywhere since
|
353
|
-
// we don't know which Flight build this will end up being used
|
354
|
-
// with.
|
355
|
-
type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
|
356
|
-
return true;
|
357
|
-
}
|
358
|
-
}
|
359
|
-
|
360
|
-
return false;
|
361
|
-
}
|
362
|
-
|
363
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
364
|
-
// replaying on render function. This currently only patches the object
|
365
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
366
|
-
// We could also eagerly patch the method.
|
367
|
-
var disabledDepth = 0;
|
368
|
-
var prevLog;
|
369
|
-
var prevInfo;
|
370
|
-
var prevWarn;
|
371
|
-
var prevError;
|
372
|
-
var prevGroup;
|
373
|
-
var prevGroupCollapsed;
|
374
|
-
var prevGroupEnd;
|
375
|
-
|
376
|
-
function disabledLog() {}
|
377
|
-
|
378
|
-
disabledLog.__reactDisabledLog = true;
|
379
|
-
function disableLogs() {
|
380
|
-
{
|
381
|
-
if (disabledDepth === 0) {
|
382
|
-
/* eslint-disable react-internal/no-production-logging */
|
383
|
-
prevLog = console.log;
|
384
|
-
prevInfo = console.info;
|
385
|
-
prevWarn = console.warn;
|
386
|
-
prevError = console.error;
|
387
|
-
prevGroup = console.group;
|
388
|
-
prevGroupCollapsed = console.groupCollapsed;
|
389
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
390
|
-
|
391
|
-
var props = {
|
392
|
-
configurable: true,
|
393
|
-
enumerable: true,
|
394
|
-
value: disabledLog,
|
395
|
-
writable: true
|
396
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
397
|
-
|
398
|
-
Object.defineProperties(console, {
|
399
|
-
info: props,
|
400
|
-
log: props,
|
401
|
-
warn: props,
|
402
|
-
error: props,
|
403
|
-
group: props,
|
404
|
-
groupCollapsed: props,
|
405
|
-
groupEnd: props
|
406
|
-
});
|
407
|
-
/* eslint-enable react-internal/no-production-logging */
|
408
|
-
}
|
409
|
-
|
410
|
-
disabledDepth++;
|
411
|
-
}
|
412
|
-
}
|
413
|
-
function reenableLogs() {
|
414
|
-
{
|
415
|
-
disabledDepth--;
|
416
|
-
|
417
|
-
if (disabledDepth === 0) {
|
418
|
-
/* eslint-disable react-internal/no-production-logging */
|
419
|
-
var props = {
|
420
|
-
configurable: true,
|
421
|
-
enumerable: true,
|
422
|
-
writable: true
|
423
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
424
|
-
|
425
|
-
Object.defineProperties(console, {
|
426
|
-
log: assign({}, props, {
|
427
|
-
value: prevLog
|
428
|
-
}),
|
429
|
-
info: assign({}, props, {
|
430
|
-
value: prevInfo
|
431
|
-
}),
|
432
|
-
warn: assign({}, props, {
|
433
|
-
value: prevWarn
|
434
|
-
}),
|
435
|
-
error: assign({}, props, {
|
436
|
-
value: prevError
|
437
|
-
}),
|
438
|
-
group: assign({}, props, {
|
439
|
-
value: prevGroup
|
440
|
-
}),
|
441
|
-
groupCollapsed: assign({}, props, {
|
442
|
-
value: prevGroupCollapsed
|
443
|
-
}),
|
444
|
-
groupEnd: assign({}, props, {
|
445
|
-
value: prevGroupEnd
|
446
|
-
})
|
447
|
-
});
|
448
|
-
/* eslint-enable react-internal/no-production-logging */
|
449
|
-
}
|
450
|
-
|
451
|
-
if (disabledDepth < 0) {
|
452
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
453
|
-
}
|
454
|
-
}
|
455
|
-
}
|
456
|
-
|
457
|
-
var prefix;
|
458
|
-
function describeBuiltInComponentFrame(name) {
|
459
|
-
{
|
460
|
-
if (prefix === undefined) {
|
461
|
-
// Extract the VM specific prefix used by each line.
|
462
|
-
try {
|
463
|
-
throw Error();
|
464
|
-
} catch (x) {
|
465
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
466
|
-
prefix = match && match[1] || '';
|
467
|
-
}
|
468
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
469
|
-
|
470
|
-
|
471
|
-
return '\n' + prefix + name;
|
472
|
-
}
|
473
|
-
}
|
474
|
-
var reentry = false;
|
475
|
-
var componentFrameCache;
|
476
|
-
|
477
|
-
{
|
478
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
479
|
-
componentFrameCache = new PossiblyWeakMap();
|
480
|
-
}
|
481
|
-
/**
|
482
|
-
* Leverages native browser/VM stack frames to get proper details (e.g.
|
483
|
-
* filename, line + col number) for a single component in a component stack. We
|
484
|
-
* do this by:
|
485
|
-
* (1) throwing and catching an error in the function - this will be our
|
486
|
-
* control error.
|
487
|
-
* (2) calling the component which will eventually throw an error that we'll
|
488
|
-
* catch - this will be our sample error.
|
489
|
-
* (3) diffing the control and sample error stacks to find the stack frame
|
490
|
-
* which represents our component.
|
491
|
-
*/
|
492
|
-
|
493
|
-
|
494
|
-
function describeNativeComponentFrame(fn, construct) {
|
495
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
496
|
-
if (!fn || reentry) {
|
497
|
-
return '';
|
498
|
-
}
|
499
|
-
|
500
|
-
{
|
501
|
-
var frame = componentFrameCache.get(fn);
|
502
|
-
|
503
|
-
if (frame !== undefined) {
|
504
|
-
return frame;
|
505
|
-
}
|
506
|
-
}
|
507
|
-
|
508
|
-
reentry = true;
|
509
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
|
510
|
-
|
511
|
-
Error.prepareStackTrace = undefined;
|
512
|
-
var previousDispatcher = null;
|
513
|
-
|
514
|
-
{
|
515
|
-
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
|
516
|
-
// for warnings.
|
517
|
-
|
518
|
-
ReactSharedInternals.H = null;
|
519
|
-
disableLogs();
|
520
|
-
}
|
521
|
-
/**
|
522
|
-
* Finding a common stack frame between sample and control errors can be
|
523
|
-
* tricky given the different types and levels of stack trace truncation from
|
524
|
-
* different JS VMs. So instead we'll attempt to control what that common
|
525
|
-
* frame should be through this object method:
|
526
|
-
* Having both the sample and control errors be in the function under the
|
527
|
-
* `DescribeNativeComponentFrameRoot` property, + setting the `name` and
|
528
|
-
* `displayName` properties of the function ensures that a stack
|
529
|
-
* frame exists that has the method name `DescribeNativeComponentFrameRoot` in
|
530
|
-
* it for both control and sample stacks.
|
531
|
-
*/
|
532
|
-
|
533
|
-
|
534
|
-
var RunInRootFrame = {
|
535
|
-
DetermineComponentFrameRoot: function () {
|
536
|
-
var control;
|
537
|
-
|
538
|
-
try {
|
539
|
-
// This should throw.
|
540
|
-
if (construct) {
|
541
|
-
// Something should be setting the props in the constructor.
|
542
|
-
var Fake = function () {
|
543
|
-
throw Error();
|
544
|
-
}; // $FlowFixMe[prop-missing]
|
545
|
-
|
546
|
-
|
547
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
548
|
-
set: function () {
|
549
|
-
// We use a throwing setter instead of frozen or non-writable props
|
550
|
-
// because that won't throw in a non-strict mode function.
|
551
|
-
throw Error();
|
552
|
-
}
|
553
|
-
});
|
554
|
-
|
555
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
556
|
-
// We construct a different control for this case to include any extra
|
557
|
-
// frames added by the construct call.
|
558
|
-
try {
|
559
|
-
Reflect.construct(Fake, []);
|
560
|
-
} catch (x) {
|
561
|
-
control = x;
|
562
|
-
}
|
563
|
-
|
564
|
-
Reflect.construct(fn, [], Fake);
|
565
|
-
} else {
|
566
|
-
try {
|
567
|
-
Fake.call();
|
568
|
-
} catch (x) {
|
569
|
-
control = x;
|
570
|
-
} // $FlowFixMe[prop-missing] found when upgrading Flow
|
571
|
-
|
572
|
-
|
573
|
-
fn.call(Fake.prototype);
|
574
|
-
}
|
575
|
-
} else {
|
576
|
-
try {
|
577
|
-
throw Error();
|
578
|
-
} catch (x) {
|
579
|
-
control = x;
|
580
|
-
} // TODO(luna): This will currently only throw if the function component
|
581
|
-
// tries to access React/ReactDOM/props. We should probably make this throw
|
582
|
-
// in simple components too
|
583
|
-
|
584
|
-
|
585
|
-
var maybePromise = fn(); // If the function component returns a promise, it's likely an async
|
586
|
-
// component, which we don't yet support. Attach a noop catch handler to
|
587
|
-
// silence the error.
|
588
|
-
// TODO: Implement component stacks for async client components?
|
589
|
-
|
590
|
-
if (maybePromise && typeof maybePromise.catch === 'function') {
|
591
|
-
maybePromise.catch(function () {});
|
592
|
-
}
|
593
|
-
}
|
594
|
-
} catch (sample) {
|
595
|
-
// This is inlined manually because closure doesn't do it for us.
|
596
|
-
if (sample && control && typeof sample.stack === 'string') {
|
597
|
-
return [sample.stack, control.stack];
|
598
|
-
}
|
599
|
-
}
|
600
|
-
|
601
|
-
return [null, null];
|
602
|
-
}
|
603
|
-
}; // $FlowFixMe[prop-missing]
|
604
|
-
|
605
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';
|
606
|
-
var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.
|
607
|
-
|
608
|
-
if (namePropDescriptor && namePropDescriptor.configurable) {
|
609
|
-
// V8 utilizes a function's `name` property when generating a stack trace.
|
610
|
-
Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor
|
611
|
-
// is set to `false`.
|
612
|
-
// $FlowFixMe[cannot-write]
|
613
|
-
'name', {
|
614
|
-
value: 'DetermineComponentFrameRoot'
|
615
|
-
});
|
616
|
-
}
|
617
|
-
|
618
|
-
try {
|
619
|
-
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
|
620
|
-
sampleStack = _RunInRootFrame$Deter[0],
|
621
|
-
controlStack = _RunInRootFrame$Deter[1];
|
622
|
-
|
623
|
-
if (sampleStack && controlStack) {
|
624
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
625
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
626
|
-
var sampleLines = sampleStack.split('\n');
|
627
|
-
var controlLines = controlStack.split('\n');
|
628
|
-
var s = 0;
|
629
|
-
var c = 0;
|
630
|
-
|
631
|
-
while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
|
632
|
-
s++;
|
633
|
-
}
|
634
|
-
|
635
|
-
while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
|
636
|
-
c++;
|
637
|
-
} // We couldn't find our intentionally injected common root frame, attempt
|
638
|
-
// to find another common root frame by search from the bottom of the
|
639
|
-
// control stack...
|
640
|
-
|
641
|
-
|
642
|
-
if (s === sampleLines.length || c === controlLines.length) {
|
643
|
-
s = sampleLines.length - 1;
|
644
|
-
c = controlLines.length - 1;
|
645
|
-
|
646
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
647
|
-
// We expect at least one stack frame to be shared.
|
648
|
-
// Typically this will be the root most one. However, stack frames may be
|
649
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
650
|
-
// earlier than the other. We assume that the sample is longer or the same
|
651
|
-
// and there for cut off earlier. So we should find the root most frame in
|
652
|
-
// the sample somewhere in the control.
|
653
|
-
c--;
|
654
|
-
}
|
655
|
-
}
|
656
|
-
|
657
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
658
|
-
// Next we find the first one that isn't the same which should be the
|
659
|
-
// frame that called our sample function and the control.
|
660
|
-
if (sampleLines[s] !== controlLines[c]) {
|
661
|
-
// In V8, the first line is describing the message but other VMs don't.
|
662
|
-
// If we're about to return the first line, and the control is also on the same
|
663
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
664
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
665
|
-
// This can happen if you passed a class to function component, or non-function.
|
666
|
-
if (s !== 1 || c !== 1) {
|
667
|
-
do {
|
668
|
-
s--;
|
669
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
670
|
-
// The next one that isn't the same should be our match though.
|
671
|
-
|
672
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
673
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
674
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
675
|
-
// but we have a user-provided "displayName"
|
676
|
-
// splice it in to make the stack more readable.
|
677
|
-
|
678
|
-
|
679
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
680
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
681
|
-
}
|
682
|
-
|
683
|
-
if (true) {
|
684
|
-
if (typeof fn === 'function') {
|
685
|
-
componentFrameCache.set(fn, _frame);
|
686
|
-
}
|
687
|
-
} // Return the line we found.
|
688
|
-
|
689
|
-
|
690
|
-
return _frame;
|
691
|
-
}
|
692
|
-
} while (s >= 1 && c >= 0);
|
693
|
-
}
|
694
|
-
|
695
|
-
break;
|
696
|
-
}
|
697
|
-
}
|
23
|
+
printWarning("warn", format, args, Error("react-stack-top-frame"));
|
698
24
|
}
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
var name = fn ? fn.displayName || fn.name : '';
|
712
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
713
|
-
|
714
|
-
{
|
715
|
-
if (typeof fn === 'function') {
|
716
|
-
componentFrameCache.set(fn, syntheticFrame);
|
717
|
-
}
|
718
|
-
}
|
719
|
-
|
720
|
-
return syntheticFrame;
|
721
|
-
}
|
722
|
-
function describeFunctionComponentFrame(fn) {
|
723
|
-
{
|
724
|
-
return describeNativeComponentFrame(fn, false);
|
725
|
-
}
|
726
|
-
}
|
727
|
-
|
728
|
-
function shouldConstruct(Component) {
|
729
|
-
var prototype = Component.prototype;
|
730
|
-
return !!(prototype && prototype.isReactComponent);
|
731
|
-
} // TODO: Delete this once the key warning no longer uses it. I.e. when enableOwnerStacks ship.
|
732
|
-
|
733
|
-
|
734
|
-
function describeUnknownElementTypeFrameInDEV(type) {
|
735
|
-
|
736
|
-
if (type == null) {
|
737
|
-
return '';
|
738
|
-
}
|
739
|
-
|
740
|
-
if (typeof type === 'function') {
|
741
|
-
{
|
742
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
743
|
-
}
|
744
|
-
}
|
745
|
-
|
746
|
-
if (typeof type === 'string') {
|
747
|
-
return describeBuiltInComponentFrame(type);
|
748
|
-
}
|
749
|
-
|
750
|
-
switch (type) {
|
751
|
-
case REACT_SUSPENSE_TYPE:
|
752
|
-
return describeBuiltInComponentFrame('Suspense');
|
753
|
-
|
754
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
755
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
756
|
-
}
|
757
|
-
|
758
|
-
if (typeof type === 'object') {
|
759
|
-
switch (type.$$typeof) {
|
760
|
-
case REACT_FORWARD_REF_TYPE:
|
761
|
-
return describeFunctionComponentFrame(type.render);
|
762
|
-
|
763
|
-
case REACT_MEMO_TYPE:
|
764
|
-
// Memo may contain any component type so we recursively resolve it.
|
765
|
-
return describeUnknownElementTypeFrameInDEV(type.type);
|
766
|
-
|
767
|
-
case REACT_LAZY_TYPE:
|
768
|
-
{
|
769
|
-
var lazyComponent = type;
|
770
|
-
var payload = lazyComponent._payload;
|
771
|
-
var init = lazyComponent._init;
|
772
|
-
|
773
|
-
try {
|
774
|
-
// Lazy may contain any component type so we recursively resolve it.
|
775
|
-
return describeUnknownElementTypeFrameInDEV(init(payload));
|
776
|
-
} catch (x) {}
|
777
|
-
}
|
778
|
-
}
|
779
|
-
}
|
780
|
-
|
781
|
-
return '';
|
782
|
-
}
|
783
|
-
|
784
|
-
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
785
|
-
|
786
|
-
function getOwner() {
|
787
|
-
{
|
788
|
-
var dispatcher = ReactSharedInternals.A;
|
789
|
-
|
790
|
-
if (dispatcher === null) {
|
791
|
-
return null;
|
792
|
-
}
|
793
|
-
|
794
|
-
return dispatcher.getOwner();
|
795
|
-
}
|
796
|
-
}
|
797
|
-
|
798
|
-
var specialPropKeyWarningShown;
|
799
|
-
var didWarnAboutElementRef;
|
800
|
-
var didWarnAboutOldJSXRuntime;
|
801
|
-
|
802
|
-
{
|
803
|
-
didWarnAboutElementRef = {};
|
804
|
-
}
|
805
|
-
|
806
|
-
function hasValidRef(config) {
|
807
|
-
{
|
808
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
809
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
810
|
-
|
811
|
-
if (getter && getter.isReactWarning) {
|
812
|
-
return false;
|
813
|
-
}
|
814
|
-
}
|
815
|
-
}
|
816
|
-
|
817
|
-
return config.ref !== undefined;
|
818
|
-
}
|
819
|
-
|
820
|
-
function hasValidKey(config) {
|
821
|
-
{
|
822
|
-
if (hasOwnProperty.call(config, 'key')) {
|
823
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
824
|
-
|
825
|
-
if (getter && getter.isReactWarning) {
|
826
|
-
return false;
|
827
|
-
}
|
828
|
-
}
|
829
|
-
}
|
830
|
-
|
831
|
-
return config.key !== undefined;
|
832
|
-
}
|
833
|
-
|
834
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
835
|
-
{
|
836
|
-
var warnAboutAccessingKey = function () {
|
837
|
-
if (!specialPropKeyWarningShown) {
|
838
|
-
specialPropKeyWarningShown = true;
|
839
|
-
|
840
|
-
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://react.dev/link/special-props)', displayName);
|
841
|
-
}
|
842
|
-
};
|
843
|
-
|
844
|
-
warnAboutAccessingKey.isReactWarning = true;
|
845
|
-
Object.defineProperty(props, 'key', {
|
846
|
-
get: warnAboutAccessingKey,
|
847
|
-
configurable: true
|
848
|
-
});
|
849
|
-
}
|
850
|
-
}
|
851
|
-
|
852
|
-
function elementRefGetterWithDeprecationWarning() {
|
853
|
-
{
|
854
|
-
var componentName = getComponentNameFromType(this.type);
|
855
|
-
|
856
|
-
if (!didWarnAboutElementRef[componentName]) {
|
857
|
-
didWarnAboutElementRef[componentName] = true;
|
858
|
-
|
859
|
-
error('Accessing element.ref was removed in React 19. ref is now a ' + 'regular prop. It will be removed from the JSX Element ' + 'type in a future release.');
|
860
|
-
} // An undefined `element.ref` is coerced to `null` for
|
861
|
-
// backwards compatibility.
|
862
|
-
|
863
|
-
|
864
|
-
var refProp = this.props.ref;
|
865
|
-
return refProp !== undefined ? refProp : null;
|
866
|
-
}
|
867
|
-
}
|
868
|
-
/**
|
869
|
-
* Factory method to create a new React element. This no longer adheres to
|
870
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
871
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
|
872
|
-
* if something is a React Element.
|
873
|
-
*
|
874
|
-
* @param {*} type
|
875
|
-
* @param {*} props
|
876
|
-
* @param {*} key
|
877
|
-
* @param {string|object} ref
|
878
|
-
* @param {*} owner
|
879
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
880
|
-
* different from the `owner` when React.createElement is called, so that we
|
881
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
882
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
883
|
-
* change in behavior.
|
884
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
885
|
-
* indicating filename, line number, and/or other information.
|
886
|
-
* @internal
|
887
|
-
*/
|
888
|
-
|
889
|
-
|
890
|
-
function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
|
891
|
-
var ref;
|
892
|
-
|
893
|
-
{
|
894
|
-
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
895
|
-
// argument and treat `props.ref` as the source of truth. The only thing we
|
896
|
-
// use this for is `element.ref`, which will log a deprecation warning on
|
897
|
-
// access. In the next release, we can remove `element.ref` as well as the
|
898
|
-
// `ref` argument.
|
899
|
-
var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
900
|
-
// backwards compatibility.
|
901
|
-
|
902
|
-
ref = refProp !== undefined ? refProp : null;
|
903
|
-
}
|
904
|
-
|
905
|
-
var element;
|
906
|
-
|
907
|
-
{
|
908
|
-
// In dev, make `ref` a non-enumerable property with a warning. It's non-
|
909
|
-
// enumerable so that test matchers and serializers don't access it and
|
910
|
-
// trigger the warning.
|
911
|
-
//
|
912
|
-
// `ref` will be removed from the element completely in a future release.
|
913
|
-
element = {
|
914
|
-
// This tag allows us to uniquely identify this as a React Element
|
915
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
916
|
-
// Built-in properties that belong on the element
|
917
|
-
type: type,
|
918
|
-
key: key,
|
919
|
-
props: props,
|
920
|
-
// Record the component responsible for creating this element.
|
921
|
-
_owner: owner
|
922
|
-
};
|
923
|
-
|
924
|
-
if (ref !== null) {
|
925
|
-
Object.defineProperty(element, 'ref', {
|
926
|
-
enumerable: false,
|
927
|
-
get: elementRefGetterWithDeprecationWarning
|
928
|
-
});
|
929
|
-
} else {
|
930
|
-
// Don't warn on access if a ref is not given. This reduces false
|
931
|
-
// positives in cases where a test serializer uses
|
932
|
-
// getOwnPropertyDescriptors to compare objects, like Jest does, which is
|
933
|
-
// a problem because it bypasses non-enumerability.
|
934
|
-
//
|
935
|
-
// So unfortunately this will trigger a false positive warning in Jest
|
936
|
-
// when the diff is printed:
|
937
|
-
//
|
938
|
-
// expect(<div ref={ref} />).toEqual(<span ref={ref} />);
|
939
|
-
//
|
940
|
-
// A bit sketchy, but this is what we've done for the `props.key` and
|
941
|
-
// `props.ref` accessors for years, which implies it will be good enough
|
942
|
-
// for `element.ref`, too. Let's see if anyone complains.
|
943
|
-
Object.defineProperty(element, 'ref', {
|
944
|
-
enumerable: false,
|
945
|
-
value: null
|
946
|
-
});
|
947
|
-
}
|
948
|
-
}
|
949
|
-
|
950
|
-
{
|
951
|
-
// The validation flag is currently mutative. We put it on
|
952
|
-
// an external backing store so that we can freeze the whole object.
|
953
|
-
// This can be replaced with a WeakMap once they are implemented in
|
954
|
-
// commonly used development environments.
|
955
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
956
|
-
// the validation flag non-enumerable (where possible, which should
|
957
|
-
// include every environment we run tests in), so the test framework
|
958
|
-
// ignores it.
|
959
|
-
|
960
|
-
Object.defineProperty(element._store, 'validated', {
|
961
|
-
configurable: false,
|
962
|
-
enumerable: false,
|
963
|
-
writable: true,
|
964
|
-
value: 0
|
965
|
-
}); // debugInfo contains Server Component debug information.
|
966
|
-
|
967
|
-
Object.defineProperty(element, '_debugInfo', {
|
968
|
-
configurable: false,
|
969
|
-
enumerable: false,
|
970
|
-
writable: true,
|
971
|
-
value: null
|
972
|
-
});
|
973
|
-
|
974
|
-
if (Object.freeze) {
|
975
|
-
Object.freeze(element.props);
|
976
|
-
Object.freeze(element);
|
977
|
-
}
|
978
|
-
}
|
979
|
-
|
980
|
-
return element;
|
981
|
-
}
|
982
|
-
/**
|
983
|
-
* Create and return a new ReactElement of the given type.
|
984
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
985
|
-
*/
|
986
|
-
|
987
|
-
|
988
|
-
function createElement(type, config, children) {
|
989
|
-
{
|
990
|
-
if (!isValidElementType(type)) {
|
991
|
-
// This is just an optimistic check that provides a better stack trace before
|
992
|
-
// owner stacks. It's really up to the renderer if it's a valid element type.
|
993
|
-
// When owner stacks are enabled, we instead warn in the renderer and it'll
|
994
|
-
// have the stack trace of the JSX element anyway.
|
995
|
-
//
|
996
|
-
// This is an invalid element type.
|
997
|
-
//
|
998
|
-
// We warn in this case but don't throw. We expect the element creation to
|
999
|
-
// succeed and there will likely be errors in render.
|
1000
|
-
var info = '';
|
1001
|
-
|
1002
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1003
|
-
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.";
|
1004
|
-
}
|
1005
|
-
|
1006
|
-
var typeString;
|
1007
|
-
|
1008
|
-
if (type === null) {
|
1009
|
-
typeString = 'null';
|
1010
|
-
} else if (isArray(type)) {
|
1011
|
-
typeString = 'array';
|
1012
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1013
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
1014
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
1015
|
-
} else {
|
1016
|
-
typeString = typeof type;
|
1017
|
-
}
|
1018
|
-
|
1019
|
-
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);
|
1020
|
-
} else {
|
1021
|
-
// This is a valid element type.
|
1022
|
-
// Skip key warning if the type isn't valid since our key validation logic
|
1023
|
-
// doesn't expect a non-string/function type and can throw confusing
|
1024
|
-
// errors. We don't want exception behavior to differ between dev and
|
1025
|
-
// prod. (Rendering will throw with a helpful message and as soon as the
|
1026
|
-
// type is fixed, the key warnings will appear.)
|
1027
|
-
for (var i = 2; i < arguments.length; i++) {
|
1028
|
-
validateChildKeys(arguments[i], type);
|
1029
|
-
}
|
1030
|
-
} // Unlike the jsx() runtime, createElement() doesn't warn about key spread.
|
1031
|
-
|
1032
|
-
}
|
1033
|
-
|
1034
|
-
var propName; // Reserved names are extracted
|
1035
|
-
|
1036
|
-
var props = {};
|
1037
|
-
var key = null;
|
1038
|
-
var ref = null;
|
1039
|
-
|
1040
|
-
if (config != null) {
|
1041
|
-
{
|
1042
|
-
if (!didWarnAboutOldJSXRuntime && '__self' in config && // Do not assume this is the result of an oudated JSX transform if key
|
1043
|
-
// is present, because the modern JSX transform sometimes outputs
|
1044
|
-
// createElement to preserve precedence between a static key and a
|
1045
|
-
// spread key. To avoid false positive warnings, we never warn if
|
1046
|
-
// there's a key.
|
1047
|
-
!('key' in config)) {
|
1048
|
-
didWarnAboutOldJSXRuntime = true;
|
1049
|
-
|
1050
|
-
warn('Your app (or one of its dependencies) is using an outdated JSX ' + 'transform. Update to the modern JSX transform for ' + 'faster performance: https://react.dev/link/new-jsx-transform');
|
1051
|
-
}
|
1052
|
-
}
|
1053
|
-
|
1054
|
-
if (hasValidRef(config)) ;
|
1055
|
-
|
1056
|
-
if (hasValidKey(config)) {
|
1057
|
-
{
|
1058
|
-
checkKeyStringCoercion(config.key);
|
1059
|
-
}
|
1060
|
-
|
1061
|
-
key = '' + config.key;
|
1062
|
-
} // Remaining properties are added to a new props object
|
1063
|
-
|
1064
|
-
|
1065
|
-
for (propName in config) {
|
1066
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1067
|
-
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
1068
|
-
// them to appear as props, so in createElement we filter them out.
|
1069
|
-
// We don't have to do this in the jsx() runtime because the jsx()
|
1070
|
-
// transform never passed these as props; it used separate arguments.
|
1071
|
-
propName !== '__self' && propName !== '__source') {
|
1072
|
-
{
|
1073
|
-
props[propName] = config[propName];
|
1074
|
-
}
|
1075
|
-
}
|
1076
|
-
}
|
1077
|
-
} // Children can be more than one argument, and those are transferred onto
|
1078
|
-
// the newly allocated props object.
|
1079
|
-
|
1080
|
-
|
1081
|
-
var childrenLength = arguments.length - 2;
|
1082
|
-
|
1083
|
-
if (childrenLength === 1) {
|
1084
|
-
props.children = children;
|
1085
|
-
} else if (childrenLength > 1) {
|
1086
|
-
var childArray = Array(childrenLength);
|
1087
|
-
|
1088
|
-
for (var _i = 0; _i < childrenLength; _i++) {
|
1089
|
-
childArray[_i] = arguments[_i + 2];
|
1090
|
-
}
|
1091
|
-
|
1092
|
-
{
|
1093
|
-
if (Object.freeze) {
|
1094
|
-
Object.freeze(childArray);
|
1095
|
-
}
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
props.children = childArray;
|
1099
|
-
} // Resolve default props
|
1100
|
-
|
1101
|
-
|
1102
|
-
if (type && type.defaultProps) {
|
1103
|
-
var defaultProps = type.defaultProps;
|
1104
|
-
|
1105
|
-
for (propName in defaultProps) {
|
1106
|
-
if (props[propName] === undefined) {
|
1107
|
-
props[propName] = defaultProps[propName];
|
1108
|
-
}
|
1109
|
-
}
|
1110
|
-
}
|
1111
|
-
|
1112
|
-
{
|
1113
|
-
if (key || !enableRefAsProp ) {
|
1114
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
1115
|
-
|
1116
|
-
if (key) {
|
1117
|
-
defineKeyPropWarningGetter(props, displayName);
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
}
|
1121
|
-
|
1122
|
-
return ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
|
1123
|
-
}
|
1124
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
1125
|
-
var clonedElement = ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
|
1126
|
-
// exists to avoid the `ref` access warning.
|
1127
|
-
null , undefined, undefined, oldElement._owner, oldElement.props);
|
1128
|
-
|
1129
|
-
{
|
1130
|
-
// The cloned element should inherit the original element's key validation.
|
1131
|
-
clonedElement._store.validated = oldElement._store.validated;
|
1132
|
-
}
|
1133
|
-
|
1134
|
-
return clonedElement;
|
1135
|
-
}
|
1136
|
-
/**
|
1137
|
-
* Clone and return a new ReactElement using element as the starting point.
|
1138
|
-
* See https://reactjs.org/docs/react-api.html#cloneelement
|
1139
|
-
*/
|
1140
|
-
|
1141
|
-
function cloneElement(element, config, children) {
|
1142
|
-
if (element === null || element === undefined) {
|
1143
|
-
throw new Error("The argument must be a React element, but you passed " + element + ".");
|
1144
|
-
}
|
1145
|
-
|
1146
|
-
var propName; // Original props are copied
|
1147
|
-
|
1148
|
-
var props = assign({}, element.props); // Reserved names are extracted
|
1149
|
-
|
1150
|
-
var key = element.key;
|
1151
|
-
var ref = null ; // Owner will be preserved, unless ref is overridden
|
1152
|
-
|
1153
|
-
var owner = element._owner;
|
1154
|
-
|
1155
|
-
if (config != null) {
|
1156
|
-
if (hasValidRef(config)) {
|
1157
|
-
owner = getOwner() ;
|
1158
|
-
}
|
1159
|
-
|
1160
|
-
if (hasValidKey(config)) {
|
1161
|
-
{
|
1162
|
-
checkKeyStringCoercion(config.key);
|
1163
|
-
}
|
1164
|
-
|
1165
|
-
key = '' + config.key;
|
1166
|
-
} // Remaining properties override existing props
|
1167
|
-
|
1168
|
-
for (propName in config) {
|
1169
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1170
|
-
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
1171
|
-
// warnings and debug information in dev. Need to decide if we're OK
|
1172
|
-
// with dropping them. In the jsx() runtime it's not an issue because
|
1173
|
-
// the data gets passed as separate arguments instead of props, but
|
1174
|
-
// it would be nice to stop relying on them entirely so we can drop
|
1175
|
-
// them from the internal Fiber field.
|
1176
|
-
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
1177
|
-
// if the property were missing. This is mostly for
|
1178
|
-
// backwards compatibility.
|
1179
|
-
!(propName === 'ref' && config.ref === undefined)) {
|
1180
|
-
{
|
1181
|
-
{
|
1182
|
-
props[propName] = config[propName];
|
1183
|
-
}
|
1184
|
-
}
|
1185
|
-
}
|
1186
|
-
}
|
1187
|
-
} // Children can be more than one argument, and those are transferred onto
|
1188
|
-
// the newly allocated props object.
|
1189
|
-
|
1190
|
-
|
1191
|
-
var childrenLength = arguments.length - 2;
|
1192
|
-
|
1193
|
-
if (childrenLength === 1) {
|
1194
|
-
props.children = children;
|
1195
|
-
} else if (childrenLength > 1) {
|
1196
|
-
var childArray = Array(childrenLength);
|
1197
|
-
|
1198
|
-
for (var i = 0; i < childrenLength; i++) {
|
1199
|
-
childArray[i] = arguments[i + 2];
|
1200
|
-
}
|
1201
|
-
|
1202
|
-
props.children = childArray;
|
1203
|
-
}
|
1204
|
-
|
1205
|
-
var clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
|
1206
|
-
|
1207
|
-
for (var _i2 = 2; _i2 < arguments.length; _i2++) {
|
1208
|
-
validateChildKeys(arguments[_i2], clonedElement.type);
|
1209
|
-
}
|
1210
|
-
|
1211
|
-
return clonedElement;
|
1212
|
-
}
|
1213
|
-
/**
|
1214
|
-
* Ensure that every element either is passed in a static location, in an
|
1215
|
-
* array with an explicit keys property defined, or in an object literal
|
1216
|
-
* with valid key property.
|
1217
|
-
*
|
1218
|
-
* @internal
|
1219
|
-
* @param {ReactNode} node Statically passed child of any type.
|
1220
|
-
* @param {*} parentType node's parent's type.
|
1221
|
-
*/
|
1222
|
-
|
1223
|
-
function validateChildKeys(node, parentType) {
|
1224
|
-
{
|
1225
|
-
if (typeof node !== 'object' || !node) {
|
1226
|
-
return;
|
1227
|
-
}
|
1228
|
-
|
1229
|
-
if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
|
1230
|
-
for (var i = 0; i < node.length; i++) {
|
1231
|
-
var child = node[i];
|
1232
|
-
|
1233
|
-
if (isValidElement(child)) {
|
1234
|
-
validateExplicitKey(child, parentType);
|
1235
|
-
}
|
1236
|
-
}
|
1237
|
-
} else if (isValidElement(node)) {
|
1238
|
-
// This element was passed in a valid location.
|
1239
|
-
if (node._store) {
|
1240
|
-
node._store.validated = 1;
|
1241
|
-
}
|
1242
|
-
} else {
|
1243
|
-
var iteratorFn = getIteratorFn(node);
|
1244
|
-
|
1245
|
-
if (typeof iteratorFn === 'function') {
|
1246
|
-
// Entry iterators used to provide implicit keys,
|
1247
|
-
// but now we print a separate warning for them later.
|
1248
|
-
if (iteratorFn !== node.entries) {
|
1249
|
-
var iterator = iteratorFn.call(node);
|
1250
|
-
|
1251
|
-
if (iterator !== node) {
|
1252
|
-
var step;
|
1253
|
-
|
1254
|
-
while (!(step = iterator.next()).done) {
|
1255
|
-
if (isValidElement(step.value)) {
|
1256
|
-
validateExplicitKey(step.value, parentType);
|
1257
|
-
}
|
1258
|
-
}
|
1259
|
-
}
|
1260
|
-
}
|
1261
|
-
}
|
1262
|
-
}
|
1263
|
-
}
|
1264
|
-
}
|
1265
|
-
/**
|
1266
|
-
* Verifies the object is a ReactElement.
|
1267
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
1268
|
-
* @param {?object} object
|
1269
|
-
* @return {boolean} True if `object` is a ReactElement.
|
1270
|
-
* @final
|
1271
|
-
*/
|
1272
|
-
|
1273
|
-
|
1274
|
-
function isValidElement(object) {
|
1275
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
1276
|
-
}
|
1277
|
-
var ownerHasKeyUseWarning = {};
|
1278
|
-
/**
|
1279
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
1280
|
-
* This element is in an array. The array could grow and shrink or be
|
1281
|
-
* reordered. All children that haven't already been validated are required to
|
1282
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
1283
|
-
* will only be shown once.
|
1284
|
-
*
|
1285
|
-
* @internal
|
1286
|
-
* @param {ReactElement} element Element that requires a key.
|
1287
|
-
* @param {*} parentType element's parent's type.
|
1288
|
-
*/
|
1289
|
-
|
1290
|
-
function validateExplicitKey(element, parentType) {
|
1291
|
-
|
1292
|
-
{
|
1293
|
-
if (!element._store || element._store.validated || element.key != null) {
|
1294
|
-
return;
|
25
|
+
function error$jscomp$0(format) {
|
26
|
+
for (
|
27
|
+
var _len2 = arguments.length,
|
28
|
+
args = Array(1 < _len2 ? _len2 - 1 : 0),
|
29
|
+
_key2 = 1;
|
30
|
+
_key2 < _len2;
|
31
|
+
_key2++
|
32
|
+
)
|
33
|
+
args[_key2 - 1] = arguments[_key2];
|
34
|
+
printWarning("error", format, args, Error("react-stack-top-frame"));
|
1295
35
|
}
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
36
|
+
function printWarning(level, format, args, currentStack) {
|
37
|
+
var isErrorLogger =
|
38
|
+
"%s\n\n%s\n" === format || "%o\n\n%s\n\n%s\n" === format;
|
39
|
+
ReactSharedInternals.getCurrentStack &&
|
40
|
+
((currentStack = ReactSharedInternals.getCurrentStack(currentStack)),
|
41
|
+
"" !== currentStack &&
|
42
|
+
((format += "%s"), (args = args.concat([currentStack]))));
|
43
|
+
isErrorLogger
|
44
|
+
? args.unshift(format)
|
45
|
+
: ((args = args.map(function (item) {
|
46
|
+
return String(item);
|
47
|
+
})),
|
48
|
+
args.unshift("Warning: " + format));
|
49
|
+
Function.prototype.apply.call(console[level], console, args);
|
1302
50
|
}
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
if (element && element._owner != null && element._owner !== getOwner()) {
|
1311
|
-
var ownerName = null;
|
1312
|
-
|
1313
|
-
if (typeof element._owner.tag === 'number') {
|
1314
|
-
ownerName = getComponentNameFromType(element._owner.type);
|
1315
|
-
} else if (typeof element._owner.name === 'string') {
|
1316
|
-
ownerName = element._owner.name;
|
1317
|
-
} // Give the component that originally created this child.
|
1318
|
-
|
1319
|
-
|
1320
|
-
childOwner = " It was passed a child from " + ownerName + ".";
|
51
|
+
function getIteratorFn(maybeIterable) {
|
52
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
53
|
+
return null;
|
54
|
+
maybeIterable =
|
55
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
56
|
+
maybeIterable["@@iterator"];
|
57
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
1321
58
|
}
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
}
|
1332
|
-
|
1333
|
-
return stack;
|
1334
|
-
};
|
1335
|
-
|
1336
|
-
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
1337
|
-
|
1338
|
-
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
1339
|
-
}
|
1340
|
-
}
|
1341
|
-
|
1342
|
-
function getCurrentComponentErrorInfo(parentType) {
|
1343
|
-
{
|
1344
|
-
var info = '';
|
1345
|
-
var owner = getOwner();
|
1346
|
-
|
1347
|
-
if (owner) {
|
1348
|
-
var name = getComponentNameFromType(owner.type);
|
1349
|
-
|
1350
|
-
if (name) {
|
1351
|
-
info = '\n\nCheck the render method of `' + name + '`.';
|
59
|
+
function testStringCoercion(value) {
|
60
|
+
return "" + value;
|
61
|
+
}
|
62
|
+
function checkKeyStringCoercion(value) {
|
63
|
+
try {
|
64
|
+
testStringCoercion(value);
|
65
|
+
var JSCompiler_inline_result = !1;
|
66
|
+
} catch (e) {
|
67
|
+
JSCompiler_inline_result = !0;
|
1352
68
|
}
|
69
|
+
if (JSCompiler_inline_result)
|
70
|
+
return (
|
71
|
+
(JSCompiler_inline_result =
|
72
|
+
("function" === typeof Symbol &&
|
73
|
+
Symbol.toStringTag &&
|
74
|
+
value[Symbol.toStringTag]) ||
|
75
|
+
value.constructor.name ||
|
76
|
+
"Object"),
|
77
|
+
error$jscomp$0(
|
78
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
79
|
+
JSCompiler_inline_result
|
80
|
+
),
|
81
|
+
testStringCoercion(value)
|
82
|
+
);
|
1353
83
|
}
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
84
|
+
function getComponentNameFromType(type) {
|
85
|
+
if (null == type) return null;
|
86
|
+
if ("function" === typeof type)
|
87
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE$2
|
88
|
+
? null
|
89
|
+
: type.displayName || type.name || null;
|
90
|
+
if ("string" === typeof type) return type;
|
91
|
+
switch (type) {
|
92
|
+
case REACT_FRAGMENT_TYPE:
|
93
|
+
return "Fragment";
|
94
|
+
case REACT_PORTAL_TYPE:
|
95
|
+
return "Portal";
|
96
|
+
case REACT_PROFILER_TYPE:
|
97
|
+
return "Profiler";
|
98
|
+
case REACT_STRICT_MODE_TYPE:
|
99
|
+
return "StrictMode";
|
100
|
+
case REACT_SUSPENSE_TYPE:
|
101
|
+
return "Suspense";
|
102
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
103
|
+
return "SuspenseList";
|
1360
104
|
}
|
105
|
+
if ("object" === typeof type)
|
106
|
+
switch (
|
107
|
+
("number" === typeof type.tag &&
|
108
|
+
error$jscomp$0(
|
109
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
110
|
+
),
|
111
|
+
type.$$typeof)
|
112
|
+
) {
|
113
|
+
case REACT_CONTEXT_TYPE:
|
114
|
+
return (type.displayName || "Context") + ".Provider";
|
115
|
+
case REACT_CONSUMER_TYPE:
|
116
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
117
|
+
case REACT_FORWARD_REF_TYPE:
|
118
|
+
var innerType = type.render;
|
119
|
+
type = type.displayName;
|
120
|
+
type ||
|
121
|
+
((type = innerType.displayName || innerType.name || ""),
|
122
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
123
|
+
return type;
|
124
|
+
case REACT_MEMO_TYPE:
|
125
|
+
return (
|
126
|
+
(innerType = type.displayName || null),
|
127
|
+
null !== innerType
|
128
|
+
? innerType
|
129
|
+
: getComponentNameFromType(type.type) || "Memo"
|
130
|
+
);
|
131
|
+
case REACT_LAZY_TYPE:
|
132
|
+
innerType = type._payload;
|
133
|
+
type = type._init;
|
134
|
+
try {
|
135
|
+
return getComponentNameFromType(type(innerType));
|
136
|
+
} catch (x) {}
|
137
|
+
}
|
138
|
+
return null;
|
1361
139
|
}
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
var escapedString = key.replace(escapeRegex, function (match) {
|
1383
|
-
return escaperLookup[match];
|
1384
|
-
});
|
1385
|
-
return '$' + escapedString;
|
1386
|
-
}
|
1387
|
-
/**
|
1388
|
-
* TODO: Test that a single child and an array with one item have the same key
|
1389
|
-
* pattern.
|
1390
|
-
*/
|
1391
|
-
|
1392
|
-
|
1393
|
-
var didWarnAboutMaps = false;
|
1394
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
1395
|
-
|
1396
|
-
function escapeUserProvidedKey(text) {
|
1397
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
1398
|
-
}
|
1399
|
-
/**
|
1400
|
-
* Generate a key string that identifies a element within a set.
|
1401
|
-
*
|
1402
|
-
* @param {*} element A element that could contain a manual key.
|
1403
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
1404
|
-
* @return {string}
|
1405
|
-
*/
|
1406
|
-
|
1407
|
-
|
1408
|
-
function getElementKey(element, index) {
|
1409
|
-
// Do some typechecking here since we call this blindly. We want to ensure
|
1410
|
-
// that we don't block potential future ES APIs.
|
1411
|
-
if (typeof element === 'object' && element !== null && element.key != null) {
|
1412
|
-
// Explicit key
|
1413
|
-
{
|
1414
|
-
checkKeyStringCoercion(element.key);
|
140
|
+
function isValidElementType(type) {
|
141
|
+
return "string" === typeof type ||
|
142
|
+
"function" === typeof type ||
|
143
|
+
type === REACT_FRAGMENT_TYPE ||
|
144
|
+
type === REACT_PROFILER_TYPE ||
|
145
|
+
type === REACT_STRICT_MODE_TYPE ||
|
146
|
+
type === REACT_SUSPENSE_TYPE ||
|
147
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
148
|
+
type === REACT_OFFSCREEN_TYPE ||
|
149
|
+
("object" === typeof type &&
|
150
|
+
null !== type &&
|
151
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
152
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
153
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
154
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
155
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
156
|
+
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
|
157
|
+
void 0 !== type.getModuleId))
|
158
|
+
? !0
|
159
|
+
: !1;
|
1415
160
|
}
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
161
|
+
function disabledLog() {}
|
162
|
+
function disableLogs() {
|
163
|
+
if (0 === disabledDepth) {
|
164
|
+
prevLog = console.log;
|
165
|
+
prevInfo = console.info;
|
166
|
+
prevWarn = console.warn;
|
167
|
+
prevError = console.error;
|
168
|
+
prevGroup = console.group;
|
169
|
+
prevGroupCollapsed = console.groupCollapsed;
|
170
|
+
prevGroupEnd = console.groupEnd;
|
171
|
+
var props = {
|
172
|
+
configurable: !0,
|
173
|
+
enumerable: !0,
|
174
|
+
value: disabledLog,
|
175
|
+
writable: !0
|
176
|
+
};
|
177
|
+
Object.defineProperties(console, {
|
178
|
+
info: props,
|
179
|
+
log: props,
|
180
|
+
warn: props,
|
181
|
+
error: props,
|
182
|
+
group: props,
|
183
|
+
groupCollapsed: props,
|
184
|
+
groupEnd: props
|
185
|
+
});
|
1438
186
|
}
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
pendingThenable.then(function (fulfilledValue) {
|
1455
|
-
if (thenable.status === 'pending') {
|
1456
|
-
var fulfilledThenable = thenable;
|
1457
|
-
fulfilledThenable.status = 'fulfilled';
|
1458
|
-
fulfilledThenable.value = fulfilledValue;
|
1459
|
-
}
|
1460
|
-
}, function (error) {
|
1461
|
-
if (thenable.status === 'pending') {
|
1462
|
-
var rejectedThenable = thenable;
|
1463
|
-
rejectedThenable.status = 'rejected';
|
1464
|
-
rejectedThenable.reason = error;
|
1465
|
-
}
|
1466
|
-
});
|
1467
|
-
} // Check one more time in case the thenable resolved synchronously.
|
1468
|
-
|
1469
|
-
|
1470
|
-
switch (thenable.status) {
|
1471
|
-
case 'fulfilled':
|
1472
|
-
{
|
1473
|
-
var fulfilledThenable = thenable;
|
1474
|
-
return fulfilledThenable.value;
|
1475
|
-
}
|
1476
|
-
|
1477
|
-
case 'rejected':
|
1478
|
-
{
|
1479
|
-
var rejectedThenable = thenable;
|
1480
|
-
var _rejectedError = rejectedThenable.reason;
|
1481
|
-
throw _rejectedError;
|
1482
|
-
}
|
1483
|
-
}
|
187
|
+
disabledDepth++;
|
188
|
+
}
|
189
|
+
function reenableLogs() {
|
190
|
+
disabledDepth--;
|
191
|
+
if (0 === disabledDepth) {
|
192
|
+
var props = { configurable: !0, enumerable: !0, writable: !0 };
|
193
|
+
Object.defineProperties(console, {
|
194
|
+
log: assign({}, props, { value: prevLog }),
|
195
|
+
info: assign({}, props, { value: prevInfo }),
|
196
|
+
warn: assign({}, props, { value: prevWarn }),
|
197
|
+
error: assign({}, props, { value: prevError }),
|
198
|
+
group: assign({}, props, { value: prevGroup }),
|
199
|
+
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
200
|
+
groupEnd: assign({}, props, { value: prevGroupEnd })
|
201
|
+
});
|
1484
202
|
}
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
function
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
var invokeCallback = false;
|
1499
|
-
|
1500
|
-
if (children === null) {
|
1501
|
-
invokeCallback = true;
|
1502
|
-
} else {
|
1503
|
-
switch (type) {
|
1504
|
-
case 'bigint':
|
1505
|
-
case 'string':
|
1506
|
-
case 'number':
|
1507
|
-
invokeCallback = true;
|
1508
|
-
break;
|
1509
|
-
|
1510
|
-
case 'object':
|
1511
|
-
switch (children.$$typeof) {
|
1512
|
-
case REACT_ELEMENT_TYPE:
|
1513
|
-
case REACT_PORTAL_TYPE:
|
1514
|
-
invokeCallback = true;
|
1515
|
-
break;
|
1516
|
-
|
1517
|
-
case REACT_LAZY_TYPE:
|
1518
|
-
var payload = children._payload;
|
1519
|
-
var init = children._init;
|
1520
|
-
return mapIntoArray(init(payload), array, escapedPrefix, nameSoFar, callback);
|
203
|
+
0 > disabledDepth &&
|
204
|
+
error$jscomp$0(
|
205
|
+
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
206
|
+
);
|
207
|
+
}
|
208
|
+
function describeBuiltInComponentFrame(name) {
|
209
|
+
if (void 0 === prefix)
|
210
|
+
try {
|
211
|
+
throw Error();
|
212
|
+
} catch (x) {
|
213
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
214
|
+
prefix = (match && match[1]) || "";
|
1521
215
|
}
|
1522
|
-
|
216
|
+
return "\n" + prefix + name;
|
1523
217
|
}
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
218
|
+
function describeNativeComponentFrame(fn, construct) {
|
219
|
+
if (!fn || reentry) return "";
|
220
|
+
var frame = componentFrameCache.get(fn);
|
221
|
+
if (void 0 !== frame) return frame;
|
222
|
+
reentry = !0;
|
223
|
+
frame = Error.prepareStackTrace;
|
224
|
+
Error.prepareStackTrace = void 0;
|
225
|
+
var previousDispatcher = null;
|
226
|
+
previousDispatcher = ReactSharedInternals.H;
|
227
|
+
ReactSharedInternals.H = null;
|
228
|
+
disableLogs();
|
229
|
+
var RunInRootFrame = {
|
230
|
+
DetermineComponentFrameRoot: function () {
|
231
|
+
try {
|
232
|
+
if (construct) {
|
233
|
+
var Fake = function () {
|
234
|
+
throw Error();
|
235
|
+
};
|
236
|
+
Object.defineProperty(Fake.prototype, "props", {
|
237
|
+
set: function () {
|
238
|
+
throw Error();
|
239
|
+
}
|
240
|
+
});
|
241
|
+
if ("object" === typeof Reflect && Reflect.construct) {
|
242
|
+
try {
|
243
|
+
Reflect.construct(Fake, []);
|
244
|
+
} catch (x) {
|
245
|
+
var control = x;
|
246
|
+
}
|
247
|
+
Reflect.construct(fn, [], Fake);
|
248
|
+
} else {
|
249
|
+
try {
|
250
|
+
Fake.call();
|
251
|
+
} catch (x$0) {
|
252
|
+
control = x$0;
|
253
|
+
}
|
254
|
+
fn.call(Fake.prototype);
|
255
|
+
}
|
256
|
+
} else {
|
257
|
+
try {
|
258
|
+
throw Error();
|
259
|
+
} catch (x$1) {
|
260
|
+
control = x$1;
|
261
|
+
}
|
262
|
+
(Fake = fn()) &&
|
263
|
+
"function" === typeof Fake.catch &&
|
264
|
+
Fake.catch(function () {});
|
1552
265
|
}
|
266
|
+
} catch (sample) {
|
267
|
+
if (sample && control && "string" === typeof sample.stack)
|
268
|
+
return [sample.stack, control.stack];
|
1553
269
|
}
|
270
|
+
return [null, null];
|
1554
271
|
}
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
272
|
+
};
|
273
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
274
|
+
"DetermineComponentFrameRoot";
|
275
|
+
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
276
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
277
|
+
"name"
|
278
|
+
);
|
279
|
+
namePropDescriptor &&
|
280
|
+
namePropDescriptor.configurable &&
|
281
|
+
Object.defineProperty(
|
282
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
283
|
+
"name",
|
284
|
+
{ value: "DetermineComponentFrameRoot" }
|
285
|
+
);
|
286
|
+
try {
|
287
|
+
var _RunInRootFrame$Deter =
|
288
|
+
RunInRootFrame.DetermineComponentFrameRoot(),
|
289
|
+
sampleStack = _RunInRootFrame$Deter[0],
|
290
|
+
controlStack = _RunInRootFrame$Deter[1];
|
291
|
+
if (sampleStack && controlStack) {
|
292
|
+
var sampleLines = sampleStack.split("\n"),
|
293
|
+
controlLines = controlStack.split("\n");
|
294
|
+
for (
|
295
|
+
sampleStack = _RunInRootFrame$Deter = 0;
|
296
|
+
_RunInRootFrame$Deter < sampleLines.length &&
|
297
|
+
!sampleLines[_RunInRootFrame$Deter].includes(
|
298
|
+
"DetermineComponentFrameRoot"
|
299
|
+
);
|
300
|
+
|
301
|
+
)
|
302
|
+
_RunInRootFrame$Deter++;
|
303
|
+
for (
|
304
|
+
;
|
305
|
+
sampleStack < controlLines.length &&
|
306
|
+
!controlLines[sampleStack].includes("DetermineComponentFrameRoot");
|
307
|
+
|
308
|
+
)
|
309
|
+
sampleStack++;
|
310
|
+
if (
|
311
|
+
_RunInRootFrame$Deter === sampleLines.length ||
|
312
|
+
sampleStack === controlLines.length
|
313
|
+
)
|
314
|
+
for (
|
315
|
+
_RunInRootFrame$Deter = sampleLines.length - 1,
|
316
|
+
sampleStack = controlLines.length - 1;
|
317
|
+
1 <= _RunInRootFrame$Deter &&
|
318
|
+
0 <= sampleStack &&
|
319
|
+
sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack];
|
320
|
+
|
321
|
+
)
|
322
|
+
sampleStack--;
|
323
|
+
for (
|
324
|
+
;
|
325
|
+
1 <= _RunInRootFrame$Deter && 0 <= sampleStack;
|
326
|
+
_RunInRootFrame$Deter--, sampleStack--
|
327
|
+
)
|
328
|
+
if (
|
329
|
+
sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]
|
330
|
+
) {
|
331
|
+
if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) {
|
332
|
+
do
|
333
|
+
if (
|
334
|
+
(_RunInRootFrame$Deter--,
|
335
|
+
sampleStack--,
|
336
|
+
0 > sampleStack ||
|
337
|
+
sampleLines[_RunInRootFrame$Deter] !==
|
338
|
+
controlLines[sampleStack])
|
339
|
+
) {
|
340
|
+
var _frame =
|
341
|
+
"\n" +
|
342
|
+
sampleLines[_RunInRootFrame$Deter].replace(
|
343
|
+
" at new ",
|
344
|
+
" at "
|
345
|
+
);
|
346
|
+
fn.displayName &&
|
347
|
+
_frame.includes("<anonymous>") &&
|
348
|
+
(_frame = _frame.replace("<anonymous>", fn.displayName));
|
349
|
+
"function" === typeof fn &&
|
350
|
+
componentFrameCache.set(fn, _frame);
|
351
|
+
return _frame;
|
352
|
+
}
|
353
|
+
while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack);
|
354
|
+
}
|
355
|
+
break;
|
1575
356
|
}
|
1576
|
-
}
|
1577
357
|
}
|
1578
|
-
|
1579
|
-
|
358
|
+
} finally {
|
359
|
+
(reentry = !1),
|
360
|
+
(ReactSharedInternals.H = previousDispatcher),
|
361
|
+
reenableLogs(),
|
362
|
+
(Error.prepareStackTrace = frame);
|
1580
363
|
}
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
}
|
1587
|
-
|
1588
|
-
var child;
|
1589
|
-
var nextName;
|
1590
|
-
var subtreeCount = 0; // Count of children found in the current subtree.
|
1591
|
-
|
1592
|
-
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1593
|
-
|
1594
|
-
if (isArray(children)) {
|
1595
|
-
for (var i = 0; i < children.length; i++) {
|
1596
|
-
child = children[i];
|
1597
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
1598
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
364
|
+
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
|
365
|
+
? describeBuiltInComponentFrame(sampleLines)
|
366
|
+
: "";
|
367
|
+
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
368
|
+
return sampleLines;
|
1599
369
|
}
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
if (iteratorFn === iterableChildren.entries) {
|
1609
|
-
if (!didWarnAboutMaps) {
|
1610
|
-
warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
1611
|
-
}
|
1612
|
-
|
1613
|
-
didWarnAboutMaps = true;
|
1614
|
-
}
|
370
|
+
function describeUnknownElementTypeFrameInDEV(type) {
|
371
|
+
if (null == type) return "";
|
372
|
+
if ("function" === typeof type) {
|
373
|
+
var prototype = type.prototype;
|
374
|
+
return describeNativeComponentFrame(
|
375
|
+
type,
|
376
|
+
!(!prototype || !prototype.isReactComponent)
|
377
|
+
);
|
1615
378
|
}
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
child = step.value;
|
1623
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
1624
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
379
|
+
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
380
|
+
switch (type) {
|
381
|
+
case REACT_SUSPENSE_TYPE:
|
382
|
+
return describeBuiltInComponentFrame("Suspense");
|
383
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
384
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
1625
385
|
}
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
386
|
+
if ("object" === typeof type)
|
387
|
+
switch (type.$$typeof) {
|
388
|
+
case REACT_FORWARD_REF_TYPE:
|
389
|
+
return (type = describeNativeComponentFrame(type.render, !1)), type;
|
390
|
+
case REACT_MEMO_TYPE:
|
391
|
+
return describeUnknownElementTypeFrameInDEV(type.type);
|
392
|
+
case REACT_LAZY_TYPE:
|
393
|
+
prototype = type._payload;
|
394
|
+
type = type._init;
|
395
|
+
try {
|
396
|
+
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
397
|
+
} catch (x) {}
|
398
|
+
}
|
399
|
+
return "";
|
1634
400
|
}
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
}
|
1639
|
-
/**
|
1640
|
-
* Maps children that are typically specified as `props.children`.
|
1641
|
-
*
|
1642
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
1643
|
-
*
|
1644
|
-
* The provided mapFunction(child, index) will be called for each
|
1645
|
-
* leaf child.
|
1646
|
-
*
|
1647
|
-
* @param {?*} children Children tree container.
|
1648
|
-
* @param {function(*, int)} func The map function.
|
1649
|
-
* @param {*} context Context for mapFunction.
|
1650
|
-
* @return {object} Object containing the ordered map of results.
|
1651
|
-
*/
|
1652
|
-
|
1653
|
-
|
1654
|
-
function mapChildren(children, func, context) {
|
1655
|
-
if (children == null) {
|
1656
|
-
// $FlowFixMe limitation refining abstract types in Flow
|
1657
|
-
return children;
|
1658
|
-
}
|
1659
|
-
|
1660
|
-
var result = [];
|
1661
|
-
var count = 0;
|
1662
|
-
mapIntoArray(children, result, '', '', function (child) {
|
1663
|
-
return func.call(context, child, count++);
|
1664
|
-
});
|
1665
|
-
return result;
|
1666
|
-
}
|
1667
|
-
/**
|
1668
|
-
* Count the number of children that are typically specified as
|
1669
|
-
* `props.children`.
|
1670
|
-
*
|
1671
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
1672
|
-
*
|
1673
|
-
* @param {?*} children Children tree container.
|
1674
|
-
* @return {number} The number of children.
|
1675
|
-
*/
|
1676
|
-
|
1677
|
-
|
1678
|
-
function countChildren(children) {
|
1679
|
-
var n = 0;
|
1680
|
-
mapChildren(children, function () {
|
1681
|
-
n++; // Don't return anything
|
1682
|
-
});
|
1683
|
-
return n;
|
1684
|
-
}
|
1685
|
-
/**
|
1686
|
-
* Iterates through children that are typically specified as `props.children`.
|
1687
|
-
*
|
1688
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
1689
|
-
*
|
1690
|
-
* The provided forEachFunc(child, index) will be called for each
|
1691
|
-
* leaf child.
|
1692
|
-
*
|
1693
|
-
* @param {?*} children Children tree container.
|
1694
|
-
* @param {function(*, int)} forEachFunc
|
1695
|
-
* @param {*} forEachContext Context for forEachContext.
|
1696
|
-
*/
|
1697
|
-
|
1698
|
-
|
1699
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
1700
|
-
mapChildren(children, // $FlowFixMe[missing-this-annot]
|
1701
|
-
function () {
|
1702
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
1703
|
-
}, forEachContext);
|
1704
|
-
}
|
1705
|
-
/**
|
1706
|
-
* Flatten a children object (typically specified as `props.children`) and
|
1707
|
-
* return an array with appropriately re-keyed children.
|
1708
|
-
*
|
1709
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
1710
|
-
*/
|
1711
|
-
|
1712
|
-
|
1713
|
-
function toArray(children) {
|
1714
|
-
return mapChildren(children, function (child) {
|
1715
|
-
return child;
|
1716
|
-
}) || [];
|
1717
|
-
}
|
1718
|
-
/**
|
1719
|
-
* Returns the first child in a collection of children and verifies that there
|
1720
|
-
* is only one child in the collection.
|
1721
|
-
*
|
1722
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
1723
|
-
*
|
1724
|
-
* The current implementation of this function assumes that a single child gets
|
1725
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
1726
|
-
* abstract away the particular structure of children.
|
1727
|
-
*
|
1728
|
-
* @param {?object} children Child collection structure.
|
1729
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
1730
|
-
* structure.
|
1731
|
-
*/
|
1732
|
-
|
1733
|
-
|
1734
|
-
function onlyChild(children) {
|
1735
|
-
if (!isValidElement(children)) {
|
1736
|
-
throw new Error('React.Children.only expected to receive a single React element child.');
|
1737
|
-
}
|
1738
|
-
|
1739
|
-
return children;
|
1740
|
-
}
|
1741
|
-
|
1742
|
-
// an immutable object with a single mutable value
|
1743
|
-
function createRef() {
|
1744
|
-
var refObject = {
|
1745
|
-
current: null
|
1746
|
-
};
|
1747
|
-
|
1748
|
-
{
|
1749
|
-
Object.seal(refObject);
|
1750
|
-
}
|
1751
|
-
|
1752
|
-
return refObject;
|
1753
|
-
}
|
1754
|
-
|
1755
|
-
function resolveDispatcher() {
|
1756
|
-
var dispatcher = ReactSharedInternals.H;
|
1757
|
-
|
1758
|
-
{
|
1759
|
-
if (dispatcher === null) {
|
1760
|
-
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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
401
|
+
function getOwner() {
|
402
|
+
var dispatcher = ReactSharedInternals.A;
|
403
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
1761
404
|
}
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
return dispatcher;
|
1768
|
-
}
|
1769
|
-
function useCallback(callback, deps) {
|
1770
|
-
var dispatcher = resolveDispatcher();
|
1771
|
-
return dispatcher.useCallback(callback, deps);
|
1772
|
-
}
|
1773
|
-
function useMemo(create, deps) {
|
1774
|
-
var dispatcher = resolveDispatcher();
|
1775
|
-
return dispatcher.useMemo(create, deps);
|
1776
|
-
}
|
1777
|
-
function useDebugValue(value, formatterFn) {
|
1778
|
-
{
|
1779
|
-
var dispatcher = resolveDispatcher();
|
1780
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
1781
|
-
}
|
1782
|
-
}
|
1783
|
-
function useId() {
|
1784
|
-
var dispatcher = resolveDispatcher();
|
1785
|
-
return dispatcher.useId();
|
1786
|
-
}
|
1787
|
-
function use(usable) {
|
1788
|
-
var dispatcher = resolveDispatcher();
|
1789
|
-
return dispatcher.use(usable);
|
1790
|
-
}
|
1791
|
-
|
1792
|
-
function forwardRef(render) {
|
1793
|
-
{
|
1794
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1795
|
-
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1796
|
-
} else if (typeof render !== 'function') {
|
1797
|
-
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1798
|
-
} else {
|
1799
|
-
if (render.length !== 0 && render.length !== 2) {
|
1800
|
-
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.');
|
405
|
+
function hasValidRef(config) {
|
406
|
+
if (hasOwnProperty.call(config, "ref")) {
|
407
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
408
|
+
if (getter && getter.isReactWarning) return !1;
|
1801
409
|
}
|
410
|
+
return void 0 !== config.ref;
|
1802
411
|
}
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
412
|
+
function hasValidKey(config) {
|
413
|
+
if (hasOwnProperty.call(config, "key")) {
|
414
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
415
|
+
if (getter && getter.isReactWarning) return !1;
|
1807
416
|
}
|
417
|
+
return void 0 !== config.key;
|
1808
418
|
}
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
var ownName;
|
1818
|
-
Object.defineProperty(elementType, 'displayName', {
|
1819
|
-
enumerable: false,
|
1820
|
-
configurable: true,
|
1821
|
-
get: function () {
|
1822
|
-
return ownName;
|
1823
|
-
},
|
1824
|
-
set: function (name) {
|
1825
|
-
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
1826
|
-
// because the component may be used elsewhere.
|
1827
|
-
// But it's nice for anonymous functions to inherit the name,
|
1828
|
-
// so that our component-stack generation logic will display their frames.
|
1829
|
-
// An anonymous function generally suggests a pattern like:
|
1830
|
-
// React.forwardRef((props, ref) => {...});
|
1831
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
1832
|
-
|
1833
|
-
if (!render.name && !render.displayName) {
|
1834
|
-
Object.defineProperty(render, 'name', {
|
1835
|
-
value: name
|
1836
|
-
});
|
1837
|
-
render.displayName = name;
|
1838
|
-
}
|
419
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
420
|
+
function warnAboutAccessingKey() {
|
421
|
+
specialPropKeyWarningShown ||
|
422
|
+
((specialPropKeyWarningShown = !0),
|
423
|
+
error$jscomp$0(
|
424
|
+
"%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://react.dev/link/special-props)",
|
425
|
+
displayName
|
426
|
+
));
|
1839
427
|
}
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
}
|
1845
|
-
|
1846
|
-
|
1847
|
-
var
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
428
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
429
|
+
Object.defineProperty(props, "key", {
|
430
|
+
get: warnAboutAccessingKey,
|
431
|
+
configurable: !0
|
432
|
+
});
|
433
|
+
}
|
434
|
+
function elementRefGetterWithDeprecationWarning() {
|
435
|
+
var componentName = getComponentNameFromType(this.type);
|
436
|
+
didWarnAboutElementRef[componentName] ||
|
437
|
+
((didWarnAboutElementRef[componentName] = !0),
|
438
|
+
error$jscomp$0(
|
439
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
440
|
+
));
|
441
|
+
componentName = this.props.ref;
|
442
|
+
return void 0 !== componentName ? componentName : null;
|
443
|
+
}
|
444
|
+
function ReactElement(type, key, _ref, self, source, owner, props) {
|
445
|
+
_ref = props.ref;
|
446
|
+
type = {
|
447
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
448
|
+
type: type,
|
449
|
+
key: key,
|
450
|
+
props: props,
|
451
|
+
_owner: owner
|
452
|
+
};
|
453
|
+
null !== (void 0 !== _ref ? _ref : null)
|
454
|
+
? Object.defineProperty(type, "ref", {
|
455
|
+
enumerable: !1,
|
456
|
+
get: elementRefGetterWithDeprecationWarning
|
457
|
+
})
|
458
|
+
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
|
459
|
+
type._store = {};
|
460
|
+
Object.defineProperty(type._store, "validated", {
|
461
|
+
configurable: !1,
|
462
|
+
enumerable: !1,
|
463
|
+
writable: !0,
|
464
|
+
value: 0
|
465
|
+
});
|
466
|
+
Object.defineProperty(type, "_debugInfo", {
|
467
|
+
configurable: !1,
|
468
|
+
enumerable: !1,
|
469
|
+
writable: !0,
|
470
|
+
value: null
|
471
|
+
});
|
472
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
473
|
+
return type;
|
474
|
+
}
|
475
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
476
|
+
newKey = ReactElement(
|
477
|
+
oldElement.type,
|
478
|
+
newKey,
|
479
|
+
null,
|
480
|
+
void 0,
|
481
|
+
void 0,
|
482
|
+
oldElement._owner,
|
483
|
+
oldElement.props
|
484
|
+
);
|
485
|
+
newKey._store.validated = oldElement._store.validated;
|
486
|
+
return newKey;
|
487
|
+
}
|
488
|
+
function validateChildKeys(node, parentType) {
|
489
|
+
if (
|
490
|
+
"object" === typeof node &&
|
491
|
+
node &&
|
492
|
+
node.$$typeof !== REACT_CLIENT_REFERENCE
|
493
|
+
)
|
494
|
+
if (isArrayImpl(node))
|
495
|
+
for (var i = 0; i < node.length; i++) {
|
496
|
+
var child = node[i];
|
497
|
+
isValidElement(child) && validateExplicitKey(child, parentType);
|
498
|
+
}
|
499
|
+
else if (isValidElement(node))
|
500
|
+
node._store && (node._store.validated = 1);
|
501
|
+
else if (
|
502
|
+
((i = getIteratorFn(node)),
|
503
|
+
"function" === typeof i &&
|
504
|
+
i !== node.entries &&
|
505
|
+
((i = i.call(node)), i !== node))
|
506
|
+
)
|
507
|
+
for (; !(node = i.next()).done; )
|
508
|
+
isValidElement(node.value) &&
|
509
|
+
validateExplicitKey(node.value, parentType);
|
510
|
+
}
|
511
|
+
function isValidElement(object) {
|
512
|
+
return (
|
513
|
+
"object" === typeof object &&
|
514
|
+
null !== object &&
|
515
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
516
|
+
);
|
517
|
+
}
|
518
|
+
function validateExplicitKey(element, parentType) {
|
519
|
+
if (
|
520
|
+
element._store &&
|
521
|
+
!element._store.validated &&
|
522
|
+
null == element.key &&
|
523
|
+
((element._store.validated = 1),
|
524
|
+
(parentType = getCurrentComponentErrorInfo(parentType)),
|
525
|
+
!ownerHasKeyUseWarning[parentType])
|
526
|
+
) {
|
527
|
+
ownerHasKeyUseWarning[parentType] = !0;
|
528
|
+
var childOwner = "";
|
529
|
+
element &&
|
530
|
+
null != element._owner &&
|
531
|
+
element._owner !== getOwner() &&
|
532
|
+
((childOwner = null),
|
533
|
+
"number" === typeof element._owner.tag
|
534
|
+
? (childOwner = getComponentNameFromType(element._owner.type))
|
535
|
+
: "string" === typeof element._owner.name &&
|
536
|
+
(childOwner = element._owner.name),
|
537
|
+
(childOwner = " It was passed a child from " + childOwner + "."));
|
538
|
+
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
539
|
+
ReactSharedInternals.getCurrentStack = function () {
|
540
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
541
|
+
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
542
|
+
return stack;
|
543
|
+
};
|
544
|
+
error$jscomp$0(
|
545
|
+
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
546
|
+
parentType,
|
547
|
+
childOwner
|
548
|
+
);
|
549
|
+
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
1873
550
|
}
|
1874
|
-
});
|
1875
|
-
|
1876
|
-
if (payload._status === Uninitialized) {
|
1877
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
1878
|
-
// to resolve. Set it as pending in the meantime.
|
1879
|
-
var pending = payload;
|
1880
|
-
pending._status = Pending;
|
1881
|
-
pending._result = thenable;
|
1882
551
|
}
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
|
1891
|
-
|
552
|
+
function getCurrentComponentErrorInfo(parentType) {
|
553
|
+
var info = "",
|
554
|
+
owner = getOwner();
|
555
|
+
owner &&
|
556
|
+
(owner = getComponentNameFromType(owner.type)) &&
|
557
|
+
(info = "\n\nCheck the render method of `" + owner + "`.");
|
558
|
+
info ||
|
559
|
+
((parentType = getComponentNameFromType(parentType)) &&
|
560
|
+
(info =
|
561
|
+
"\n\nCheck the top-level render call using <" + parentType + ">."));
|
562
|
+
return info;
|
563
|
+
}
|
564
|
+
function escape(key) {
|
565
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
566
|
+
return (
|
567
|
+
"$" +
|
568
|
+
key.replace(/[=:]/g, function (match) {
|
569
|
+
return escaperLookup[match];
|
570
|
+
})
|
571
|
+
);
|
572
|
+
}
|
573
|
+
function getElementKey(element, index) {
|
574
|
+
return "object" === typeof element &&
|
575
|
+
null !== element &&
|
576
|
+
null != element.key
|
577
|
+
? (checkKeyStringCoercion(element.key), escape("" + element.key))
|
578
|
+
: index.toString(36);
|
579
|
+
}
|
580
|
+
function noop() {}
|
581
|
+
function resolveThenable(thenable) {
|
582
|
+
switch (thenable.status) {
|
583
|
+
case "fulfilled":
|
584
|
+
return thenable.value;
|
585
|
+
case "rejected":
|
586
|
+
throw thenable.reason;
|
587
|
+
default:
|
588
|
+
switch (
|
589
|
+
("string" === typeof thenable.status
|
590
|
+
? thenable.then(noop, noop)
|
591
|
+
: ((thenable.status = "pending"),
|
592
|
+
thenable.then(
|
593
|
+
function (fulfilledValue) {
|
594
|
+
"pending" === thenable.status &&
|
595
|
+
((thenable.status = "fulfilled"),
|
596
|
+
(thenable.value = fulfilledValue));
|
597
|
+
},
|
598
|
+
function (error) {
|
599
|
+
"pending" === thenable.status &&
|
600
|
+
((thenable.status = "rejected"),
|
601
|
+
(thenable.reason = error));
|
602
|
+
}
|
603
|
+
)),
|
604
|
+
thenable.status)
|
605
|
+
) {
|
606
|
+
case "fulfilled":
|
607
|
+
return thenable.value;
|
608
|
+
case "rejected":
|
609
|
+
throw thenable.reason;
|
610
|
+
}
|
1892
611
|
}
|
612
|
+
throw thenable;
|
1893
613
|
}
|
1894
|
-
|
1895
|
-
|
1896
|
-
if (
|
1897
|
-
|
1898
|
-
|
614
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
615
|
+
var type = typeof children;
|
616
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
617
|
+
var invokeCallback = !1;
|
618
|
+
if (null === children) invokeCallback = !0;
|
619
|
+
else
|
620
|
+
switch (type) {
|
621
|
+
case "bigint":
|
622
|
+
case "string":
|
623
|
+
case "number":
|
624
|
+
invokeCallback = !0;
|
625
|
+
break;
|
626
|
+
case "object":
|
627
|
+
switch (children.$$typeof) {
|
628
|
+
case REACT_ELEMENT_TYPE:
|
629
|
+
case REACT_PORTAL_TYPE:
|
630
|
+
invokeCallback = !0;
|
631
|
+
break;
|
632
|
+
case REACT_LAZY_TYPE:
|
633
|
+
return (
|
634
|
+
(invokeCallback = children._init),
|
635
|
+
mapIntoArray(
|
636
|
+
invokeCallback(children._payload),
|
637
|
+
array,
|
638
|
+
escapedPrefix,
|
639
|
+
nameSoFar,
|
640
|
+
callback
|
641
|
+
)
|
642
|
+
);
|
643
|
+
}
|
644
|
+
}
|
645
|
+
if (invokeCallback) {
|
646
|
+
invokeCallback = children;
|
647
|
+
callback = callback(invokeCallback);
|
648
|
+
var childKey =
|
649
|
+
"" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
650
|
+
isArrayImpl(callback)
|
651
|
+
? ((escapedPrefix = ""),
|
652
|
+
null != childKey &&
|
653
|
+
(escapedPrefix =
|
654
|
+
childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
|
655
|
+
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
|
656
|
+
return c;
|
657
|
+
}))
|
658
|
+
: null != callback &&
|
659
|
+
(isValidElement(callback) &&
|
660
|
+
(null != callback.key &&
|
661
|
+
((invokeCallback && invokeCallback.key === callback.key) ||
|
662
|
+
checkKeyStringCoercion(callback.key)),
|
663
|
+
(escapedPrefix = cloneAndReplaceKey(
|
664
|
+
callback,
|
665
|
+
escapedPrefix +
|
666
|
+
(null == callback.key ||
|
667
|
+
(invokeCallback && invokeCallback.key === callback.key)
|
668
|
+
? ""
|
669
|
+
: ("" + callback.key).replace(
|
670
|
+
userProvidedKeyEscapeRegex,
|
671
|
+
"$&/"
|
672
|
+
) + "/") +
|
673
|
+
childKey
|
674
|
+
)),
|
675
|
+
"" !== nameSoFar &&
|
676
|
+
null != invokeCallback &&
|
677
|
+
isValidElement(invokeCallback) &&
|
678
|
+
null == invokeCallback.key &&
|
679
|
+
invokeCallback._store &&
|
680
|
+
!invokeCallback._store.validated &&
|
681
|
+
(escapedPrefix._store.validated = 2),
|
682
|
+
(callback = escapedPrefix)),
|
683
|
+
array.push(callback));
|
684
|
+
return 1;
|
685
|
+
}
|
686
|
+
invokeCallback = 0;
|
687
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
688
|
+
if (isArrayImpl(children))
|
689
|
+
for (var i = 0; i < children.length; i++)
|
690
|
+
(nameSoFar = children[i]),
|
691
|
+
(type = childKey + getElementKey(nameSoFar, i)),
|
692
|
+
(invokeCallback += mapIntoArray(
|
693
|
+
nameSoFar,
|
694
|
+
array,
|
695
|
+
escapedPrefix,
|
696
|
+
type,
|
697
|
+
callback
|
698
|
+
));
|
699
|
+
else if (((i = getIteratorFn(children)), "function" === typeof i))
|
700
|
+
for (
|
701
|
+
i === children.entries &&
|
702
|
+
(didWarnAboutMaps ||
|
703
|
+
warn(
|
704
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
705
|
+
),
|
706
|
+
(didWarnAboutMaps = !0)),
|
707
|
+
children = i.call(children),
|
708
|
+
i = 0;
|
709
|
+
!(nameSoFar = children.next()).done;
|
710
|
+
|
711
|
+
)
|
712
|
+
(nameSoFar = nameSoFar.value),
|
713
|
+
(type = childKey + getElementKey(nameSoFar, i++)),
|
714
|
+
(invokeCallback += mapIntoArray(
|
715
|
+
nameSoFar,
|
716
|
+
array,
|
717
|
+
escapedPrefix,
|
718
|
+
type,
|
719
|
+
callback
|
720
|
+
));
|
721
|
+
else if ("object" === type) {
|
722
|
+
if ("function" === typeof children.then)
|
723
|
+
return mapIntoArray(
|
724
|
+
resolveThenable(children),
|
725
|
+
array,
|
726
|
+
escapedPrefix,
|
727
|
+
nameSoFar,
|
728
|
+
callback
|
729
|
+
);
|
730
|
+
array = String(children);
|
731
|
+
throw Error(
|
732
|
+
"Objects are not valid as a React child (found: " +
|
733
|
+
("[object Object]" === array
|
734
|
+
? "object with keys {" + Object.keys(children).join(", ") + "}"
|
735
|
+
: array) +
|
736
|
+
"). If you meant to render a collection of children, use an array instead."
|
737
|
+
);
|
1899
738
|
}
|
739
|
+
return invokeCallback;
|
1900
740
|
}
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
var payload = {
|
1910
|
-
// We use these fields to store the result.
|
1911
|
-
_status: Uninitialized,
|
1912
|
-
_result: ctor
|
1913
|
-
};
|
1914
|
-
var lazyType = {
|
1915
|
-
$$typeof: REACT_LAZY_TYPE,
|
1916
|
-
_payload: payload,
|
1917
|
-
_init: lazyInitializer
|
1918
|
-
};
|
1919
|
-
|
1920
|
-
return lazyType;
|
1921
|
-
}
|
1922
|
-
|
1923
|
-
function memo(type, compare) {
|
1924
|
-
{
|
1925
|
-
if (!isValidElementType(type)) {
|
1926
|
-
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
741
|
+
function mapChildren(children, func, context) {
|
742
|
+
if (null == children) return children;
|
743
|
+
var result = [],
|
744
|
+
count = 0;
|
745
|
+
mapIntoArray(children, result, "", "", function (child) {
|
746
|
+
return func.call(context, child, count++);
|
747
|
+
});
|
748
|
+
return result;
|
1927
749
|
}
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
if (!type.name && !type.displayName) {
|
1954
|
-
Object.defineProperty(type, 'name', {
|
1955
|
-
value: name
|
1956
|
-
});
|
1957
|
-
type.displayName = name;
|
1958
|
-
}
|
750
|
+
function resolveDispatcher() {
|
751
|
+
var dispatcher = ReactSharedInternals.H;
|
752
|
+
null === dispatcher &&
|
753
|
+
error$jscomp$0(
|
754
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
755
|
+
);
|
756
|
+
return dispatcher;
|
757
|
+
}
|
758
|
+
function lazyInitializer(payload) {
|
759
|
+
if (-1 === payload._status) {
|
760
|
+
var ctor = payload._result;
|
761
|
+
ctor = ctor();
|
762
|
+
ctor.then(
|
763
|
+
function (moduleObject) {
|
764
|
+
if (0 === payload._status || -1 === payload._status)
|
765
|
+
(payload._status = 1), (payload._result = moduleObject);
|
766
|
+
},
|
767
|
+
function (error) {
|
768
|
+
if (0 === payload._status || -1 === payload._status)
|
769
|
+
(payload._status = 2), (payload._result = error);
|
770
|
+
}
|
771
|
+
);
|
772
|
+
-1 === payload._status &&
|
773
|
+
((payload._status = 0), (payload._result = ctor));
|
1959
774
|
}
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
s: UNTERMINATED,
|
1977
|
-
// status, represents whether the cached computation returned a value or threw an error
|
1978
|
-
v: undefined,
|
1979
|
-
// value, either the cached result or an error, depending on s
|
1980
|
-
o: null,
|
1981
|
-
// object cache, a WeakMap where non-primitive arguments are stored
|
1982
|
-
p: null // primitive cache, a regular Map where primitive arguments are stored.
|
1983
|
-
|
1984
|
-
};
|
1985
|
-
}
|
1986
|
-
|
1987
|
-
function cache(fn) {
|
1988
|
-
return function () {
|
1989
|
-
var dispatcher = ReactSharedInternals.A;
|
1990
|
-
|
1991
|
-
if (!dispatcher) {
|
1992
|
-
// If there is no dispatcher, then we treat this as not being cached.
|
1993
|
-
// $FlowFixMe[incompatible-call]: We don't want to use rest arguments since we transpile the code.
|
1994
|
-
return fn.apply(null, arguments);
|
775
|
+
if (1 === payload._status)
|
776
|
+
return (
|
777
|
+
(ctor = payload._result),
|
778
|
+
void 0 === ctor &&
|
779
|
+
error$jscomp$0(
|
780
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
781
|
+
ctor
|
782
|
+
),
|
783
|
+
"default" in ctor ||
|
784
|
+
error$jscomp$0(
|
785
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
786
|
+
ctor
|
787
|
+
),
|
788
|
+
ctor.default
|
789
|
+
);
|
790
|
+
throw payload._result;
|
1995
791
|
}
|
1996
|
-
|
1997
|
-
|
1998
|
-
var fnNode = fnMap.get(fn);
|
1999
|
-
var cacheNode;
|
2000
|
-
|
2001
|
-
if (fnNode === undefined) {
|
2002
|
-
cacheNode = createCacheNode();
|
2003
|
-
fnMap.set(fn, cacheNode);
|
2004
|
-
} else {
|
2005
|
-
cacheNode = fnNode;
|
792
|
+
function createCacheRoot() {
|
793
|
+
return new WeakMap();
|
2006
794
|
}
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
795
|
+
function createCacheNode() {
|
796
|
+
return { s: 0, v: void 0, o: null, p: null };
|
797
|
+
}
|
798
|
+
var ReactSharedInternals = { H: null, A: null, getCurrentStack: null },
|
799
|
+
isArrayImpl = Array.isArray,
|
800
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
801
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
802
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
803
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
804
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
805
|
+
Symbol.for("react.provider");
|
806
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
807
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
808
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
809
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
810
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
811
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
812
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
813
|
+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
814
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
815
|
+
REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
|
816
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
817
|
+
assign = Object.assign,
|
818
|
+
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
819
|
+
disabledDepth = 0,
|
820
|
+
prevLog,
|
821
|
+
prevInfo,
|
822
|
+
prevWarn,
|
823
|
+
prevError,
|
824
|
+
prevGroup,
|
825
|
+
prevGroupCollapsed,
|
826
|
+
prevGroupEnd;
|
827
|
+
disabledLog.__reactDisabledLog = !0;
|
828
|
+
var prefix,
|
829
|
+
reentry = !1;
|
830
|
+
var componentFrameCache = new (
|
831
|
+
"function" === typeof WeakMap ? WeakMap : Map
|
832
|
+
)();
|
833
|
+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
834
|
+
specialPropKeyWarningShown,
|
835
|
+
didWarnAboutOldJSXRuntime;
|
836
|
+
var didWarnAboutElementRef = {};
|
837
|
+
var ownerHasKeyUseWarning = {},
|
838
|
+
didWarnAboutMaps = !1,
|
839
|
+
userProvidedKeyEscapeRegex = /\/+/g;
|
840
|
+
exports.Children = {
|
841
|
+
map: mapChildren,
|
842
|
+
forEach: function (children, forEachFunc, forEachContext) {
|
843
|
+
mapChildren(
|
844
|
+
children,
|
845
|
+
function () {
|
846
|
+
forEachFunc.apply(this, arguments);
|
847
|
+
},
|
848
|
+
forEachContext
|
849
|
+
);
|
850
|
+
},
|
851
|
+
count: function (children) {
|
852
|
+
var n = 0;
|
853
|
+
mapChildren(children, function () {
|
854
|
+
n++;
|
855
|
+
});
|
856
|
+
return n;
|
857
|
+
},
|
858
|
+
toArray: function (children) {
|
859
|
+
return (
|
860
|
+
mapChildren(children, function (child) {
|
861
|
+
return child;
|
862
|
+
}) || []
|
863
|
+
);
|
864
|
+
},
|
865
|
+
only: function (children) {
|
866
|
+
if (!isValidElement(children))
|
867
|
+
throw Error(
|
868
|
+
"React.Children.only expected to receive a single React element child."
|
869
|
+
);
|
870
|
+
return children;
|
871
|
+
}
|
872
|
+
};
|
873
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
874
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
875
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
876
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
877
|
+
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
|
878
|
+
ReactSharedInternals;
|
879
|
+
exports.cache = function (fn) {
|
880
|
+
return function () {
|
881
|
+
var dispatcher = ReactSharedInternals.A;
|
882
|
+
if (!dispatcher) return fn.apply(null, arguments);
|
883
|
+
var fnMap = dispatcher.getCacheForType(createCacheRoot);
|
884
|
+
dispatcher = fnMap.get(fn);
|
885
|
+
void 0 === dispatcher &&
|
886
|
+
((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
|
887
|
+
fnMap = 0;
|
888
|
+
for (var l = arguments.length; fnMap < l; fnMap++) {
|
889
|
+
var arg = arguments[fnMap];
|
890
|
+
if (
|
891
|
+
"function" === typeof arg ||
|
892
|
+
("object" === typeof arg && null !== arg)
|
893
|
+
) {
|
894
|
+
var objectCache = dispatcher.o;
|
895
|
+
null === objectCache &&
|
896
|
+
(dispatcher.o = objectCache = new WeakMap());
|
897
|
+
dispatcher = objectCache.get(arg);
|
898
|
+
void 0 === dispatcher &&
|
899
|
+
((dispatcher = createCacheNode()),
|
900
|
+
objectCache.set(arg, dispatcher));
|
901
|
+
} else
|
902
|
+
(objectCache = dispatcher.p),
|
903
|
+
null === objectCache && (dispatcher.p = objectCache = new Map()),
|
904
|
+
(dispatcher = objectCache.get(arg)),
|
905
|
+
void 0 === dispatcher &&
|
906
|
+
((dispatcher = createCacheNode()),
|
907
|
+
objectCache.set(arg, dispatcher));
|
2017
908
|
}
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
|
909
|
+
if (1 === dispatcher.s) return dispatcher.v;
|
910
|
+
if (2 === dispatcher.s) throw dispatcher.v;
|
911
|
+
try {
|
912
|
+
var result = fn.apply(null, arguments);
|
913
|
+
fnMap = dispatcher;
|
914
|
+
fnMap.s = 1;
|
915
|
+
return (fnMap.v = result);
|
916
|
+
} catch (error$2) {
|
917
|
+
throw (
|
918
|
+
((result = dispatcher),
|
919
|
+
(result.s = 2),
|
920
|
+
(result.v = error$2),
|
921
|
+
error$2)
|
922
|
+
);
|
2026
923
|
}
|
2027
|
-
}
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
|
2032
|
-
|
924
|
+
};
|
925
|
+
};
|
926
|
+
exports.cloneElement = function (element, config, children) {
|
927
|
+
if (null === element || void 0 === element)
|
928
|
+
throw Error(
|
929
|
+
"The argument must be a React element, but you passed " +
|
930
|
+
element +
|
931
|
+
"."
|
932
|
+
);
|
933
|
+
var props = assign({}, element.props),
|
934
|
+
key = element.key,
|
935
|
+
owner = element._owner;
|
936
|
+
if (null != config)
|
937
|
+
for (propName in (hasValidRef(config) && (owner = getOwner()),
|
938
|
+
hasValidKey(config) &&
|
939
|
+
(checkKeyStringCoercion(config.key), (key = "" + config.key)),
|
940
|
+
config))
|
941
|
+
!hasOwnProperty.call(config, propName) ||
|
942
|
+
"key" === propName ||
|
943
|
+
"__self" === propName ||
|
944
|
+
"__source" === propName ||
|
945
|
+
("ref" === propName && void 0 === config.ref) ||
|
946
|
+
(props[propName] = config[propName]);
|
947
|
+
var propName = arguments.length - 2;
|
948
|
+
if (1 === propName) props.children = children;
|
949
|
+
else if (1 < propName) {
|
950
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
951
|
+
childArray[i] = arguments[i + 2];
|
952
|
+
props.children = childArray;
|
953
|
+
}
|
954
|
+
props = ReactElement(
|
955
|
+
element.type,
|
956
|
+
key,
|
957
|
+
null,
|
958
|
+
void 0,
|
959
|
+
void 0,
|
960
|
+
owner,
|
961
|
+
props
|
962
|
+
);
|
963
|
+
for (key = 2; key < arguments.length; key++)
|
964
|
+
validateChildKeys(arguments[key], props.type);
|
965
|
+
return props;
|
966
|
+
};
|
967
|
+
exports.createElement = function (type, config, children) {
|
968
|
+
if (isValidElementType(type))
|
969
|
+
for (var i = 2; i < arguments.length; i++)
|
970
|
+
validateChildKeys(arguments[i], type);
|
971
|
+
else {
|
972
|
+
i = "";
|
973
|
+
if (
|
974
|
+
void 0 === type ||
|
975
|
+
("object" === typeof type &&
|
976
|
+
null !== type &&
|
977
|
+
0 === Object.keys(type).length)
|
978
|
+
)
|
979
|
+
i +=
|
980
|
+
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
981
|
+
if (null === type) var typeString = "null";
|
982
|
+
else
|
983
|
+
isArrayImpl(type)
|
984
|
+
? (typeString = "array")
|
985
|
+
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
|
986
|
+
? ((typeString =
|
987
|
+
"<" +
|
988
|
+
(getComponentNameFromType(type.type) || "Unknown") +
|
989
|
+
" />"),
|
990
|
+
(i =
|
991
|
+
" Did you accidentally export a JSX literal instead of a component?"))
|
992
|
+
: (typeString = typeof type);
|
993
|
+
error$jscomp$0(
|
994
|
+
"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
995
|
+
typeString,
|
996
|
+
i
|
997
|
+
);
|
998
|
+
}
|
999
|
+
i = {};
|
1000
|
+
typeString = null;
|
1001
|
+
if (null != config)
|
1002
|
+
for (propName in (didWarnAboutOldJSXRuntime ||
|
1003
|
+
!("__self" in config) ||
|
1004
|
+
"key" in config ||
|
1005
|
+
((didWarnAboutOldJSXRuntime = !0),
|
1006
|
+
warn(
|
1007
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
1008
|
+
)),
|
1009
|
+
hasValidRef(config),
|
1010
|
+
hasValidKey(config) &&
|
1011
|
+
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
|
1012
|
+
config))
|
1013
|
+
hasOwnProperty.call(config, propName) &&
|
1014
|
+
"key" !== propName &&
|
1015
|
+
"__self" !== propName &&
|
1016
|
+
"__source" !== propName &&
|
1017
|
+
(i[propName] = config[propName]);
|
1018
|
+
var childrenLength = arguments.length - 2;
|
1019
|
+
if (1 === childrenLength) i.children = children;
|
1020
|
+
else if (1 < childrenLength) {
|
1021
|
+
for (
|
1022
|
+
var childArray = Array(childrenLength), _i = 0;
|
1023
|
+
_i < childrenLength;
|
1024
|
+
_i++
|
1025
|
+
)
|
1026
|
+
childArray[_i] = arguments[_i + 2];
|
1027
|
+
Object.freeze && Object.freeze(childArray);
|
1028
|
+
i.children = childArray;
|
1029
|
+
}
|
1030
|
+
if (type && type.defaultProps)
|
1031
|
+
for (propName in ((childrenLength = type.defaultProps), childrenLength))
|
1032
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
1033
|
+
if (typeString) {
|
1034
|
+
var propName =
|
1035
|
+
"function" === typeof type
|
1036
|
+
? type.displayName || type.name || "Unknown"
|
1037
|
+
: type;
|
1038
|
+
typeString && defineKeyPropWarningGetter(i, propName);
|
1039
|
+
}
|
1040
|
+
return ReactElement(
|
1041
|
+
type,
|
1042
|
+
typeString,
|
1043
|
+
null,
|
1044
|
+
void 0,
|
1045
|
+
void 0,
|
1046
|
+
getOwner(),
|
1047
|
+
i
|
1048
|
+
);
|
1049
|
+
};
|
1050
|
+
exports.createRef = function () {
|
1051
|
+
var refObject = { current: null };
|
1052
|
+
Object.seal(refObject);
|
1053
|
+
return refObject;
|
1054
|
+
};
|
1055
|
+
exports.forwardRef = function (render) {
|
1056
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE
|
1057
|
+
? error$jscomp$0(
|
1058
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
1059
|
+
)
|
1060
|
+
: "function" !== typeof render
|
1061
|
+
? error$jscomp$0(
|
1062
|
+
"forwardRef requires a render function but was given %s.",
|
1063
|
+
null === render ? "null" : typeof render
|
1064
|
+
)
|
1065
|
+
: 0 !== render.length &&
|
1066
|
+
2 !== render.length &&
|
1067
|
+
error$jscomp$0(
|
1068
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
1069
|
+
1 === render.length
|
1070
|
+
? "Did you forget to use the ref parameter?"
|
1071
|
+
: "Any additional parameter will be undefined."
|
1072
|
+
);
|
1073
|
+
null != render &&
|
1074
|
+
null != render.defaultProps &&
|
1075
|
+
error$jscomp$0(
|
1076
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
1077
|
+
);
|
1078
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
|
1079
|
+
ownName;
|
1080
|
+
Object.defineProperty(elementType, "displayName", {
|
1081
|
+
enumerable: !1,
|
1082
|
+
configurable: !0,
|
1083
|
+
get: function () {
|
1084
|
+
return ownName;
|
1085
|
+
},
|
1086
|
+
set: function (name) {
|
1087
|
+
ownName = name;
|
1088
|
+
render.name ||
|
1089
|
+
render.displayName ||
|
1090
|
+
(Object.defineProperty(render, "name", { value: name }),
|
1091
|
+
(render.displayName = name));
|
2033
1092
|
}
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
2040
|
-
|
2041
|
-
|
1093
|
+
});
|
1094
|
+
return elementType;
|
1095
|
+
};
|
1096
|
+
exports.isValidElement = isValidElement;
|
1097
|
+
exports.lazy = function (ctor) {
|
1098
|
+
return {
|
1099
|
+
$$typeof: REACT_LAZY_TYPE,
|
1100
|
+
_payload: { _status: -1, _result: ctor },
|
1101
|
+
_init: lazyInitializer
|
1102
|
+
};
|
1103
|
+
};
|
1104
|
+
exports.memo = function (type, compare) {
|
1105
|
+
isValidElementType(type) ||
|
1106
|
+
error$jscomp$0(
|
1107
|
+
"memo: The first argument must be a component. Instead received: %s",
|
1108
|
+
null === type ? "null" : typeof type
|
1109
|
+
);
|
1110
|
+
compare = {
|
1111
|
+
$$typeof: REACT_MEMO_TYPE,
|
1112
|
+
type: type,
|
1113
|
+
compare: void 0 === compare ? null : compare
|
1114
|
+
};
|
1115
|
+
var ownName;
|
1116
|
+
Object.defineProperty(compare, "displayName", {
|
1117
|
+
enumerable: !1,
|
1118
|
+
configurable: !0,
|
1119
|
+
get: function () {
|
1120
|
+
return ownName;
|
1121
|
+
},
|
1122
|
+
set: function (name) {
|
1123
|
+
ownName = name;
|
1124
|
+
type.name ||
|
1125
|
+
type.displayName ||
|
1126
|
+
(Object.defineProperty(type, "name", { value: name }),
|
1127
|
+
(type.displayName = name));
|
2042
1128
|
}
|
2043
|
-
}
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
return
|
2048
|
-
}
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2059
|
-
|
2060
|
-
|
2061
|
-
|
2062
|
-
// We store the first error that's thrown and rethrow it.
|
2063
|
-
var erroredNode = cacheNode;
|
2064
|
-
erroredNode.s = ERRORED;
|
2065
|
-
erroredNode.v = error;
|
2066
|
-
throw error;
|
2067
|
-
}
|
2068
|
-
};
|
2069
|
-
}
|
2070
|
-
|
2071
|
-
var ReactVersion = '19.0.0-rc-20b6f4c0e8-20240607';
|
2072
|
-
|
2073
|
-
var Children = {
|
2074
|
-
map: mapChildren,
|
2075
|
-
forEach: forEachChildren,
|
2076
|
-
count: countChildren,
|
2077
|
-
toArray: toArray,
|
2078
|
-
only: onlyChild
|
2079
|
-
};
|
2080
|
-
|
2081
|
-
exports.Children = Children;
|
2082
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
2083
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
2084
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
2085
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
2086
|
-
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
2087
|
-
exports.cache = cache;
|
2088
|
-
exports.cloneElement = cloneElement;
|
2089
|
-
exports.createElement = createElement;
|
2090
|
-
exports.createRef = createRef;
|
2091
|
-
exports.forwardRef = forwardRef;
|
2092
|
-
exports.isValidElement = isValidElement;
|
2093
|
-
exports.lazy = lazy;
|
2094
|
-
exports.memo = memo;
|
2095
|
-
exports.use = use;
|
2096
|
-
exports.useCallback = useCallback;
|
2097
|
-
exports.useDebugValue = useDebugValue;
|
2098
|
-
exports.useId = useId;
|
2099
|
-
exports.useMemo = useMemo;
|
2100
|
-
exports.version = ReactVersion;
|
1129
|
+
});
|
1130
|
+
return compare;
|
1131
|
+
};
|
1132
|
+
exports.use = function (usable) {
|
1133
|
+
return resolveDispatcher().use(usable);
|
1134
|
+
};
|
1135
|
+
exports.useCallback = function (callback, deps) {
|
1136
|
+
return resolveDispatcher().useCallback(callback, deps);
|
1137
|
+
};
|
1138
|
+
exports.useDebugValue = function (value, formatterFn) {
|
1139
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
1140
|
+
};
|
1141
|
+
exports.useId = function () {
|
1142
|
+
return resolveDispatcher().useId();
|
1143
|
+
};
|
1144
|
+
exports.useMemo = function (create, deps) {
|
1145
|
+
return resolveDispatcher().useMemo(create, deps);
|
1146
|
+
};
|
1147
|
+
exports.version = "19.0.0-rc-a532d91d01-20240610";
|
2101
1148
|
})();
|
2102
|
-
}
|