/
ReactNativeFiber-dev.js
4522 lines (4445 loc) · 299 KB
/
ReactNativeFiber-dev.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
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
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @noflow
* @providesModule ReactNativeFiber-dev
*/
"use strict";
__DEV__ && function() {
var invariant = require("fbjs/lib/invariant"), require$$0 = require("fbjs/lib/warning"), ExceptionsManager = require("ExceptionsManager"), emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), checkPropTypes = require("prop-types/checkPropTypes"), shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"), UIManager = require("UIManager"), deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev");
require("InitializeCore");
var RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/lib/emptyFunction"), ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function(capturedError) {
return !0;
}, showDialog = defaultShowDialog;
function logCapturedError(capturedError) {
if (!1 !== showDialog(capturedError)) {
var componentName = (capturedError.error, capturedError.componentName), componentStack = capturedError.componentStack, errorBoundaryName = capturedError.errorBoundaryName, errorBoundaryFound = capturedError.errorBoundaryFound, willRetry = capturedError.willRetry, componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:", errorBoundaryMessage = void 0;
errorBoundaryMessage = errorBoundaryFound && errorBoundaryName ? willRetry ? "React will try to recreate this component tree from scratch " + "using the error boundary you provided, " + errorBoundaryName + "." : "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree." : "Consider adding an error boundary to your tree to customize error handling behavior.\n" + "You can learn more about error boundaries at https://fb.me/react-error-boundaries.";
var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + errorBoundaryMessage;
console.error(combinedMessage);
}
}
var injection = {
injectDialog: function(fn) {
invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."),
invariant("function" == typeof fn, "Injected showDialog() must be a function."),
showDialog = fn;
}
}, logCapturedError_1 = logCapturedError, ReactFiberErrorLogger = {
injection: injection,
logCapturedError: logCapturedError_1
}, ReactErrorUtils = {
_caughtError: null,
_hasCaughtError: !1,
_rethrowError: null,
_hasRethrowError: !1,
injection: {
injectErrorUtils: function(injectedErrorUtils) {
invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."),
invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;
}
},
invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) {
invokeGuardedCallback.apply(ReactErrorUtils, arguments);
},
invokeGuardedCallbackAndCatchFirstError: function(name, func, context, a, b, c, d, e, f) {
if (ReactErrorUtils.invokeGuardedCallback.apply(this, arguments), ReactErrorUtils.hasCaughtError()) {
var error = ReactErrorUtils.clearCaughtError();
ReactErrorUtils._hasRethrowError || (ReactErrorUtils._hasRethrowError = !0, ReactErrorUtils._rethrowError = error);
}
},
rethrowCaughtError: function() {
return rethrowCaughtError.apply(ReactErrorUtils, arguments);
},
hasCaughtError: function() {
return ReactErrorUtils._hasCaughtError;
},
clearCaughtError: function() {
if (ReactErrorUtils._hasCaughtError) {
var error = ReactErrorUtils._caughtError;
return ReactErrorUtils._caughtError = null, ReactErrorUtils._hasCaughtError = !1,
error;
}
invariant(!1, "clearCaughtError was called but no error was captured. This error " + "is likely caused by a bug in React. Please file an issue.");
}
}, invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) {
ReactErrorUtils._hasCaughtError = !1, ReactErrorUtils._caughtError = null;
var funcArgs = Array.prototype.slice.call(arguments, 3);
try {
func.apply(context, funcArgs);
} catch (error) {
ReactErrorUtils._caughtError = error, ReactErrorUtils._hasCaughtError = !0;
}
};
if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && "undefined" != typeof document && "function" == typeof document.createEvent) {
var fakeNode = document.createElement("react");
invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) {
var didError = !0, funcArgs = Array.prototype.slice.call(arguments, 3);
function callCallback() {
fakeNode.removeEventListener(evtType, callCallback, !1), func.apply(context, funcArgs),
didError = !1;
}
var error = void 0, didSetError = !1, isCrossOriginError = !1;
function onError(event) {
error = event.error, didSetError = !0, null === error && 0 === event.colno && 0 === event.lineno && (isCrossOriginError = !0);
}
var evtType = "react-" + (name || "invokeguardedcallback");
window.addEventListener("error", onError), fakeNode.addEventListener(evtType, callCallback, !1);
var evt = document.createEvent("Event");
evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), didError ? (didSetError ? isCrossOriginError && (error = new Error("A cross-origin error was thrown. React doesn't have access to " + "the actual error because it catches errors using a global " + 'error handler, in order to preserve the "Pause on exceptions" ' + "behavior of the DevTools. This is only an issue in DEV-mode; " + "in production, React uses a normal try-catch statement.\n\n" + "If you are using React from a CDN, ensure that the <script> tag " + "has a `crossorigin` attribute, and that it is served with the " + "`Access-Control-Allow-Origin: *` HTTP header. " + "See https://fb.me/react-cdn-crossorigin")) : error = new Error("An error was thrown inside one of your components, but React " + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + "your browser. Try triggering the error in production mode, " + "or switching to a modern browser. If you suspect that this is " + "actually an issue with React, please file an issue."),
ReactErrorUtils._hasCaughtError = !0, ReactErrorUtils._caughtError = error) : (ReactErrorUtils._hasCaughtError = !1,
ReactErrorUtils._caughtError = null), window.removeEventListener("error", onError);
};
}
var ComponentTree, rethrowCaughtError = function() {
if (ReactErrorUtils._hasRethrowError) {
var error = ReactErrorUtils._rethrowError;
throw ReactErrorUtils._rethrowError = null, ReactErrorUtils._hasRethrowError = !1,
error;
}
}, ReactErrorUtils_1 = ReactErrorUtils, warning = require$$0, injection$1 = {
injectComponentTree: function(Injected) {
ComponentTree = Injected, warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, "EventPluginUtils.injection.injectComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode.");
}
};
function isEndish(topLevelType) {
return "topMouseUp" === topLevelType || "topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType;
}
function isMoveish(topLevelType) {
return "topMouseMove" === topLevelType || "topTouchMove" === topLevelType;
}
function isStartish(topLevelType) {
return "topMouseDown" === topLevelType || "topTouchStart" === topLevelType;
}
var validateEventDispatches;
validateEventDispatches = function(event) {
var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances, listenersIsArr = Array.isArray(dispatchListeners), listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0, instancesIsArr = Array.isArray(dispatchInstances), instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, "EventPluginUtils: Invalid `event`.");
};
function executeDispatch(event, simulated, listener, inst) {
var type = event.type || "unknown-event";
event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event),
event.currentTarget = null;
}
function executeDispatchesInOrder(event, simulated) {
var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances;
if (validateEventDispatches(event), Array.isArray(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); else dispatchListeners && executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
event._dispatchListeners = null, event._dispatchInstances = null;
}
function executeDispatchesInOrderStopAtTrueImpl(event) {
var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances;
if (validateEventDispatches(event), Array.isArray(dispatchListeners)) {
for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) if (dispatchListeners[i](event, dispatchInstances[i])) return dispatchInstances[i];
} else if (dispatchListeners && dispatchListeners(event, dispatchInstances)) return dispatchInstances;
return null;
}
function executeDispatchesInOrderStopAtTrue(event) {
var ret = executeDispatchesInOrderStopAtTrueImpl(event);
return event._dispatchInstances = null, event._dispatchListeners = null, ret;
}
function executeDirectDispatch(event) {
validateEventDispatches(event);
var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances;
invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."),
event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
var res = dispatchListener ? dispatchListener(event) : null;
return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null,
res;
}
function hasDispatches(event) {
return !!event._dispatchListeners;
}
var EventPluginUtils = {
isEndish: isEndish,
isMoveish: isMoveish,
isStartish: isStartish,
executeDirectDispatch: executeDirectDispatch,
executeDispatchesInOrder: executeDispatchesInOrder,
executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
hasDispatches: hasDispatches,
getFiberCurrentPropsFromNode: function(node) {
return ComponentTree.getFiberCurrentPropsFromNode(node);
},
getInstanceFromNode: function(node) {
return ComponentTree.getInstanceFromNode(node);
},
getNodeFromInstance: function(node) {
return ComponentTree.getNodeFromInstance(node);
},
injection: injection$1
}, EventPluginUtils_1 = EventPluginUtils, fiberHostComponent = null, ReactControlledComponentInjection = {
injectFiberControlledHostComponent: function(hostComponentImpl) {
fiberHostComponent = hostComponentImpl;
}
}, restoreTarget = null, restoreQueue = null;
function restoreStateOfTarget(target) {
var internalInstance = EventPluginUtils_1.getInstanceFromNode(target);
if (internalInstance) {
if ("number" == typeof internalInstance.tag) {
invariant(fiberHostComponent && "function" == typeof fiberHostComponent.restoreControlledState, "Fiber needs to be injected to handle a fiber target for controlled " + "events. This error is likely caused by a bug in React. Please file an issue.");
var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode);
return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);
}
invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component. " + "This error is likely caused by a bug in React. Please file an issue."),
internalInstance.restoreControlledState();
}
}
var ReactControlledComponent = {
injection: ReactControlledComponentInjection,
enqueueStateRestore: function(target) {
restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [ target ] : restoreTarget = target;
},
restoreStateIfNeeded: function() {
if (restoreTarget) {
var target = restoreTarget, queuedTargets = restoreQueue;
if (restoreTarget = null, restoreQueue = null, restoreStateOfTarget(target), queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]);
}
}
}, ReactControlledComponent_1 = ReactControlledComponent, stackBatchedUpdates = function(fn, a, b, c, d, e) {
return fn(a, b, c, d, e);
}, fiberBatchedUpdates = function(fn, bookkeeping) {
return fn(bookkeeping);
};
function performFiberBatchedUpdates(fn, bookkeeping) {
return fiberBatchedUpdates(fn, bookkeeping);
}
function batchedUpdates(fn, bookkeeping) {
return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping);
}
var isNestingBatched = !1;
function batchedUpdatesWithControlledComponents(fn, bookkeeping) {
if (isNestingBatched) return batchedUpdates(fn, bookkeeping);
isNestingBatched = !0;
try {
return batchedUpdates(fn, bookkeeping);
} finally {
isNestingBatched = !1, ReactControlledComponent_1.restoreStateIfNeeded();
}
}
var ReactGenericBatchingInjection = {
injectStackBatchedUpdates: function(_batchedUpdates) {
stackBatchedUpdates = _batchedUpdates;
},
injectFiberBatchedUpdates: function(_batchedUpdates) {
fiberBatchedUpdates = _batchedUpdates;
}
}, ReactGenericBatching = {
batchedUpdates: batchedUpdatesWithControlledComponents,
injection: ReactGenericBatchingInjection
}, ReactGenericBatching_1 = ReactGenericBatching;
function ReactNativeFiberErrorDialog(capturedError) {
var componentStack = capturedError.componentStack, error = capturedError.error, errorToHandle = void 0;
if (error instanceof Error) {
var message = error.message, name = error.name, summary = message ? name + ": " + message : name;
errorToHandle = error;
try {
errorToHandle.message = summary + "\n\nThis error is located at:" + componentStack;
} catch (e) {}
} else errorToHandle = "string" == typeof error ? new Error(error + "\n\nThis error is located at:" + componentStack) : new Error("Unspecified error at:" + componentStack);
return ExceptionsManager.handleException(errorToHandle, !1), !1;
}
var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = {
showDialog: showDialog$1
}, REACT_PORTAL_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.portal") || 60106, createPortal = function(children, containerInfo, implementation) {
var key = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null;
return {
$$typeof: REACT_PORTAL_TYPE,
key: null == key ? null : "" + key,
children: children,
containerInfo: containerInfo,
implementation: implementation
};
}, isPortal = function(object) {
return "object" == typeof object && null !== object && object.$$typeof === REACT_PORTAL_TYPE;
}, REACT_PORTAL_TYPE_1 = REACT_PORTAL_TYPE, ReactPortal = {
createPortal: createPortal,
isPortal: isPortal,
REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1
}, instanceCache = {}, instanceProps = {};
function getRenderedHostOrTextFromComponent(component) {
for (var rendered; rendered = component._renderedComponent; ) component = rendered;
return component;
}
function precacheNode(inst, tag) {
var nativeInst = getRenderedHostOrTextFromComponent(inst);
instanceCache[tag] = nativeInst;
}
function precacheFiberNode(hostInst, tag) {
instanceCache[tag] = hostInst;
}
function uncacheNode(inst) {
var tag = inst._rootNodeID;
tag && delete instanceCache[tag];
}
function uncacheFiberNode(tag) {
delete instanceCache[tag], delete instanceProps[tag];
}
function getInstanceFromTag(tag) {
return instanceCache[tag] || null;
}
function getTagFromInstance(inst) {
var tag = "number" != typeof inst.tag ? inst._rootNodeID : inst.stateNode._nativeTag;
return invariant(tag, "All native instances should have a tag."), tag;
}
function getFiberCurrentPropsFromNode(stateNode) {
return instanceProps[stateNode._nativeTag] || null;
}
function updateFiberProps(tag, props) {
instanceProps[tag] = props;
}
var ReactNativeComponentTree = {
getClosestInstanceFromNode: getInstanceFromTag,
getInstanceFromNode: getInstanceFromTag,
getNodeFromInstance: getTagFromInstance,
precacheFiberNode: precacheFiberNode,
precacheNode: precacheNode,
uncacheFiberNode: uncacheFiberNode,
uncacheNode: uncacheNode,
getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode,
updateFiberProps: updateFiberProps
}, ReactNativeComponentTree_1 = ReactNativeComponentTree, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = {
disableNewFiberFeatures: !1,
enableAsyncSubtreeAPI: !1
}, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = {
NoEffect: 0,
PerformedWork: 1,
Placement: 2,
Update: 4,
PlacementAndUpdate: 6,
Deletion: 8,
ContentReset: 16,
Callback: 32,
Err: 64,
Ref: 128
}, ReactPriorityLevel = {
NoWork: 0,
SynchronousPriority: 1,
TaskPriority: 2,
HighPriority: 3,
LowPriority: 4,
OffscreenPriority: 5
}, ReactTypeOfWork = {
IndeterminateComponent: 0,
FunctionalComponent: 1,
ClassComponent: 2,
HostRoot: 3,
HostPortal: 4,
HostComponent: 5,
HostText: 6,
CoroutineComponent: 7,
CoroutineHandlerPhase: 8,
YieldComponent: 9,
Fragment: 10
}, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority, ClassComponent = ReactTypeOfWork.ClassComponent, HostRoot = ReactTypeOfWork.HostRoot, warning$2 = require$$0;
function comparePriority(a, b) {
return a !== TaskPriority && a !== SynchronousPriority || b !== TaskPriority && b !== SynchronousPriority ? a === NoWork && b !== NoWork ? -255 : a !== NoWork && b === NoWork ? 255 : a - b : 0;
}
function createUpdateQueue() {
var queue = {
first: null,
last: null,
hasForceUpdate: !1,
callbackList: null
};
return queue.isProcessing = !1, queue;
}
function cloneUpdate(update) {
return {
priorityLevel: update.priorityLevel,
partialState: update.partialState,
callback: update.callback,
isReplace: update.isReplace,
isForced: update.isForced,
isTopLevelUnmount: update.isTopLevelUnmount,
next: null
};
}
function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) {
null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update),
null !== insertBefore ? update.next = insertBefore : queue.last = update;
}
function findInsertionPosition(queue, update) {
var priorityLevel = update.priorityLevel, insertAfter = null, insertBefore = null;
if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore,
insertBefore = insertBefore.next;
return insertAfter;
}
function ensureUpdateQueues(fiber) {
var alternateFiber = fiber.alternate, queue1 = fiber.updateQueue;
null === queue1 && (queue1 = fiber.updateQueue = createUpdateQueue());
var queue2 = void 0;
return null !== alternateFiber ? null === (queue2 = alternateFiber.updateQueue) && (queue2 = alternateFiber.updateQueue = createUpdateQueue()) : queue2 = null,
[ queue1, queue2 !== queue1 ? queue2 : null ];
}
function insertUpdate(fiber, update) {
var _ensureUpdateQueues = ensureUpdateQueues(fiber), queue1 = _ensureUpdateQueues[0], queue2 = _ensureUpdateQueues[1];
(queue1.isProcessing || null !== queue2 && queue2.isProcessing) && warning$2(!1, "An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback.");
var insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first;
if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1),
null;
var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first;
if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 === insertBefore2 && null !== insertBefore1 || insertAfter1 === insertAfter2 && null !== insertAfter1) return null === insertAfter2 && (queue2.first = update),
null === insertBefore2 && (queue2.last = null), null;
var update2 = cloneUpdate(update);
return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2;
}
function addUpdate(fiber, partialState, callback, priorityLevel) {
insertUpdate(fiber, {
priorityLevel: priorityLevel,
partialState: partialState,
callback: callback,
isReplace: !1,
isForced: !1,
isTopLevelUnmount: !1,
next: null
});
}
var addUpdate_1 = addUpdate;
function addReplaceUpdate(fiber, state, callback, priorityLevel) {
insertUpdate(fiber, {
priorityLevel: priorityLevel,
partialState: state,
callback: callback,
isReplace: !0,
isForced: !1,
isTopLevelUnmount: !1,
next: null
});
}
var addReplaceUpdate_1 = addReplaceUpdate;
function addForceUpdate(fiber, callback, priorityLevel) {
insertUpdate(fiber, {
priorityLevel: priorityLevel,
partialState: null,
callback: callback,
isReplace: !1,
isForced: !0,
isTopLevelUnmount: !1,
next: null
});
}
var addForceUpdate_1 = addForceUpdate;
function getUpdatePriority(fiber) {
var updateQueue = fiber.updateQueue;
return null === updateQueue ? NoWork : fiber.tag !== ClassComponent && fiber.tag !== HostRoot ? NoWork : null !== updateQueue.first ? updateQueue.first.priorityLevel : NoWork;
}
var getUpdatePriority_1 = getUpdatePriority;
function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) {
var isTopLevelUnmount = null === partialState.element, update = {
priorityLevel: priorityLevel,
partialState: partialState,
callback: callback,
isReplace: !1,
isForced: !1,
isTopLevelUnmount: isTopLevelUnmount,
next: null
}, update2 = insertUpdate(fiber, update);
if (isTopLevelUnmount) {
var _ensureUpdateQueues2 = ensureUpdateQueues(fiber), queue1 = _ensureUpdateQueues2[0], queue2 = _ensureUpdateQueues2[1];
null !== queue1 && null !== update.next && (update.next = null, queue1.last = update),
null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null,
queue2.last = update);
}
}
var addTopLevelUpdate_1 = addTopLevelUpdate$1;
function getStateFromUpdate(update, instance, prevState, props) {
var partialState = update.partialState;
if ("function" == typeof partialState) {
return partialState.call(instance, prevState, props);
}
return partialState;
}
function beginUpdateQueue(current, workInProgress, queue, instance, prevState, props, priorityLevel) {
if (null !== current && current.updateQueue === queue) {
var currentQueue = queue;
queue = workInProgress.updateQueue = {
first: currentQueue.first,
last: currentQueue.last,
callbackList: null,
hasForceUpdate: !1
};
}
queue.isProcessing = !0;
for (var callbackList = queue.callbackList, hasForceUpdate = queue.hasForceUpdate, state = prevState, dontMutatePrevState = !0, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) {
queue.first = update.next, null === queue.first && (queue.last = null);
var _partialState = void 0;
update.isReplace ? (state = getStateFromUpdate(update, instance, state, props),
dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState),
dontMutatePrevState = !1), update.isForced && (hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = null !== callbackList ? callbackList : [],
callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect),
update = update.next;
}
return queue.callbackList = callbackList, queue.hasForceUpdate = hasForceUpdate,
null !== queue.first || null !== callbackList || hasForceUpdate || (workInProgress.updateQueue = null),
queue.isProcessing = !1, state;
}
var beginUpdateQueue_1 = beginUpdateQueue;
function commitCallbacks(finishedWork, queue, context) {
var callbackList = queue.callbackList;
if (null !== callbackList) {
queue.callbackList = null;
for (var i = 0; i < callbackList.length; i++) {
var _callback = callbackList[i];
invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback),
_callback.call(context);
}
}
}
var commitCallbacks_1 = commitCallbacks, ReactFiberUpdateQueue = {
addUpdate: addUpdate_1,
addReplaceUpdate: addReplaceUpdate_1,
addForceUpdate: addForceUpdate_1,
getUpdatePriority: getUpdatePriority_1,
addTopLevelUpdate: addTopLevelUpdate_1,
beginUpdateQueue: beginUpdateQueue_1,
commitCallbacks: commitCallbacks_1
};
function getComponentName$1(instanceOrFiber) {
if ("function" == typeof instanceOrFiber.getName) {
return instanceOrFiber.getName();
}
if ("number" == typeof instanceOrFiber.tag) {
var fiber = instanceOrFiber, type = fiber.type;
if ("string" == typeof type) return type;
if ("function" == typeof type) return type.displayName || type.name;
}
return null;
}
var getComponentName_1 = getComponentName$1, ReactInstanceMap = {
remove: function(key) {
key._reactInternalInstance = void 0;
},
get: function(key) {
return key._reactInternalInstance;
},
has: function(key) {
return void 0 !== key._reactInternalInstance;
},
set: function(key, value) {
key._reactInternalInstance = value;
}
}, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = {
ReactCurrentOwner: ReactInternals.ReactCurrentOwner
};
Object.assign(ReactGlobalSharedState, {
ReactComponentTreeHook: ReactInternals.ReactComponentTreeHook,
ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame
});
var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = require$$0, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$1 = ReactTypeOfWork.HostComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostPortal = ReactTypeOfWork.HostPortal, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3;
function isFiberMountedImpl(fiber) {
var node = fiber;
if (fiber.alternate) for (;node.return; ) node = node.return; else {
if ((node.effectTag & Placement) !== NoEffect) return MOUNTING;
for (;node.return; ) if (node = node.return, (node.effectTag & Placement) !== NoEffect) return MOUNTING;
}
return node.tag === HostRoot$2 ? MOUNTED : UNMOUNTED;
}
var isFiberMounted$1 = function(fiber) {
return isFiberMountedImpl(fiber) === MOUNTED;
}, isMounted = function(component) {
var owner = ReactCurrentOwner.current;
if (null !== owner && owner.tag === ClassComponent$2) {
var ownerFiber = owner, instance = ownerFiber.stateNode;
warning$4(instance._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentName_1(ownerFiber) || "A component"),
instance._warnedAboutRefsInRender = !0;
}
var fiber = ReactInstanceMap_1.get(component);
return !!fiber && isFiberMountedImpl(fiber) === MOUNTED;
};
function assertIsMounted(fiber) {
invariant(isFiberMountedImpl(fiber) === MOUNTED, "Unable to find node on an unmounted component.");
}
function findCurrentFiberUsingSlowPath(fiber) {
var alternate = fiber.alternate;
if (!alternate) {
var state = isFiberMountedImpl(fiber);
return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."),
state === MOUNTING ? null : fiber;
}
for (var a = fiber, b = alternate; !0; ) {
var parentA = a.return, parentB = parentA ? parentA.alternate : null;
if (!parentA || !parentB) break;
if (parentA.child === parentB.child) {
for (var child = parentA.child; child; ) {
if (child === a) return assertIsMounted(parentA), fiber;
if (child === b) return assertIsMounted(parentA), alternate;
child = child.sibling;
}
invariant(!1, "Unable to find node on an unmounted component.");
}
if (a.return !== b.return) a = parentA, b = parentB; else {
for (var didFindChild = !1, _child = parentA.child; _child; ) {
if (_child === a) {
didFindChild = !0, a = parentA, b = parentB;
break;
}
if (_child === b) {
didFindChild = !0, b = parentA, a = parentB;
break;
}
_child = _child.sibling;
}
if (!didFindChild) {
for (_child = parentB.child; _child; ) {
if (_child === a) {
didFindChild = !0, a = parentB, b = parentA;
break;
}
if (_child === b) {
didFindChild = !0, b = parentB, a = parentA;
break;
}
_child = _child.sibling;
}
invariant(didFindChild, "Child was not found in either parent set. This indicates a bug " + "in React related to the return pointer. Please file an issue.");
}
}
invariant(a.alternate === b, "Return fibers should always be each others' alternates. " + "This error is likely caused by a bug in React. Please file an issue.");
}
return invariant(a.tag === HostRoot$2, "Unable to find node on an unmounted component."),
a.stateNode.current === a ? fiber : alternate;
}
var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrentHostFiber$1 = function(parent) {
var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) return null;
for (var node = currentParent; !0; ) {
if (node.tag === HostComponent$1 || node.tag === HostText) return node;
if (node.child) node.child.return = node, node = node.child; else {
if (node === currentParent) return null;
for (;!node.sibling; ) {
if (!node.return || node.return === currentParent) return null;
node = node.return;
}
node.sibling.return = node.return, node = node.sibling;
}
}
return null;
}, findCurrentHostFiberWithNoPortals$1 = function(parent) {
var currentParent = findCurrentFiberUsingSlowPath(parent);
if (!currentParent) return null;
for (var node = currentParent; !0; ) {
if (node.tag === HostComponent$1 || node.tag === HostText) return node;
if (node.child && node.tag !== HostPortal) node.child.return = node, node = node.child; else {
if (node === currentParent) return null;
for (;!node.sibling; ) {
if (!node.return || node.return === currentParent) return null;
node = node.return;
}
node.sibling.return = node.return, node = node.sibling;
}
}
return null;
}, ReactFiberTreeReflection = {
isFiberMounted: isFiberMounted$1,
isMounted: isMounted,
findCurrentFiberUsingSlowPath: findCurrentFiberUsingSlowPath_1,
findCurrentHostFiber: findCurrentHostFiber$1,
findCurrentHostFiberWithNoPortals: findCurrentHostFiberWithNoPortals$1
}, warning$5 = require$$0, valueStack = [], fiberStack = [], index = -1, createCursor$1 = function(defaultValue) {
return {
current: defaultValue
};
}, isEmpty = function() {
return -1 === index;
}, pop$1 = function(cursor, fiber) {
if (index < 0) return void warning$5(!1, "Unexpected pop.");
fiber !== fiberStack[index] && warning$5(!1, "Unexpected Fiber popped."), cursor.current = valueStack[index],
valueStack[index] = null, fiberStack[index] = null, index--;
}, push$1 = function(cursor, value, fiber) {
index++, valueStack[index] = cursor.current, fiberStack[index] = fiber, cursor.current = value;
}, reset = function() {
for (;index > -1; ) valueStack[index] = null, fiberStack[index] = null, index--;
}, ReactFiberStack = {
createCursor: createCursor$1,
isEmpty: isEmpty,
pop: pop$1,
push: push$1,
reset: reset
}, describeComponentFrame = function(name, source, ownerName) {
return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : "");
}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostComponent$2 = ReactTypeOfWork.HostComponent;
function describeFiber(fiber) {
switch (fiber.tag) {
case IndeterminateComponent:
case FunctionalComponent:
case ClassComponent$3:
case HostComponent$2:
var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null;
return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName);
default:
return "";
}
}
function getStackAddendumByWorkInProgressFiber$1(workInProgress) {
var info = "", node = workInProgress;
do {
info += describeFiber(node), node = node.return;
} while (node);
return info;
}
var ReactFiberComponentTreeHook = {
getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1
}, ReactDebugCurrentFrame = ReactGlobalSharedState_1.ReactDebugCurrentFrame, getComponentName$3 = getComponentName_1, _require2$1 = ReactFiberComponentTreeHook, getStackAddendumByWorkInProgressFiber = _require2$1.getStackAddendumByWorkInProgressFiber;
function getCurrentFiberOwnerName() {
var fiber = ReactDebugCurrentFiber$2.current;
return null === fiber ? null : null != fiber._debugOwner ? getComponentName$3(fiber._debugOwner) : null;
}
function getCurrentFiberStackAddendum() {
var fiber = ReactDebugCurrentFiber$2.current;
return null === fiber ? null : getStackAddendumByWorkInProgressFiber(fiber);
}
function resetCurrentFiber() {
ReactDebugCurrentFrame.getCurrentStack = null, ReactDebugCurrentFiber$2.current = null,
ReactDebugCurrentFiber$2.phase = null;
}
function setCurrentFiber(fiber, phase) {
ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum, ReactDebugCurrentFiber$2.current = fiber,
ReactDebugCurrentFiber$2.phase = phase;
}
var ReactDebugCurrentFiber$2 = {
current: null,
phase: null,
resetCurrentFiber: resetCurrentFiber,
setCurrentFiber: setCurrentFiber,
getCurrentFiberOwnerName: getCurrentFiberOwnerName,
getCurrentFiberStackAddendum: getCurrentFiberStackAddendum
}, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$3 = _require$2.HostRoot, HostComponent$3 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal$1 = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "⚛", warningEmoji = "⛔", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) {
return reactEmoji + " " + markName;
}, formatLabel = function(label, warning) {
return (warning ? warningEmoji + " " : reactEmoji + " ") + label + (warning ? " Warning: " + warning : "");
}, beginMark = function(markName) {
performance.mark(formatMarkName(markName));
}, clearMark = function(markName) {
performance.clearMarks(formatMarkName(markName));
}, endMark = function(label, markName, warning) {
var formattedMarkName = formatMarkName(markName), formattedLabel = formatLabel(label, warning);
try {
performance.measure(formattedLabel, formattedMarkName);
} catch (err) {}
performance.clearMarks(formattedMarkName), performance.clearMeasures(formattedLabel);
}, getFiberMarkName = function(label, debugID) {
return label + " (#" + debugID + ")";
}, getFiberLabel = function(componentName, isMounted, phase) {
return null === phase ? componentName + " [" + (isMounted ? "update" : "mount") + "]" : componentName + "." + phase;
}, beginFiberMark = function(fiber, phase) {
var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase);
if (isCommitting && labelsInCurrentCommit.has(label)) return !1;
labelsInCurrentCommit.add(label);
var markName = getFiberMarkName(label, debugID);
return beginMark(markName), !0;
}, clearFiberMark = function(fiber, phase) {
var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID);
clearMark(markName);
}, endFiberMark = function(fiber, phase, warning) {
var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID);
endMark(label, markName, warning);
}, shouldIgnoreFiber = function(fiber) {
switch (fiber.tag) {
case HostRoot$3:
case HostComponent$3:
case HostText$1:
case HostPortal$1:
case YieldComponent:
case Fragment:
return !0;
default:
return !1;
}
}, clearPendingPhaseMeasurement = function() {
null !== currentPhase && null !== currentPhaseFiber && clearFiberMark(currentPhaseFiber, currentPhase),
currentPhaseFiber = null, currentPhase = null, hasScheduledUpdateInCurrentPhase = !1;
}, pauseTimers = function() {
for (var fiber = currentFiber; fiber; ) fiber._debugIsCurrentlyTiming && endFiberMark(fiber, null, null),
fiber = fiber.return;
}, resumeTimersRecursively = function(fiber) {
null !== fiber.return && resumeTimersRecursively(fiber.return), fiber._debugIsCurrentlyTiming && beginFiberMark(fiber, null);
}, resumeTimers = function() {
null !== currentFiber && resumeTimersRecursively(currentFiber);
};
ReactDebugFiberPerf = {
recordEffect: function() {
effectCountInCurrentCommit++;
},
recordScheduleUpdate: function() {
isCommitting && (hasScheduledUpdateInCurrentCommit = !0), null !== currentPhase && "componentWillMount" !== currentPhase && "componentWillReceiveProps" !== currentPhase && (hasScheduledUpdateInCurrentPhase = !0);
},
startWorkTimer: function(fiber) {
supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber, beginFiberMark(fiber, null) && (fiber._debugIsCurrentlyTiming = !0));
},
cancelWorkTimer: function(fiber) {
supportsUserTiming && !shouldIgnoreFiber(fiber) && (fiber._debugIsCurrentlyTiming = !1,
clearFiberMark(fiber, null));
},
stopWorkTimer: function(fiber) {
supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return,
fiber._debugIsCurrentlyTiming && (fiber._debugIsCurrentlyTiming = !1, endFiberMark(fiber, null, null)));
},
stopFailedWorkTimer: function(fiber) {
if (supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return,
fiber._debugIsCurrentlyTiming)) {
fiber._debugIsCurrentlyTiming = !1;
endFiberMark(fiber, null, "An error was thrown inside this error boundary");
}
},
startPhaseTimer: function(fiber, phase) {
supportsUserTiming && (clearPendingPhaseMeasurement(), beginFiberMark(fiber, phase) && (currentPhaseFiber = fiber,
currentPhase = phase));
},
stopPhaseTimer: function() {
if (supportsUserTiming) {
if (null !== currentPhase && null !== currentPhaseFiber) {
endFiberMark(currentPhaseFiber, currentPhase, hasScheduledUpdateInCurrentPhase ? "Scheduled a cascading update" : null);
}
currentPhase = null, currentPhaseFiber = null;
}
},
startWorkLoopTimer: function() {
supportsUserTiming && (commitCountInCurrentWorkLoop = 0, beginMark("(React Tree Reconciliation)"),
resumeTimers());
},
stopWorkLoopTimer: function() {
if (supportsUserTiming) {
var warning = commitCountInCurrentWorkLoop > 1 ? "There were cascading updates" : null;
commitCountInCurrentWorkLoop = 0, pauseTimers(), endMark("(React Tree Reconciliation)", "(React Tree Reconciliation)", warning);
}
},
startCommitTimer: function() {
supportsUserTiming && (isCommitting = !0, hasScheduledUpdateInCurrentCommit = !1,
labelsInCurrentCommit.clear(), beginMark("(Committing Changes)"));
},
stopCommitTimer: function() {
if (supportsUserTiming) {
var warning = null;
hasScheduledUpdateInCurrentCommit ? warning = "Lifecycle hook scheduled a cascading update" : commitCountInCurrentWorkLoop > 0 && (warning = "Caused by a cascading update in earlier commit"),
hasScheduledUpdateInCurrentCommit = !1, commitCountInCurrentWorkLoop++, isCommitting = !1,
labelsInCurrentCommit.clear(), endMark("(Committing Changes)", "(Committing Changes)", warning);
}
},
startCommitHostEffectsTimer: function() {
supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Committing Host Effects)"));
},
stopCommitHostEffectsTimer: function() {
if (supportsUserTiming) {
var count = effectCountInCurrentCommit;
effectCountInCurrentCommit = 0, endMark("(Committing Host Effects: " + count + " Total)", "(Committing Host Effects)", null);
}
},
startCommitLifeCyclesTimer: function() {
supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Calling Lifecycle Methods)"));
},
stopCommitLifeCyclesTimer: function() {
if (supportsUserTiming) {
var count = effectCountInCurrentCommit;
effectCountInCurrentCommit = 0, endMark("(Calling Lifecycle Methods: " + count + " Total)", "(Calling Lifecycle Methods)", null);
}
}
};
var ReactDebugFiberPerf_1 = ReactDebugFiberPerf, isFiberMounted = ReactFiberTreeReflection.isFiberMounted, ClassComponent$1 = ReactTypeOfWork.ClassComponent, HostRoot$1 = ReactTypeOfWork.HostRoot, createCursor = ReactFiberStack.createCursor, pop = ReactFiberStack.pop, push = ReactFiberStack.push, warning$3 = require$$0, checkPropTypes$1 = checkPropTypes, ReactDebugCurrentFiber$1 = ReactDebugCurrentFiber_1, _require4 = ReactDebugFiberPerf_1, startPhaseTimer = _require4.startPhaseTimer, stopPhaseTimer = _require4.stopPhaseTimer, warnedAboutMissingGetChildContext = {}, contextStackCursor = createCursor(emptyObject), didPerformWorkStackCursor = createCursor(!1), previousContext = emptyObject;
function getUnmaskedContext(workInProgress) {
return isContextProvider$1(workInProgress) ? previousContext : contextStackCursor.current;
}
var getUnmaskedContext_1 = getUnmaskedContext;
function cacheContext(workInProgress, unmaskedContext, maskedContext) {
var instance = workInProgress.stateNode;
instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
}
var cacheContext_1 = cacheContext, getMaskedContext = function(workInProgress, unmaskedContext) {
var type = workInProgress.type, contextTypes = type.contextTypes;
if (!contextTypes) return emptyObject;
var instance = workInProgress.stateNode;
if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext;
var context = {};
for (var key in contextTypes) context[key] = unmaskedContext[key];
var name = getComponentName_1(workInProgress) || "Unknown";
return ReactDebugCurrentFiber$1.setCurrentFiber(workInProgress, null), checkPropTypes$1(contextTypes, context, "context", name, ReactDebugCurrentFiber$1.getCurrentFiberStackAddendum),
ReactDebugCurrentFiber$1.resetCurrentFiber(), instance && cacheContext(workInProgress, unmaskedContext, context),
context;
}, hasContextChanged = function() {
return didPerformWorkStackCursor.current;
};
function isContextConsumer(fiber) {
return fiber.tag === ClassComponent$1 && null != fiber.type.contextTypes;
}
var isContextConsumer_1 = isContextConsumer;
function isContextProvider$1(fiber) {
return fiber.tag === ClassComponent$1 && null != fiber.type.childContextTypes;
}
var isContextProvider_1 = isContextProvider$1;
function popContextProvider(fiber) {
isContextProvider$1(fiber) && (pop(didPerformWorkStackCursor, fiber), pop(contextStackCursor, fiber));
}
var popContextProvider_1 = popContextProvider, pushTopLevelContextObject = function(fiber, context, didChange) {
invariant(null == contextStackCursor.cursor, "Unexpected context found on stack. " + "This error is likely caused by a bug in React. Please file an issue."),
push(contextStackCursor, context, fiber), push(didPerformWorkStackCursor, didChange, fiber);
};
function processChildContext$1(fiber, parentContext, isReconciling) {
var instance = fiber.stateNode, childContextTypes = fiber.type.childContextTypes;
if ("function" != typeof instance.getChildContext) {
var componentName = getComponentName_1(fiber) || "Unknown";
return warnedAboutMissingGetChildContext[componentName] || (warnedAboutMissingGetChildContext[componentName] = !0,
warning$3(!1, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)),
parentContext;
}
var childContext = void 0;
ReactDebugCurrentFiber$1.setCurrentFiber(fiber, "getChildContext"), startPhaseTimer(fiber, "getChildContext"),
childContext = instance.getChildContext(), stopPhaseTimer(), ReactDebugCurrentFiber$1.resetCurrentFiber();
for (var contextKey in childContext) invariant(contextKey in childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName_1(fiber) || "Unknown", contextKey);
var name = getComponentName_1(fiber) || "Unknown", workInProgress = isReconciling ? fiber : null;
return ReactDebugCurrentFiber$1.setCurrentFiber(workInProgress, null), checkPropTypes$1(childContextTypes, childContext, "child context", name, ReactDebugCurrentFiber$1.getCurrentFiberStackAddendum),
ReactDebugCurrentFiber$1.resetCurrentFiber(), Object.assign({}, parentContext, childContext);
}
var processChildContext_1 = processChildContext$1, pushContextProvider = function(workInProgress) {
if (!isContextProvider$1(workInProgress)) return !1;
var instance = workInProgress.stateNode, memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject;
return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress),
push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress),
!0;
}, invalidateContextProvider = function(workInProgress, didChange) {
var instance = workInProgress.stateNode;
if (invariant(instance, "Expected to have an instance by this point. " + "This error is likely caused by a bug in React. Please file an issue."),
didChange) {
var mergedContext = processChildContext$1(workInProgress, previousContext, !0);
instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress),
pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress),
push(didPerformWorkStackCursor, didChange, workInProgress);
} else pop(didPerformWorkStackCursor, workInProgress), push(didPerformWorkStackCursor, didChange, workInProgress);
}, resetContext = function() {
previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1;
}, findCurrentUnmaskedContext$1 = function(fiber) {
invariant(isFiberMounted(fiber) && fiber.tag === ClassComponent$1, "Expected subtree parent to be a mounted class component. " + "This error is likely caused by a bug in React. Please file an issue.");
for (var node = fiber; node.tag !== HostRoot$1; ) {
if (isContextProvider$1(node)) return node.stateNode.__reactInternalMemoizedMergedChildContext;
var parent = node.return;
invariant(parent, "Found unexpected detached subtree parent. " + "This error is likely caused by a bug in React. Please file an issue."),
node = parent;
}
return node.stateNode.context;
}, ReactFiberContext = {
getUnmaskedContext: getUnmaskedContext_1,
cacheContext: cacheContext_1,
getMaskedContext: getMaskedContext,
hasContextChanged: hasContextChanged,
isContextConsumer: isContextConsumer_1,
isContextProvider: isContextProvider_1,
popContextProvider: popContextProvider_1,
pushTopLevelContextObject: pushTopLevelContextObject,
processChildContext: processChildContext_1,
pushContextProvider: pushContextProvider,
invalidateContextProvider: invalidateContextProvider,
resetContext: resetContext,
findCurrentUnmaskedContext: findCurrentUnmaskedContext$1
}, ReactTypeOfInternalContext = {
NoContext: 0,
AsyncUpdates: 1
}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1;
try {
var nonExtensibleObject = Object.preventExtensions({});
new Map([ [ nonExtensibleObject, null ] ]), new Set([ nonExtensibleObject ]);
} catch (e) {
hasBadMapPolyfill = !0;
}
var debugCounter = 1, createFiber = function(tag, key, internalContextTag) {
var fiber = {
tag: tag,
key: key,
type: null,
stateNode: null,
return: null,
child: null,
sibling: null,
index: 0,
ref: null,
pendingProps: null,
memoizedProps: null,
updateQueue: null,
memoizedState: null,
internalContextTag: internalContextTag,
effectTag: NoEffect$1,
nextEffect: null,
firstEffect: null,
lastEffect: null,
pendingWorkPriority: NoWork$1,
alternate: null
};
return fiber._debugID = debugCounter++, fiber._debugSource = null, fiber._debugOwner = null,
fiber._debugIsCurrentlyTiming = !1, hasBadMapPolyfill || "function" != typeof Object.preventExtensions || Object.preventExtensions(fiber),
fiber;
};
function shouldConstruct(Component) {
return !(!Component.prototype || !Component.prototype.isReactComponent);
}
var createWorkInProgress = function(current, renderPriority) {
var workInProgress = current.alternate;
return null === workInProgress ? (workInProgress = createFiber(current.tag, current.key, current.internalContextTag),
workInProgress.type = current.type, workInProgress.stateNode = current.stateNode,
workInProgress._debugID = current._debugID, workInProgress._debugSource = current._debugSource,
workInProgress._debugOwner = current._debugOwner, workInProgress.alternate = current,
current.alternate = workInProgress) : (workInProgress.effectTag = NoWork$1, workInProgress.nextEffect = null,
workInProgress.firstEffect = null, workInProgress.lastEffect = null), workInProgress.pendingWorkPriority = renderPriority,
workInProgress.child = current.child, workInProgress.memoizedProps = current.memoizedProps,
workInProgress.memoizedState = current.memoizedState, workInProgress.updateQueue = current.updateQueue,
workInProgress.sibling = current.sibling, workInProgress.index = current.index,
workInProgress.ref = current.ref, workInProgress;
}, createHostRootFiber$1 = function() {
return createFiber(HostRoot$4, null, NoContext);
}, createFiberFromElement = function(element, internalContextTag, priorityLevel) {
var owner = null;
owner = element._owner;
var fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner);
return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel,
fiber._debugSource = element._source, fiber._debugOwner = element._owner, fiber;
}, createFiberFromFragment = function(elements, internalContextTag, priorityLevel) {
var fiber = createFiber(Fragment$1, null, internalContextTag);