react 19.0.0-canary-33a32441e9-20240418 → 19.0.0-canary-db913d8e17-20240422
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-jsx-dev-runtime.development.js +7 -4
- package/cjs/react-jsx-dev-runtime.production.js +4 -9
- package/cjs/react-jsx-dev-runtime.profiling.js +4 -9
- package/cjs/react-jsx-runtime.development.js +7 -4
- package/cjs/react-jsx-runtime.production.js +24 -144
- package/cjs/react-jsx-runtime.profiling.js +24 -144
- package/cjs/react-jsx-runtime.react-server.development.js +7 -4
- package/cjs/react-jsx-runtime.react-server.production.js +29 -151
- package/cjs/react.development.js +18 -8
- package/cjs/react.production.js +469 -1029
- package/cjs/react.react-server.development.js +8 -5
- package/cjs/react.react-server.production.js +479 -986
- package/index.js +1 -1
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.react-server.js +1 -1
- package/package.json +1 -1
- package/react.react-server.js +1 -1
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-dev-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.production.min.js +0 -12
- package/cjs/react-jsx-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.react-server.production.min.js +0 -13
- package/cjs/react-jsx-runtime.react-server.production.min.js.map +0 -1
- package/cjs/react.production.min.js +0 -30
- package/cjs/react.production.min.js.map +0 -1
- package/cjs/react.react-server.production.min.js +0 -29
- package/cjs/react.react-server.production.min.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license React
|
3
|
-
* react.react-server.production.
|
3
|
+
* react.react-server.production.js
|
4
4
|
*
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
6
|
*
|
@@ -8,1055 +8,548 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
// -----------------------------------------------------------------------------
|
16
|
-
// as a normal prop instead of stripping it from the props object.
|
17
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
18
|
-
// during element creation.
|
19
|
-
|
20
|
-
const enableRefAsProp = true;
|
21
|
-
|
22
|
-
const ReactSharedInternals = {
|
23
|
-
H: null,
|
24
|
-
C: null
|
25
|
-
};
|
26
|
-
|
11
|
+
"use strict";
|
12
|
+
var assign = Object.assign,
|
13
|
+
ReactSharedInternals = { H: null, C: null };
|
27
14
|
function createFetchCache() {
|
28
15
|
return new Map();
|
29
16
|
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
// We don't include the `cache` field, because we end up using whatever
|
36
|
-
// caching resulted from the first request.
|
37
|
-
// Notably we currently don't consider non-standard (or future) options.
|
38
|
-
// This might not be safe. TODO: warn for non-standard extensions differing.
|
39
|
-
// IF YOU CHANGE THIS UPDATE THE simpleCacheKey ABOVE.
|
40
|
-
return JSON.stringify([request.method, Array.from(request.headers.entries()), request.mode, request.redirect, request.credentials, request.referrer, request.referrerPolicy, request.integrity]);
|
41
|
-
}
|
42
|
-
|
43
|
-
{
|
44
|
-
if (typeof fetch === 'function') {
|
45
|
-
const originalFetch = fetch;
|
46
|
-
|
47
|
-
const cachedFetch = function fetch(resource, options) {
|
48
|
-
const dispatcher = ReactSharedInternals.C;
|
49
|
-
|
50
|
-
if (!dispatcher) {
|
51
|
-
// We're outside a cached scope.
|
17
|
+
if ("function" === typeof fetch) {
|
18
|
+
var originalFetch = fetch,
|
19
|
+
cachedFetch = function (resource, options) {
|
20
|
+
var dispatcher = ReactSharedInternals.C;
|
21
|
+
if (!dispatcher || (options && options.signal))
|
52
22
|
return originalFetch(resource, options);
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
// Ideally we should be able to check this on the Request but
|
60
|
-
// it always gets initialized with its own signal so we don't
|
61
|
-
// know if it's supposed to override - unless we also override the
|
62
|
-
// Request constructor.
|
63
|
-
return originalFetch(resource, options);
|
64
|
-
} // Normalize the Request
|
65
|
-
|
66
|
-
|
67
|
-
let url;
|
68
|
-
let cacheKey;
|
69
|
-
|
70
|
-
if (typeof resource === 'string' && !options) {
|
71
|
-
// Fast path.
|
72
|
-
cacheKey = simpleCacheKey;
|
73
|
-
url = resource;
|
74
|
-
} else {
|
75
|
-
// Normalize the request.
|
76
|
-
// if resource is not a string or a URL (its an instance of Request)
|
77
|
-
// then do not instantiate a new Request but instead
|
78
|
-
// reuse the request as to not disturb the body in the event it's a ReadableStream.
|
79
|
-
const request = typeof resource === 'string' || resource instanceof URL ? new Request(resource, options) : resource;
|
80
|
-
|
81
|
-
if (request.method !== 'GET' && request.method !== 'HEAD' || // $FlowFixMe[prop-missing]: keepalive is real
|
82
|
-
request.keepalive) {
|
83
|
-
// We currently don't dedupe requests that might have side-effects. Those
|
84
|
-
// have to be explicitly cached. We assume that the request doesn't have a
|
85
|
-
// body if it's GET or HEAD.
|
86
|
-
// keepalive gets treated the same as if you passed a custom cache signal.
|
23
|
+
if ("string" !== typeof resource || options) {
|
24
|
+
var url =
|
25
|
+
"string" === typeof resource || resource instanceof URL
|
26
|
+
? new Request(resource, options)
|
27
|
+
: resource;
|
28
|
+
if (("GET" !== url.method && "HEAD" !== url.method) || url.keepalive)
|
87
29
|
return originalFetch(resource, options);
|
30
|
+
var cacheKey = JSON.stringify([
|
31
|
+
url.method,
|
32
|
+
Array.from(url.headers.entries()),
|
33
|
+
url.mode,
|
34
|
+
url.redirect,
|
35
|
+
url.credentials,
|
36
|
+
url.referrer,
|
37
|
+
url.referrerPolicy,
|
38
|
+
url.integrity
|
39
|
+
]);
|
40
|
+
url = url.url;
|
41
|
+
} else
|
42
|
+
(cacheKey = '["GET",[],null,"follow",null,null,null,null]'),
|
43
|
+
(url = resource);
|
44
|
+
var cache = dispatcher.getCacheForType(createFetchCache);
|
45
|
+
dispatcher = cache.get(url);
|
46
|
+
if (void 0 === dispatcher)
|
47
|
+
(resource = originalFetch(resource, options)),
|
48
|
+
cache.set(url, [cacheKey, resource]);
|
49
|
+
else {
|
50
|
+
url = 0;
|
51
|
+
for (cache = dispatcher.length; url < cache; url += 2) {
|
52
|
+
var value = dispatcher[url + 1];
|
53
|
+
if (dispatcher[url] === cacheKey)
|
54
|
+
return (
|
55
|
+
(resource = value),
|
56
|
+
resource.then(function (response) {
|
57
|
+
return response.clone();
|
58
|
+
})
|
59
|
+
);
|
88
60
|
}
|
89
|
-
|
90
|
-
cacheKey
|
91
|
-
url = request.url;
|
61
|
+
resource = originalFetch(resource, options);
|
62
|
+
dispatcher.push(cacheKey, resource);
|
92
63
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
match = originalFetch(resource, options);
|
102
|
-
cache.set(url, [cacheKey, match]);
|
103
|
-
} else {
|
104
|
-
// We use an array as the inner data structure since it's lighter and
|
105
|
-
// we typically only expect to see one or two entries here.
|
106
|
-
for (let i = 0, l = cacheEntries.length; i < l; i += 2) {
|
107
|
-
const key = cacheEntries[i];
|
108
|
-
const value = cacheEntries[i + 1];
|
109
|
-
|
110
|
-
if (key === cacheKey) {
|
111
|
-
match = value; // I would've preferred a labelled break but lint says no.
|
112
|
-
|
113
|
-
return match.then(response => response.clone());
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
match = originalFetch(resource, options);
|
118
|
-
cacheEntries.push(cacheKey, match);
|
119
|
-
} // We clone the response so that each time you call this you get a new read
|
120
|
-
// of the body so that it can be read multiple times.
|
121
|
-
|
122
|
-
|
123
|
-
return match.then(response => response.clone());
|
124
|
-
}; // We don't expect to see any extra properties on fetch but if there are any,
|
125
|
-
// copy them over. Useful for extended fetch environments or mocks.
|
126
|
-
|
127
|
-
|
128
|
-
assign(cachedFetch, originalFetch);
|
129
|
-
|
64
|
+
return resource.then(function (response) {
|
65
|
+
return response.clone();
|
66
|
+
});
|
67
|
+
};
|
68
|
+
assign(cachedFetch, originalFetch);
|
69
|
+
try {
|
70
|
+
fetch = cachedFetch;
|
71
|
+
} catch (error1) {
|
130
72
|
try {
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
globalThis.fetch = cachedFetch;
|
137
|
-
} catch (error2) {
|
138
|
-
// Log even in production just to make sure this is seen if only prod is frozen.
|
139
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
140
|
-
console.warn('React was unable to patch the fetch() function in this environment. ' + 'Suspensey APIs might not work correctly as a result.');
|
141
|
-
}
|
73
|
+
globalThis.fetch = cachedFetch;
|
74
|
+
} catch (error2) {
|
75
|
+
console.warn(
|
76
|
+
"React was unable to patch the fetch() function in this environment. Suspensey APIs might not work correctly as a result."
|
77
|
+
);
|
142
78
|
}
|
143
79
|
}
|
144
80
|
}
|
145
|
-
|
146
|
-
// Do not require this module directly! Use normal `invariant` calls with
|
147
|
-
// template literal strings. The messages will be replaced with error codes
|
148
|
-
// during build.
|
149
81
|
function formatProdErrorMessage(code) {
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
for (let i = 2; i < arguments.length; i++) {
|
156
|
-
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
157
|
-
}
|
82
|
+
var url = "https://react.dev/errors/" + code;
|
83
|
+
if (1 < arguments.length) {
|
84
|
+
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
85
|
+
for (var i = 2; i < arguments.length; i++)
|
86
|
+
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
158
87
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
179
|
-
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
180
|
-
const REACT_MEMO_TYPE = Symbol.for('react.memo');
|
181
|
-
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
182
|
-
const MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
183
|
-
const FAUX_ITERATOR_SYMBOL = '@@iterator';
|
88
|
+
return (
|
89
|
+
"Minified React error #" +
|
90
|
+
code +
|
91
|
+
"; visit " +
|
92
|
+
url +
|
93
|
+
" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
|
94
|
+
);
|
95
|
+
}
|
96
|
+
var isArrayImpl = Array.isArray,
|
97
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.element"),
|
98
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
99
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
100
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
101
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
102
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
103
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
104
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
105
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
106
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
184
107
|
function getIteratorFn(maybeIterable) {
|
185
|
-
if (
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
if (typeof maybeIterator === 'function') {
|
192
|
-
return maybeIterator;
|
193
|
-
}
|
194
|
-
|
195
|
-
return null;
|
108
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
109
|
+
maybeIterable =
|
110
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
111
|
+
maybeIterable["@@iterator"];
|
112
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
196
113
|
}
|
197
|
-
|
198
|
-
// $FlowFixMe[method-unbinding]
|
199
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
200
|
-
|
201
|
-
function hasValidRef(config) {
|
202
|
-
|
203
|
-
return config.ref !== undefined;
|
204
|
-
}
|
205
|
-
|
206
|
-
function hasValidKey(config) {
|
207
|
-
|
208
|
-
return config.key !== undefined;
|
209
|
-
}
|
210
|
-
/**
|
211
|
-
* Factory method to create a new React element. This no longer adheres to
|
212
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
213
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
214
|
-
* if something is a React Element.
|
215
|
-
*
|
216
|
-
* @param {*} type
|
217
|
-
* @param {*} props
|
218
|
-
* @param {*} key
|
219
|
-
* @param {string|object} ref
|
220
|
-
* @param {*} owner
|
221
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
222
|
-
* different from the `owner` when React.createElement is called, so that we
|
223
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
224
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
225
|
-
* change in behavior.
|
226
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
227
|
-
* indicating filename, line number, and/or other information.
|
228
|
-
* @internal
|
229
|
-
*/
|
230
|
-
|
231
|
-
|
114
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
232
115
|
function ReactElement(type, key, _ref, self, source, owner, props) {
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
242
|
-
// backwards compatibility.
|
243
|
-
|
244
|
-
ref = refProp !== undefined ? refProp : null;
|
245
|
-
}
|
246
|
-
|
247
|
-
let element;
|
248
|
-
|
249
|
-
{
|
250
|
-
// In prod, `ref` is a regular property and _owner doesn't exist.
|
251
|
-
element = {
|
252
|
-
// This tag allows us to uniquely identify this as a React Element
|
253
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
254
|
-
// Built-in properties that belong on the element
|
255
|
-
type,
|
256
|
-
key,
|
257
|
-
ref,
|
258
|
-
props
|
259
|
-
};
|
260
|
-
}
|
261
|
-
|
262
|
-
return element;
|
263
|
-
}
|
264
|
-
/**
|
265
|
-
* Create and return a new ReactElement of the given type.
|
266
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
267
|
-
*/
|
268
|
-
|
269
|
-
function createElement(type, config, children) {
|
270
|
-
|
271
|
-
let propName; // Reserved names are extracted
|
272
|
-
|
273
|
-
const props = {};
|
274
|
-
let key = null;
|
275
|
-
let ref = null;
|
276
|
-
|
277
|
-
if (config != null) {
|
278
|
-
|
279
|
-
if (hasValidKey(config)) {
|
280
|
-
|
281
|
-
key = '' + config.key;
|
282
|
-
} // Remaining properties are added to a new props object
|
283
|
-
|
284
|
-
|
285
|
-
for (propName in config) {
|
286
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
287
|
-
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
288
|
-
// them to appear as props, so in createElement we filter them out.
|
289
|
-
// We don't have to do this in the jsx() runtime because the jsx()
|
290
|
-
// transform never passed these as props; it used separate arguments.
|
291
|
-
propName !== '__self' && propName !== '__source') {
|
292
|
-
{
|
293
|
-
props[propName] = config[propName];
|
294
|
-
}
|
295
|
-
}
|
296
|
-
}
|
297
|
-
} // Children can be more than one argument, and those are transferred onto
|
298
|
-
// the newly allocated props object.
|
299
|
-
|
300
|
-
|
301
|
-
const childrenLength = arguments.length - 2;
|
302
|
-
|
303
|
-
if (childrenLength === 1) {
|
304
|
-
props.children = children;
|
305
|
-
} else if (childrenLength > 1) {
|
306
|
-
const childArray = Array(childrenLength);
|
307
|
-
|
308
|
-
for (let i = 0; i < childrenLength; i++) {
|
309
|
-
childArray[i] = arguments[i + 2];
|
310
|
-
}
|
311
|
-
|
312
|
-
props.children = childArray;
|
313
|
-
} // Resolve default props
|
314
|
-
|
315
|
-
|
316
|
-
if (type && type.defaultProps) {
|
317
|
-
const defaultProps = type.defaultProps;
|
318
|
-
|
319
|
-
for (propName in defaultProps) {
|
320
|
-
if (props[propName] === undefined) {
|
321
|
-
props[propName] = defaultProps[propName];
|
322
|
-
}
|
323
|
-
}
|
324
|
-
}
|
325
|
-
|
326
|
-
const element = ReactElement(type, key, ref, undefined, undefined, ReactSharedInternals.owner, props);
|
327
|
-
|
328
|
-
return element;
|
116
|
+
_ref = props.ref;
|
117
|
+
return {
|
118
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
119
|
+
type: type,
|
120
|
+
key: key,
|
121
|
+
ref: void 0 !== _ref ? _ref : null,
|
122
|
+
props: props
|
123
|
+
};
|
329
124
|
}
|
330
125
|
function cloneAndReplaceKey(oldElement, newKey) {
|
331
|
-
return ReactElement(
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
function cloneElement(element, config, children) {
|
341
|
-
if (element === null || element === undefined) {
|
342
|
-
throw Error(formatProdErrorMessage(267, element));
|
343
|
-
}
|
344
|
-
|
345
|
-
let propName; // Original props are copied
|
346
|
-
|
347
|
-
const props = assign({}, element.props); // Reserved names are extracted
|
348
|
-
|
349
|
-
let key = element.key;
|
350
|
-
let ref = null ; // Owner will be preserved, unless ref is overridden
|
351
|
-
|
352
|
-
let owner = undefined ;
|
353
|
-
|
354
|
-
if (config != null) {
|
355
|
-
if (hasValidRef(config)) {
|
356
|
-
owner = ReactSharedInternals.owner;
|
357
|
-
}
|
358
|
-
|
359
|
-
if (hasValidKey(config)) {
|
360
|
-
|
361
|
-
key = '' + config.key;
|
362
|
-
} // Remaining properties override existing props
|
363
|
-
|
364
|
-
for (propName in config) {
|
365
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
366
|
-
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
367
|
-
// warnings and debug information in dev. Need to decide if we're OK
|
368
|
-
// with dropping them. In the jsx() runtime it's not an issue because
|
369
|
-
// the data gets passed as separate arguments instead of props, but
|
370
|
-
// it would be nice to stop relying on them entirely so we can drop
|
371
|
-
// them from the internal Fiber field.
|
372
|
-
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
373
|
-
// if the property were missing. This is mostly for
|
374
|
-
// backwards compatibility.
|
375
|
-
!(propName === 'ref' && config.ref === undefined)) {
|
376
|
-
{
|
377
|
-
{
|
378
|
-
props[propName] = config[propName];
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
}
|
383
|
-
} // Children can be more than one argument, and those are transferred onto
|
384
|
-
// the newly allocated props object.
|
385
|
-
|
386
|
-
|
387
|
-
const childrenLength = arguments.length - 2;
|
388
|
-
|
389
|
-
if (childrenLength === 1) {
|
390
|
-
props.children = children;
|
391
|
-
} else if (childrenLength > 1) {
|
392
|
-
const childArray = Array(childrenLength);
|
393
|
-
|
394
|
-
for (let i = 0; i < childrenLength; i++) {
|
395
|
-
childArray[i] = arguments[i + 2];
|
396
|
-
}
|
397
|
-
|
398
|
-
props.children = childArray;
|
399
|
-
}
|
400
|
-
|
401
|
-
const clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
|
402
|
-
|
403
|
-
return clonedElement;
|
126
|
+
return ReactElement(
|
127
|
+
oldElement.type,
|
128
|
+
newKey,
|
129
|
+
null,
|
130
|
+
void 0,
|
131
|
+
void 0,
|
132
|
+
void 0,
|
133
|
+
oldElement.props
|
134
|
+
);
|
404
135
|
}
|
405
|
-
/**
|
406
|
-
* Verifies the object is a ReactElement.
|
407
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
408
|
-
* @param {?object} object
|
409
|
-
* @return {boolean} True if `object` is a ReactElement.
|
410
|
-
* @final
|
411
|
-
*/
|
412
|
-
|
413
|
-
|
414
136
|
function isValidElement(object) {
|
415
|
-
return
|
137
|
+
return (
|
138
|
+
"object" === typeof object &&
|
139
|
+
null !== object &&
|
140
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
141
|
+
);
|
416
142
|
}
|
417
|
-
|
418
|
-
const SEPARATOR = '.';
|
419
|
-
const SUBSEPARATOR = ':';
|
420
|
-
/**
|
421
|
-
* Escape and wrap key so it is safe to use as a reactid
|
422
|
-
*
|
423
|
-
* @param {string} key to be escaped.
|
424
|
-
* @return {string} the escaped key.
|
425
|
-
*/
|
426
|
-
|
427
143
|
function escape(key) {
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
}
|
438
|
-
const userProvidedKeyEscapeRegex = /\/+/g;
|
439
|
-
|
440
|
-
function escapeUserProvidedKey(text) {
|
441
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
442
|
-
}
|
443
|
-
/**
|
444
|
-
* Generate a key string that identifies a element within a set.
|
445
|
-
*
|
446
|
-
* @param {*} element A element that could contain a manual key.
|
447
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
448
|
-
* @return {string}
|
449
|
-
*/
|
450
|
-
|
451
|
-
|
144
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
145
|
+
return (
|
146
|
+
"$" +
|
147
|
+
key.replace(/[=:]/g, function (match) {
|
148
|
+
return escaperLookup[match];
|
149
|
+
})
|
150
|
+
);
|
151
|
+
}
|
152
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
452
153
|
function getElementKey(element, index) {
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
return escape('' + element.key);
|
458
|
-
} // Implicit key determined by the index in the set
|
459
|
-
|
460
|
-
|
461
|
-
return index.toString(36);
|
154
|
+
return "object" === typeof element && null !== element && null != element.key
|
155
|
+
? escape("" + element.key)
|
156
|
+
: index.toString(36);
|
462
157
|
}
|
463
|
-
|
464
158
|
function noop$1() {}
|
465
|
-
|
466
159
|
function resolveThenable(thenable) {
|
467
160
|
switch (thenable.status) {
|
468
|
-
case
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
}
|
473
|
-
|
474
|
-
case 'rejected':
|
475
|
-
{
|
476
|
-
const rejectedError = thenable.reason;
|
477
|
-
throw rejectedError;
|
478
|
-
}
|
479
|
-
|
161
|
+
case "fulfilled":
|
162
|
+
return thenable.value;
|
163
|
+
case "rejected":
|
164
|
+
throw thenable.reason;
|
480
165
|
default:
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
const rejectedThenable = thenable;
|
503
|
-
rejectedThenable.status = 'rejected';
|
504
|
-
rejectedThenable.reason = error;
|
505
|
-
}
|
506
|
-
});
|
507
|
-
} // Check one more time in case the thenable resolved synchronously.
|
508
|
-
|
509
|
-
|
510
|
-
switch (thenable.status) {
|
511
|
-
case 'fulfilled':
|
512
|
-
{
|
513
|
-
const fulfilledThenable = thenable;
|
514
|
-
return fulfilledThenable.value;
|
515
|
-
}
|
516
|
-
|
517
|
-
case 'rejected':
|
518
|
-
{
|
519
|
-
const rejectedThenable = thenable;
|
520
|
-
const rejectedError = rejectedThenable.reason;
|
521
|
-
throw rejectedError;
|
522
|
-
}
|
523
|
-
}
|
166
|
+
switch (
|
167
|
+
("string" === typeof thenable.status
|
168
|
+
? thenable.then(noop$1, noop$1)
|
169
|
+
: ((thenable.status = "pending"),
|
170
|
+
thenable.then(
|
171
|
+
function (fulfilledValue) {
|
172
|
+
"pending" === thenable.status &&
|
173
|
+
((thenable.status = "fulfilled"),
|
174
|
+
(thenable.value = fulfilledValue));
|
175
|
+
},
|
176
|
+
function (error) {
|
177
|
+
"pending" === thenable.status &&
|
178
|
+
((thenable.status = "rejected"), (thenable.reason = error));
|
179
|
+
}
|
180
|
+
)),
|
181
|
+
thenable.status)
|
182
|
+
) {
|
183
|
+
case "fulfilled":
|
184
|
+
return thenable.value;
|
185
|
+
case "rejected":
|
186
|
+
throw thenable.reason;
|
524
187
|
}
|
525
188
|
}
|
526
|
-
|
527
189
|
throw thenable;
|
528
190
|
}
|
529
|
-
|
530
191
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
}
|
537
|
-
|
538
|
-
let invokeCallback = false;
|
539
|
-
|
540
|
-
if (children === null) {
|
541
|
-
invokeCallback = true;
|
542
|
-
} else {
|
192
|
+
var type = typeof children;
|
193
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
194
|
+
var invokeCallback = !1;
|
195
|
+
if (null === children) invokeCallback = !0;
|
196
|
+
else
|
543
197
|
switch (type) {
|
544
|
-
case
|
545
|
-
case
|
546
|
-
case
|
547
|
-
invokeCallback =
|
198
|
+
case "bigint":
|
199
|
+
case "string":
|
200
|
+
case "number":
|
201
|
+
invokeCallback = !0;
|
548
202
|
break;
|
549
|
-
|
550
|
-
case 'object':
|
203
|
+
case "object":
|
551
204
|
switch (children.$$typeof) {
|
552
205
|
case REACT_ELEMENT_TYPE:
|
553
206
|
case REACT_PORTAL_TYPE:
|
554
|
-
invokeCallback =
|
207
|
+
invokeCallback = !0;
|
555
208
|
break;
|
556
|
-
|
557
209
|
case REACT_LAZY_TYPE:
|
558
|
-
|
559
|
-
|
560
|
-
|
210
|
+
return (
|
211
|
+
(invokeCallback = children._init),
|
212
|
+
mapIntoArray(
|
213
|
+
invokeCallback(children._payload),
|
214
|
+
array,
|
215
|
+
escapedPrefix,
|
216
|
+
nameSoFar,
|
217
|
+
callback
|
218
|
+
)
|
219
|
+
);
|
561
220
|
}
|
562
|
-
|
563
221
|
}
|
222
|
+
if (invokeCallback)
|
223
|
+
return (
|
224
|
+
(callback = callback(children)),
|
225
|
+
(invokeCallback =
|
226
|
+
"" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
|
227
|
+
isArrayImpl(callback)
|
228
|
+
? ((escapedPrefix = ""),
|
229
|
+
null != invokeCallback &&
|
230
|
+
(escapedPrefix =
|
231
|
+
invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
|
232
|
+
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
|
233
|
+
return c;
|
234
|
+
}))
|
235
|
+
: null != callback &&
|
236
|
+
(isValidElement(callback) &&
|
237
|
+
(callback = cloneAndReplaceKey(
|
238
|
+
callback,
|
239
|
+
escapedPrefix +
|
240
|
+
(!callback.key || (children && children.key === callback.key)
|
241
|
+
? ""
|
242
|
+
: ("" + callback.key).replace(
|
243
|
+
userProvidedKeyEscapeRegex,
|
244
|
+
"$&/"
|
245
|
+
) + "/") +
|
246
|
+
invokeCallback
|
247
|
+
)),
|
248
|
+
array.push(callback)),
|
249
|
+
1
|
250
|
+
);
|
251
|
+
invokeCallback = 0;
|
252
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
253
|
+
if (isArrayImpl(children))
|
254
|
+
for (var i = 0; i < children.length; i++)
|
255
|
+
(nameSoFar = children[i]),
|
256
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i)),
|
257
|
+
(invokeCallback += mapIntoArray(
|
258
|
+
nameSoFar,
|
259
|
+
array,
|
260
|
+
escapedPrefix,
|
261
|
+
type,
|
262
|
+
callback
|
263
|
+
));
|
264
|
+
else if (((i = getIteratorFn(children)), "function" === typeof i))
|
265
|
+
for (
|
266
|
+
children = i.call(children), i = 0;
|
267
|
+
!(nameSoFar = children.next()).done;
|
268
|
+
|
269
|
+
)
|
270
|
+
(nameSoFar = nameSoFar.value),
|
271
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i++)),
|
272
|
+
(invokeCallback += mapIntoArray(
|
273
|
+
nameSoFar,
|
274
|
+
array,
|
275
|
+
escapedPrefix,
|
276
|
+
type,
|
277
|
+
callback
|
278
|
+
));
|
279
|
+
else if ("object" === type) {
|
280
|
+
if ("function" === typeof children.then)
|
281
|
+
return mapIntoArray(
|
282
|
+
resolveThenable(children),
|
283
|
+
array,
|
284
|
+
escapedPrefix,
|
285
|
+
nameSoFar,
|
286
|
+
callback
|
287
|
+
);
|
288
|
+
array = String(children);
|
289
|
+
throw Error(
|
290
|
+
formatProdErrorMessage(
|
291
|
+
31,
|
292
|
+
"[object Object]" === array
|
293
|
+
? "object with keys {" + Object.keys(children).join(", ") + "}"
|
294
|
+
: array
|
295
|
+
)
|
296
|
+
);
|
564
297
|
}
|
565
|
-
|
566
|
-
if (invokeCallback) {
|
567
|
-
const child = children;
|
568
|
-
let mappedChild = callback(child); // If it's the only child, treat the name as if it was wrapped in an array
|
569
|
-
// so that it's consistent if the number of children grows:
|
570
|
-
|
571
|
-
const childKey = nameSoFar === '' ? SEPARATOR + getElementKey(child, 0) : nameSoFar;
|
572
|
-
|
573
|
-
if (isArray(mappedChild)) {
|
574
|
-
let escapedChildKey = '';
|
575
|
-
|
576
|
-
if (childKey != null) {
|
577
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
578
|
-
}
|
579
|
-
|
580
|
-
mapIntoArray(mappedChild, array, escapedChildKey, '', c => c);
|
581
|
-
} else if (mappedChild != null) {
|
582
|
-
if (isValidElement(mappedChild)) {
|
583
|
-
|
584
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
585
|
-
// traverseAllChildren used to do for objects as children
|
586
|
-
escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
|
587
|
-
mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
|
588
|
-
'' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
|
589
|
-
) + '/' : '') + childKey);
|
590
|
-
}
|
591
|
-
|
592
|
-
array.push(mappedChild);
|
593
|
-
}
|
594
|
-
|
595
|
-
return 1;
|
596
|
-
}
|
597
|
-
|
598
|
-
let child;
|
599
|
-
let nextName;
|
600
|
-
let subtreeCount = 0; // Count of children found in the current subtree.
|
601
|
-
|
602
|
-
const nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
603
|
-
|
604
|
-
if (isArray(children)) {
|
605
|
-
for (let i = 0; i < children.length; i++) {
|
606
|
-
child = children[i];
|
607
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
608
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
609
|
-
}
|
610
|
-
} else {
|
611
|
-
const iteratorFn = getIteratorFn(children);
|
612
|
-
|
613
|
-
if (typeof iteratorFn === 'function') {
|
614
|
-
const iterableChildren = children;
|
615
|
-
|
616
|
-
const iterator = iteratorFn.call(iterableChildren);
|
617
|
-
let step;
|
618
|
-
let ii = 0; // $FlowFixMe[incompatible-use] `iteratorFn` might return null according to typing.
|
619
|
-
|
620
|
-
while (!(step = iterator.next()).done) {
|
621
|
-
child = step.value;
|
622
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
623
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
624
|
-
}
|
625
|
-
} else if (type === 'object') {
|
626
|
-
if (typeof children.then === 'function') {
|
627
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
628
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
629
|
-
|
630
|
-
|
631
|
-
const childrenString = String(children);
|
632
|
-
throw Error(formatProdErrorMessage(31, childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString));
|
633
|
-
}
|
634
|
-
}
|
635
|
-
|
636
|
-
return subtreeCount;
|
298
|
+
return invokeCallback;
|
637
299
|
}
|
638
|
-
/**
|
639
|
-
* Maps children that are typically specified as `props.children`.
|
640
|
-
*
|
641
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
642
|
-
*
|
643
|
-
* The provided mapFunction(child, index) will be called for each
|
644
|
-
* leaf child.
|
645
|
-
*
|
646
|
-
* @param {?*} children Children tree container.
|
647
|
-
* @param {function(*, int)} func The map function.
|
648
|
-
* @param {*} context Context for mapFunction.
|
649
|
-
* @return {object} Object containing the ordered map of results.
|
650
|
-
*/
|
651
|
-
|
652
|
-
|
653
300
|
function mapChildren(children, func, context) {
|
654
|
-
if (
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
const result = [];
|
660
|
-
let count = 0;
|
661
|
-
mapIntoArray(children, result, '', '', function (child) {
|
301
|
+
if (null == children) return children;
|
302
|
+
var result = [],
|
303
|
+
count = 0;
|
304
|
+
mapIntoArray(children, result, "", "", function (child) {
|
662
305
|
return func.call(context, child, count++);
|
663
306
|
});
|
664
307
|
return result;
|
665
308
|
}
|
666
|
-
/**
|
667
|
-
* Count the number of children that are typically specified as
|
668
|
-
* `props.children`.
|
669
|
-
*
|
670
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
671
|
-
*
|
672
|
-
* @param {?*} children Children tree container.
|
673
|
-
* @return {number} The number of children.
|
674
|
-
*/
|
675
|
-
|
676
|
-
|
677
|
-
function countChildren(children) {
|
678
|
-
let n = 0;
|
679
|
-
mapChildren(children, () => {
|
680
|
-
n++; // Don't return anything
|
681
|
-
});
|
682
|
-
return n;
|
683
|
-
}
|
684
|
-
/**
|
685
|
-
* Iterates through children that are typically specified as `props.children`.
|
686
|
-
*
|
687
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
688
|
-
*
|
689
|
-
* The provided forEachFunc(child, index) will be called for each
|
690
|
-
* leaf child.
|
691
|
-
*
|
692
|
-
* @param {?*} children Children tree container.
|
693
|
-
* @param {function(*, int)} forEachFunc
|
694
|
-
* @param {*} forEachContext Context for forEachContext.
|
695
|
-
*/
|
696
|
-
|
697
|
-
|
698
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
699
|
-
mapChildren(children, // $FlowFixMe[missing-this-annot]
|
700
|
-
function () {
|
701
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
702
|
-
}, forEachContext);
|
703
|
-
}
|
704
|
-
/**
|
705
|
-
* Flatten a children object (typically specified as `props.children`) and
|
706
|
-
* return an array with appropriately re-keyed children.
|
707
|
-
*
|
708
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
709
|
-
*/
|
710
|
-
|
711
|
-
|
712
|
-
function toArray(children) {
|
713
|
-
return mapChildren(children, child => child) || [];
|
714
|
-
}
|
715
|
-
/**
|
716
|
-
* Returns the first child in a collection of children and verifies that there
|
717
|
-
* is only one child in the collection.
|
718
|
-
*
|
719
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
720
|
-
*
|
721
|
-
* The current implementation of this function assumes that a single child gets
|
722
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
723
|
-
* abstract away the particular structure of children.
|
724
|
-
*
|
725
|
-
* @param {?object} children Child collection structure.
|
726
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
727
|
-
* structure.
|
728
|
-
*/
|
729
|
-
|
730
|
-
|
731
|
-
function onlyChild(children) {
|
732
|
-
if (!isValidElement(children)) {
|
733
|
-
throw Error(formatProdErrorMessage(143));
|
734
|
-
}
|
735
|
-
|
736
|
-
return children;
|
737
|
-
}
|
738
|
-
|
739
|
-
// an immutable object with a single mutable value
|
740
|
-
function createRef() {
|
741
|
-
const refObject = {
|
742
|
-
current: null
|
743
|
-
};
|
744
|
-
|
745
|
-
return refObject;
|
746
|
-
}
|
747
|
-
|
748
|
-
function resolveDispatcher() {
|
749
|
-
const dispatcher = ReactSharedInternals.H;
|
750
|
-
// intentionally don't throw our own error because this is in a hot path.
|
751
|
-
// Also helps ensure this is inlined.
|
752
|
-
|
753
|
-
|
754
|
-
return dispatcher;
|
755
|
-
}
|
756
|
-
function useCallback(callback, deps) {
|
757
|
-
const dispatcher = resolveDispatcher();
|
758
|
-
return dispatcher.useCallback(callback, deps);
|
759
|
-
}
|
760
|
-
function useMemo(create, deps) {
|
761
|
-
const dispatcher = resolveDispatcher();
|
762
|
-
return dispatcher.useMemo(create, deps);
|
763
|
-
}
|
764
|
-
function useDebugValue(value, formatterFn) {
|
765
|
-
}
|
766
|
-
function useId() {
|
767
|
-
const dispatcher = resolveDispatcher();
|
768
|
-
return dispatcher.useId();
|
769
|
-
}
|
770
|
-
function use(usable) {
|
771
|
-
const dispatcher = resolveDispatcher();
|
772
|
-
return dispatcher.use(usable);
|
773
|
-
}
|
774
|
-
function useActionState(action, initialState, permalink) {
|
775
|
-
{
|
776
|
-
const dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
777
|
-
|
778
|
-
return dispatcher.useActionState(action, initialState, permalink);
|
779
|
-
}
|
780
|
-
}
|
781
|
-
|
782
|
-
function forwardRef(render) {
|
783
|
-
|
784
|
-
const elementType = {
|
785
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
786
|
-
render
|
787
|
-
};
|
788
|
-
|
789
|
-
return elementType;
|
790
|
-
}
|
791
|
-
|
792
|
-
const Uninitialized = -1;
|
793
|
-
const Pending = 0;
|
794
|
-
const Resolved = 1;
|
795
|
-
const Rejected = 2;
|
796
|
-
|
797
309
|
function lazyInitializer(payload) {
|
798
|
-
if (payload._status
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
const resolved = payload;
|
810
|
-
resolved._status = Resolved;
|
811
|
-
resolved._result = moduleObject;
|
310
|
+
if (-1 === payload._status) {
|
311
|
+
var ctor = payload._result;
|
312
|
+
ctor = ctor();
|
313
|
+
ctor.then(
|
314
|
+
function (moduleObject) {
|
315
|
+
if (0 === payload._status || -1 === payload._status)
|
316
|
+
(payload._status = 1), (payload._result = moduleObject);
|
317
|
+
},
|
318
|
+
function (error) {
|
319
|
+
if (0 === payload._status || -1 === payload._status)
|
320
|
+
(payload._status = 2), (payload._result = error);
|
812
321
|
}
|
813
|
-
|
814
|
-
|
815
|
-
// Transition to the next state.
|
816
|
-
const rejected = payload;
|
817
|
-
rejected._status = Rejected;
|
818
|
-
rejected._result = error;
|
819
|
-
}
|
820
|
-
});
|
821
|
-
|
822
|
-
if (payload._status === Uninitialized) {
|
823
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
824
|
-
// to resolve. Set it as pending in the meantime.
|
825
|
-
const pending = payload;
|
826
|
-
pending._status = Pending;
|
827
|
-
pending._result = thenable;
|
828
|
-
}
|
829
|
-
}
|
830
|
-
|
831
|
-
if (payload._status === Resolved) {
|
832
|
-
const moduleObject = payload._result;
|
833
|
-
|
834
|
-
return moduleObject.default;
|
835
|
-
} else {
|
836
|
-
throw payload._result;
|
322
|
+
);
|
323
|
+
-1 === payload._status && ((payload._status = 0), (payload._result = ctor));
|
837
324
|
}
|
325
|
+
if (1 === payload._status) return payload._result.default;
|
326
|
+
throw payload._result;
|
838
327
|
}
|
839
|
-
|
840
|
-
function lazy(ctor) {
|
841
|
-
const payload = {
|
842
|
-
// We use these fields to store the result.
|
843
|
-
_status: Uninitialized,
|
844
|
-
_result: ctor
|
845
|
-
};
|
846
|
-
const lazyType = {
|
847
|
-
$$typeof: REACT_LAZY_TYPE,
|
848
|
-
_payload: payload,
|
849
|
-
_init: lazyInitializer
|
850
|
-
};
|
851
|
-
|
852
|
-
return lazyType;
|
853
|
-
}
|
854
|
-
|
855
|
-
function memo(type, compare) {
|
856
|
-
|
857
|
-
const elementType = {
|
858
|
-
$$typeof: REACT_MEMO_TYPE,
|
859
|
-
type,
|
860
|
-
compare: compare === undefined ? null : compare
|
861
|
-
};
|
862
|
-
|
863
|
-
return elementType;
|
864
|
-
}
|
865
|
-
|
866
|
-
const UNTERMINATED = 0;
|
867
|
-
const TERMINATED = 1;
|
868
|
-
const ERRORED = 2;
|
869
|
-
|
870
328
|
function createCacheRoot() {
|
871
329
|
return new WeakMap();
|
872
330
|
}
|
873
|
-
|
874
331
|
function createCacheNode() {
|
875
|
-
return {
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
fnMap.set(fn, cacheNode);
|
904
|
-
} else {
|
905
|
-
cacheNode = fnNode;
|
906
|
-
}
|
907
|
-
|
908
|
-
for (let i = 0, l = arguments.length; i < l; i++) {
|
909
|
-
const arg = arguments[i];
|
910
|
-
|
911
|
-
if (typeof arg === 'function' || typeof arg === 'object' && arg !== null) {
|
912
|
-
// Objects go into a WeakMap
|
913
|
-
let objectCache = cacheNode.o;
|
914
|
-
|
915
|
-
if (objectCache === null) {
|
916
|
-
cacheNode.o = objectCache = new WeakMap();
|
917
|
-
}
|
918
|
-
|
919
|
-
const objectNode = objectCache.get(arg);
|
920
|
-
|
921
|
-
if (objectNode === undefined) {
|
922
|
-
cacheNode = createCacheNode();
|
923
|
-
objectCache.set(arg, cacheNode);
|
924
|
-
} else {
|
925
|
-
cacheNode = objectNode;
|
926
|
-
}
|
927
|
-
} else {
|
928
|
-
// Primitives go into a regular Map
|
929
|
-
let primitiveCache = cacheNode.p;
|
930
|
-
|
931
|
-
if (primitiveCache === null) {
|
932
|
-
cacheNode.p = primitiveCache = new Map();
|
933
|
-
}
|
934
|
-
|
935
|
-
const primitiveNode = primitiveCache.get(arg);
|
936
|
-
|
937
|
-
if (primitiveNode === undefined) {
|
938
|
-
cacheNode = createCacheNode();
|
939
|
-
primitiveCache.set(arg, cacheNode);
|
940
|
-
} else {
|
941
|
-
cacheNode = primitiveNode;
|
332
|
+
return { s: 0, v: void 0, o: null, p: null };
|
333
|
+
}
|
334
|
+
var reportGlobalError =
|
335
|
+
"function" === typeof reportError
|
336
|
+
? reportError
|
337
|
+
: function (error) {
|
338
|
+
if (
|
339
|
+
"object" === typeof window &&
|
340
|
+
"function" === typeof window.ErrorEvent
|
341
|
+
) {
|
342
|
+
var event = new window.ErrorEvent("error", {
|
343
|
+
bubbles: !0,
|
344
|
+
cancelable: !0,
|
345
|
+
message:
|
346
|
+
"object" === typeof error &&
|
347
|
+
null !== error &&
|
348
|
+
"string" === typeof error.message
|
349
|
+
? String(error.message)
|
350
|
+
: String(error),
|
351
|
+
error: error
|
352
|
+
});
|
353
|
+
if (!window.dispatchEvent(event)) return;
|
354
|
+
} else if (
|
355
|
+
"object" === typeof process &&
|
356
|
+
"function" === typeof process.emit
|
357
|
+
) {
|
358
|
+
process.emit("uncaughtException", error);
|
359
|
+
return;
|
942
360
|
}
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
361
|
+
console.error(error);
|
362
|
+
};
|
363
|
+
function noop() {}
|
364
|
+
exports.Children = {
|
365
|
+
map: mapChildren,
|
366
|
+
forEach: function (children, forEachFunc, forEachContext) {
|
367
|
+
mapChildren(
|
368
|
+
children,
|
369
|
+
function () {
|
370
|
+
forEachFunc.apply(this, arguments);
|
371
|
+
},
|
372
|
+
forEachContext
|
373
|
+
);
|
374
|
+
},
|
375
|
+
count: function (children) {
|
376
|
+
var n = 0;
|
377
|
+
mapChildren(children, function () {
|
378
|
+
n++;
|
379
|
+
});
|
380
|
+
return n;
|
381
|
+
},
|
382
|
+
toArray: function (children) {
|
383
|
+
return (
|
384
|
+
mapChildren(children, function (child) {
|
385
|
+
return child;
|
386
|
+
}) || []
|
387
|
+
);
|
388
|
+
},
|
389
|
+
only: function (children) {
|
390
|
+
if (!isValidElement(children)) throw Error(formatProdErrorMessage(143));
|
391
|
+
return children;
|
392
|
+
}
|
393
|
+
};
|
394
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
395
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
396
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
397
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
398
|
+
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
|
399
|
+
ReactSharedInternals;
|
400
|
+
exports.cache = function (fn) {
|
401
|
+
return function () {
|
402
|
+
var dispatcher = ReactSharedInternals.C;
|
403
|
+
if (!dispatcher) return fn.apply(null, arguments);
|
404
|
+
var fnMap = dispatcher.getCacheForType(createCacheRoot);
|
405
|
+
dispatcher = fnMap.get(fn);
|
406
|
+
void 0 === dispatcher &&
|
407
|
+
((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
|
408
|
+
fnMap = 0;
|
409
|
+
for (var l = arguments.length; fnMap < l; fnMap++) {
|
410
|
+
var arg = arguments[fnMap];
|
411
|
+
if (
|
412
|
+
"function" === typeof arg ||
|
413
|
+
("object" === typeof arg && null !== arg)
|
414
|
+
) {
|
415
|
+
var objectCache = dispatcher.o;
|
416
|
+
null === objectCache && (dispatcher.o = objectCache = new WeakMap());
|
417
|
+
dispatcher = objectCache.get(arg);
|
418
|
+
void 0 === dispatcher &&
|
419
|
+
((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher));
|
420
|
+
} else
|
421
|
+
(objectCache = dispatcher.p),
|
422
|
+
null === objectCache && (dispatcher.p = objectCache = new Map()),
|
423
|
+
(dispatcher = objectCache.get(arg)),
|
424
|
+
void 0 === dispatcher &&
|
425
|
+
((dispatcher = createCacheNode()),
|
426
|
+
objectCache.set(arg, dispatcher));
|
952
427
|
}
|
953
|
-
|
428
|
+
if (1 === dispatcher.s) return dispatcher.v;
|
429
|
+
if (2 === dispatcher.s) throw dispatcher.v;
|
954
430
|
try {
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
terminatedNode.v = result;
|
960
|
-
return result;
|
431
|
+
var result = fn.apply(null, arguments);
|
432
|
+
fnMap = dispatcher;
|
433
|
+
fnMap.s = 1;
|
434
|
+
return (fnMap.v = result);
|
961
435
|
} catch (error) {
|
962
|
-
|
963
|
-
const erroredNode = cacheNode;
|
964
|
-
erroredNode.s = ERRORED;
|
965
|
-
erroredNode.v = error;
|
966
|
-
throw error;
|
436
|
+
throw ((result = dispatcher), (result.s = 2), (result.v = error), error);
|
967
437
|
}
|
968
438
|
};
|
969
|
-
}
|
970
|
-
|
971
|
-
const reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
|
972
|
-
// emulating an uncaught JavaScript error.
|
973
|
-
reportError : error => {
|
974
|
-
if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
|
975
|
-
// Browser Polyfill
|
976
|
-
const message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
|
977
|
-
String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
|
978
|
-
String(error);
|
979
|
-
const event = new window.ErrorEvent('error', {
|
980
|
-
bubbles: true,
|
981
|
-
cancelable: true,
|
982
|
-
message: message,
|
983
|
-
error: error
|
984
|
-
});
|
985
|
-
const shouldLog = window.dispatchEvent(event);
|
986
|
-
|
987
|
-
if (!shouldLog) {
|
988
|
-
return;
|
989
|
-
}
|
990
|
-
} else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
|
991
|
-
typeof process.emit === 'function') {
|
992
|
-
// Node Polyfill
|
993
|
-
process.emit('uncaughtException', error);
|
994
|
-
return;
|
995
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
996
|
-
|
997
|
-
|
998
|
-
console['error'](error);
|
999
439
|
};
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
ReactSharedInternals.T = prevTransition;
|
1024
|
-
}
|
440
|
+
exports.cloneElement = function (element, config, children) {
|
441
|
+
if (null === element || void 0 === element)
|
442
|
+
throw Error(formatProdErrorMessage(267, element));
|
443
|
+
var props = assign({}, element.props),
|
444
|
+
key = element.key,
|
445
|
+
owner = void 0;
|
446
|
+
if (null != config)
|
447
|
+
for (propName in (void 0 !== config.ref &&
|
448
|
+
(owner = ReactSharedInternals.owner),
|
449
|
+
void 0 !== config.key && (key = "" + config.key),
|
450
|
+
config))
|
451
|
+
!hasOwnProperty.call(config, propName) ||
|
452
|
+
"key" === propName ||
|
453
|
+
"__self" === propName ||
|
454
|
+
"__source" === propName ||
|
455
|
+
("ref" === propName && void 0 === config.ref) ||
|
456
|
+
(props[propName] = config[propName]);
|
457
|
+
var propName = arguments.length - 2;
|
458
|
+
if (1 === propName) props.children = children;
|
459
|
+
else if (1 < propName) {
|
460
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
461
|
+
childArray[i] = arguments[i + 2];
|
462
|
+
props.children = childArray;
|
1025
463
|
}
|
1026
|
-
|
1027
|
-
|
1028
|
-
function
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
464
|
+
return ReactElement(element.type, key, null, void 0, void 0, owner, props);
|
465
|
+
};
|
466
|
+
exports.createElement = function (type, config, children) {
|
467
|
+
var propName,
|
468
|
+
props = {},
|
469
|
+
key = null;
|
470
|
+
if (null != config)
|
471
|
+
for (propName in (void 0 !== config.key && (key = "" + config.key), config))
|
472
|
+
hasOwnProperty.call(config, propName) &&
|
473
|
+
"key" !== propName &&
|
474
|
+
"__self" !== propName &&
|
475
|
+
"__source" !== propName &&
|
476
|
+
(props[propName] = config[propName]);
|
477
|
+
var childrenLength = arguments.length - 2;
|
478
|
+
if (1 === childrenLength) props.children = children;
|
479
|
+
else if (1 < childrenLength) {
|
480
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
481
|
+
childArray[i] = arguments[i + 2];
|
482
|
+
props.children = childArray;
|
483
|
+
}
|
484
|
+
if (type && type.defaultProps)
|
485
|
+
for (propName in ((childrenLength = type.defaultProps), childrenLength))
|
486
|
+
void 0 === props[propName] &&
|
487
|
+
(props[propName] = childrenLength[propName]);
|
488
|
+
return ReactElement(
|
489
|
+
type,
|
490
|
+
key,
|
491
|
+
null,
|
492
|
+
void 0,
|
493
|
+
void 0,
|
494
|
+
ReactSharedInternals.owner,
|
495
|
+
props
|
496
|
+
);
|
497
|
+
};
|
498
|
+
exports.createRef = function () {
|
499
|
+
return { current: null };
|
500
|
+
};
|
501
|
+
exports.forwardRef = function (render) {
|
502
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
|
1039
503
|
};
|
1040
|
-
|
1041
|
-
exports.Children = Children;
|
1042
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
1043
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
1044
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
1045
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
1046
|
-
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
1047
|
-
exports.cache = cache;
|
1048
|
-
exports.cloneElement = cloneElement;
|
1049
|
-
exports.createElement = createElement;
|
1050
|
-
exports.createRef = createRef;
|
1051
|
-
exports.forwardRef = forwardRef;
|
1052
504
|
exports.isValidElement = isValidElement;
|
1053
|
-
exports.lazy =
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
exports.
|
1061
|
-
|
1062
|
-
|
505
|
+
exports.lazy = function (ctor) {
|
506
|
+
return {
|
507
|
+
$$typeof: REACT_LAZY_TYPE,
|
508
|
+
_payload: { _status: -1, _result: ctor },
|
509
|
+
_init: lazyInitializer
|
510
|
+
};
|
511
|
+
};
|
512
|
+
exports.memo = function (type, compare) {
|
513
|
+
return {
|
514
|
+
$$typeof: REACT_MEMO_TYPE,
|
515
|
+
type: type,
|
516
|
+
compare: void 0 === compare ? null : compare
|
517
|
+
};
|
518
|
+
};
|
519
|
+
exports.startTransition = function (scope) {
|
520
|
+
var prevTransition = ReactSharedInternals.T,
|
521
|
+
callbacks = new Set();
|
522
|
+
ReactSharedInternals.T = { _callbacks: callbacks };
|
523
|
+
var currentTransition = ReactSharedInternals.T;
|
524
|
+
try {
|
525
|
+
var returnValue = scope();
|
526
|
+
"object" === typeof returnValue &&
|
527
|
+
null !== returnValue &&
|
528
|
+
"function" === typeof returnValue.then &&
|
529
|
+
(callbacks.forEach(function (callback) {
|
530
|
+
return callback(currentTransition, returnValue);
|
531
|
+
}),
|
532
|
+
returnValue.then(noop, reportGlobalError));
|
533
|
+
} catch (error) {
|
534
|
+
reportGlobalError(error);
|
535
|
+
} finally {
|
536
|
+
ReactSharedInternals.T = prevTransition;
|
537
|
+
}
|
538
|
+
};
|
539
|
+
exports.use = function (usable) {
|
540
|
+
return ReactSharedInternals.H.use(usable);
|
541
|
+
};
|
542
|
+
exports.useActionState = function (action, initialState, permalink) {
|
543
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
544
|
+
};
|
545
|
+
exports.useCallback = function (callback, deps) {
|
546
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
547
|
+
};
|
548
|
+
exports.useDebugValue = function () {};
|
549
|
+
exports.useId = function () {
|
550
|
+
return ReactSharedInternals.H.useId();
|
551
|
+
};
|
552
|
+
exports.useMemo = function (create, deps) {
|
553
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
554
|
+
};
|
555
|
+
exports.version = "19.0.0-canary-db913d8e17-20240422";
|