react-test-renderer 16.8.5 → 16.9.0
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/build-info.json +5 -5
- package/cjs/react-test-renderer-shallow.development.js +109 -73
- package/cjs/react-test-renderer-shallow.production.min.js +25 -26
- package/cjs/react-test-renderer.development.js +10787 -8048
- package/cjs/react-test-renderer.production.min.js +164 -154
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +108 -72
- package/umd/react-test-renderer-shallow.production.min.js +24 -24
- package/umd/react-test-renderer.development.js +8631 -5912
- package/umd/react-test-renderer.production.min.js +140 -129
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-test-renderer",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.9.0",
|
|
4
4
|
"description": "React package for snapshot testing.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"object-assign": "^4.1.1",
|
|
23
23
|
"prop-types": "^15.6.2",
|
|
24
|
-
"react-is": "^16.
|
|
25
|
-
"scheduler": "^0.
|
|
24
|
+
"react-is": "^16.9.0",
|
|
25
|
+
"scheduler": "^0.15.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.9.0
|
|
2
2
|
* react-test-renderer-shallow.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -15,51 +15,19 @@
|
|
|
15
15
|
(global.ReactShallowRenderer = factory(global.React));
|
|
16
16
|
}(this, (function (React) { 'use strict';
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* Provide sprintf-style format (only %s is supported) and arguments
|
|
22
|
-
* to provide information about what broke and what you were
|
|
23
|
-
* expecting.
|
|
24
|
-
*
|
|
25
|
-
* The invariant message will be stripped in production, but the invariant
|
|
26
|
-
* will remain to ensure logic does not differ in production.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
var validateFormat = function () {};
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
validateFormat = function (format) {
|
|
33
|
-
if (format === undefined) {
|
|
34
|
-
throw new Error('invariant requires an error message argument');
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
18
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
19
|
+
// template literal strings. The messages will be converted to ReactError during
|
|
20
|
+
// build, and in production they will be minified.
|
|
38
21
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!condition) {
|
|
43
|
-
var error = void 0;
|
|
44
|
-
if (format === undefined) {
|
|
45
|
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
46
|
-
} else {
|
|
47
|
-
var args = [a, b, c, d, e, f];
|
|
48
|
-
var argIndex = 0;
|
|
49
|
-
error = new Error(format.replace(/%s/g, function () {
|
|
50
|
-
return args[argIndex++];
|
|
51
|
-
}));
|
|
52
|
-
error.name = 'Invariant Violation';
|
|
53
|
-
}
|
|
22
|
+
// Do not require this module directly! Use normal `invariant` calls with
|
|
23
|
+
// template literal strings. The messages will be converted to ReactError during
|
|
24
|
+
// build, and in production they will be minified.
|
|
54
25
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
26
|
+
function ReactError(error) {
|
|
27
|
+
error.name = 'Invariant Violation';
|
|
28
|
+
return error;
|
|
58
29
|
}
|
|
59
30
|
|
|
60
|
-
// Relying on the `invariant()` implementation lets us
|
|
61
|
-
// preserve the format and params in the www builds.
|
|
62
|
-
|
|
63
31
|
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
64
32
|
|
|
65
33
|
var _assign = ReactInternals.assign;
|
|
@@ -75,10 +43,13 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
|
|
|
75
43
|
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
76
44
|
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
77
45
|
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
|
46
|
+
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
47
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
78
48
|
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
79
49
|
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
80
50
|
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
81
51
|
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
52
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
82
53
|
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
83
54
|
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
84
55
|
|
|
@@ -274,8 +245,6 @@ function getComponentName(type) {
|
|
|
274
245
|
return type;
|
|
275
246
|
}
|
|
276
247
|
switch (type) {
|
|
277
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
278
|
-
return 'ConcurrentMode';
|
|
279
248
|
case REACT_FRAGMENT_TYPE:
|
|
280
249
|
return 'Fragment';
|
|
281
250
|
case REACT_PORTAL_TYPE:
|
|
@@ -286,6 +255,8 @@ function getComponentName(type) {
|
|
|
286
255
|
return 'StrictMode';
|
|
287
256
|
case REACT_SUSPENSE_TYPE:
|
|
288
257
|
return 'Suspense';
|
|
258
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
259
|
+
return 'SuspenseList';
|
|
289
260
|
}
|
|
290
261
|
if (typeof type === 'object') {
|
|
291
262
|
switch (type.$$typeof) {
|
|
@@ -304,6 +275,7 @@ function getComponentName(type) {
|
|
|
304
275
|
if (resolvedThenable) {
|
|
305
276
|
return getComponentName(resolvedThenable);
|
|
306
277
|
}
|
|
278
|
+
break;
|
|
307
279
|
}
|
|
308
280
|
}
|
|
309
281
|
}
|
|
@@ -352,6 +324,17 @@ function shallowEqual(objA, objB) {
|
|
|
352
324
|
return true;
|
|
353
325
|
}
|
|
354
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Use invariant() to assert state which your program assumes to be true.
|
|
329
|
+
*
|
|
330
|
+
* Provide sprintf-style format (only %s is supported) and arguments
|
|
331
|
+
* to provide information about what broke and what you were
|
|
332
|
+
* expecting.
|
|
333
|
+
*
|
|
334
|
+
* The invariant message will be stripped in production, but the invariant
|
|
335
|
+
* will remain to ensure logic does not differ in production.
|
|
336
|
+
*/
|
|
337
|
+
|
|
355
338
|
/**
|
|
356
339
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
357
340
|
*
|
|
@@ -467,6 +450,11 @@ if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
|
|
467
450
|
current: null
|
|
468
451
|
};
|
|
469
452
|
}
|
|
453
|
+
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
|
|
454
|
+
ReactSharedInternals.ReactCurrentBatchConfig = {
|
|
455
|
+
suspense: null
|
|
456
|
+
};
|
|
457
|
+
}
|
|
470
458
|
|
|
471
459
|
/**
|
|
472
460
|
* Similar to invariant but only logs a warning if the condition is not met.
|
|
@@ -635,28 +623,36 @@ var ReactShallowRenderer = function () {
|
|
|
635
623
|
};
|
|
636
624
|
|
|
637
625
|
ReactShallowRenderer.prototype._validateCurrentlyRenderingComponent = function _validateCurrentlyRenderingComponent() {
|
|
638
|
-
|
|
626
|
+
var _this = this;
|
|
627
|
+
|
|
628
|
+
(function () {
|
|
629
|
+
if (!(_this._rendering && !_this._instance)) {
|
|
630
|
+
{
|
|
631
|
+
throw ReactError(Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.'));
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
})();
|
|
639
635
|
};
|
|
640
636
|
|
|
641
637
|
ReactShallowRenderer.prototype._createDispatcher = function _createDispatcher() {
|
|
642
|
-
var
|
|
638
|
+
var _this2 = this;
|
|
643
639
|
|
|
644
640
|
var useReducer = function (reducer, initialArg, init) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
var workInProgressHook =
|
|
641
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
642
|
+
_this2._createWorkInProgressHook();
|
|
643
|
+
var workInProgressHook = _this2._workInProgressHook;
|
|
648
644
|
|
|
649
|
-
if (
|
|
645
|
+
if (_this2._isReRender) {
|
|
650
646
|
// This is a re-render.
|
|
651
647
|
var _queue = workInProgressHook.queue;
|
|
652
648
|
var _dispatch = _queue.dispatch;
|
|
653
|
-
if (
|
|
649
|
+
if (_this2._numberOfReRenders > 0) {
|
|
654
650
|
// Apply the new render phase updates to the previous current hook.
|
|
655
|
-
if (
|
|
651
|
+
if (_this2._renderPhaseUpdates !== null) {
|
|
656
652
|
// Render phase updates are stored in a map of queue -> linked list
|
|
657
|
-
var firstRenderPhaseUpdate =
|
|
653
|
+
var firstRenderPhaseUpdate = _this2._renderPhaseUpdates.get(_queue);
|
|
658
654
|
if (firstRenderPhaseUpdate !== undefined) {
|
|
659
|
-
|
|
655
|
+
_this2._renderPhaseUpdates.delete(_queue);
|
|
660
656
|
var _newState = workInProgressHook.memoizedState;
|
|
661
657
|
var _update = firstRenderPhaseUpdate;
|
|
662
658
|
do {
|
|
@@ -696,7 +692,7 @@ var ReactShallowRenderer = function () {
|
|
|
696
692
|
first: null,
|
|
697
693
|
dispatch: null
|
|
698
694
|
};
|
|
699
|
-
var _dispatch2 = _queue2.dispatch =
|
|
695
|
+
var _dispatch2 = _queue2.dispatch = _this2._dispatchAction.bind(_this2, _queue2);
|
|
700
696
|
return [workInProgressHook.memoizedState, _dispatch2];
|
|
701
697
|
}
|
|
702
698
|
};
|
|
@@ -708,13 +704,13 @@ var ReactShallowRenderer = function () {
|
|
|
708
704
|
};
|
|
709
705
|
|
|
710
706
|
var useMemo = function (nextCreate, deps) {
|
|
711
|
-
|
|
712
|
-
|
|
707
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
708
|
+
_this2._createWorkInProgressHook();
|
|
713
709
|
|
|
714
710
|
var nextDeps = deps !== undefined ? deps : null;
|
|
715
711
|
|
|
716
|
-
if (
|
|
717
|
-
var prevState =
|
|
712
|
+
if (_this2._workInProgressHook !== null && _this2._workInProgressHook.memoizedState !== null) {
|
|
713
|
+
var prevState = _this2._workInProgressHook.memoizedState;
|
|
718
714
|
var prevDeps = prevState[1];
|
|
719
715
|
if (nextDeps !== null) {
|
|
720
716
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
@@ -724,20 +720,20 @@ var ReactShallowRenderer = function () {
|
|
|
724
720
|
}
|
|
725
721
|
|
|
726
722
|
var nextValue = nextCreate();
|
|
727
|
-
|
|
723
|
+
_this2._workInProgressHook.memoizedState = [nextValue, nextDeps];
|
|
728
724
|
return nextValue;
|
|
729
725
|
};
|
|
730
726
|
|
|
731
727
|
var useRef = function (initialValue) {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
var previousRef =
|
|
728
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
729
|
+
_this2._createWorkInProgressHook();
|
|
730
|
+
var previousRef = _this2._workInProgressHook.memoizedState;
|
|
735
731
|
if (previousRef === null) {
|
|
736
732
|
var ref = { current: initialValue };
|
|
737
733
|
{
|
|
738
734
|
Object.seal(ref);
|
|
739
735
|
}
|
|
740
|
-
|
|
736
|
+
_this2._workInProgressHook.memoizedState = ref;
|
|
741
737
|
return ref;
|
|
742
738
|
} else {
|
|
743
739
|
return previousRef;
|
|
@@ -749,18 +745,25 @@ var ReactShallowRenderer = function () {
|
|
|
749
745
|
};
|
|
750
746
|
|
|
751
747
|
var noOp = function () {
|
|
752
|
-
|
|
748
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
753
749
|
};
|
|
754
750
|
|
|
755
751
|
var identity = function (fn) {
|
|
756
752
|
return fn;
|
|
757
753
|
};
|
|
758
754
|
|
|
755
|
+
var useResponder = function (responder, props) {
|
|
756
|
+
return {
|
|
757
|
+
props: props,
|
|
758
|
+
responder: responder
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
|
|
759
762
|
return {
|
|
760
763
|
readContext: readContext,
|
|
761
764
|
useCallback: identity,
|
|
762
765
|
useContext: function (context) {
|
|
763
|
-
|
|
766
|
+
_this2._validateCurrentlyRenderingComponent();
|
|
764
767
|
return readContext(context);
|
|
765
768
|
},
|
|
766
769
|
useDebugValue: noOp,
|
|
@@ -770,12 +773,21 @@ var ReactShallowRenderer = function () {
|
|
|
770
773
|
useMemo: useMemo,
|
|
771
774
|
useReducer: useReducer,
|
|
772
775
|
useRef: useRef,
|
|
773
|
-
useState: useState
|
|
776
|
+
useState: useState,
|
|
777
|
+
useResponder: useResponder
|
|
774
778
|
};
|
|
775
779
|
};
|
|
776
780
|
|
|
777
781
|
ReactShallowRenderer.prototype._dispatchAction = function _dispatchAction(queue, action) {
|
|
778
|
-
|
|
782
|
+
var _this3 = this;
|
|
783
|
+
|
|
784
|
+
(function () {
|
|
785
|
+
if (!(_this3._numberOfReRenders < RE_RENDER_LIMIT)) {
|
|
786
|
+
{
|
|
787
|
+
throw ReactError(Error('Too many re-renders. React limits the number of renders to prevent an infinite loop.'));
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
})();
|
|
779
791
|
|
|
780
792
|
if (this._rendering) {
|
|
781
793
|
// This is a render phase update. Stash it in a lazily-created map of
|
|
@@ -879,11 +891,29 @@ var ReactShallowRenderer = function () {
|
|
|
879
891
|
ReactShallowRenderer.prototype.render = function render(element) {
|
|
880
892
|
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyObject;
|
|
881
893
|
|
|
882
|
-
|
|
894
|
+
(function () {
|
|
895
|
+
if (!React.isValidElement(element)) {
|
|
896
|
+
{
|
|
897
|
+
throw ReactError(Error('ReactShallowRenderer render(): Invalid component element.' + (typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '')));
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
})();
|
|
883
901
|
element = element;
|
|
884
902
|
// Show a special message for host elements since it's a common case.
|
|
885
|
-
|
|
886
|
-
|
|
903
|
+
(function () {
|
|
904
|
+
if (!(typeof element.type !== 'string')) {
|
|
905
|
+
{
|
|
906
|
+
throw ReactError(Error('ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (' + element.type + '). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.'));
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
})();
|
|
910
|
+
(function () {
|
|
911
|
+
if (!(isForwardRef(element) || typeof element.type === 'function' || isMemo(element.type))) {
|
|
912
|
+
{
|
|
913
|
+
throw ReactError(Error('ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `' + (Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) + '`.'));
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
})();
|
|
887
917
|
|
|
888
918
|
if (this._rendering) {
|
|
889
919
|
return;
|
|
@@ -941,7 +971,13 @@ var ReactShallowRenderer = function () {
|
|
|
941
971
|
// elementType could still be a ForwardRef if it was
|
|
942
972
|
// nested inside Memo.
|
|
943
973
|
if (elementType.$$typeof === ForwardRef) {
|
|
944
|
-
|
|
974
|
+
(function () {
|
|
975
|
+
if (!(typeof elementType.render === 'function')) {
|
|
976
|
+
{
|
|
977
|
+
throw ReactError(Error('forwardRef requires a render function but was given ' + typeof elementType.render + '.'));
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
})();
|
|
945
981
|
this._rendered = elementType.render.call(undefined, element.props, element.ref);
|
|
946
982
|
} else {
|
|
947
983
|
this._rendered = elementType(element.props, this._context);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.9.0
|
|
2
2
|
* react-test-renderer-shallow.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,26 +6,26 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';(function(l
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
c=
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this._instance.
|
|
9
|
+
'use strict';(function(m,l){"object"===typeof exports&&"undefined"!==typeof module?module.exports=l(require("react")):"function"===typeof define&&define.amd?define(["react"],l):m.ReactShallowRenderer=l(m.React)})(this,function(m){function l(a){for(var b=a.message,e="https://reactjs.org/docs/error-decoder.html?invariant="+b,c=1;c<arguments.length;c++)e+="&args[]="+encodeURIComponent(arguments[c]);a.message="Minified React error #"+b+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ";
|
|
10
|
+
return a}function p(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case K:switch(a=a.type,a){case L:case M:case z:case A:case B:case C:return a;default:switch(a=a&&a.$$typeof,a){case D:case q:case E:return a;default:return b}}case F:case n:case G:return b}}}function u(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case z:return"Fragment";case G:return"Portal";case A:return"Profiler";case B:return"StrictMode";
|
|
11
|
+
case C:return"Suspense";case N:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case D:return"Context.Consumer";case E:return"Context.Provider";case q:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");case n:return u(a.type);case F:if(a=1===a._status?a._result:null)return u(a)}return null}function v(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}function w(a,b){if(v(a,b))return!0;if("object"!==typeof a||null===a||"object"!==
|
|
12
|
+
typeof b||null===b)return!1;var e=Object.keys(a),c=Object.keys(b);if(e.length!==c.length)return!1;for(c=0;c<e.length;c++)if(!O.call(b,e[c])||!v(a[e[c]],b[e[c]]))return!1;return!0}function H(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}function I(){return{memoizedState:null,queue:null,next:null}}function J(a,b){return"function"===typeof b?b(a):b}var x=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,d="function"===typeof Symbol&&Symbol.for,K=d?Symbol.for("react.element"):
|
|
13
|
+
60103,G=d?Symbol.for("react.portal"):60106,z=d?Symbol.for("react.fragment"):60107,B=d?Symbol.for("react.strict_mode"):60108,A=d?Symbol.for("react.profiler"):60114,E=d?Symbol.for("react.provider"):60109,D=d?Symbol.for("react.context"):60110,L=d?Symbol.for("react.async_mode"):60111,M=d?Symbol.for("react.concurrent_mode"):60111,q=d?Symbol.for("react.forward_ref"):60112,C=d?Symbol.for("react.suspense"):60113,N=d?Symbol.for("react.suspense_list"):60120,n=d?Symbol.for("react.memo"):60115,F=d?Symbol.for("react.lazy"):
|
|
14
|
+
60116,P=q,O=Object.prototype.hasOwnProperty;d=m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;d.hasOwnProperty("ReactCurrentDispatcher")||(d.ReactCurrentDispatcher={current:null});d.hasOwnProperty("ReactCurrentBatchConfig")||(d.ReactCurrentBatchConfig={suspense:null});var y=d.ReactCurrentDispatcher,r={},Q=function(){function a(b){H(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};
|
|
15
|
+
a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(b){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a,c){this._enqueueCallback(a,b);this._renderer._forcedUpdate=!0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c,f){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,
|
|
16
|
+
this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c,f){this._enqueueCallback(c,b);c=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,c,b.props));null!==a&&void 0!==a&&(this._renderer._newState=x({},c,a),this._renderer.render(this._renderer._element,this._renderer._context))};return a}(),t=function(){function a(){H(this,a);this._reset()}a.prototype._reset=function(){this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=
|
|
17
|
+
this._rendering=!1;this._updater=new Q(this);this._dispatcher=this._createDispatcher();this._firstWorkInProgressHook=this._workInProgressHook=null;this._didScheduleRenderPhaseUpdate=this._isReRender=!1;this._renderPhaseUpdates=null;this._numberOfReRenders=0};a.prototype._validateCurrentlyRenderingComponent=function(){if(!this._rendering||this._instance)throw l(Error(321));};a.prototype._createDispatcher=function(){var b=this,a=function(a,c,e){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();
|
|
18
|
+
var f=b._workInProgressHook;if(b._isReRender){e=f.queue;c=e.dispatch;if(0<b._numberOfReRenders){if(null!==b._renderPhaseUpdates){var d=b._renderPhaseUpdates.get(e);if(void 0!==d){b._renderPhaseUpdates.delete(e);e=f.memoizedState;do e=a(e,d.action),d=d.next;while(null!==d);f.memoizedState=e;return[e,c]}}return[f.memoizedState,c]}d=f.memoizedState;var g=e.first;if(null!==g){do d=a(d,g.action),g=g.next;while(null!==g);e.first=null;f.memoizedState=d}return[d,c]}a=a===J?"function"===typeof c?c():c:void 0!==
|
|
19
|
+
e?e(c):c;f.memoizedState=a;a=f.queue={first:null,dispatch:null};a=a.dispatch=b._dispatchAction.bind(b,a);return[f.memoizedState,a]},c=function(){b._validateCurrentlyRenderingComponent()};return{readContext:function(b,a){return b._currentValue},useCallback:function(b){return b},useContext:function(a){b._validateCurrentlyRenderingComponent();return a._currentValue},useDebugValue:c,useEffect:c,useImperativeHandle:c,useLayoutEffect:c,useMemo:function(a,c){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();
|
|
20
|
+
c=void 0!==c?c:null;if(null!==b._workInProgressHook&&null!==b._workInProgressHook.memoizedState){var e=b._workInProgressHook.memoizedState,d=e[1];if(null!==c){a:if(null===d)d=!1;else{for(var f=0;f<d.length&&f<c.length;f++)if(!v(c[f],d[f])){d=!1;break a}d=!0}if(d)return e[0]}}a=a();b._workInProgressHook.memoizedState=[a,c];return a},useReducer:a,useRef:function(a){b._validateCurrentlyRenderingComponent();b._createWorkInProgressHook();var c=b._workInProgressHook.memoizedState;return null===c?(a={current:a},
|
|
21
|
+
b._workInProgressHook.memoizedState=a):c},useState:function(b){return a(J,b)},useResponder:function(b,a){return{props:a,responder:b}}}};a.prototype._dispatchAction=function(b,a){if(!(25>this._numberOfReRenders))throw l(Error(301));if(this._rendering){this._didScheduleRenderPhaseUpdate=!0;a={action:a,next:null};var c=this._renderPhaseUpdates;null===c&&(this._renderPhaseUpdates=c=new Map);var e=c.get(b);if(void 0===e)c.set(b,a);else{for(b=e;null!==b.next;)b=b.next;b.next=a}}else{a={action:a,next:null};
|
|
22
|
+
c=b.first;if(null===c)b.first=a;else{for(;null!==c.next;)c=c.next;c.next=a}this.render(this._element,this._context)}};a.prototype._createWorkInProgressHook=function(){null===this._workInProgressHook?null===this._firstWorkInProgressHook?(this._isReRender=!1,this._firstWorkInProgressHook=this._workInProgressHook=I()):(this._isReRender=!0,this._workInProgressHook=this._firstWorkInProgressHook):null===this._workInProgressHook.next?(this._isReRender=!1,this._workInProgressHook=this._workInProgressHook.next=
|
|
23
|
+
I()):(this._isReRender=!0,this._workInProgressHook=this._workInProgressHook.next);return this._workInProgressHook};a.prototype._finishHooks=function(b,a){this._didScheduleRenderPhaseUpdate?(this._didScheduleRenderPhaseUpdate=!1,this._numberOfReRenders+=1,this._workInProgressHook=null,this._rendering=!1,this.render(b,a)):(this._renderPhaseUpdates=this._workInProgressHook=null,this._numberOfReRenders=0)};a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};
|
|
24
|
+
a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r;if(!m.isValidElement(b))throw l(Error(12),"function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":"");if("string"===typeof b.type)throw l(Error(13),b.type);if(p(b)!==q&&"function"!==typeof b.type&&p(b.type)!==n)throw l(Error(249),Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){null!=this._element&&
|
|
25
|
+
this._element.type!==b.type&&this._reset();var c=p(b.type)===n?b.type.type:b.type,d=this._element;this._rendering=!0;this._element=b;var g;if((g=c.contextTypes)&&a){var k={},h;for(h in g)k[h]=a[h];g=k}else g=r;this._context=g;p(b.type)===n&&c.propTypes&&u(c);if(this._instance)this._updateClassComponent(c,b,this._context);else if(c.prototype&&c.prototype.isReactComponent)this._instance=new c(b.props,this._context,this._updater),"function"===typeof c.getDerivedStateFromProps&&(a=c.getDerivedStateFromProps.call(null,
|
|
26
|
+
b.props,this._instance.state),null!=a&&(this._instance.state=x({},this._instance.state,a))),this._mountClassComponent(c,b,this._context);else if(g=!0,p(b.type)===n&&null!==d&&(b.type.compare||w)(d.props,b.props)&&(g=!1),g){d=y.current;y.current=this._dispatcher;try{if(c.$$typeof===P){if("function"!==typeof c.render)throw l(Error(322),typeof c.render);this._rendered=c.render.call(void 0,b.props,b.ref)}else this._rendered=c(b.props,this._context)}finally{y.current=d}this._finishHooks(b,a)}this._rendering=
|
|
27
|
+
!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._reset()};a.prototype._mountClassComponent=function(a,d,c){this._instance.context=c;this._instance.props=d.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)d=
|
|
28
|
+
this._newState,"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),d!==this._newState&&(this._instance.state=this._newState||r);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d,c){d=d.props;var b=this._instance.state||
|
|
29
|
+
r,e=this._instance.props;e!==d&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(d,c),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(d,c));var k=this._newState||b;if("function"===typeof a.getDerivedStateFromProps){var h=a.getDerivedStateFromProps.call(null,d,k);null!=
|
|
30
|
+
h&&(k=x({},k,h))}h=!0;this._forcedUpdate?(h=!0,this._forcedUpdate=!1):"function"===typeof this._instance.shouldComponentUpdate?h=!!this._instance.shouldComponentUpdate(d,k,c):a.prototype&&a.prototype.isPureReactComponent&&(h=!w(e,d)||!w(b,k));h&&"function"!==typeof a.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(d,k,c),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&
|
|
31
|
+
this._instance.UNSAFE_componentWillUpdate(d,k,c));this._instance.context=c;this._instance.props=d;this._instance.state=k;this._newState=null;h&&(this._rendered=this._instance.render())};return a}();t.createRenderer=function(){return new t};d=(d={default:t},t)||d;return d.default||d});
|