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.
@@ -8,1261 +8,679 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
-
17
- var React = require('react');
18
-
19
- // -----------------------------------------------------------------------------
20
-
21
- var enableScopeAPI = false; // Experimental Create Event Handle API.
22
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
23
-
24
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
25
- // as a normal prop instead of stripping it from the props object.
26
- // Passes `ref` as a normal prop instead of stripping it from the props object
27
- // during element creation.
28
-
29
- var enableRefAsProp = true;
30
-
31
- var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
32
- // stuff. Intended to enable React core members to more easily debug scheduling
33
- // issues in DEV builds.
34
-
35
- var enableDebugTracing = false;
36
-
37
- var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
38
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
39
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
40
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
41
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
42
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
43
-
44
- var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
45
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
46
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
47
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
48
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
49
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
50
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
51
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
52
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
53
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
54
- function getIteratorFn(maybeIterable) {
55
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
56
- return null;
57
- }
58
-
59
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
60
-
61
- if (typeof maybeIterator === 'function') {
62
- return maybeIterator;
63
- }
64
-
65
- return null;
66
- }
67
-
68
- var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
69
-
70
- function error(format) {
71
- {
72
- {
73
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ function error(format) {
15
+ for (
16
+ var _len2 = arguments.length,
17
+ args = Array(1 < _len2 ? _len2 - 1 : 0),
18
+ _key2 = 1;
19
+ _key2 < _len2;
20
+ _key2++
21
+ )
74
22
  args[_key2 - 1] = arguments[_key2];
23
+ printWarning("error", format, args, Error("react-stack-top-frame"));
24
+ }
25
+ function printWarning(level, format, args, currentStack) {
26
+ var isErrorLogger =
27
+ "%s\n\n%s\n" === format || "%o\n\n%s\n\n%s\n" === format;
28
+ ReactSharedInternals.getCurrentStack &&
29
+ ((currentStack = ReactSharedInternals.getCurrentStack(currentStack)),
30
+ "" !== currentStack &&
31
+ ((format += "%s"), (args = args.concat([currentStack]))));
32
+ isErrorLogger
33
+ ? args.unshift(format)
34
+ : ((args = args.map(function (item) {
35
+ return String(item);
36
+ })),
37
+ args.unshift("Warning: " + format));
38
+ Function.prototype.apply.call(console[level], console, args);
39
+ }
40
+ function getComponentNameFromType(type) {
41
+ if (null == type) return null;
42
+ if ("function" === typeof type)
43
+ return type.$$typeof === REACT_CLIENT_REFERENCE$2
44
+ ? null
45
+ : type.displayName || type.name || null;
46
+ if ("string" === typeof type) return type;
47
+ switch (type) {
48
+ case REACT_FRAGMENT_TYPE:
49
+ return "Fragment";
50
+ case REACT_PORTAL_TYPE:
51
+ return "Portal";
52
+ case REACT_PROFILER_TYPE:
53
+ return "Profiler";
54
+ case REACT_STRICT_MODE_TYPE:
55
+ return "StrictMode";
56
+ case REACT_SUSPENSE_TYPE:
57
+ return "Suspense";
58
+ case REACT_SUSPENSE_LIST_TYPE:
59
+ return "SuspenseList";
75
60
  }
76
-
77
- printWarning('error', format, args, new Error('react-stack-top-frame'));
78
- }
79
- }
80
- } // eslint-disable-next-line react-internal/no-production-logging
81
-
82
- function printWarning(level, format, args, currentStack) {
83
- // When changing this logic, you might want to also
84
- // update consoleWithStackDev.www.js as well.
85
- {
86
- var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
87
-
88
- if (ReactSharedInternals.getCurrentStack) {
89
- // We only add the current stack to the console when createTask is not supported.
90
- // Since createTask requires DevTools to be open to work, this means that stacks
91
- // can be lost while DevTools isn't open but we can't detect this.
92
- var stack = ReactSharedInternals.getCurrentStack(currentStack);
93
-
94
- if (stack !== '') {
95
- format += '%s';
96
- args = args.concat([stack]);
97
- }
98
- }
99
-
100
- if (isErrorLogger) {
101
- // Don't prefix our default logging formatting in ReactFiberErrorLoggger.
102
- // Don't toString the arguments.
103
- args.unshift(format);
104
- } else {
105
- // TODO: Remove this prefix and stop toStringing in the wrapper and
106
- // instead do it at each callsite as needed.
107
- // Careful: RN currently depends on this prefix
108
- // eslint-disable-next-line react-internal/safe-string-coercion
109
- args = args.map(function (item) {
110
- return String(item);
111
- });
112
- args.unshift('Warning: ' + format);
113
- } // We intentionally don't use spread (or .apply) directly because it
114
- // breaks IE9: https://github.com/facebook/react/issues/13610
115
- // eslint-disable-next-line react-internal/no-production-logging
116
-
117
-
118
- Function.prototype.apply.call(console[level], console, args);
119
- }
120
- }
121
-
122
- function getWrappedName(outerType, innerType, wrapperName) {
123
- var displayName = outerType.displayName;
124
-
125
- if (displayName) {
126
- return displayName;
127
- }
128
-
129
- var functionName = innerType.displayName || innerType.name || '';
130
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
131
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
132
-
133
-
134
- function getContextName(type) {
135
- return type.displayName || 'Context';
136
- }
137
-
138
- var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
139
-
140
- function getComponentNameFromType(type) {
141
- if (type == null) {
142
- // Host root, text node or just invalid type.
143
- return null;
144
- }
145
-
146
- if (typeof type === 'function') {
147
- if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
148
- // TODO: Create a convention for naming client references with debug info.
149
- return null;
150
- }
151
-
152
- return type.displayName || type.name || null;
153
- }
154
-
155
- if (typeof type === 'string') {
156
- return type;
157
- }
158
-
159
- switch (type) {
160
- case REACT_FRAGMENT_TYPE:
161
- return 'Fragment';
162
-
163
- case REACT_PORTAL_TYPE:
164
- return 'Portal';
165
-
166
- case REACT_PROFILER_TYPE:
167
- return 'Profiler';
168
-
169
- case REACT_STRICT_MODE_TYPE:
170
- return 'StrictMode';
171
-
172
- case REACT_SUSPENSE_TYPE:
173
- return 'Suspense';
174
-
175
- case REACT_SUSPENSE_LIST_TYPE:
176
- return 'SuspenseList';
177
-
178
- }
179
-
180
- if (typeof type === 'object') {
181
- {
182
- if (typeof type.tag === 'number') {
183
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
184
- }
185
- }
186
-
187
- switch (type.$$typeof) {
188
- case REACT_PROVIDER_TYPE:
189
- {
190
- return null;
191
- }
192
-
193
- case REACT_CONTEXT_TYPE:
194
- var context = type;
195
-
196
- {
197
- return getContextName(context) + '.Provider';
198
- }
199
-
200
- case REACT_CONSUMER_TYPE:
201
- {
202
- var consumer = type;
203
- return getContextName(consumer._context) + '.Consumer';
204
- }
205
-
206
- case REACT_FORWARD_REF_TYPE:
207
- return getWrappedName(type, type.render, 'ForwardRef');
208
-
209
- case REACT_MEMO_TYPE:
210
- var outerName = type.displayName || null;
211
-
212
- if (outerName !== null) {
213
- return outerName;
214
- }
215
-
216
- return getComponentNameFromType(type.type) || 'Memo';
217
-
218
- case REACT_LAZY_TYPE:
219
- {
220
- var lazyComponent = type;
221
- var payload = lazyComponent._payload;
222
- var init = lazyComponent._init;
223
-
224
- try {
225
- return getComponentNameFromType(init(payload));
226
- } catch (x) {
227
- return null;
228
- }
61
+ if ("object" === typeof type)
62
+ switch (
63
+ ("number" === typeof type.tag &&
64
+ error(
65
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
66
+ ),
67
+ type.$$typeof)
68
+ ) {
69
+ case REACT_CONTEXT_TYPE:
70
+ return (type.displayName || "Context") + ".Provider";
71
+ case REACT_CONSUMER_TYPE:
72
+ return (type._context.displayName || "Context") + ".Consumer";
73
+ case REACT_FORWARD_REF_TYPE:
74
+ var innerType = type.render;
75
+ type = type.displayName;
76
+ type ||
77
+ ((type = innerType.displayName || innerType.name || ""),
78
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
79
+ return type;
80
+ case REACT_MEMO_TYPE:
81
+ return (
82
+ (innerType = type.displayName || null),
83
+ null !== innerType
84
+ ? innerType
85
+ : getComponentNameFromType(type.type) || "Memo"
86
+ );
87
+ case REACT_LAZY_TYPE:
88
+ innerType = type._payload;
89
+ type = type._init;
90
+ try {
91
+ return getComponentNameFromType(type(innerType));
92
+ } catch (x) {}
229
93
  }
94
+ return null;
230
95
  }
231
- }
232
-
233
- return null;
234
- }
235
-
236
- // $FlowFixMe[method-unbinding]
237
- var hasOwnProperty = Object.prototype.hasOwnProperty;
238
-
239
- var assign = Object.assign;
240
-
241
- /*
242
- * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
243
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
244
- *
245
- * The functions in this module will throw an easier-to-understand,
246
- * easier-to-debug exception with a clear errors message message explaining the
247
- * problem. (Instead of a confusing exception thrown inside the implementation
248
- * of the `value` object).
249
- */
250
- // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
251
- function typeName(value) {
252
- {
253
- // toStringTag is needed for namespaced types like Temporal.Instant
254
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
255
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
256
-
257
- return type;
258
- }
259
- } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
260
-
261
-
262
- function willCoercionThrow(value) {
263
- {
264
- try {
265
- testStringCoercion(value);
266
- return false;
267
- } catch (e) {
268
- return true;
269
- }
270
- }
271
- }
272
-
273
- function testStringCoercion(value) {
274
- // If you ended up here by following an exception call stack, here's what's
275
- // happened: you supplied an object or symbol value to React (as a prop, key,
276
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
277
- // coerce it to a string using `'' + value`, an exception was thrown.
278
- //
279
- // The most common types that will cause this exception are `Symbol` instances
280
- // and Temporal objects like `Temporal.Instant`. But any object that has a
281
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
282
- // exception. (Library authors do this to prevent users from using built-in
283
- // numeric operators like `+` or comparison operators like `>=` because custom
284
- // methods are needed to perform accurate arithmetic or comparison.)
285
- //
286
- // To fix the problem, coerce this object or symbol value to a string before
287
- // passing it to React. The most reliable way is usually `String(value)`.
288
- //
289
- // To find which value is throwing, check the browser or debugger console.
290
- // Before this exception was thrown, there should be `console.error` output
291
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
292
- // problem and how that type was used: key, atrribute, input value prop, etc.
293
- // In most cases, this console output also shows the component and its
294
- // ancestor components where the exception happened.
295
- //
296
- // eslint-disable-next-line react-internal/safe-string-coercion
297
- return '' + value;
298
- }
299
- function checkKeyStringCoercion(value) {
300
- {
301
- if (willCoercionThrow(value)) {
302
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
303
-
304
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
305
- }
306
- }
307
- }
308
-
309
- 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.
310
- // TODO: Delete this when enableOwnerStacks ships.
311
-
312
- function isValidElementType(type) {
313
- if (typeof type === 'string' || typeof type === 'function') {
314
- return true;
315
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
316
-
317
-
318
- 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 ) {
319
- return true;
320
- }
321
-
322
- if (typeof type === 'object' && type !== null) {
323
- 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
324
- // types supported by any Flight configuration anywhere since
325
- // we don't know which Flight build this will end up being used
326
- // with.
327
- type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
328
- return true;
329
- }
330
- }
331
-
332
- return false;
333
- }
334
-
335
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
336
-
337
- function isArray(a) {
338
- return isArrayImpl(a);
339
- }
340
-
341
- // Helpers to patch console.logs to avoid logging during side-effect free
342
- // replaying on render function. This currently only patches the object
343
- // lazily which won't cover if the log function was extracted eagerly.
344
- // We could also eagerly patch the method.
345
- var disabledDepth = 0;
346
- var prevLog;
347
- var prevInfo;
348
- var prevWarn;
349
- var prevError;
350
- var prevGroup;
351
- var prevGroupCollapsed;
352
- var prevGroupEnd;
353
-
354
- function disabledLog() {}
355
-
356
- disabledLog.__reactDisabledLog = true;
357
- function disableLogs() {
358
- {
359
- if (disabledDepth === 0) {
360
- /* eslint-disable react-internal/no-production-logging */
361
- prevLog = console.log;
362
- prevInfo = console.info;
363
- prevWarn = console.warn;
364
- prevError = console.error;
365
- prevGroup = console.group;
366
- prevGroupCollapsed = console.groupCollapsed;
367
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
368
-
369
- var props = {
370
- configurable: true,
371
- enumerable: true,
372
- value: disabledLog,
373
- writable: true
374
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
375
-
376
- Object.defineProperties(console, {
377
- info: props,
378
- log: props,
379
- warn: props,
380
- error: props,
381
- group: props,
382
- groupCollapsed: props,
383
- groupEnd: props
384
- });
385
- /* eslint-enable react-internal/no-production-logging */
386
- }
387
-
388
- disabledDepth++;
389
- }
390
- }
391
- function reenableLogs() {
392
- {
393
- disabledDepth--;
394
-
395
- if (disabledDepth === 0) {
396
- /* eslint-disable react-internal/no-production-logging */
397
- var props = {
398
- configurable: true,
399
- enumerable: true,
400
- writable: true
401
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
402
-
403
- Object.defineProperties(console, {
404
- log: assign({}, props, {
405
- value: prevLog
406
- }),
407
- info: assign({}, props, {
408
- value: prevInfo
409
- }),
410
- warn: assign({}, props, {
411
- value: prevWarn
412
- }),
413
- error: assign({}, props, {
414
- value: prevError
415
- }),
416
- group: assign({}, props, {
417
- value: prevGroup
418
- }),
419
- groupCollapsed: assign({}, props, {
420
- value: prevGroupCollapsed
421
- }),
422
- groupEnd: assign({}, props, {
423
- value: prevGroupEnd
424
- })
425
- });
426
- /* eslint-enable react-internal/no-production-logging */
427
- }
428
-
429
- if (disabledDepth < 0) {
430
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
96
+ function testStringCoercion(value) {
97
+ return "" + value;
431
98
  }
432
- }
433
- }
434
-
435
- var prefix;
436
- function describeBuiltInComponentFrame(name) {
437
- {
438
- if (prefix === undefined) {
439
- // Extract the VM specific prefix used by each line.
99
+ function checkKeyStringCoercion(value) {
440
100
  try {
441
- throw Error();
442
- } catch (x) {
443
- var match = x.stack.trim().match(/\n( *(at )?)/);
444
- prefix = match && match[1] || '';
101
+ testStringCoercion(value);
102
+ var JSCompiler_inline_result = !1;
103
+ } catch (e) {
104
+ JSCompiler_inline_result = !0;
445
105
  }
446
- } // We use the prefix to ensure our stacks line up with native stack frames.
447
-
448
-
449
- return '\n' + prefix + name;
450
- }
451
- }
452
- var reentry = false;
453
- var componentFrameCache;
454
-
455
- {
456
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
457
- componentFrameCache = new PossiblyWeakMap();
458
- }
459
- /**
460
- * Leverages native browser/VM stack frames to get proper details (e.g.
461
- * filename, line + col number) for a single component in a component stack. We
462
- * do this by:
463
- * (1) throwing and catching an error in the function - this will be our
464
- * control error.
465
- * (2) calling the component which will eventually throw an error that we'll
466
- * catch - this will be our sample error.
467
- * (3) diffing the control and sample error stacks to find the stack frame
468
- * which represents our component.
469
- */
470
-
471
-
472
- function describeNativeComponentFrame(fn, construct) {
473
- // If something asked for a stack inside a fake render, it should get ignored.
474
- if (!fn || reentry) {
475
- return '';
476
- }
477
-
478
- {
479
- var frame = componentFrameCache.get(fn);
480
-
481
- if (frame !== undefined) {
482
- return frame;
483
- }
484
- }
485
-
486
- reentry = true;
487
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
488
-
489
- Error.prepareStackTrace = undefined;
490
- var previousDispatcher = null;
491
-
492
- {
493
- previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
494
- // for warnings.
495
-
496
- ReactSharedInternals.H = null;
497
- disableLogs();
498
- }
499
- /**
500
- * Finding a common stack frame between sample and control errors can be
501
- * tricky given the different types and levels of stack trace truncation from
502
- * different JS VMs. So instead we'll attempt to control what that common
503
- * frame should be through this object method:
504
- * Having both the sample and control errors be in the function under the
505
- * `DescribeNativeComponentFrameRoot` property, + setting the `name` and
506
- * `displayName` properties of the function ensures that a stack
507
- * frame exists that has the method name `DescribeNativeComponentFrameRoot` in
508
- * it for both control and sample stacks.
509
- */
510
-
511
-
512
- var RunInRootFrame = {
513
- DetermineComponentFrameRoot: function () {
514
- var control;
515
-
516
- try {
517
- // This should throw.
518
- if (construct) {
519
- // Something should be setting the props in the constructor.
520
- var Fake = function () {
521
- throw Error();
522
- }; // $FlowFixMe[prop-missing]
523
-
524
-
525
- Object.defineProperty(Fake.prototype, 'props', {
526
- set: function () {
527
- // We use a throwing setter instead of frozen or non-writable props
528
- // because that won't throw in a non-strict mode function.
529
- throw Error();
530
- }
531
- });
532
-
533
- if (typeof Reflect === 'object' && Reflect.construct) {
534
- // We construct a different control for this case to include any extra
535
- // frames added by the construct call.
536
- try {
537
- Reflect.construct(Fake, []);
538
- } catch (x) {
539
- control = x;
540
- }
541
-
542
- Reflect.construct(fn, [], Fake);
543
- } else {
544
- try {
545
- Fake.call();
546
- } catch (x) {
547
- control = x;
548
- } // $FlowFixMe[prop-missing] found when upgrading Flow
549
-
550
-
551
- fn.call(Fake.prototype);
552
- }
553
- } else {
554
- try {
555
- throw Error();
556
- } catch (x) {
557
- control = x;
558
- } // TODO(luna): This will currently only throw if the function component
559
- // tries to access React/ReactDOM/props. We should probably make this throw
560
- // in simple components too
561
-
562
-
563
- var maybePromise = fn(); // If the function component returns a promise, it's likely an async
564
- // component, which we don't yet support. Attach a noop catch handler to
565
- // silence the error.
566
- // TODO: Implement component stacks for async client components?
567
-
568
- if (maybePromise && typeof maybePromise.catch === 'function') {
569
- maybePromise.catch(function () {});
570
- }
571
- }
572
- } catch (sample) {
573
- // This is inlined manually because closure doesn't do it for us.
574
- if (sample && control && typeof sample.stack === 'string') {
575
- return [sample.stack, control.stack];
576
- }
106
+ if (JSCompiler_inline_result)
107
+ return (
108
+ (JSCompiler_inline_result =
109
+ ("function" === typeof Symbol &&
110
+ Symbol.toStringTag &&
111
+ value[Symbol.toStringTag]) ||
112
+ value.constructor.name ||
113
+ "Object"),
114
+ error(
115
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
116
+ JSCompiler_inline_result
117
+ ),
118
+ testStringCoercion(value)
119
+ );
120
+ }
121
+ function disabledLog() {}
122
+ function disableLogs() {
123
+ if (0 === disabledDepth) {
124
+ prevLog = console.log;
125
+ prevInfo = console.info;
126
+ prevWarn = console.warn;
127
+ prevError = console.error;
128
+ prevGroup = console.group;
129
+ prevGroupCollapsed = console.groupCollapsed;
130
+ prevGroupEnd = console.groupEnd;
131
+ var props = {
132
+ configurable: !0,
133
+ enumerable: !0,
134
+ value: disabledLog,
135
+ writable: !0
136
+ };
137
+ Object.defineProperties(console, {
138
+ info: props,
139
+ log: props,
140
+ warn: props,
141
+ error: props,
142
+ group: props,
143
+ groupCollapsed: props,
144
+ groupEnd: props
145
+ });
577
146
  }
578
-
579
- return [null, null];
580
- }
581
- }; // $FlowFixMe[prop-missing]
582
-
583
- RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';
584
- var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.
585
-
586
- if (namePropDescriptor && namePropDescriptor.configurable) {
587
- // V8 utilizes a function's `name` property when generating a stack trace.
588
- Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor
589
- // is set to `false`.
590
- // $FlowFixMe[cannot-write]
591
- 'name', {
592
- value: 'DetermineComponentFrameRoot'
593
- });
594
- }
595
-
596
- try {
597
- var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
598
- sampleStack = _RunInRootFrame$Deter[0],
599
- controlStack = _RunInRootFrame$Deter[1];
600
-
601
- if (sampleStack && controlStack) {
602
- // This extracts the first frame from the sample that isn't also in the control.
603
- // Skipping one frame that we assume is the frame that calls the two.
604
- var sampleLines = sampleStack.split('\n');
605
- var controlLines = controlStack.split('\n');
606
- var s = 0;
607
- var c = 0;
608
-
609
- while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
610
- s++;
147
+ disabledDepth++;
148
+ }
149
+ function reenableLogs() {
150
+ disabledDepth--;
151
+ if (0 === disabledDepth) {
152
+ var props = { configurable: !0, enumerable: !0, writable: !0 };
153
+ Object.defineProperties(console, {
154
+ log: assign({}, props, { value: prevLog }),
155
+ info: assign({}, props, { value: prevInfo }),
156
+ warn: assign({}, props, { value: prevWarn }),
157
+ error: assign({}, props, { value: prevError }),
158
+ group: assign({}, props, { value: prevGroup }),
159
+ groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
160
+ groupEnd: assign({}, props, { value: prevGroupEnd })
161
+ });
611
162
  }
612
-
613
- while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
614
- c++;
615
- } // We couldn't find our intentionally injected common root frame, attempt
616
- // to find another common root frame by search from the bottom of the
617
- // control stack...
618
-
619
-
620
- if (s === sampleLines.length || c === controlLines.length) {
621
- s = sampleLines.length - 1;
622
- c = controlLines.length - 1;
623
-
624
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
625
- // We expect at least one stack frame to be shared.
626
- // Typically this will be the root most one. However, stack frames may be
627
- // cut off due to maximum stack limits. In this case, one maybe cut off
628
- // earlier than the other. We assume that the sample is longer or the same
629
- // and there for cut off earlier. So we should find the root most frame in
630
- // the sample somewhere in the control.
631
- c--;
163
+ 0 > disabledDepth &&
164
+ error(
165
+ "disabledDepth fell below zero. This is a bug in React. Please file an issue."
166
+ );
167
+ }
168
+ function describeBuiltInComponentFrame(name) {
169
+ if (void 0 === prefix)
170
+ try {
171
+ throw Error();
172
+ } catch (x) {
173
+ var match = x.stack.trim().match(/\n( *(at )?)/);
174
+ prefix = (match && match[1]) || "";
632
175
  }
633
- }
634
-
635
- for (; s >= 1 && c >= 0; s--, c--) {
636
- // Next we find the first one that isn't the same which should be the
637
- // frame that called our sample function and the control.
638
- if (sampleLines[s] !== controlLines[c]) {
639
- // In V8, the first line is describing the message but other VMs don't.
640
- // If we're about to return the first line, and the control is also on the same
641
- // line, that's a pretty good indicator that our sample threw at same line as
642
- // the control. I.e. before we entered the sample frame. So we ignore this result.
643
- // This can happen if you passed a class to function component, or non-function.
644
- if (s !== 1 || c !== 1) {
645
- do {
646
- s--;
647
- c--; // We may still have similar intermediate frames from the construct call.
648
- // The next one that isn't the same should be our match though.
649
-
650
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
651
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
652
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
653
- // but we have a user-provided "displayName"
654
- // splice it in to make the stack more readable.
655
-
656
-
657
- if (fn.displayName && _frame.includes('<anonymous>')) {
658
- _frame = _frame.replace('<anonymous>', fn.displayName);
176
+ return "\n" + prefix + name;
177
+ }
178
+ function describeNativeComponentFrame(fn, construct) {
179
+ if (!fn || reentry) return "";
180
+ var frame = componentFrameCache.get(fn);
181
+ if (void 0 !== frame) return frame;
182
+ reentry = !0;
183
+ frame = Error.prepareStackTrace;
184
+ Error.prepareStackTrace = void 0;
185
+ var previousDispatcher = null;
186
+ previousDispatcher = ReactSharedInternals.H;
187
+ ReactSharedInternals.H = null;
188
+ disableLogs();
189
+ var RunInRootFrame = {
190
+ DetermineComponentFrameRoot: function () {
191
+ try {
192
+ if (construct) {
193
+ var Fake = function () {
194
+ throw Error();
195
+ };
196
+ Object.defineProperty(Fake.prototype, "props", {
197
+ set: function () {
198
+ throw Error();
659
199
  }
660
-
661
- if (true) {
662
- if (typeof fn === 'function') {
663
- componentFrameCache.set(fn, _frame);
664
- }
665
- } // Return the line we found.
666
-
667
-
668
- return _frame;
200
+ });
201
+ if ("object" === typeof Reflect && Reflect.construct) {
202
+ try {
203
+ Reflect.construct(Fake, []);
204
+ } catch (x) {
205
+ var control = x;
206
+ }
207
+ Reflect.construct(fn, [], Fake);
208
+ } else {
209
+ try {
210
+ Fake.call();
211
+ } catch (x$0) {
212
+ control = x$0;
213
+ }
214
+ fn.call(Fake.prototype);
215
+ }
216
+ } else {
217
+ try {
218
+ throw Error();
219
+ } catch (x$1) {
220
+ control = x$1;
669
221
  }
670
- } while (s >= 1 && c >= 0);
222
+ (Fake = fn()) &&
223
+ "function" === typeof Fake.catch &&
224
+ Fake.catch(function () {});
225
+ }
226
+ } catch (sample) {
227
+ if (sample && control && "string" === typeof sample.stack)
228
+ return [sample.stack, control.stack];
671
229
  }
672
-
673
- break;
230
+ return [null, null];
674
231
  }
675
- }
676
- }
677
- } finally {
678
- reentry = false;
679
-
680
- {
681
- ReactSharedInternals.H = previousDispatcher;
682
- reenableLogs();
683
- }
684
-
685
- Error.prepareStackTrace = previousPrepareStackTrace;
686
- } // Fallback to just using the name if we couldn't make it throw.
687
-
688
-
689
- var name = fn ? fn.displayName || fn.name : '';
690
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
691
-
692
- {
693
- if (typeof fn === 'function') {
694
- componentFrameCache.set(fn, syntheticFrame);
695
- }
696
- }
697
-
698
- return syntheticFrame;
699
- }
700
- function describeFunctionComponentFrame(fn) {
701
- {
702
- return describeNativeComponentFrame(fn, false);
703
- }
704
- }
705
-
706
- function shouldConstruct(Component) {
707
- var prototype = Component.prototype;
708
- return !!(prototype && prototype.isReactComponent);
709
- } // TODO: Delete this once the key warning no longer uses it. I.e. when enableOwnerStacks ship.
710
-
711
-
712
- function describeUnknownElementTypeFrameInDEV(type) {
713
-
714
- if (type == null) {
715
- return '';
716
- }
717
-
718
- if (typeof type === 'function') {
719
- {
720
- return describeNativeComponentFrame(type, shouldConstruct(type));
721
- }
722
- }
723
-
724
- if (typeof type === 'string') {
725
- return describeBuiltInComponentFrame(type);
726
- }
727
-
728
- switch (type) {
729
- case REACT_SUSPENSE_TYPE:
730
- return describeBuiltInComponentFrame('Suspense');
731
-
732
- case REACT_SUSPENSE_LIST_TYPE:
733
- return describeBuiltInComponentFrame('SuspenseList');
734
- }
735
-
736
- if (typeof type === 'object') {
737
- switch (type.$$typeof) {
738
- case REACT_FORWARD_REF_TYPE:
739
- return describeFunctionComponentFrame(type.render);
740
-
741
- case REACT_MEMO_TYPE:
742
- // Memo may contain any component type so we recursively resolve it.
743
- return describeUnknownElementTypeFrameInDEV(type.type);
744
-
745
- case REACT_LAZY_TYPE:
746
- {
747
- var lazyComponent = type;
748
- var payload = lazyComponent._payload;
749
- var init = lazyComponent._init;
750
-
751
- try {
752
- // Lazy may contain any component type so we recursively resolve it.
753
- return describeUnknownElementTypeFrameInDEV(init(payload));
754
- } catch (x) {}
232
+ };
233
+ RunInRootFrame.DetermineComponentFrameRoot.displayName =
234
+ "DetermineComponentFrameRoot";
235
+ var namePropDescriptor = Object.getOwnPropertyDescriptor(
236
+ RunInRootFrame.DetermineComponentFrameRoot,
237
+ "name"
238
+ );
239
+ namePropDescriptor &&
240
+ namePropDescriptor.configurable &&
241
+ Object.defineProperty(
242
+ RunInRootFrame.DetermineComponentFrameRoot,
243
+ "name",
244
+ { value: "DetermineComponentFrameRoot" }
245
+ );
246
+ try {
247
+ var _RunInRootFrame$Deter =
248
+ RunInRootFrame.DetermineComponentFrameRoot(),
249
+ sampleStack = _RunInRootFrame$Deter[0],
250
+ controlStack = _RunInRootFrame$Deter[1];
251
+ if (sampleStack && controlStack) {
252
+ var sampleLines = sampleStack.split("\n"),
253
+ controlLines = controlStack.split("\n");
254
+ for (
255
+ sampleStack = _RunInRootFrame$Deter = 0;
256
+ _RunInRootFrame$Deter < sampleLines.length &&
257
+ !sampleLines[_RunInRootFrame$Deter].includes(
258
+ "DetermineComponentFrameRoot"
259
+ );
260
+
261
+ )
262
+ _RunInRootFrame$Deter++;
263
+ for (
264
+ ;
265
+ sampleStack < controlLines.length &&
266
+ !controlLines[sampleStack].includes("DetermineComponentFrameRoot");
267
+
268
+ )
269
+ sampleStack++;
270
+ if (
271
+ _RunInRootFrame$Deter === sampleLines.length ||
272
+ sampleStack === controlLines.length
273
+ )
274
+ for (
275
+ _RunInRootFrame$Deter = sampleLines.length - 1,
276
+ sampleStack = controlLines.length - 1;
277
+ 1 <= _RunInRootFrame$Deter &&
278
+ 0 <= sampleStack &&
279
+ sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack];
280
+
281
+ )
282
+ sampleStack--;
283
+ for (
284
+ ;
285
+ 1 <= _RunInRootFrame$Deter && 0 <= sampleStack;
286
+ _RunInRootFrame$Deter--, sampleStack--
287
+ )
288
+ if (
289
+ sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]
290
+ ) {
291
+ if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) {
292
+ do
293
+ if (
294
+ (_RunInRootFrame$Deter--,
295
+ sampleStack--,
296
+ 0 > sampleStack ||
297
+ sampleLines[_RunInRootFrame$Deter] !==
298
+ controlLines[sampleStack])
299
+ ) {
300
+ var _frame =
301
+ "\n" +
302
+ sampleLines[_RunInRootFrame$Deter].replace(
303
+ " at new ",
304
+ " at "
305
+ );
306
+ fn.displayName &&
307
+ _frame.includes("<anonymous>") &&
308
+ (_frame = _frame.replace("<anonymous>", fn.displayName));
309
+ "function" === typeof fn &&
310
+ componentFrameCache.set(fn, _frame);
311
+ return _frame;
312
+ }
313
+ while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack);
314
+ }
315
+ break;
316
+ }
755
317
  }
756
- }
757
- }
758
-
759
- return '';
760
- }
761
-
762
- var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
763
-
764
- function getOwner() {
765
- {
766
- var dispatcher = ReactSharedInternals.A;
767
-
768
- if (dispatcher === null) {
769
- return null;
770
- }
771
-
772
- return dispatcher.getOwner();
773
- }
774
- }
775
-
776
- var specialPropKeyWarningShown;
777
- var didWarnAboutElementRef;
778
-
779
- {
780
- didWarnAboutElementRef = {};
781
- }
782
-
783
- function hasValidRef(config) {
784
- {
785
- if (hasOwnProperty.call(config, 'ref')) {
786
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
787
-
788
- if (getter && getter.isReactWarning) {
789
- return false;
318
+ } finally {
319
+ (reentry = !1),
320
+ (ReactSharedInternals.H = previousDispatcher),
321
+ reenableLogs(),
322
+ (Error.prepareStackTrace = frame);
790
323
  }
791
- }
792
- }
793
-
794
- return config.ref !== undefined;
795
- }
796
-
797
- function hasValidKey(config) {
798
- {
799
- if (hasOwnProperty.call(config, 'key')) {
800
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
801
-
802
- if (getter && getter.isReactWarning) {
803
- return false;
324
+ sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
325
+ ? describeBuiltInComponentFrame(sampleLines)
326
+ : "";
327
+ "function" === typeof fn && componentFrameCache.set(fn, sampleLines);
328
+ return sampleLines;
329
+ }
330
+ function describeUnknownElementTypeFrameInDEV(type) {
331
+ if (null == type) return "";
332
+ if ("function" === typeof type) {
333
+ var prototype = type.prototype;
334
+ return describeNativeComponentFrame(
335
+ type,
336
+ !(!prototype || !prototype.isReactComponent)
337
+ );
804
338
  }
805
- }
806
- }
807
-
808
- return config.key !== undefined;
809
- }
810
-
811
- function defineKeyPropWarningGetter(props, displayName) {
812
- {
813
- var warnAboutAccessingKey = function () {
814
- if (!specialPropKeyWarningShown) {
815
- specialPropKeyWarningShown = true;
816
-
817
- 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);
339
+ if ("string" === typeof type) return describeBuiltInComponentFrame(type);
340
+ switch (type) {
341
+ case REACT_SUSPENSE_TYPE:
342
+ return describeBuiltInComponentFrame("Suspense");
343
+ case REACT_SUSPENSE_LIST_TYPE:
344
+ return describeBuiltInComponentFrame("SuspenseList");
818
345
  }
819
- };
820
-
821
- warnAboutAccessingKey.isReactWarning = true;
822
- Object.defineProperty(props, 'key', {
823
- get: warnAboutAccessingKey,
824
- configurable: true
825
- });
826
- }
827
- }
828
-
829
- function elementRefGetterWithDeprecationWarning() {
830
- {
831
- var componentName = getComponentNameFromType(this.type);
832
-
833
- if (!didWarnAboutElementRef[componentName]) {
834
- didWarnAboutElementRef[componentName] = true;
835
-
836
- 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.');
837
- } // An undefined `element.ref` is coerced to `null` for
838
- // backwards compatibility.
839
-
840
-
841
- var refProp = this.props.ref;
842
- return refProp !== undefined ? refProp : null;
843
- }
844
- }
845
- /**
846
- * Factory method to create a new React element. This no longer adheres to
847
- * the class pattern, so do not use new to call it. Also, instanceof check
848
- * will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
849
- * if something is a React Element.
850
- *
851
- * @param {*} type
852
- * @param {*} props
853
- * @param {*} key
854
- * @param {string|object} ref
855
- * @param {*} owner
856
- * @param {*} self A *temporary* helper to detect places where `this` is
857
- * different from the `owner` when React.createElement is called, so that we
858
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
859
- * functions, and as long as `this` and owner are the same, there will be no
860
- * change in behavior.
861
- * @param {*} source An annotation object (added by a transpiler or otherwise)
862
- * indicating filename, line number, and/or other information.
863
- * @internal
864
- */
865
-
866
-
867
- function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
868
- var ref;
869
-
870
- {
871
- // When enableRefAsProp is on, ignore whatever was passed as the ref
872
- // argument and treat `props.ref` as the source of truth. The only thing we
873
- // use this for is `element.ref`, which will log a deprecation warning on
874
- // access. In the next release, we can remove `element.ref` as well as the
875
- // `ref` argument.
876
- var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
877
- // backwards compatibility.
878
-
879
- ref = refProp !== undefined ? refProp : null;
880
- }
881
-
882
- var element;
883
-
884
- {
885
- // In dev, make `ref` a non-enumerable property with a warning. It's non-
886
- // enumerable so that test matchers and serializers don't access it and
887
- // trigger the warning.
888
- //
889
- // `ref` will be removed from the element completely in a future release.
890
- element = {
891
- // This tag allows us to uniquely identify this as a React Element
892
- $$typeof: REACT_ELEMENT_TYPE,
893
- // Built-in properties that belong on the element
894
- type: type,
895
- key: key,
896
- props: props,
897
- // Record the component responsible for creating this element.
898
- _owner: owner
899
- };
900
-
901
- if (ref !== null) {
902
- Object.defineProperty(element, 'ref', {
903
- enumerable: false,
904
- get: elementRefGetterWithDeprecationWarning
905
- });
906
- } else {
907
- // Don't warn on access if a ref is not given. This reduces false
908
- // positives in cases where a test serializer uses
909
- // getOwnPropertyDescriptors to compare objects, like Jest does, which is
910
- // a problem because it bypasses non-enumerability.
911
- //
912
- // So unfortunately this will trigger a false positive warning in Jest
913
- // when the diff is printed:
914
- //
915
- // expect(<div ref={ref} />).toEqual(<span ref={ref} />);
916
- //
917
- // A bit sketchy, but this is what we've done for the `props.key` and
918
- // `props.ref` accessors for years, which implies it will be good enough
919
- // for `element.ref`, too. Let's see if anyone complains.
920
- Object.defineProperty(element, 'ref', {
921
- enumerable: false,
922
- value: null
923
- });
924
- }
925
- }
926
-
927
- {
928
- // The validation flag is currently mutative. We put it on
929
- // an external backing store so that we can freeze the whole object.
930
- // This can be replaced with a WeakMap once they are implemented in
931
- // commonly used development environments.
932
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
933
- // the validation flag non-enumerable (where possible, which should
934
- // include every environment we run tests in), so the test framework
935
- // ignores it.
936
-
937
- Object.defineProperty(element._store, 'validated', {
938
- configurable: false,
939
- enumerable: false,
940
- writable: true,
941
- value: 0
942
- }); // debugInfo contains Server Component debug information.
943
-
944
- Object.defineProperty(element, '_debugInfo', {
945
- configurable: false,
946
- enumerable: false,
947
- writable: true,
948
- value: null
949
- });
950
-
951
- if (Object.freeze) {
952
- Object.freeze(element.props);
953
- Object.freeze(element);
954
- }
955
- }
956
-
957
- return element;
958
- }
959
- var didWarnAboutKeySpread = {};
960
- /**
961
- * https://github.com/reactjs/rfcs/pull/107
962
- * @param {*} type
963
- * @param {object} props
964
- * @param {string} key
965
- */
966
-
967
- function jsxDEV$1(type, config, maybeKey, isStaticChildren, source, self) {
968
- return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
969
- }
970
-
971
- function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self, debugStack, debugTask) {
972
- {
973
- if (!isValidElementType(type)) {
974
- // This is an invalid element type.
975
- //
976
- // We warn in this case but don't throw. We expect the element creation to
977
- // succeed and there will likely be errors in render.
978
- var info = '';
979
-
980
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
981
- 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.";
982
- }
983
-
984
- var typeString;
985
-
986
- if (type === null) {
987
- typeString = 'null';
988
- } else if (isArray(type)) {
989
- typeString = 'array';
990
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
991
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
992
- info = ' Did you accidentally export a JSX literal instead of a component?';
993
- } else {
994
- typeString = typeof type;
995
- }
996
-
997
- error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
998
- } else {
999
- // This is a valid element type.
1000
- // Skip key warning if the type isn't valid since our key validation logic
1001
- // doesn't expect a non-string/function type and can throw confusing
1002
- // errors. We don't want exception behavior to differ between dev and
1003
- // prod. (Rendering will throw with a helpful message and as soon as the
1004
- // type is fixed, the key warnings will appear.)
1005
- var children = config.children;
1006
-
1007
- if (children !== undefined) {
1008
- if (isStaticChildren) {
1009
- if (isArray(children)) {
1010
- for (var i = 0; i < children.length; i++) {
1011
- validateChildKeys(children[i], type);
1012
- }
1013
-
1014
- if (Object.freeze) {
1015
- Object.freeze(children);
1016
- }
1017
- } else {
1018
- error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1019
- }
1020
- } else {
1021
- validateChildKeys(children, type);
346
+ if ("object" === typeof type)
347
+ switch (type.$$typeof) {
348
+ case REACT_FORWARD_REF_TYPE:
349
+ return (type = describeNativeComponentFrame(type.render, !1)), type;
350
+ case REACT_MEMO_TYPE:
351
+ return describeUnknownElementTypeFrameInDEV(type.type);
352
+ case REACT_LAZY_TYPE:
353
+ prototype = type._payload;
354
+ type = type._init;
355
+ try {
356
+ return describeUnknownElementTypeFrameInDEV(type(prototype));
357
+ } catch (x) {}
1022
358
  }
1023
- }
1024
- } // Warn about key spread regardless of whether the type is valid.
1025
-
1026
-
1027
- if (hasOwnProperty.call(config, 'key')) {
1028
- var componentName = getComponentNameFromType(type);
1029
- var keys = Object.keys(config).filter(function (k) {
1030
- return k !== 'key';
1031
- });
1032
- var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
1033
-
1034
- if (!didWarnAboutKeySpread[componentName + beforeExample]) {
1035
- var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
1036
-
1037
- error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
1038
-
1039
- didWarnAboutKeySpread[componentName + beforeExample] = true;
1040
- }
359
+ return "";
1041
360
  }
1042
-
1043
- var key = null;
1044
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
1045
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
1046
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
1047
- // but as an intermediary step, we will use jsxDEV for everything except
1048
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
1049
- // key is explicitly declared to be undefined or not.
1050
-
1051
- if (maybeKey !== undefined) {
1052
- {
1053
- checkKeyStringCoercion(maybeKey);
1054
- }
1055
-
1056
- key = '' + maybeKey;
361
+ function getOwner() {
362
+ var dispatcher = ReactSharedInternals.A;
363
+ return null === dispatcher ? null : dispatcher.getOwner();
1057
364
  }
1058
-
1059
- if (hasValidKey(config)) {
1060
- {
1061
- checkKeyStringCoercion(config.key);
365
+ function hasValidRef(config) {
366
+ if (hasOwnProperty.call(config, "ref")) {
367
+ var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
368
+ if (getter && getter.isReactWarning) return !1;
1062
369
  }
1063
-
1064
- key = '' + config.key;
370
+ return void 0 !== config.ref;
1065
371
  }
1066
-
1067
- if (hasValidRef(config)) ;
1068
-
1069
- var props;
1070
-
1071
- if (!('key' in config)) {
1072
- // If key was not spread in, we can reuse the original props object. This
1073
- // only works for `jsx`, not `createElement`, because `jsx` is a compiler
1074
- // target and the compiler always passes a new object. For `createElement`,
1075
- // we can't assume a new object is passed every time because it can be
1076
- // called manually.
1077
- //
1078
- // Spreading key is a warning in dev. In a future release, we will not
1079
- // remove a spread key from the props object. (But we'll still warn.) We'll
1080
- // always pass the object straight through.
1081
- props = config;
1082
- } else {
1083
- // We need to remove reserved props (key, prop, ref). Create a fresh props
1084
- // object and copy over all the non-reserved props. We don't use `delete`
1085
- // because in V8 it will deopt the object to dictionary mode.
1086
- props = {};
1087
-
1088
- for (var propName in config) {
1089
- // Skip over reserved prop names
1090
- if (propName !== 'key' && (enableRefAsProp )) {
1091
- {
1092
- props[propName] = config[propName];
1093
- }
1094
- }
372
+ function hasValidKey(config) {
373
+ if (hasOwnProperty.call(config, "key")) {
374
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
375
+ if (getter && getter.isReactWarning) return !1;
1095
376
  }
1096
- }
1097
-
1098
- if (key || !enableRefAsProp ) {
1099
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1100
-
1101
- if (key) {
1102
- defineKeyPropWarningGetter(props, displayName);
377
+ return void 0 !== config.key;
378
+ }
379
+ function defineKeyPropWarningGetter(props, displayName) {
380
+ function warnAboutAccessingKey() {
381
+ specialPropKeyWarningShown ||
382
+ ((specialPropKeyWarningShown = !0),
383
+ error(
384
+ "%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)",
385
+ displayName
386
+ ));
1103
387
  }
388
+ warnAboutAccessingKey.isReactWarning = !0;
389
+ Object.defineProperty(props, "key", {
390
+ get: warnAboutAccessingKey,
391
+ configurable: !0
392
+ });
1104
393
  }
1105
-
1106
- return ReactElement(type, key, ref, self, source, getOwner(), props);
1107
- }
1108
- }
1109
- /**
1110
- * Ensure that every element either is passed in a static location, in an
1111
- * array with an explicit keys property defined, or in an object literal
1112
- * with valid key property.
1113
- *
1114
- * @internal
1115
- * @param {ReactNode} node Statically passed child of any type.
1116
- * @param {*} parentType node's parent's type.
1117
- */
1118
-
1119
- function validateChildKeys(node, parentType) {
1120
- {
1121
- if (typeof node !== 'object' || !node) {
1122
- return;
1123
- }
1124
-
1125
- if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
1126
- for (var i = 0; i < node.length; i++) {
1127
- var child = node[i];
1128
-
1129
- if (isValidElement(child)) {
1130
- validateExplicitKey(child, parentType);
1131
- }
394
+ function elementRefGetterWithDeprecationWarning() {
395
+ var componentName = getComponentNameFromType(this.type);
396
+ didWarnAboutElementRef[componentName] ||
397
+ ((didWarnAboutElementRef[componentName] = !0),
398
+ error(
399
+ "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."
400
+ ));
401
+ componentName = this.props.ref;
402
+ return void 0 !== componentName ? componentName : null;
403
+ }
404
+ function ReactElement(type, key, _ref, self, source, owner, props) {
405
+ _ref = props.ref;
406
+ type = {
407
+ $$typeof: REACT_ELEMENT_TYPE,
408
+ type: type,
409
+ key: key,
410
+ props: props,
411
+ _owner: owner
412
+ };
413
+ null !== (void 0 !== _ref ? _ref : null)
414
+ ? Object.defineProperty(type, "ref", {
415
+ enumerable: !1,
416
+ get: elementRefGetterWithDeprecationWarning
417
+ })
418
+ : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
419
+ type._store = {};
420
+ Object.defineProperty(type._store, "validated", {
421
+ configurable: !1,
422
+ enumerable: !1,
423
+ writable: !0,
424
+ value: 0
425
+ });
426
+ Object.defineProperty(type, "_debugInfo", {
427
+ configurable: !1,
428
+ enumerable: !1,
429
+ writable: !0,
430
+ value: null
431
+ });
432
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
433
+ return type;
434
+ }
435
+ function jsxDEVImpl(
436
+ type,
437
+ config,
438
+ maybeKey,
439
+ isStaticChildren,
440
+ source,
441
+ self
442
+ ) {
443
+ if (
444
+ "string" === typeof type ||
445
+ "function" === typeof type ||
446
+ type === REACT_FRAGMENT_TYPE ||
447
+ type === REACT_PROFILER_TYPE ||
448
+ type === REACT_STRICT_MODE_TYPE ||
449
+ type === REACT_SUSPENSE_TYPE ||
450
+ type === REACT_SUSPENSE_LIST_TYPE ||
451
+ type === REACT_OFFSCREEN_TYPE ||
452
+ ("object" === typeof type &&
453
+ null !== type &&
454
+ (type.$$typeof === REACT_LAZY_TYPE ||
455
+ type.$$typeof === REACT_MEMO_TYPE ||
456
+ type.$$typeof === REACT_CONTEXT_TYPE ||
457
+ type.$$typeof === REACT_CONSUMER_TYPE ||
458
+ type.$$typeof === REACT_FORWARD_REF_TYPE ||
459
+ type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
460
+ void 0 !== type.getModuleId))
461
+ ) {
462
+ var children = config.children;
463
+ if (void 0 !== children)
464
+ if (isStaticChildren)
465
+ if (isArrayImpl(children)) {
466
+ for (
467
+ isStaticChildren = 0;
468
+ isStaticChildren < children.length;
469
+ isStaticChildren++
470
+ )
471
+ validateChildKeys(children[isStaticChildren], type);
472
+ Object.freeze && Object.freeze(children);
473
+ } else
474
+ error(
475
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
476
+ );
477
+ else validateChildKeys(children, type);
478
+ } else {
479
+ children = "";
480
+ if (
481
+ void 0 === type ||
482
+ ("object" === typeof type &&
483
+ null !== type &&
484
+ 0 === Object.keys(type).length)
485
+ )
486
+ children +=
487
+ " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
488
+ null === type
489
+ ? (isStaticChildren = "null")
490
+ : isArrayImpl(type)
491
+ ? (isStaticChildren = "array")
492
+ : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
493
+ ? ((isStaticChildren =
494
+ "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"),
495
+ (children =
496
+ " Did you accidentally export a JSX literal instead of a component?"))
497
+ : (isStaticChildren = typeof type);
498
+ error(
499
+ "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
500
+ isStaticChildren,
501
+ children
502
+ );
1132
503
  }
1133
- } else if (isValidElement(node)) {
1134
- // This element was passed in a valid location.
1135
- if (node._store) {
1136
- node._store.validated = 1;
504
+ if (hasOwnProperty.call(config, "key")) {
505
+ children = getComponentNameFromType(type);
506
+ var keys = Object.keys(config).filter(function (k) {
507
+ return "key" !== k;
508
+ });
509
+ isStaticChildren =
510
+ 0 < keys.length
511
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
512
+ : "{key: someKey}";
513
+ didWarnAboutKeySpread[children + isStaticChildren] ||
514
+ ((keys =
515
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
516
+ error(
517
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
518
+ isStaticChildren,
519
+ children,
520
+ keys,
521
+ children
522
+ ),
523
+ (didWarnAboutKeySpread[children + isStaticChildren] = !0));
1137
524
  }
1138
- } else {
1139
- var iteratorFn = getIteratorFn(node);
1140
-
1141
- if (typeof iteratorFn === 'function') {
1142
- // Entry iterators used to provide implicit keys,
1143
- // but now we print a separate warning for them later.
1144
- if (iteratorFn !== node.entries) {
1145
- var iterator = iteratorFn.call(node);
1146
-
1147
- if (iterator !== node) {
1148
- var step;
1149
-
1150
- while (!(step = iterator.next()).done) {
1151
- if (isValidElement(step.value)) {
1152
- validateExplicitKey(step.value, parentType);
1153
- }
1154
- }
525
+ children = null;
526
+ void 0 !== maybeKey &&
527
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
528
+ hasValidKey(config) &&
529
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
530
+ hasValidRef(config);
531
+ if ("key" in config) {
532
+ maybeKey = {};
533
+ for (var propName in config)
534
+ "key" !== propName && (maybeKey[propName] = config[propName]);
535
+ } else maybeKey = config;
536
+ children &&
537
+ ((config =
538
+ "function" === typeof type
539
+ ? type.displayName || type.name || "Unknown"
540
+ : type),
541
+ children && defineKeyPropWarningGetter(maybeKey, config));
542
+ return ReactElement(
543
+ type,
544
+ children,
545
+ null,
546
+ self,
547
+ source,
548
+ getOwner(),
549
+ maybeKey
550
+ );
551
+ }
552
+ function validateChildKeys(node, parentType) {
553
+ if (
554
+ "object" === typeof node &&
555
+ node &&
556
+ node.$$typeof !== REACT_CLIENT_REFERENCE
557
+ )
558
+ if (isArrayImpl(node))
559
+ for (var i = 0; i < node.length; i++) {
560
+ var child = node[i];
561
+ isValidElement(child) && validateExplicitKey(child, parentType);
1155
562
  }
1156
- }
563
+ else if (isValidElement(node))
564
+ node._store && (node._store.validated = 1);
565
+ else if (
566
+ (null === node || "object" !== typeof node
567
+ ? (i = null)
568
+ : ((i =
569
+ (MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
570
+ node["@@iterator"]),
571
+ (i = "function" === typeof i ? i : null)),
572
+ "function" === typeof i &&
573
+ i !== node.entries &&
574
+ ((i = i.call(node)), i !== node))
575
+ )
576
+ for (; !(node = i.next()).done; )
577
+ isValidElement(node.value) &&
578
+ validateExplicitKey(node.value, parentType);
579
+ }
580
+ function isValidElement(object) {
581
+ return (
582
+ "object" === typeof object &&
583
+ null !== object &&
584
+ object.$$typeof === REACT_ELEMENT_TYPE
585
+ );
586
+ }
587
+ function validateExplicitKey(element, parentType) {
588
+ if (
589
+ element._store &&
590
+ !element._store.validated &&
591
+ null == element.key &&
592
+ ((element._store.validated = 1),
593
+ (parentType = getCurrentComponentErrorInfo(parentType)),
594
+ !ownerHasKeyUseWarning[parentType])
595
+ ) {
596
+ ownerHasKeyUseWarning[parentType] = !0;
597
+ var childOwner = "";
598
+ element &&
599
+ null != element._owner &&
600
+ element._owner !== getOwner() &&
601
+ ((childOwner = null),
602
+ "number" === typeof element._owner.tag
603
+ ? (childOwner = getComponentNameFromType(element._owner.type))
604
+ : "string" === typeof element._owner.name &&
605
+ (childOwner = element._owner.name),
606
+ (childOwner = " It was passed a child from " + childOwner + "."));
607
+ var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
608
+ ReactSharedInternals.getCurrentStack = function () {
609
+ var stack = describeUnknownElementTypeFrameInDEV(element.type);
610
+ prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
611
+ return stack;
612
+ };
613
+ error(
614
+ 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
615
+ parentType,
616
+ childOwner
617
+ );
618
+ ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
1157
619
  }
1158
620
  }
1159
- }
1160
- }
1161
- /**
1162
- * Verifies the object is a ReactElement.
1163
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1164
- * @param {?object} object
1165
- * @return {boolean} True if `object` is a ReactElement.
1166
- * @final
1167
- */
1168
-
1169
-
1170
- function isValidElement(object) {
1171
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1172
- }
1173
- var ownerHasKeyUseWarning = {};
1174
- /**
1175
- * Warn if the element doesn't have an explicit key assigned to it.
1176
- * This element is in an array. The array could grow and shrink or be
1177
- * reordered. All children that haven't already been validated are required to
1178
- * have a "key" property assigned to it. Error statuses are cached so a warning
1179
- * will only be shown once.
1180
- *
1181
- * @internal
1182
- * @param {ReactElement} element Element that requires a key.
1183
- * @param {*} parentType element's parent's type.
1184
- */
1185
-
1186
- function validateExplicitKey(element, parentType) {
1187
-
1188
- {
1189
- if (!element._store || element._store.validated || element.key != null) {
1190
- return;
1191
- }
1192
-
1193
- element._store.validated = 1;
1194
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1195
-
1196
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1197
- return;
1198
- }
1199
-
1200
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1201
- // property, it may be the creator of the child that's responsible for
1202
- // assigning it a key.
1203
-
1204
- var childOwner = '';
1205
-
1206
- if (element && element._owner != null && element._owner !== getOwner()) {
1207
- var ownerName = null;
1208
-
1209
- if (typeof element._owner.tag === 'number') {
1210
- ownerName = getComponentNameFromType(element._owner.type);
1211
- } else if (typeof element._owner.name === 'string') {
1212
- ownerName = element._owner.name;
1213
- } // Give the component that originally created this child.
1214
-
1215
-
1216
- childOwner = " It was passed a child from " + ownerName + ".";
1217
- }
1218
-
1219
- var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
1220
-
1221
- ReactSharedInternals.getCurrentStack = function () {
1222
-
1223
- var stack = describeUnknownElementTypeFrameInDEV(element.type); // Delegate to the injected renderer-specific implementation
1224
-
1225
- if (prevGetCurrentStack) {
1226
- stack += prevGetCurrentStack() || '';
1227
- }
1228
-
1229
- return stack;
621
+ function getCurrentComponentErrorInfo(parentType) {
622
+ var info = "",
623
+ owner = getOwner();
624
+ owner &&
625
+ (owner = getComponentNameFromType(owner.type)) &&
626
+ (info = "\n\nCheck the render method of `" + owner + "`.");
627
+ info ||
628
+ ((parentType = getComponentNameFromType(parentType)) &&
629
+ (info =
630
+ "\n\nCheck the top-level render call using <" + parentType + ">."));
631
+ return info;
632
+ }
633
+ var React = require("react"),
634
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
635
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
636
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
637
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
638
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler");
639
+ Symbol.for("react.provider");
640
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
641
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
642
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
643
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
644
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
645
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
646
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
647
+ REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
648
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
649
+ ReactSharedInternals =
650
+ React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
651
+ REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
652
+ hasOwnProperty = Object.prototype.hasOwnProperty,
653
+ assign = Object.assign,
654
+ REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
655
+ isArrayImpl = Array.isArray,
656
+ disabledDepth = 0,
657
+ prevLog,
658
+ prevInfo,
659
+ prevWarn,
660
+ prevError,
661
+ prevGroup,
662
+ prevGroupCollapsed,
663
+ prevGroupEnd;
664
+ disabledLog.__reactDisabledLog = !0;
665
+ var prefix,
666
+ reentry = !1;
667
+ var componentFrameCache = new (
668
+ "function" === typeof WeakMap ? WeakMap : Map
669
+ )();
670
+ var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
671
+ specialPropKeyWarningShown;
672
+ var didWarnAboutElementRef = {};
673
+ var didWarnAboutKeySpread = {},
674
+ ownerHasKeyUseWarning = {};
675
+ exports.Fragment = REACT_FRAGMENT_TYPE;
676
+ exports.jsxDEV = function (
677
+ type,
678
+ config,
679
+ maybeKey,
680
+ isStaticChildren,
681
+ source,
682
+ self
683
+ ) {
684
+ return jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self);
1230
685
  };
1231
-
1232
- 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);
1233
-
1234
- ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
1235
- }
1236
- }
1237
-
1238
- function getCurrentComponentErrorInfo(parentType) {
1239
- {
1240
- var info = '';
1241
- var owner = getOwner();
1242
-
1243
- if (owner) {
1244
- var name = getComponentNameFromType(owner.type);
1245
-
1246
- if (name) {
1247
- info = '\n\nCheck the render method of `' + name + '`.';
1248
- }
1249
- }
1250
-
1251
- if (!info) {
1252
- var parentName = getComponentNameFromType(parentType);
1253
-
1254
- if (parentName) {
1255
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1256
- }
1257
- }
1258
-
1259
- return info;
1260
- }
1261
- }
1262
-
1263
- var jsxDEV = jsxDEV$1 ;
1264
-
1265
- exports.Fragment = REACT_FRAGMENT_TYPE;
1266
- exports.jsxDEV = jsxDEV;
1267
686
  })();
1268
- }