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
package/cjs/react.production.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license React
|
3
|
-
* react.production.
|
3
|
+
* react.production.js
|
4
4
|
*
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
6
|
*
|
@@ -8,1101 +8,541 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
const REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
26
|
-
const REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
27
|
-
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
28
|
-
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
29
|
-
const REACT_MEMO_TYPE = Symbol.for('react.memo');
|
30
|
-
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
31
|
-
const MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
32
|
-
const FAUX_ITERATOR_SYMBOL = '@@iterator';
|
11
|
+
"use strict";
|
12
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
|
13
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
14
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
15
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
16
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
17
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
18
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
19
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
20
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
21
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
22
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
23
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
33
24
|
function getIteratorFn(maybeIterable) {
|
34
|
-
if (
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
/**
|
48
|
-
* This is the abstract API for an update queue.
|
49
|
-
*/
|
50
|
-
|
51
|
-
|
52
|
-
const ReactNoopUpdateQueue = {
|
53
|
-
/**
|
54
|
-
* Checks whether or not this composite component is mounted.
|
55
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
56
|
-
* @return {boolean} True if mounted, false otherwise.
|
57
|
-
* @protected
|
58
|
-
* @final
|
59
|
-
*/
|
60
|
-
isMounted: function (publicInstance) {
|
61
|
-
return false;
|
62
|
-
},
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Forces an update. This should only be invoked when it is known with
|
66
|
-
* certainty that we are **not** in a DOM transaction.
|
67
|
-
*
|
68
|
-
* You may want to call this when you know that some deeper aspect of the
|
69
|
-
* component's state has changed but `setState` was not called.
|
70
|
-
*
|
71
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
72
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
73
|
-
*
|
74
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
75
|
-
* @param {?function} callback Called after component is updated.
|
76
|
-
* @param {?string} callerName name of the calling function in the public API.
|
77
|
-
* @internal
|
78
|
-
*/
|
79
|
-
enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
25
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
26
|
+
maybeIterable =
|
27
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
28
|
+
maybeIterable["@@iterator"];
|
29
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
30
|
+
}
|
31
|
+
var ReactNoopUpdateQueue = {
|
32
|
+
isMounted: function () {
|
33
|
+
return !1;
|
34
|
+
},
|
35
|
+
enqueueForceUpdate: function () {},
|
36
|
+
enqueueReplaceState: function () {},
|
37
|
+
enqueueSetState: function () {}
|
80
38
|
},
|
81
|
-
|
82
|
-
|
83
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
84
|
-
* You should treat `this.state` as immutable.
|
85
|
-
*
|
86
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
87
|
-
* accessing `this.state` after calling this method may return the old value.
|
88
|
-
*
|
89
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
90
|
-
* @param {object} completeState Next state.
|
91
|
-
* @param {?function} callback Called after component is updated.
|
92
|
-
* @param {?string} callerName name of the calling function in the public API.
|
93
|
-
* @internal
|
94
|
-
*/
|
95
|
-
enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
96
|
-
},
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
100
|
-
* internal. This provides a merging strategy that is not available to deep
|
101
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
102
|
-
* during the merge.
|
103
|
-
*
|
104
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
105
|
-
* @param {object} partialState Next partial state to be merged with state.
|
106
|
-
* @param {?function} callback Called after component is updated.
|
107
|
-
* @param {?string} Name of the calling function in the public API.
|
108
|
-
* @internal
|
109
|
-
*/
|
110
|
-
enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
111
|
-
}
|
112
|
-
};
|
113
|
-
|
114
|
-
const assign = Object.assign;
|
115
|
-
|
116
|
-
/**
|
117
|
-
* Base class helpers for the updating state of a component.
|
118
|
-
*/
|
119
|
-
|
39
|
+
assign = Object.assign,
|
40
|
+
emptyObject = {};
|
120
41
|
function Component(props, context, updater) {
|
121
42
|
this.props = props;
|
122
43
|
this.context = context;
|
123
|
-
this.refs =
|
124
|
-
// renderer.
|
125
|
-
|
44
|
+
this.refs = emptyObject;
|
126
45
|
this.updater = updater || ReactNoopUpdateQueue;
|
127
46
|
}
|
128
|
-
|
129
47
|
Component.prototype.isReactComponent = {};
|
130
|
-
/**
|
131
|
-
* Sets a subset of the state. Always use this to mutate
|
132
|
-
* state. You should treat `this.state` as immutable.
|
133
|
-
*
|
134
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
135
|
-
* accessing `this.state` after calling this method may return the old value.
|
136
|
-
*
|
137
|
-
* There is no guarantee that calls to `setState` will run synchronously,
|
138
|
-
* as they may eventually be batched together. You can provide an optional
|
139
|
-
* callback that will be executed when the call to setState is actually
|
140
|
-
* completed.
|
141
|
-
*
|
142
|
-
* When a function is provided to setState, it will be called at some point in
|
143
|
-
* the future (not synchronously). It will be called with the up to date
|
144
|
-
* component arguments (state, props, context). These values can be different
|
145
|
-
* from this.* because your function may be called after receiveProps but before
|
146
|
-
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
147
|
-
* assigned to this.
|
148
|
-
*
|
149
|
-
* @param {object|function} partialState Next partial state or function to
|
150
|
-
* produce next partial state to be merged with current state.
|
151
|
-
* @param {?function} callback Called after state is updated.
|
152
|
-
* @final
|
153
|
-
* @protected
|
154
|
-
*/
|
155
|
-
|
156
48
|
Component.prototype.setState = function (partialState, callback) {
|
157
|
-
if (
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
49
|
+
if (
|
50
|
+
"object" !== typeof partialState &&
|
51
|
+
"function" !== typeof partialState &&
|
52
|
+
null != partialState
|
53
|
+
)
|
54
|
+
throw Error(
|
55
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
56
|
+
);
|
57
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
162
58
|
};
|
163
|
-
/**
|
164
|
-
* Forces an update. This should only be invoked when it is known with
|
165
|
-
* certainty that we are **not** in a DOM transaction.
|
166
|
-
*
|
167
|
-
* You may want to call this when you know that some deeper aspect of the
|
168
|
-
* component's state has changed but `setState` was not called.
|
169
|
-
*
|
170
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
171
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
172
|
-
*
|
173
|
-
* @param {?function} callback Called after update is complete.
|
174
|
-
* @final
|
175
|
-
* @protected
|
176
|
-
*/
|
177
|
-
|
178
|
-
|
179
59
|
Component.prototype.forceUpdate = function (callback) {
|
180
|
-
this.updater.enqueueForceUpdate(this, callback,
|
60
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
181
61
|
};
|
182
|
-
|
183
62
|
function ComponentDummy() {}
|
184
|
-
|
185
63
|
ComponentDummy.prototype = Component.prototype;
|
186
|
-
/**
|
187
|
-
* Convenience component with default shallow equality check for sCU.
|
188
|
-
*/
|
189
|
-
|
190
64
|
function PureComponent(props, context, updater) {
|
191
65
|
this.props = props;
|
192
|
-
this.context = context;
|
193
|
-
|
194
|
-
this.refs = {};
|
66
|
+
this.context = context;
|
67
|
+
this.refs = emptyObject;
|
195
68
|
this.updater = updater || ReactNoopUpdateQueue;
|
196
69
|
}
|
197
|
-
|
198
|
-
|
199
|
-
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
200
|
-
|
70
|
+
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
|
71
|
+
pureComponentPrototype.constructor = PureComponent;
|
201
72
|
assign(pureComponentPrototype, Component.prototype);
|
202
|
-
pureComponentPrototype.isPureReactComponent =
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
const refObject = {
|
207
|
-
current: null
|
208
|
-
};
|
209
|
-
|
210
|
-
return refObject;
|
211
|
-
}
|
212
|
-
|
213
|
-
const isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
214
|
-
|
215
|
-
function isArray(a) {
|
216
|
-
return isArrayImpl(a);
|
217
|
-
}
|
218
|
-
|
219
|
-
// -----------------------------------------------------------------------------
|
220
|
-
// as a normal prop instead of stripping it from the props object.
|
221
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
222
|
-
// during element creation.
|
223
|
-
|
224
|
-
const enableRefAsProp = true;
|
225
|
-
|
226
|
-
const ReactSharedInternals = {
|
227
|
-
H: null,
|
228
|
-
C: null,
|
229
|
-
T: null
|
230
|
-
};
|
231
|
-
|
232
|
-
// $FlowFixMe[method-unbinding]
|
233
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
234
|
-
|
235
|
-
function hasValidRef(config) {
|
236
|
-
|
237
|
-
return config.ref !== undefined;
|
238
|
-
}
|
239
|
-
|
240
|
-
function hasValidKey(config) {
|
241
|
-
|
242
|
-
return config.key !== undefined;
|
243
|
-
}
|
244
|
-
/**
|
245
|
-
* Factory method to create a new React element. This no longer adheres to
|
246
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
247
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
248
|
-
* if something is a React Element.
|
249
|
-
*
|
250
|
-
* @param {*} type
|
251
|
-
* @param {*} props
|
252
|
-
* @param {*} key
|
253
|
-
* @param {string|object} ref
|
254
|
-
* @param {*} owner
|
255
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
256
|
-
* different from the `owner` when React.createElement is called, so that we
|
257
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
258
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
259
|
-
* change in behavior.
|
260
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
261
|
-
* indicating filename, line number, and/or other information.
|
262
|
-
* @internal
|
263
|
-
*/
|
264
|
-
|
265
|
-
|
73
|
+
pureComponentPrototype.isPureReactComponent = !0;
|
74
|
+
var isArrayImpl = Array.isArray,
|
75
|
+
ReactSharedInternals = { H: null, C: null, T: null },
|
76
|
+
hasOwnProperty = Object.prototype.hasOwnProperty;
|
266
77
|
function ReactElement(type, key, _ref, self, source, owner, props) {
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
276
|
-
// backwards compatibility.
|
277
|
-
|
278
|
-
ref = refProp !== undefined ? refProp : null;
|
279
|
-
}
|
280
|
-
|
281
|
-
let element;
|
282
|
-
|
283
|
-
{
|
284
|
-
// In prod, `ref` is a regular property and _owner doesn't exist.
|
285
|
-
element = {
|
286
|
-
// This tag allows us to uniquely identify this as a React Element
|
287
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
288
|
-
// Built-in properties that belong on the element
|
289
|
-
type,
|
290
|
-
key,
|
291
|
-
ref,
|
292
|
-
props
|
293
|
-
};
|
294
|
-
}
|
295
|
-
|
296
|
-
return element;
|
297
|
-
}
|
298
|
-
/**
|
299
|
-
* Create and return a new ReactElement of the given type.
|
300
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
301
|
-
*/
|
302
|
-
|
303
|
-
function createElement(type, config, children) {
|
304
|
-
|
305
|
-
let propName; // Reserved names are extracted
|
306
|
-
|
307
|
-
const props = {};
|
308
|
-
let key = null;
|
309
|
-
let ref = null;
|
310
|
-
|
311
|
-
if (config != null) {
|
312
|
-
|
313
|
-
if (hasValidKey(config)) {
|
314
|
-
|
315
|
-
key = '' + config.key;
|
316
|
-
} // Remaining properties are added to a new props object
|
317
|
-
|
318
|
-
|
319
|
-
for (propName in config) {
|
320
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
321
|
-
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
322
|
-
// them to appear as props, so in createElement we filter them out.
|
323
|
-
// We don't have to do this in the jsx() runtime because the jsx()
|
324
|
-
// transform never passed these as props; it used separate arguments.
|
325
|
-
propName !== '__self' && propName !== '__source') {
|
326
|
-
{
|
327
|
-
props[propName] = config[propName];
|
328
|
-
}
|
329
|
-
}
|
330
|
-
}
|
331
|
-
} // Children can be more than one argument, and those are transferred onto
|
332
|
-
// the newly allocated props object.
|
333
|
-
|
334
|
-
|
335
|
-
const childrenLength = arguments.length - 2;
|
336
|
-
|
337
|
-
if (childrenLength === 1) {
|
338
|
-
props.children = children;
|
339
|
-
} else if (childrenLength > 1) {
|
340
|
-
const childArray = Array(childrenLength);
|
341
|
-
|
342
|
-
for (let i = 0; i < childrenLength; i++) {
|
343
|
-
childArray[i] = arguments[i + 2];
|
344
|
-
}
|
345
|
-
|
346
|
-
props.children = childArray;
|
347
|
-
} // Resolve default props
|
348
|
-
|
349
|
-
|
350
|
-
if (type && type.defaultProps) {
|
351
|
-
const defaultProps = type.defaultProps;
|
352
|
-
|
353
|
-
for (propName in defaultProps) {
|
354
|
-
if (props[propName] === undefined) {
|
355
|
-
props[propName] = defaultProps[propName];
|
356
|
-
}
|
357
|
-
}
|
358
|
-
}
|
359
|
-
|
360
|
-
const element = ReactElement(type, key, ref, undefined, undefined, ReactSharedInternals.owner, props);
|
361
|
-
|
362
|
-
return element;
|
78
|
+
_ref = props.ref;
|
79
|
+
return {
|
80
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
81
|
+
type: type,
|
82
|
+
key: key,
|
83
|
+
ref: void 0 !== _ref ? _ref : null,
|
84
|
+
props: props
|
85
|
+
};
|
363
86
|
}
|
364
87
|
function cloneAndReplaceKey(oldElement, newKey) {
|
365
|
-
return ReactElement(
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
function cloneElement(element, config, children) {
|
375
|
-
if (element === null || element === undefined) {
|
376
|
-
throw new Error("The argument must be a React element, but you passed " + element + ".");
|
377
|
-
}
|
378
|
-
|
379
|
-
let propName; // Original props are copied
|
380
|
-
|
381
|
-
const props = assign({}, element.props); // Reserved names are extracted
|
382
|
-
|
383
|
-
let key = element.key;
|
384
|
-
let ref = null ; // Owner will be preserved, unless ref is overridden
|
385
|
-
|
386
|
-
let owner = undefined ;
|
387
|
-
|
388
|
-
if (config != null) {
|
389
|
-
if (hasValidRef(config)) {
|
390
|
-
owner = ReactSharedInternals.owner;
|
391
|
-
}
|
392
|
-
|
393
|
-
if (hasValidKey(config)) {
|
394
|
-
|
395
|
-
key = '' + config.key;
|
396
|
-
} // Remaining properties override existing props
|
397
|
-
|
398
|
-
for (propName in config) {
|
399
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
400
|
-
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
401
|
-
// warnings and debug information in dev. Need to decide if we're OK
|
402
|
-
// with dropping them. In the jsx() runtime it's not an issue because
|
403
|
-
// the data gets passed as separate arguments instead of props, but
|
404
|
-
// it would be nice to stop relying on them entirely so we can drop
|
405
|
-
// them from the internal Fiber field.
|
406
|
-
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
407
|
-
// if the property were missing. This is mostly for
|
408
|
-
// backwards compatibility.
|
409
|
-
!(propName === 'ref' && config.ref === undefined)) {
|
410
|
-
{
|
411
|
-
{
|
412
|
-
props[propName] = config[propName];
|
413
|
-
}
|
414
|
-
}
|
415
|
-
}
|
416
|
-
}
|
417
|
-
} // Children can be more than one argument, and those are transferred onto
|
418
|
-
// the newly allocated props object.
|
419
|
-
|
420
|
-
|
421
|
-
const childrenLength = arguments.length - 2;
|
422
|
-
|
423
|
-
if (childrenLength === 1) {
|
424
|
-
props.children = children;
|
425
|
-
} else if (childrenLength > 1) {
|
426
|
-
const childArray = Array(childrenLength);
|
427
|
-
|
428
|
-
for (let i = 0; i < childrenLength; i++) {
|
429
|
-
childArray[i] = arguments[i + 2];
|
430
|
-
}
|
431
|
-
|
432
|
-
props.children = childArray;
|
433
|
-
}
|
434
|
-
|
435
|
-
const clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
|
436
|
-
|
437
|
-
return clonedElement;
|
88
|
+
return ReactElement(
|
89
|
+
oldElement.type,
|
90
|
+
newKey,
|
91
|
+
null,
|
92
|
+
void 0,
|
93
|
+
void 0,
|
94
|
+
void 0,
|
95
|
+
oldElement.props
|
96
|
+
);
|
438
97
|
}
|
439
|
-
/**
|
440
|
-
* Verifies the object is a ReactElement.
|
441
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
442
|
-
* @param {?object} object
|
443
|
-
* @return {boolean} True if `object` is a ReactElement.
|
444
|
-
* @final
|
445
|
-
*/
|
446
|
-
|
447
|
-
|
448
98
|
function isValidElement(object) {
|
449
|
-
return
|
99
|
+
return (
|
100
|
+
"object" === typeof object &&
|
101
|
+
null !== object &&
|
102
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
103
|
+
);
|
450
104
|
}
|
451
|
-
|
452
|
-
const SEPARATOR = '.';
|
453
|
-
const SUBSEPARATOR = ':';
|
454
|
-
/**
|
455
|
-
* Escape and wrap key so it is safe to use as a reactid
|
456
|
-
*
|
457
|
-
* @param {string} key to be escaped.
|
458
|
-
* @return {string} the escaped key.
|
459
|
-
*/
|
460
|
-
|
461
105
|
function escape(key) {
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
}
|
472
|
-
const userProvidedKeyEscapeRegex = /\/+/g;
|
473
|
-
|
474
|
-
function escapeUserProvidedKey(text) {
|
475
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
476
|
-
}
|
477
|
-
/**
|
478
|
-
* Generate a key string that identifies a element within a set.
|
479
|
-
*
|
480
|
-
* @param {*} element A element that could contain a manual key.
|
481
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
482
|
-
* @return {string}
|
483
|
-
*/
|
484
|
-
|
485
|
-
|
106
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
107
|
+
return (
|
108
|
+
"$" +
|
109
|
+
key.replace(/[=:]/g, function (match) {
|
110
|
+
return escaperLookup[match];
|
111
|
+
})
|
112
|
+
);
|
113
|
+
}
|
114
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
486
115
|
function getElementKey(element, index) {
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
return escape('' + element.key);
|
492
|
-
} // Implicit key determined by the index in the set
|
493
|
-
|
494
|
-
|
495
|
-
return index.toString(36);
|
116
|
+
return "object" === typeof element && null !== element && null != element.key
|
117
|
+
? escape("" + element.key)
|
118
|
+
: index.toString(36);
|
496
119
|
}
|
497
|
-
|
498
120
|
function noop$1() {}
|
499
|
-
|
500
121
|
function resolveThenable(thenable) {
|
501
122
|
switch (thenable.status) {
|
502
|
-
case
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
}
|
507
|
-
|
508
|
-
case 'rejected':
|
509
|
-
{
|
510
|
-
const rejectedError = thenable.reason;
|
511
|
-
throw rejectedError;
|
512
|
-
}
|
513
|
-
|
123
|
+
case "fulfilled":
|
124
|
+
return thenable.value;
|
125
|
+
case "rejected":
|
126
|
+
throw thenable.reason;
|
514
127
|
default:
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
const rejectedThenable = thenable;
|
537
|
-
rejectedThenable.status = 'rejected';
|
538
|
-
rejectedThenable.reason = error;
|
539
|
-
}
|
540
|
-
});
|
541
|
-
} // Check one more time in case the thenable resolved synchronously.
|
542
|
-
|
543
|
-
|
544
|
-
switch (thenable.status) {
|
545
|
-
case 'fulfilled':
|
546
|
-
{
|
547
|
-
const fulfilledThenable = thenable;
|
548
|
-
return fulfilledThenable.value;
|
549
|
-
}
|
550
|
-
|
551
|
-
case 'rejected':
|
552
|
-
{
|
553
|
-
const rejectedThenable = thenable;
|
554
|
-
const rejectedError = rejectedThenable.reason;
|
555
|
-
throw rejectedError;
|
556
|
-
}
|
557
|
-
}
|
128
|
+
switch (
|
129
|
+
("string" === typeof thenable.status
|
130
|
+
? thenable.then(noop$1, noop$1)
|
131
|
+
: ((thenable.status = "pending"),
|
132
|
+
thenable.then(
|
133
|
+
function (fulfilledValue) {
|
134
|
+
"pending" === thenable.status &&
|
135
|
+
((thenable.status = "fulfilled"),
|
136
|
+
(thenable.value = fulfilledValue));
|
137
|
+
},
|
138
|
+
function (error) {
|
139
|
+
"pending" === thenable.status &&
|
140
|
+
((thenable.status = "rejected"), (thenable.reason = error));
|
141
|
+
}
|
142
|
+
)),
|
143
|
+
thenable.status)
|
144
|
+
) {
|
145
|
+
case "fulfilled":
|
146
|
+
return thenable.value;
|
147
|
+
case "rejected":
|
148
|
+
throw thenable.reason;
|
558
149
|
}
|
559
150
|
}
|
560
|
-
|
561
151
|
throw thenable;
|
562
152
|
}
|
563
|
-
|
564
153
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
}
|
571
|
-
|
572
|
-
let invokeCallback = false;
|
573
|
-
|
574
|
-
if (children === null) {
|
575
|
-
invokeCallback = true;
|
576
|
-
} else {
|
154
|
+
var type = typeof children;
|
155
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
156
|
+
var invokeCallback = !1;
|
157
|
+
if (null === children) invokeCallback = !0;
|
158
|
+
else
|
577
159
|
switch (type) {
|
578
|
-
case
|
579
|
-
case
|
580
|
-
case
|
581
|
-
invokeCallback =
|
160
|
+
case "bigint":
|
161
|
+
case "string":
|
162
|
+
case "number":
|
163
|
+
invokeCallback = !0;
|
582
164
|
break;
|
583
|
-
|
584
|
-
case 'object':
|
165
|
+
case "object":
|
585
166
|
switch (children.$$typeof) {
|
586
167
|
case REACT_ELEMENT_TYPE:
|
587
168
|
case REACT_PORTAL_TYPE:
|
588
|
-
invokeCallback =
|
169
|
+
invokeCallback = !0;
|
589
170
|
break;
|
590
|
-
|
591
171
|
case REACT_LAZY_TYPE:
|
592
|
-
|
593
|
-
|
594
|
-
|
172
|
+
return (
|
173
|
+
(invokeCallback = children._init),
|
174
|
+
mapIntoArray(
|
175
|
+
invokeCallback(children._payload),
|
176
|
+
array,
|
177
|
+
escapedPrefix,
|
178
|
+
nameSoFar,
|
179
|
+
callback
|
180
|
+
)
|
181
|
+
);
|
595
182
|
}
|
596
|
-
|
597
|
-
}
|
598
|
-
}
|
599
|
-
|
600
|
-
if (invokeCallback) {
|
601
|
-
const child = children;
|
602
|
-
let mappedChild = callback(child); // If it's the only child, treat the name as if it was wrapped in an array
|
603
|
-
// so that it's consistent if the number of children grows:
|
604
|
-
|
605
|
-
const childKey = nameSoFar === '' ? SEPARATOR + getElementKey(child, 0) : nameSoFar;
|
606
|
-
|
607
|
-
if (isArray(mappedChild)) {
|
608
|
-
let escapedChildKey = '';
|
609
|
-
|
610
|
-
if (childKey != null) {
|
611
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
612
|
-
}
|
613
|
-
|
614
|
-
mapIntoArray(mappedChild, array, escapedChildKey, '', c => c);
|
615
|
-
} else if (mappedChild != null) {
|
616
|
-
if (isValidElement(mappedChild)) {
|
617
|
-
|
618
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
619
|
-
// traverseAllChildren used to do for objects as children
|
620
|
-
escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
|
621
|
-
mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
|
622
|
-
'' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
|
623
|
-
) + '/' : '') + childKey);
|
624
|
-
}
|
625
|
-
|
626
|
-
array.push(mappedChild);
|
627
|
-
}
|
628
|
-
|
629
|
-
return 1;
|
630
|
-
}
|
631
|
-
|
632
|
-
let child;
|
633
|
-
let nextName;
|
634
|
-
let subtreeCount = 0; // Count of children found in the current subtree.
|
635
|
-
|
636
|
-
const nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
637
|
-
|
638
|
-
if (isArray(children)) {
|
639
|
-
for (let i = 0; i < children.length; i++) {
|
640
|
-
child = children[i];
|
641
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
642
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
643
|
-
}
|
644
|
-
} else {
|
645
|
-
const iteratorFn = getIteratorFn(children);
|
646
|
-
|
647
|
-
if (typeof iteratorFn === 'function') {
|
648
|
-
const iterableChildren = children;
|
649
|
-
|
650
|
-
const iterator = iteratorFn.call(iterableChildren);
|
651
|
-
let step;
|
652
|
-
let ii = 0; // $FlowFixMe[incompatible-use] `iteratorFn` might return null according to typing.
|
653
|
-
|
654
|
-
while (!(step = iterator.next()).done) {
|
655
|
-
child = step.value;
|
656
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
657
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
658
|
-
}
|
659
|
-
} else if (type === 'object') {
|
660
|
-
if (typeof children.then === 'function') {
|
661
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
662
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
663
|
-
|
664
|
-
|
665
|
-
const childrenString = String(children);
|
666
|
-
throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
|
667
183
|
}
|
184
|
+
if (invokeCallback)
|
185
|
+
return (
|
186
|
+
(callback = callback(children)),
|
187
|
+
(invokeCallback =
|
188
|
+
"" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
|
189
|
+
isArrayImpl(callback)
|
190
|
+
? ((escapedPrefix = ""),
|
191
|
+
null != invokeCallback &&
|
192
|
+
(escapedPrefix =
|
193
|
+
invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
|
194
|
+
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
|
195
|
+
return c;
|
196
|
+
}))
|
197
|
+
: null != callback &&
|
198
|
+
(isValidElement(callback) &&
|
199
|
+
(callback = cloneAndReplaceKey(
|
200
|
+
callback,
|
201
|
+
escapedPrefix +
|
202
|
+
(!callback.key || (children && children.key === callback.key)
|
203
|
+
? ""
|
204
|
+
: ("" + callback.key).replace(
|
205
|
+
userProvidedKeyEscapeRegex,
|
206
|
+
"$&/"
|
207
|
+
) + "/") +
|
208
|
+
invokeCallback
|
209
|
+
)),
|
210
|
+
array.push(callback)),
|
211
|
+
1
|
212
|
+
);
|
213
|
+
invokeCallback = 0;
|
214
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
215
|
+
if (isArrayImpl(children))
|
216
|
+
for (var i = 0; i < children.length; i++)
|
217
|
+
(nameSoFar = children[i]),
|
218
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i)),
|
219
|
+
(invokeCallback += mapIntoArray(
|
220
|
+
nameSoFar,
|
221
|
+
array,
|
222
|
+
escapedPrefix,
|
223
|
+
type,
|
224
|
+
callback
|
225
|
+
));
|
226
|
+
else if (((i = getIteratorFn(children)), "function" === typeof i))
|
227
|
+
for (
|
228
|
+
children = i.call(children), i = 0;
|
229
|
+
!(nameSoFar = children.next()).done;
|
230
|
+
|
231
|
+
)
|
232
|
+
(nameSoFar = nameSoFar.value),
|
233
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i++)),
|
234
|
+
(invokeCallback += mapIntoArray(
|
235
|
+
nameSoFar,
|
236
|
+
array,
|
237
|
+
escapedPrefix,
|
238
|
+
type,
|
239
|
+
callback
|
240
|
+
));
|
241
|
+
else if ("object" === type) {
|
242
|
+
if ("function" === typeof children.then)
|
243
|
+
return mapIntoArray(
|
244
|
+
resolveThenable(children),
|
245
|
+
array,
|
246
|
+
escapedPrefix,
|
247
|
+
nameSoFar,
|
248
|
+
callback
|
249
|
+
);
|
250
|
+
array = String(children);
|
251
|
+
throw Error(
|
252
|
+
"Objects are not valid as a React child (found: " +
|
253
|
+
("[object Object]" === array
|
254
|
+
? "object with keys {" + Object.keys(children).join(", ") + "}"
|
255
|
+
: array) +
|
256
|
+
"). If you meant to render a collection of children, use an array instead."
|
257
|
+
);
|
668
258
|
}
|
669
|
-
|
670
|
-
return subtreeCount;
|
259
|
+
return invokeCallback;
|
671
260
|
}
|
672
|
-
/**
|
673
|
-
* Maps children that are typically specified as `props.children`.
|
674
|
-
*
|
675
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
676
|
-
*
|
677
|
-
* The provided mapFunction(child, index) will be called for each
|
678
|
-
* leaf child.
|
679
|
-
*
|
680
|
-
* @param {?*} children Children tree container.
|
681
|
-
* @param {function(*, int)} func The map function.
|
682
|
-
* @param {*} context Context for mapFunction.
|
683
|
-
* @return {object} Object containing the ordered map of results.
|
684
|
-
*/
|
685
|
-
|
686
|
-
|
687
261
|
function mapChildren(children, func, context) {
|
688
|
-
if (
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
const result = [];
|
694
|
-
let count = 0;
|
695
|
-
mapIntoArray(children, result, '', '', function (child) {
|
262
|
+
if (null == children) return children;
|
263
|
+
var result = [],
|
264
|
+
count = 0;
|
265
|
+
mapIntoArray(children, result, "", "", function (child) {
|
696
266
|
return func.call(context, child, count++);
|
697
267
|
});
|
698
268
|
return result;
|
699
269
|
}
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
});
|
716
|
-
return n;
|
717
|
-
}
|
718
|
-
/**
|
719
|
-
* Iterates through children that are typically specified as `props.children`.
|
720
|
-
*
|
721
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
722
|
-
*
|
723
|
-
* The provided forEachFunc(child, index) will be called for each
|
724
|
-
* leaf child.
|
725
|
-
*
|
726
|
-
* @param {?*} children Children tree container.
|
727
|
-
* @param {function(*, int)} forEachFunc
|
728
|
-
* @param {*} forEachContext Context for forEachContext.
|
729
|
-
*/
|
730
|
-
|
731
|
-
|
732
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
733
|
-
mapChildren(children, // $FlowFixMe[missing-this-annot]
|
734
|
-
function () {
|
735
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
736
|
-
}, forEachContext);
|
737
|
-
}
|
738
|
-
/**
|
739
|
-
* Flatten a children object (typically specified as `props.children`) and
|
740
|
-
* return an array with appropriately re-keyed children.
|
741
|
-
*
|
742
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
743
|
-
*/
|
744
|
-
|
745
|
-
|
746
|
-
function toArray(children) {
|
747
|
-
return mapChildren(children, child => child) || [];
|
748
|
-
}
|
749
|
-
/**
|
750
|
-
* Returns the first child in a collection of children and verifies that there
|
751
|
-
* is only one child in the collection.
|
752
|
-
*
|
753
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
754
|
-
*
|
755
|
-
* The current implementation of this function assumes that a single child gets
|
756
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
757
|
-
* abstract away the particular structure of children.
|
758
|
-
*
|
759
|
-
* @param {?object} children Child collection structure.
|
760
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
761
|
-
* structure.
|
762
|
-
*/
|
763
|
-
|
764
|
-
|
765
|
-
function onlyChild(children) {
|
766
|
-
if (!isValidElement(children)) {
|
767
|
-
throw new Error('React.Children.only expected to receive a single React element child.');
|
270
|
+
function lazyInitializer(payload) {
|
271
|
+
if (-1 === payload._status) {
|
272
|
+
var ctor = payload._result;
|
273
|
+
ctor = ctor();
|
274
|
+
ctor.then(
|
275
|
+
function (moduleObject) {
|
276
|
+
if (0 === payload._status || -1 === payload._status)
|
277
|
+
(payload._status = 1), (payload._result = moduleObject);
|
278
|
+
},
|
279
|
+
function (error) {
|
280
|
+
if (0 === payload._status || -1 === payload._status)
|
281
|
+
(payload._status = 2), (payload._result = error);
|
282
|
+
}
|
283
|
+
);
|
284
|
+
-1 === payload._status && ((payload._status = 0), (payload._result = ctor));
|
768
285
|
}
|
769
|
-
|
770
|
-
|
771
|
-
}
|
772
|
-
|
773
|
-
function
|
774
|
-
|
775
|
-
|
776
|
-
|
286
|
+
if (1 === payload._status) return payload._result.default;
|
287
|
+
throw payload._result;
|
288
|
+
}
|
289
|
+
var reportGlobalError =
|
290
|
+
"function" === typeof reportError
|
291
|
+
? reportError
|
292
|
+
: function (error) {
|
293
|
+
if (
|
294
|
+
"object" === typeof window &&
|
295
|
+
"function" === typeof window.ErrorEvent
|
296
|
+
) {
|
297
|
+
var event = new window.ErrorEvent("error", {
|
298
|
+
bubbles: !0,
|
299
|
+
cancelable: !0,
|
300
|
+
message:
|
301
|
+
"object" === typeof error &&
|
302
|
+
null !== error &&
|
303
|
+
"string" === typeof error.message
|
304
|
+
? String(error.message)
|
305
|
+
: String(error),
|
306
|
+
error: error
|
307
|
+
});
|
308
|
+
if (!window.dispatchEvent(event)) return;
|
309
|
+
} else if (
|
310
|
+
"object" === typeof process &&
|
311
|
+
"function" === typeof process.emit
|
312
|
+
) {
|
313
|
+
process.emit("uncaughtException", error);
|
314
|
+
return;
|
315
|
+
}
|
316
|
+
console.error(error);
|
317
|
+
};
|
318
|
+
function noop() {}
|
319
|
+
exports.Children = {
|
320
|
+
map: mapChildren,
|
321
|
+
forEach: function (children, forEachFunc, forEachContext) {
|
322
|
+
mapChildren(
|
323
|
+
children,
|
324
|
+
function () {
|
325
|
+
forEachFunc.apply(this, arguments);
|
326
|
+
},
|
327
|
+
forEachContext
|
328
|
+
);
|
329
|
+
},
|
330
|
+
count: function (children) {
|
331
|
+
var n = 0;
|
332
|
+
mapChildren(children, function () {
|
333
|
+
n++;
|
334
|
+
});
|
335
|
+
return n;
|
336
|
+
},
|
337
|
+
toArray: function (children) {
|
338
|
+
return (
|
339
|
+
mapChildren(children, function (child) {
|
340
|
+
return child;
|
341
|
+
}) || []
|
342
|
+
);
|
343
|
+
},
|
344
|
+
only: function (children) {
|
345
|
+
if (!isValidElement(children))
|
346
|
+
throw Error(
|
347
|
+
"React.Children.only expected to receive a single React element child."
|
348
|
+
);
|
349
|
+
return children;
|
350
|
+
}
|
351
|
+
};
|
352
|
+
exports.Component = Component;
|
353
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
354
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
355
|
+
exports.PureComponent = PureComponent;
|
356
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
357
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
358
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
|
359
|
+
ReactSharedInternals;
|
360
|
+
exports.act = function () {
|
361
|
+
throw Error("act(...) is not supported in production builds of React.");
|
362
|
+
};
|
363
|
+
exports.cache = function (fn) {
|
364
|
+
return function () {
|
365
|
+
return fn.apply(null, arguments);
|
366
|
+
};
|
367
|
+
};
|
368
|
+
exports.cloneElement = function (element, config, children) {
|
369
|
+
if (null === element || void 0 === element)
|
370
|
+
throw Error(
|
371
|
+
"The argument must be a React element, but you passed " + element + "."
|
372
|
+
);
|
373
|
+
var props = assign({}, element.props),
|
374
|
+
key = element.key,
|
375
|
+
owner = void 0;
|
376
|
+
if (null != config)
|
377
|
+
for (propName in (void 0 !== config.ref &&
|
378
|
+
(owner = ReactSharedInternals.owner),
|
379
|
+
void 0 !== config.key && (key = "" + config.key),
|
380
|
+
config))
|
381
|
+
!hasOwnProperty.call(config, propName) ||
|
382
|
+
"key" === propName ||
|
383
|
+
"__self" === propName ||
|
384
|
+
"__source" === propName ||
|
385
|
+
("ref" === propName && void 0 === config.ref) ||
|
386
|
+
(props[propName] = config[propName]);
|
387
|
+
var propName = arguments.length - 2;
|
388
|
+
if (1 === propName) props.children = children;
|
389
|
+
else if (1 < propName) {
|
390
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
391
|
+
childArray[i] = arguments[i + 2];
|
392
|
+
props.children = childArray;
|
393
|
+
}
|
394
|
+
return ReactElement(element.type, key, null, void 0, void 0, owner, props);
|
395
|
+
};
|
396
|
+
exports.createContext = function (defaultValue) {
|
397
|
+
defaultValue = {
|
777
398
|
$$typeof: REACT_CONTEXT_TYPE,
|
778
|
-
// As a workaround to support multiple concurrent renderers, we categorize
|
779
|
-
// some renderers as primary and others as secondary. We only expect
|
780
|
-
// there to be two concurrent renderers at most: React Native (primary) and
|
781
|
-
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
782
|
-
// Secondary renderers store their context values on separate fields.
|
783
399
|
_currentValue: defaultValue,
|
784
400
|
_currentValue2: defaultValue,
|
785
|
-
// Used to track how many concurrent renderers this context currently
|
786
|
-
// supports within in a single renderer. Such as parallel server rendering.
|
787
401
|
_threadCount: 0,
|
788
|
-
// These are circular
|
789
402
|
Provider: null,
|
790
403
|
Consumer: null
|
791
404
|
};
|
792
|
-
|
793
|
-
{
|
794
|
-
|
795
|
-
|
796
|
-
$$typeof: REACT_CONSUMER_TYPE,
|
797
|
-
_context: context
|
798
|
-
};
|
799
|
-
}
|
800
|
-
|
801
|
-
return context;
|
802
|
-
}
|
803
|
-
|
804
|
-
const Uninitialized = -1;
|
805
|
-
const Pending = 0;
|
806
|
-
const Resolved = 1;
|
807
|
-
const Rejected = 2;
|
808
|
-
|
809
|
-
function lazyInitializer(payload) {
|
810
|
-
if (payload._status === Uninitialized) {
|
811
|
-
const ctor = payload._result;
|
812
|
-
const thenable = ctor(); // Transition to the next state.
|
813
|
-
// This might throw either because it's missing or throws. If so, we treat it
|
814
|
-
// as still uninitialized and try again next time. Which is the same as what
|
815
|
-
// happens if the ctor or any wrappers processing the ctor throws. This might
|
816
|
-
// end up fixing it if the resolution was a concurrency bug.
|
817
|
-
|
818
|
-
thenable.then(moduleObject => {
|
819
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
820
|
-
// Transition to the next state.
|
821
|
-
const resolved = payload;
|
822
|
-
resolved._status = Resolved;
|
823
|
-
resolved._result = moduleObject;
|
824
|
-
}
|
825
|
-
}, error => {
|
826
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
827
|
-
// Transition to the next state.
|
828
|
-
const rejected = payload;
|
829
|
-
rejected._status = Rejected;
|
830
|
-
rejected._result = error;
|
831
|
-
}
|
832
|
-
});
|
833
|
-
|
834
|
-
if (payload._status === Uninitialized) {
|
835
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
836
|
-
// to resolve. Set it as pending in the meantime.
|
837
|
-
const pending = payload;
|
838
|
-
pending._status = Pending;
|
839
|
-
pending._result = thenable;
|
840
|
-
}
|
841
|
-
}
|
842
|
-
|
843
|
-
if (payload._status === Resolved) {
|
844
|
-
const moduleObject = payload._result;
|
845
|
-
|
846
|
-
return moduleObject.default;
|
847
|
-
} else {
|
848
|
-
throw payload._result;
|
849
|
-
}
|
850
|
-
}
|
851
|
-
|
852
|
-
function lazy(ctor) {
|
853
|
-
const payload = {
|
854
|
-
// We use these fields to store the result.
|
855
|
-
_status: Uninitialized,
|
856
|
-
_result: ctor
|
405
|
+
defaultValue.Provider = defaultValue;
|
406
|
+
defaultValue.Consumer = {
|
407
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
408
|
+
_context: defaultValue
|
857
409
|
};
|
858
|
-
|
410
|
+
return defaultValue;
|
411
|
+
};
|
412
|
+
exports.createElement = function (type, config, children) {
|
413
|
+
var propName,
|
414
|
+
props = {},
|
415
|
+
key = null;
|
416
|
+
if (null != config)
|
417
|
+
for (propName in (void 0 !== config.key && (key = "" + config.key), config))
|
418
|
+
hasOwnProperty.call(config, propName) &&
|
419
|
+
"key" !== propName &&
|
420
|
+
"__self" !== propName &&
|
421
|
+
"__source" !== propName &&
|
422
|
+
(props[propName] = config[propName]);
|
423
|
+
var childrenLength = arguments.length - 2;
|
424
|
+
if (1 === childrenLength) props.children = children;
|
425
|
+
else if (1 < childrenLength) {
|
426
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
427
|
+
childArray[i] = arguments[i + 2];
|
428
|
+
props.children = childArray;
|
429
|
+
}
|
430
|
+
if (type && type.defaultProps)
|
431
|
+
for (propName in ((childrenLength = type.defaultProps), childrenLength))
|
432
|
+
void 0 === props[propName] &&
|
433
|
+
(props[propName] = childrenLength[propName]);
|
434
|
+
return ReactElement(
|
435
|
+
type,
|
436
|
+
key,
|
437
|
+
null,
|
438
|
+
void 0,
|
439
|
+
void 0,
|
440
|
+
ReactSharedInternals.owner,
|
441
|
+
props
|
442
|
+
);
|
443
|
+
};
|
444
|
+
exports.createRef = function () {
|
445
|
+
return { current: null };
|
446
|
+
};
|
447
|
+
exports.forwardRef = function (render) {
|
448
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
|
449
|
+
};
|
450
|
+
exports.isValidElement = isValidElement;
|
451
|
+
exports.lazy = function (ctor) {
|
452
|
+
return {
|
859
453
|
$$typeof: REACT_LAZY_TYPE,
|
860
|
-
_payload:
|
454
|
+
_payload: { _status: -1, _result: ctor },
|
861
455
|
_init: lazyInitializer
|
862
456
|
};
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
function forwardRef(render) {
|
868
|
-
|
869
|
-
const elementType = {
|
870
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
871
|
-
render
|
872
|
-
};
|
873
|
-
|
874
|
-
return elementType;
|
875
|
-
}
|
876
|
-
|
877
|
-
function memo(type, compare) {
|
878
|
-
|
879
|
-
const elementType = {
|
457
|
+
};
|
458
|
+
exports.memo = function (type, compare) {
|
459
|
+
return {
|
880
460
|
$$typeof: REACT_MEMO_TYPE,
|
881
|
-
type,
|
882
|
-
compare:
|
883
|
-
};
|
884
|
-
|
885
|
-
return elementType;
|
886
|
-
}
|
887
|
-
|
888
|
-
function noopCache(fn) {
|
889
|
-
// On the client (i.e. not a Server Components environment) `cache` has
|
890
|
-
// no caching behavior. We just return the function as-is.
|
891
|
-
//
|
892
|
-
// We intend to implement client caching in a future major release. In the
|
893
|
-
// meantime, it's only exposed as an API so that Shared Components can use
|
894
|
-
// per-request caching on the server without breaking on the client. But it
|
895
|
-
// does mean they need to be aware of the behavioral difference.
|
896
|
-
//
|
897
|
-
// The rest of the behavior is the same as the server implementation — it
|
898
|
-
// returns a new reference, extra properties like `displayName` are not
|
899
|
-
// preserved, the length of the new function is 0, etc. That way apps can't
|
900
|
-
// accidentally depend on those details.
|
901
|
-
return function () {
|
902
|
-
// $FlowFixMe[incompatible-call]: We don't want to use rest arguments since we transpile the code.
|
903
|
-
return fn.apply(null, arguments);
|
461
|
+
type: type,
|
462
|
+
compare: void 0 === compare ? null : compare
|
904
463
|
};
|
905
|
-
}
|
906
|
-
const cache = noopCache ;
|
907
|
-
|
908
|
-
function resolveDispatcher() {
|
909
|
-
const dispatcher = ReactSharedInternals.H;
|
910
|
-
// intentionally don't throw our own error because this is in a hot path.
|
911
|
-
// Also helps ensure this is inlined.
|
912
|
-
|
913
|
-
|
914
|
-
return dispatcher;
|
915
|
-
}
|
916
|
-
function useContext(Context) {
|
917
|
-
const dispatcher = resolveDispatcher();
|
918
|
-
|
919
|
-
return dispatcher.useContext(Context);
|
920
|
-
}
|
921
|
-
function useState(initialState) {
|
922
|
-
const dispatcher = resolveDispatcher();
|
923
|
-
return dispatcher.useState(initialState);
|
924
|
-
}
|
925
|
-
function useReducer(reducer, initialArg, init) {
|
926
|
-
const dispatcher = resolveDispatcher();
|
927
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
928
|
-
}
|
929
|
-
function useRef(initialValue) {
|
930
|
-
const dispatcher = resolveDispatcher();
|
931
|
-
return dispatcher.useRef(initialValue);
|
932
|
-
}
|
933
|
-
function useEffect(create, deps) {
|
934
|
-
const dispatcher = resolveDispatcher();
|
935
|
-
return dispatcher.useEffect(create, deps);
|
936
|
-
}
|
937
|
-
function useInsertionEffect(create, deps) {
|
938
|
-
const dispatcher = resolveDispatcher();
|
939
|
-
return dispatcher.useInsertionEffect(create, deps);
|
940
|
-
}
|
941
|
-
function useLayoutEffect(create, deps) {
|
942
|
-
const dispatcher = resolveDispatcher();
|
943
|
-
return dispatcher.useLayoutEffect(create, deps);
|
944
|
-
}
|
945
|
-
function useCallback(callback, deps) {
|
946
|
-
const dispatcher = resolveDispatcher();
|
947
|
-
return dispatcher.useCallback(callback, deps);
|
948
|
-
}
|
949
|
-
function useMemo(create, deps) {
|
950
|
-
const dispatcher = resolveDispatcher();
|
951
|
-
return dispatcher.useMemo(create, deps);
|
952
|
-
}
|
953
|
-
function useImperativeHandle(ref, create, deps) {
|
954
|
-
const dispatcher = resolveDispatcher();
|
955
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
956
|
-
}
|
957
|
-
function useDebugValue(value, formatterFn) {
|
958
|
-
}
|
959
|
-
function useTransition() {
|
960
|
-
const dispatcher = resolveDispatcher();
|
961
|
-
return dispatcher.useTransition();
|
962
|
-
}
|
963
|
-
function useDeferredValue(value, initialValue) {
|
964
|
-
const dispatcher = resolveDispatcher();
|
965
|
-
return dispatcher.useDeferredValue(value, initialValue);
|
966
|
-
}
|
967
|
-
function useId() {
|
968
|
-
const dispatcher = resolveDispatcher();
|
969
|
-
return dispatcher.useId();
|
970
|
-
}
|
971
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
972
|
-
const dispatcher = resolveDispatcher();
|
973
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
974
|
-
}
|
975
|
-
function useCacheRefresh() {
|
976
|
-
const dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
977
|
-
|
978
|
-
return dispatcher.useCacheRefresh();
|
979
|
-
}
|
980
|
-
function use(usable) {
|
981
|
-
const dispatcher = resolveDispatcher();
|
982
|
-
return dispatcher.use(usable);
|
983
|
-
}
|
984
|
-
function useOptimistic(passthrough, reducer) {
|
985
|
-
const dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
986
|
-
|
987
|
-
return dispatcher.useOptimistic(passthrough, reducer);
|
988
|
-
}
|
989
|
-
function useActionState(action, initialState, permalink) {
|
990
|
-
{
|
991
|
-
const dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
992
|
-
|
993
|
-
return dispatcher.useActionState(action, initialState, permalink);
|
994
|
-
}
|
995
|
-
}
|
996
|
-
|
997
|
-
const reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
|
998
|
-
// emulating an uncaught JavaScript error.
|
999
|
-
reportError : error => {
|
1000
|
-
if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
|
1001
|
-
// Browser Polyfill
|
1002
|
-
const message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
|
1003
|
-
String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
|
1004
|
-
String(error);
|
1005
|
-
const event = new window.ErrorEvent('error', {
|
1006
|
-
bubbles: true,
|
1007
|
-
cancelable: true,
|
1008
|
-
message: message,
|
1009
|
-
error: error
|
1010
|
-
});
|
1011
|
-
const shouldLog = window.dispatchEvent(event);
|
1012
|
-
|
1013
|
-
if (!shouldLog) {
|
1014
|
-
return;
|
1015
|
-
}
|
1016
|
-
} else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
|
1017
|
-
typeof process.emit === 'function') {
|
1018
|
-
// Node Polyfill
|
1019
|
-
process.emit('uncaughtException', error);
|
1020
|
-
return;
|
1021
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
1022
|
-
|
1023
|
-
|
1024
|
-
console['error'](error);
|
1025
464
|
};
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
returnValue.then(noop, reportGlobalError);
|
1045
|
-
}
|
1046
|
-
} catch (error) {
|
1047
|
-
reportGlobalError(error);
|
1048
|
-
} finally {
|
1049
|
-
ReactSharedInternals.T = prevTransition;
|
1050
|
-
}
|
1051
|
-
}
|
1052
|
-
}
|
1053
|
-
|
1054
|
-
function noop() {}
|
1055
|
-
|
1056
|
-
function act(callback) {
|
1057
|
-
{
|
1058
|
-
throw new Error('act(...) is not supported in production builds of React.');
|
465
|
+
exports.startTransition = function (scope) {
|
466
|
+
var prevTransition = ReactSharedInternals.T,
|
467
|
+
callbacks = new Set();
|
468
|
+
ReactSharedInternals.T = { _callbacks: callbacks };
|
469
|
+
var currentTransition = ReactSharedInternals.T;
|
470
|
+
try {
|
471
|
+
var returnValue = scope();
|
472
|
+
"object" === typeof returnValue &&
|
473
|
+
null !== returnValue &&
|
474
|
+
"function" === typeof returnValue.then &&
|
475
|
+
(callbacks.forEach(function (callback) {
|
476
|
+
return callback(currentTransition, returnValue);
|
477
|
+
}),
|
478
|
+
returnValue.then(noop, reportGlobalError));
|
479
|
+
} catch (error) {
|
480
|
+
reportGlobalError(error);
|
481
|
+
} finally {
|
482
|
+
ReactSharedInternals.T = prevTransition;
|
1059
483
|
}
|
1060
|
-
}
|
1061
|
-
|
1062
|
-
const Children = {
|
1063
|
-
map: mapChildren,
|
1064
|
-
forEach: forEachChildren,
|
1065
|
-
count: countChildren,
|
1066
|
-
toArray,
|
1067
|
-
only: onlyChild
|
1068
484
|
};
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
exports.
|
1073
|
-
|
1074
|
-
|
1075
|
-
exports.
|
1076
|
-
|
1077
|
-
|
1078
|
-
exports.
|
1079
|
-
|
1080
|
-
|
1081
|
-
exports.
|
1082
|
-
|
1083
|
-
|
1084
|
-
exports.
|
1085
|
-
exports.
|
1086
|
-
|
1087
|
-
|
1088
|
-
exports.
|
1089
|
-
|
1090
|
-
|
1091
|
-
exports.
|
1092
|
-
|
1093
|
-
|
1094
|
-
exports.
|
1095
|
-
|
1096
|
-
|
1097
|
-
exports.
|
1098
|
-
|
1099
|
-
|
1100
|
-
exports.useLayoutEffect =
|
1101
|
-
|
1102
|
-
|
1103
|
-
exports.
|
1104
|
-
|
1105
|
-
|
1106
|
-
exports.
|
1107
|
-
|
1108
|
-
|
485
|
+
exports.unstable_useCacheRefresh = function () {
|
486
|
+
return ReactSharedInternals.H.useCacheRefresh();
|
487
|
+
};
|
488
|
+
exports.use = function (usable) {
|
489
|
+
return ReactSharedInternals.H.use(usable);
|
490
|
+
};
|
491
|
+
exports.useActionState = function (action, initialState, permalink) {
|
492
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
493
|
+
};
|
494
|
+
exports.useCallback = function (callback, deps) {
|
495
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
496
|
+
};
|
497
|
+
exports.useContext = function (Context) {
|
498
|
+
return ReactSharedInternals.H.useContext(Context);
|
499
|
+
};
|
500
|
+
exports.useDebugValue = function () {};
|
501
|
+
exports.useDeferredValue = function (value, initialValue) {
|
502
|
+
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
503
|
+
};
|
504
|
+
exports.useEffect = function (create, deps) {
|
505
|
+
return ReactSharedInternals.H.useEffect(create, deps);
|
506
|
+
};
|
507
|
+
exports.useId = function () {
|
508
|
+
return ReactSharedInternals.H.useId();
|
509
|
+
};
|
510
|
+
exports.useImperativeHandle = function (ref, create, deps) {
|
511
|
+
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
512
|
+
};
|
513
|
+
exports.useInsertionEffect = function (create, deps) {
|
514
|
+
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
515
|
+
};
|
516
|
+
exports.useLayoutEffect = function (create, deps) {
|
517
|
+
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
518
|
+
};
|
519
|
+
exports.useMemo = function (create, deps) {
|
520
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
521
|
+
};
|
522
|
+
exports.useOptimistic = function (passthrough, reducer) {
|
523
|
+
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
524
|
+
};
|
525
|
+
exports.useReducer = function (reducer, initialArg, init) {
|
526
|
+
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
527
|
+
};
|
528
|
+
exports.useRef = function (initialValue) {
|
529
|
+
return ReactSharedInternals.H.useRef(initialValue);
|
530
|
+
};
|
531
|
+
exports.useState = function (initialState) {
|
532
|
+
return ReactSharedInternals.H.useState(initialState);
|
533
|
+
};
|
534
|
+
exports.useSyncExternalStore = function (
|
535
|
+
subscribe,
|
536
|
+
getSnapshot,
|
537
|
+
getServerSnapshot
|
538
|
+
) {
|
539
|
+
return ReactSharedInternals.H.useSyncExternalStore(
|
540
|
+
subscribe,
|
541
|
+
getSnapshot,
|
542
|
+
getServerSnapshot
|
543
|
+
);
|
544
|
+
};
|
545
|
+
exports.useTransition = function () {
|
546
|
+
return ReactSharedInternals.H.useTransition();
|
547
|
+
};
|
548
|
+
exports.version = "19.0.0-canary-db913d8e17-20240422";
|